Comments (21)
@vielmetti Did you set your GOPATH
to /Users/emv
?
from runc.
I have the same issue on linux and i did setup my GOPATH as well
from runc.
Different error on OS X Yosemite:
cd runc/
tim@home /go/src/github.com/opencontainers/runc> make
go get github.com/tools/godep
godep go build -o runc .
# github.com/opencontainers/runc/libcontainer/configs
libcontainer/configs/namespaces.go:5: undefined: Namespace
# github.com/opencontainers/runc/libcontainer/nsenter
libcontainer/nsenter/nsexec.c:8:10: fatal error: 'linux/limits.h' file not found
godep: go exit status 2
make: *** [all] Error 1
from runc.
Since runc
does the containerization directly, I believe it is only intended to be built/ran on Linux.
from runc.
I'm pretty sure it should build on MacOS and FreeBSD.
from runc.
Looks like libcontainers hasn't been vendored?
[~/runc] master ∞ ls Godeps/_workspace/src/github.com/opencontainers
ls: cannot access Godeps/_workspace/src/github.com/opencontainers: No such file or directory
from runc.
Install instructions should probably be:
go get github.com/opencontainers/runc
cd $GOPATH/src/github.com/opencontainers/runc
make
from runc.
+1 to @AndrewVos who got me closer with his install instructions. Again on Mac OS X 10.9, some progress:
Edwards-MacBook-Air:runc emv$ go get github.com/opencontainers/runc
# github.com/opencontainers/runc/libcontainer/configs
../github.com/opencontainers/runc/libcontainer/configs/namespaces.go:5: undefined: Namespace
# github.com/opencontainers/runc/libcontainer/nsenter
../github.com/opencontainers/runc/libcontainer/nsenter/nsexec.c:8:10: fatal error: 'linux/limits.h' file not found
Edwards-MacBook-Air:runc emv$ cd $GOPATH/src/github.com/opencontainers/runc
Edwards-MacBook-Air:runc emv$ make
go get github.com/tools/godep
godep go build -o runc .
# github.com/opencontainers/runc/libcontainer/configs
libcontainer/configs/namespaces.go:5: undefined: Namespace
# github.com/opencontainers/runc/libcontainer/nsenter
libcontainer/nsenter/nsexec.c:8:10: fatal error: 'linux/limits.h' file not found
godep: go exit status 2
make: *** [all] Error 1
at least that suggests where a change might be made.
from runc.
And digging a little deeper, when I patch so that I do
#include <limits.h>
instead of including linux/limits.h, I discover that this all depends on the clone(2) syscall which Darwin does not have. Not sure that there's an easy way around that on OS X without delving way deeper into kernel space that I don't pretend to understand.
http://linux.die.net/man/2/clone is a man page.
from runc.
Same thing happens on OSX 10.10.3
# github.com/opencontainers/runc/libcontainer/configs
libcontainer/configs/namespaces.go:5: undefined: Namespace
# github.com/opencontainers/runc/libcontainer/nsenter
libcontainer/nsenter/nsexec.c:8:10: fatal error: 'linux/limits.h' file not found
godep: go exit status 2
make: *** [all] Error 1
from runc.
@vielmetti is onto something here.
It should be #include <limits.h>
because on OS X Yosemite that file is located here:
/Library/Developer/CommandLineTools/usr/lib/clang/6.1.0/include/limits.h
Once I changed the include to limits.h
, I got different errors:
make
go get github.com/tools/godep
godep go build -o runc .
# github.com/opencontainers/runc/libcontainer/configs
libcontainer/configs/namespaces.go:5: undefined: Namespace
# github.com/opencontainers/runc/libcontainer/nsenter
libcontainer/nsenter/nsexec.c:61:10: warning: implicit declaration of function 'clone' is invalid in C99 [-Wimplicit-function-declaration]
libcontainer/nsenter/nsexec.c:61:42: error: use of undeclared identifier 'CLONE_PARENT'
libcontainer/nsenter/nsexec.c:135:7: warning: implicit declaration of function 'setns' is invalid in C99 [-Wimplicit-function-declaration]
libcontainer/nsenter/nsexec.c:154:8: warning: implicit declaration of function 'dup3' is invalid in C99 [-Wimplicit-function-declaration]
godep: go exit status 2
make: *** [all] Error 1
Going further down the rabbit hole, I added the following:
int clone(int (*fn)(void *), void *child_stack, int flags, void *arg, ... /* pid_t *ptid, struct user_desc *tls, pid_t *ctid */ );
int setns(int fd, int nstype);
int dup3(int oldfd, int newfd, int flags);
#if __APPLE__
#define CLONE_PARENT 0
#endif
Which leads me to this error:
Undefined symbols for architecture x86_64:
"_clone", referenced from:
_clone_parent in nsexec.o
"_dup3", referenced from:
_nsexec in nsexec.o
"_setns", referenced from:
_nsexec in nsexec.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Funny that https://github.com/docker/libcontainer does not have the same problem even though the code looks identical.
from runc.
On linux (debian jessie), the exact reported error is fixed by using:
GOPATH=$PWD PATH=$PWD/bin:$PATH make
#wait for it to fail, fixup dependencies
mkdir -p src/github.com/opencontainers/runc/
ln -sf $PWD/libcontainer src/github.com/opencontainers/runc/
GOPATH=$PWD PATH=$PWD/bin:$PATH make
#works now
I think this is preferred for not using systemwide Go dependencies.
from runc.
the above snippet fixed the problem for me.
from runc.
Using godep
the build is straightforward (tested on Ubuntu 14.04).
go get github.com/tools/godep
godep get github.com/opencontainers/runc
cd $GOPATH/src/github.com/opencontainers/runc
make
from runc.
@collinanderson fixed it on Mac OS ? from which folder do you run those lines ?
from runc.
This was linux. I ran it from the runc git checkout. @ggiamarchi's snippet looks promising too.
from runc.
unfortunately @ggiamarchi's snippet fails in mac (Mac OS 10.10.2)
godep get github.com/opencontainers/runc
# github.com/opencontainers/runc/libcontainer/configs
libcontainer/configs/namespaces.go:5: undefined: Namespace
# github.com/opencontainers/runc/libcontainer/nsenter
libcontainer/nsenter/nsexec.c:8:10: fatal error: 'linux/limits.h' file not found
godep: go exit status 2
godep: exit status 1
from runc.
Using make
or manually running the commands in the Makefile also didn't work for me on Arch Linux and also in a golang:latest
Docker container with the GOPATH
set properly. But @exaexa 's snippet works.
from runc.
even in Linux, for runc and libcontainers to be compiled vendor list need to be pulled.
from runc.
I wouldn't expect it to build on Mac because the spec won't exist there. spec.go
is an interface. The only implementation is spec_linux.go
which only builds on linux.
from runc.
The documentation should be updated and this issue closed - it makes no sense to build this on OS X (yet).
from runc.
Related Issues (20)
- runc can not wait process in the container exits when share pid namespace HOT 4
- Reasons that can't use runc-dmz
- flaky test: kill KILL [host pidns] HOT 8
- flaky test: check_cpu_* HOT 1
- [ci] We should check `memory.swap.max` exists or not for cgroupv2 HOT 1
- Building runc 1.1.11 causes
- runc-dmz masks the error from unix.SYS_EXECVEAT HOT 12
- writing sync procError: write sync: file already closed
- `--manage-cgroups-mode` can not be `ignore` when checkpoint and restore containers HOT 5
- BPF programs installed by libcontainer are not distinguished
- Kubelet fails to invoke runc to delete residual cgroup resources in pods. HOT 4
- racy RLIMIT_NOFILE setting with Go 1.19+ HOT 13
- vagrant up is not working in Cirrus CI HOT 4
- Seems like a typo, the .PHONY label has no purpose this way HOT 3
- runc update will clear cpu burst value HOT 3
- runc update: cpu period and cpu burst being reset to defaults after an unrelated update HOT 8
- runc init hang up HOT 1
- runc doesn't work with go1.22 HOT 1
- GHSA-c5pj-mqfh-rvc3 "Runc allows an arbitrary systemd property to be injected" is a misunderstood vulnerability. Users do NOT need to update runc. HOT 3
- flaky test: TestUsernsCheckpoint
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from runc.