diff --git a/.travis.yml b/.travis.yml index d4c2045d..5ce45876 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,22 +1,30 @@ language: go +go: 1.3 # let us have pretty experimental Docker-based Travis workers sudo: false env: - TRAVIS_GLOBAL_WTF=1 - - GOOS=linux GOARCH=amd64 - - GOOS=linux GOARCH=386 - - GOOS=linux GOARCH=arm - - GOOS=darwin GOARCH=amd64 - - GOOS=darwin GOARCH=386 - - GOOS=freebsd GOARCH=amd64 + - _GOOS=linux _GOARCH=amd64 +# - _GOOS=linux _GOARCH=386 # Travis can't currently do 32bit cgo... (see https://travis-ci.org/tianon/libcontainer/jobs/30126518#L168) +# - _GOOS=linux _GOARCH=arm # see https://github.com/moovweb/gvm/issues/22 install: + - mkdir -pv "${GOPATH%%:*}/src/github.com/docker" && [ -d "${GOPATH%%:*}/src/github.com/docker/libcontainer" ] || ln -sv "$(readlink -f .)" "${GOPATH%%:*}/src/github.com/docker/libcontainer" + - if [ -z "$TRAVIS_GLOBAL_WTF" ]; then + export CGO_ENABLED=1; + gvm cross "$_GOOS" "$_GOARCH"; + export GOOS="$_GOOS" GOARCH="$_GOARCH"; + fi + - if [ -z "$TRAVIS_GLOBAL_WTF" ]; then go env; fi - go get -d -v ./... - - go get -d -v github.com/dotcloud/docker # just to be sure - - DOCKER_PATH="${GOPATH%%:*}/src/github.com/dotcloud/docker" - - sed -i 's!dotcloud/docker!docker/libcontainer!' "$DOCKER_PATH/hack/make/.validate" + - if [ "$TRAVIS_GLOBAL_WTF" ]; then + export DOCKER_PATH="${GOPATH%%:*}/src/github.com/dotcloud/docker"; + mkdir -p "$DOCKER_PATH/hack/make"; + ( cd "$DOCKER_PATH/hack/make" && wget -c 'https://raw.githubusercontent.com/dotcloud/docker/master/hack/make/'{.validate,validate-dco,validate-gofmt} ); + sed -i 's!dotcloud/docker!docker/libcontainer!' "$DOCKER_PATH/hack/make/.validate"; + fi script: - if [ "$TRAVIS_GLOBAL_WTF" ]; then bash "$DOCKER_PATH/hack/make/validate-dco"; fi diff --git a/apparmor/apparmor.go b/apparmor/apparmor.go index 704ee29e..fb1574df 100644 --- a/apparmor/apparmor.go +++ b/apparmor/apparmor.go @@ -1,4 +1,4 @@ -// +build apparmor,linux,amd64 +// +build apparmor,linux package apparmor diff --git a/apparmor/apparmor_disabled.go b/apparmor/apparmor_disabled.go index 8d86ce9d..937bf915 100644 --- a/apparmor/apparmor_disabled.go +++ b/apparmor/apparmor_disabled.go @@ -1,4 +1,4 @@ -// +build !apparmor !linux !amd64 +// +build !apparmor !linux package apparmor diff --git a/netlink/netlink_linux.go b/netlink/netlink_linux.go index 14e30aa0..39630c3e 100644 --- a/netlink/netlink_linux.go +++ b/netlink/netlink_linux.go @@ -1,5 +1,3 @@ -// +build amd64 - package netlink import ( diff --git a/netlink/netlink_unsupported.go b/netlink/netlink_unsupported.go index 13593456..2c4d3194 100644 --- a/netlink/netlink_unsupported.go +++ b/netlink/netlink_unsupported.go @@ -1,4 +1,4 @@ -// +build !linux !amd64 +// +build !linux package netlink diff --git a/system/setns_linux.go b/system/setns_linux.go index a0a259e1..32821ee2 100644 --- a/system/setns_linux.go +++ b/system/setns_linux.go @@ -11,7 +11,9 @@ import ( // We need different setns values for the different platforms and arch // We are declaring the macro here because the SETNS syscall does not exist in th stdlib var setNsMap = map[string]uintptr{ + "linux/386": 346, "linux/amd64": 308, + "linux/arm": 374, } func Setns(fd uintptr, flags uintptr) error {