Skip to content

Comments

pkg/reexec: some cleaning up in preparation of moving to a separate module#49118

Merged
thaJeztah merged 3 commits intomoby:masterfrom
thaJeztah:reexec_clean
Dec 17, 2024
Merged

pkg/reexec: some cleaning up in preparation of moving to a separate module#49118
thaJeztah merged 3 commits intomoby:masterfrom
thaJeztah:reexec_clean

Conversation

@thaJeztah
Copy link
Member

Relates to:

pkg/reexec: use const for name of test binary

Also use a slightly different name, because "reexec" is used so
widely as term in this package, making it somewhat confusing.

pkg/reexec: make platform-agnostic (again)

relates to:

The reexec package originally was platform-agnostic, but gained some
Linux-specific handling in 1cb17f0.

When Windows support was implemented in Docker, the pkg/reexec package
was adjusted accordingly in 64715c4,
which now made the package with with either Linux or Windows, with various
other platforms (freebsd, solaris, darwin) being added back in separate
changes.

Based on the history above, this package should be platform-agnostic, except
for Linux-specific changes introduced in 1cb17f0
and 5aee880.

This patch

  • removes the stub-implementation to make it functional on other platforms.
  • renames the files for consistency

pkg/reexec: Command: separate public API from implementation

Move the exported Command to a platform-agnostic file, and un-export
the platform-specific implementations. This allows us to maintain the
GoDoc in a single place, describing platform-specific differences where
needed.

- Description for the changelog

Go-SDK: pkg/reexec can now be used on platforms other than Linux, Windows, macOS and FreeBSD

- A picture of a cute animal (not mandatory but encouraged)

Also use a slightly different name, because "reexec" is used so
widely as term in this package, making it somewhat confusing.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
The reexec package originally was platform-agnostic, but gained some
Linux-specific handling in 1cb17f0.

When Windows support was implemented in Docker, the pkg/reexec package
was adjusted accordingly in 64715c4,
which now made the package with with either Linux or Windows, with various
other platforms (freebsd, solaris, darwin) being added back in separate
changes.

Based on the history above, this package should be platform-agnostic, except
for Linux-specific changes introduced in 1cb17f0
and 5aee880.

This patch:

- removes the stub-implementation to make it functional on other platforms.
- renames the files for consistency

Signed-off-by: Sebastiaan van Stijn <[email protected]>
Move the exported `Command` to a platform-agnostic file, and un-export
the platform-specific implementations. This allows us to maintain the
GoDoc in a single place, describing platform-specific differences where
needed.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah thaJeztah added status/2-code-review kind/refactor PR's that refactor, or clean-up code area/go-sdk impact/go-sdk Noteworthy (compatibility changes) in the Go SDK labels Dec 17, 2024
@thaJeztah thaJeztah added this to the 28.0.0 milestone Dec 17, 2024
@thaJeztah thaJeztah self-assigned this Dec 17, 2024
@thaJeztah thaJeztah mentioned this pull request Dec 17, 2024
79 tasks
@thaJeztah
Copy link
Member Author

@crazy-max @vvoland PTAL 🤗

after this, I'll start preparing a migration to moby/sys

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/go-sdk impact/go-sdk Noteworthy (compatibility changes) in the Go SDK kind/refactor PR's that refactor, or clean-up code status/2-code-review

Projects

Development

Successfully merging this pull request may close these issues.

3 participants