Reduce Windows stubs#79
Merged
Merged
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❌ Patch coverage is
Additional details and impacted files@@ 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 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
thaJeztah
commented
Sep 15, 2021
| // 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) { |
Member
Author
There was a problem hiding this comment.
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") |
Member
Author
There was a problem hiding this comment.
At least, I couldn't find code using this on Windows (looks like the only thing used by hcsshim / runhcs is runc.Monitor)
kzys
approved these changes
Sep 21, 2021
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.
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.