-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Fix non-Unix build of libcontainer/user #1509
Conversation
This was found by moby/tool#102 / linuxkit/linuxkit#2159. Looking through the |
Commit 3d7cb42 ("Move libcontainer to x/sys/unix") switched from `syscall.Get[ug]id` to `unix.Get[ug]id` where `unix.*` is (naturally) not available on non-Unix platforms such as Windows. Move the offending code into a Unix specific file and provide stubs in the _unsupported.go case. The stubs use `-1` for UID and GID which is what syscall_windows.go was returning prior to 3d7cb42, and these are laundered through `Lookup[GU]id` to provide the same behaviour as before. Signed-off-by: Ian Campbell <ian.campbell@docker.com>
Unfortunately |
Commit 3d7cb42 ("Move libcontainer to x/sys/unix") switched from `syscall.WaitStatus` to `unix.WaitStatus` which is not available in Windows. Provide a version which uses x/sys/windows. Signed-off-by: Ian Campbell <ian.campbell@docker.com>
To satisfy the Console interface. Signed-off-by: Ian Campbell <ian.campbell@docker.com>
To fix Windows build issues. Signed-off-by: Ian Campbell <ian.campbell@docker.com>
@ijc overall, we don't care about runc compiling on anything but linux. This wasn't the case before but after looking how different platforms will make their own runtimes we stopped this. Can you just add build tags in your code around this import? |
@crosbymichael should we also start cleaning up the rest of non-linux code ? |
@dqminh probably. I think that will also prompt us to break out a few packages that are generally useful and that could support cross platform operations. That is what I have been doing in containerd with console and cgroups(not cross platform ;) ) packages. The user package would be good to breakout if we have a way to make it work cross platform correctly. |
Yah, my plan is to merge console once we have the change for EpollConsole, and merge with containerd/cgroups after that |
Ya, we need that review from @mrunalp ;) |
Right, I wasn't sure if that extended to
It's being pulled in through nested vendoring, I think there is one path via |
@justincormack has filed moby/moby#34040 which should avoid this call chain for our use case, so closing this. |
Commit 3d7cb42 ("Move libcontainer to x/sys/unix") switched from
syscall.Get[ug]id
tounix.Get[ug]id
whereunix.*
is (naturally) notavailable on non-Unix platforms such as Windows.
Move the offending code into a Unix specific file and provide stubs in the
_unsupported.go case.
The stubs use
-1
for UID and GID which is what syscall_windows.go wasreturning prior to 3d7cb42, and these are laundered through
Lookup[GU]id
to provide the same behaviour as before.
Signed-off-by: Ian Campbell ian.campbell@docker.com