Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

Commit

Permalink
Update a few build tags to be more generic, add a couple more SETNS c…
Browse files Browse the repository at this point in the history
…onstants, and update Travis with a bunch of fixes/tweaks (including removing the nonfunctional cross-compile stuff for now)

Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
  • Loading branch information
tianon committed Jul 17, 2014
1 parent 3c03998 commit 1cdf742
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 14 deletions.
26 changes: 17 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion apparmor/apparmor.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build apparmor,linux,amd64
// +build apparmor,linux

package apparmor

Expand Down
2 changes: 1 addition & 1 deletion apparmor/apparmor_disabled.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build !apparmor !linux !amd64
// +build !apparmor !linux

package apparmor

Expand Down
2 changes: 0 additions & 2 deletions netlink/netlink_linux.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// +build amd64

package netlink

import (
Expand Down
2 changes: 1 addition & 1 deletion netlink/netlink_unsupported.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build !linux !amd64
// +build !linux

package netlink

Expand Down
2 changes: 2 additions & 0 deletions system/setns_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 1cdf742

Please sign in to comment.