Skip to content
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

Merged
merged 1 commit into from
Sep 21, 2021
Merged

Conversation

thaJeztah
Copy link
Member

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.

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-commenter
Copy link

Codecov Report

Merging #79 (cb9c869) into main (d1e3ca2) will decrease coverage by 0.06%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            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              
Impacted Files Coverage Δ
io.go 6.45% <0.00%> (-0.15%) ⬇️
io_unix.go 0.00% <0.00%> (ø)
runc.go 21.07% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d1e3ca2...cb9c869. Read the comment docs.

// 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) {
Copy link
Member Author

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")
Copy link
Member Author

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)

Copy link
Member

@estesp estesp left a comment

Choose a reason for hiding this comment

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

LGTM

@estesp estesp merged commit 1c99ade into containerd:main Sep 21, 2021
@thaJeztah thaJeztah deleted the reduce_windows_stubs branch September 21, 2021 18:48
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.

None yet

4 participants