io: skip chowning pipes on non-Linux platforms - #117
Merged
Conversation
Member
Author
|
cc @mxpv @AkihiroSuda PTAL - probably would be good to tag a v1.2.1 with this (and #118). |
1 task
There was a problem hiding this comment.
Pull request overview
This PR makes pipe ownership handling platform-specific, retaining fchown on Linux while skipping unsupported operations elsewhere.
Changes:
- Added Linux and non-Linux
chownPipeimplementations. - Updated pipe setup and cleanup handling.
- Removed debug logging,
logrus, and obsolete checksums.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
io_unix.go |
Delegates pipe ownership changes to platform helpers. |
io_nolinux.go |
Provides a no-op implementation on non-Linux platforms. |
io_linux.go |
Retains Linux fchown behavior. |
go.sum |
Removes obsolete dependency checksums. |
go.mod |
Removes the unused logrus dependency. |
Suppressed comments (1)
io_unix.go:49
- The new platform-specific behavior is not exercised by the test suite: CI runs only on Ubuntu and there are no tests for
NewPipeIO/chownPipe. A broken non-Linux build selection or no-op implementation would therefore pass CI. Add platform-specific tests or compile checks, and run them on at least one supported non-Linux target.
if err := chownPipe(int(stdin.r.Fd()), uid, gid); err != nil {
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
AkihiroSuda
reviewed
Aug 22, 2026
Member
There was a problem hiding this comment.
nit: this could be named *_unix.go
Member
Author
There was a problem hiding this comment.
heh; yeah, but that's what the existing file was named 🫠
AkihiroSuda
reviewed
Aug 22, 2026
| @@ -0,0 +1,25 @@ | |||
| //go:build linux | |||
AkihiroSuda
approved these changes
Aug 22, 2026
BSD variants, including macOS, FreeBSD, and OpenBSD, do not support changing ownership of anonymous pipes. Update the workaround introduced in 52ac244 by moving pipe ownership handling behind platform-specific helpers. Continue changing ownership on Linux, and make the operation a no-op elsewhere. This also removes the debug logging for the expected failure and the logrus dependency, which was used only for those messages. updates 52ac244 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Member
Author
mxpv
approved these changes
Aug 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BSD variants, including macOS, FreeBSD, and OpenBSD, do not support changing ownership of anonymous pipes.
Update the workaround introduced in 52ac244 by moving pipe ownership handling behind platform-specific helpers. Continue changing ownership on Linux, and make the operation a no-op elsewhere.
This also removes the debug logging for the expected failure and the logrus dependency, which was used only for those messages.
updates 52ac244