Merge pull request #104 from tianon/more-generics

Update a few build tags to be more generic, ...
This commit is contained in:
Michael Crosby 2014-07-17 11:42:48 -07:00
commit 2e422fc2a1
6 changed files with 22 additions and 14 deletions

View File

@ -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

View File

@ -1,4 +1,4 @@
// +build apparmor,linux,amd64
// +build apparmor,linux
package apparmor

View File

@ -1,4 +1,4 @@
// +build !apparmor !linux !amd64
// +build !apparmor !linux
package apparmor

View File

@ -1,5 +1,3 @@
// +build amd64
package netlink
import (

View File

@ -1,4 +1,4 @@
// +build !linux !amd64
// +build !linux
package netlink

View File

@ -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 {