-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reduce Windows stubs #79
Conversation
Commit 421b4ca changed the use of syscall.Signal in favor of unix.Signal, to match other code. As a result, some code that imported these files on Windows (even if unused) failed to compile, which lead to d6ba496, which created a separate implementation for Windows without PdeathSignal. Given that golang.org/x/sys/unix.Signal is an alias for syscall.Signal (see https://github.com/golang/sys/blob/751e447fb3d0a97f584890476adddc1d56307388/unix/aliases.go#L13-L14), they should be interchangeable. Note that the io.go files could probably be excluded on Windows as a whole, but taking a slightly less rigorous approach in this PR. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Codecov Report
@@ Coverage Diff @@
## main #79 +/- ##
==========================================
- Coverage 21.52% 21.45% -0.07%
==========================================
Files 7 7
Lines 683 685 +2
==========================================
Hits 147 147
- Misses 498 500 +2
Partials 38 38
Continue to review full report at Codecov.
|
// NewPipeIO creates pipe pairs to be used with runc | ||
func NewPipeIO(uid, gid int, opts ...IOOpt) (i IO, err error) { | ||
// newPipeIO creates pipe pairs to be used with runc | ||
func newPipeIO(uid, gid int, opts ...IOOpt) (i IO, err error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me know if we should instead make whole of io**.go
excluded on Windows (mostly concerned if there's code that might refer the types somewhere)
import "errors" | ||
|
||
func newPipeIO(uid, gid int, opts ...IOOpt) (i IO, err error) { | ||
return nil, errors.New("not implemented on Windows") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least, I couldn't find code using this on Windows (looks like the only thing used by hcsshim / runhcs is runc.Monitor
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Commit 421b4ca (#61) changed the use of
syscall.Signal in favor of unix.Signal, to match other code.
As a result, some code that imported these files on Windows (even if unused)
failed to compile, which lead to d6ba496 (#66),
which created a separate implementation for Windows without PdeathSignal.
Given that golang.org/x/sys/unix.Signal is an alias for syscall.Signal
(see https://github.com/golang/sys/blob/751e447fb3d0a97f584890476adddc1d56307388/unix/aliases.go#L13-L14),
they should be interchangeable.
Note that the io.go files could probably be excluded on Windows as a whole,
but taking a slightly less rigorous approach in this PR.