Skip to content

reexec: align closer to exec.Command#191

Merged
thaJeztah merged 1 commit intomoby:mainfrom
thaJeztah:align_with_stdlib
Jun 24, 2025
Merged

reexec: align closer to exec.Command#191
thaJeztah merged 1 commit intomoby:mainfrom
thaJeztah:align_with_stdlib

Conversation

@thaJeztah
Copy link
Member

Make our implementation a wrapper for exec.Command to make sure our implementation keeps aligned with a regular exec.Command with the exception of the "Args" that we need to override, and (on Linux), Pdeathsig to be set.

@thaJeztah thaJeztah requested a review from Copilot June 23, 2025 16:59

This comment was marked as outdated.

@thaJeztah thaJeztah force-pushed the align_with_stdlib branch 2 times, most recently from 90223b1 to e7eb7e4 Compare June 24, 2025 09:28
@thaJeztah thaJeztah requested a review from Copilot June 24, 2025 09:28

This comment was marked as outdated.

@thaJeztah thaJeztah force-pushed the align_with_stdlib branch from e7eb7e4 to e7a5b32 Compare June 24, 2025 09:50
@thaJeztah thaJeztah requested a review from Copilot June 24, 2025 09:50

This comment was marked as outdated.

@thaJeztah thaJeztah force-pushed the align_with_stdlib branch from e7a5b32 to 8ff6205 Compare June 24, 2025 09:52
@thaJeztah thaJeztah requested a review from Copilot June 24, 2025 09:53

This comment was marked as outdated.

Make our implementation a wrapper for exec.Command to make sure
our implementation keeps aligned with a regular exec.Command with
the exception of the "Args" that we need to override, and (on Linux),
Pdeathsig to be set.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah force-pushed the align_with_stdlib branch from 8ff6205 to d05b721 Compare June 24, 2025 09:55
@thaJeztah thaJeztah requested a review from Copilot June 24, 2025 09:55
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request refactors our reexec package to more closely align with the behavior of exec.Command by wrapping it while still overriding Args and, on Linux, setting Pdeathsig.

  • Updated test cases in reexec_test.go to validate the new command API and output formatting.
  • Modified command implementations in reexec_other.go and reexec_linux.go to use exec.Command and adjust the Args field accordingly.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
reexec/reexec_test.go Updated testing to check the new command signature and output format.
reexec/reexec_other.go Refactored command creation to call exec.Command and remove the prepended Self().
reexec/reexec_linux.go Same as above with additional setting of Pdeathsig for Linux.
Comments suppressed due to low confidence (1)

reexec/reexec_test.go:23

  • The new code uses fmt functions (e.g. fmt.Sprintf and fmt.Println) but the 'fmt' package is not imported. Please add 'import "fmt"' to the import block.
		var args string

@thaJeztah thaJeztah merged commit e79d77f into moby:main Jun 24, 2025
20 checks passed
@thaJeztah thaJeztah deleted the align_with_stdlib branch June 24, 2025 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants