Skip to content

io: skip chowning pipes on non-Linux platforms - #117

Merged
mxpv merged 1 commit into
containerd:mainfrom
thaJeztah:fix_darwin
Aug 25, 2026
Merged

io: skip chowning pipes on non-Linux platforms#117
mxpv merged 1 commit into
containerd:mainfrom
thaJeztah:fix_darwin

Conversation

@thaJeztah

Copy link
Copy Markdown
Member

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

@thaJeztah

Copy link
Copy Markdown
Member Author

cc @mxpv @AkihiroSuda PTAL - probably would be good to tag a v1.2.1 with this (and #118).

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 chownPipe implementations.
  • 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.

@thaJeztah
thaJeztah requested review from AkihiroSuda and mxpv August 22, 2026 15:51
Comment thread io_nolinux.go

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: this could be named *_unix.go

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

heh; yeah, but that's what the existing file was named 🫠

Comment thread io_linux.go Outdated
@@ -0,0 +1,25 @@
//go:build linux

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This line is not needed

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

removed 👍

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>
@thaJeztah

Copy link
Copy Markdown
Member Author

@mxpv ptal; I'll rebase #119 after this one's merged 😅

@mxpv
mxpv merged commit 7c051b9 into containerd:main Aug 25, 2026
4 checks passed
@thaJeztah
thaJeztah deleted the fix_darwin branch August 25, 2026 04:13
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.

4 participants