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

libcontainer/utils: cross-platform use of unix/syscall #1701

Closed
wants to merge 1 commit into from

Conversation

vbatts
Copy link
Member

@vbatts vbatts commented Jan 24, 2018

unix.WaitStatus is unix only ... syscall.WaitStatus exists on more platforms

Signed-off-by: Vincent Batts vbatts@hashbangbash.com

@vbatts vbatts force-pushed the platform branch 3 times, most recently from 6cb5ac3 to f04fb4e Compare January 24, 2018 21:19
@cyphar
Copy link
Member

cyphar commented Jan 24, 2018

We've been slowly switching runc to use golang.org/x/sys/unix over syscall because it is getting improvements and is better maintained than syscall (syscall has the Go stability guarantee attached which means that it cannot really be improved). Since runc only is meant to work on Linux, this shouldn't be an issue.

@frezbo
Copy link

frezbo commented Jan 24, 2018

BTW this topic being aside, what does docker uses for windows containers as the runtime? I thought it also used runc

@cyphar
Copy link
Member

cyphar commented Jan 24, 2018

Docker uses VMs under the hood using HyperV (though I believe in newer versions hcsshim will actually create a "container" on Windows -- which is a new HyperV concept apparently). MacOS also uses VMs with xhyve.

You still can't run runc underneath their Linux compatiblity project (though you can get quite close -- they have yet to implement mount propagation and a few other Linux features needed to use runc). And unlike the FreeBSD or illumos Linux compatibility projects, I believe (though can't verify since I don't use Windows) that you couldn't use the above to run Windows programs inside a runc container on Windows since WSL has some odd restrictions on where Windows programs must exist in order to execute them.

EDIT: Sorry, they do appear to have cross-compatibility now but it's not clear to me how this interoperability works and whether you could actually us it from within a runc container (they talk about the "windows $PATH" which leads me to believe they still require Windows binaries to be on the Windows filesystem).

@vbatts
Copy link
Member Author

vbatts commented Feb 27, 2018

@cyphar i understand that, but that is the benefit of a stdlib that may have multi-platform presence. It gets uglier to spread these calls out to their on platform files. :-\

@cyphar
Copy link
Member

cyphar commented Feb 28, 2018

The problem is that syscall is not as well-maintained as golang.org/x/sys -- because Go as its backwards compatibility guarantees that make it hard to change incorrectly designed APIs. But ultimately I don't have a strong opinion on a ~6 line patch so ... idk.

unix.WaitStatus is unix only ... syscall.WaitStatus exists on more platforms

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
@vbatts
Copy link
Member Author

vbatts commented Mar 6, 2018

updated. PTAL.

@vbatts vbatts changed the title libcontainer/utils: switch to less platform dependent libcontainer/utils: cross-platform use of unix/syscall Mar 8, 2018
@vbatts
Copy link
Member Author

vbatts commented Mar 8, 2018

changed the title as this is not wholly switching back to syscall

vbatts added a commit to vbatts/cri-o that referenced this pull request Mar 8, 2018
opencontainers/runc#1701

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
vbatts added a commit to vbatts/cri-o that referenced this pull request Mar 8, 2018
opencontainers/runc#1701

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
vbatts added a commit to vbatts/cri-o that referenced this pull request Mar 8, 2018
opencontainers/runc#1701

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
@vbatts
Copy link
Member Author

vbatts commented Apr 3, 2018

bump

vbatts added a commit to vbatts/cri-o that referenced this pull request Apr 5, 2018
opencontainers/runc#1701

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
vbatts added a commit to vbatts/cri-o that referenced this pull request Apr 12, 2018
opencontainers/runc#1701

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
@vbatts vbatts closed this May 2, 2018
@vbatts vbatts deleted the platform branch May 2, 2018 19:04
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

3 participants