mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Add -a to our BUILDFLAGS directly, which fixes some fun test compilation issues
Also, now that we use "-a", we no longer get any benefit from "go test -i", and it actually causes problems sometimes, so let's nuke it.
This commit is contained in:
parent
70c7220a99
commit
fbac812540
3 changed files with 3 additions and 7 deletions
|
@ -63,7 +63,7 @@ fi
|
||||||
# Use these flags when compiling the tests and final binary
|
# Use these flags when compiling the tests and final binary
|
||||||
LDFLAGS='-X main.GITCOMMIT "'$GITCOMMIT'" -X main.VERSION "'$VERSION'" -w'
|
LDFLAGS='-X main.GITCOMMIT "'$GITCOMMIT'" -X main.VERSION "'$VERSION'" -w'
|
||||||
LDFLAGS_STATIC='-X github.com/dotcloud/docker/utils.IAMSTATIC true -linkmode external -extldflags "-lpthread -static -Wl,--unresolved-symbols=ignore-in-object-files"'
|
LDFLAGS_STATIC='-X github.com/dotcloud/docker/utils.IAMSTATIC true -linkmode external -extldflags "-lpthread -static -Wl,--unresolved-symbols=ignore-in-object-files"'
|
||||||
BUILDFLAGS='-tags netgo'
|
BUILDFLAGS='-tags netgo -a'
|
||||||
|
|
||||||
HAVE_GO_TEST_COVER=
|
HAVE_GO_TEST_COVER=
|
||||||
if \
|
if \
|
||||||
|
@ -88,10 +88,6 @@ go_test_dir() {
|
||||||
coverprofile="$DEST/coverprofiles/${coverprofile//\//-}"
|
coverprofile="$DEST/coverprofiles/${coverprofile//\//-}"
|
||||||
testcover=( -cover -coverprofile "$coverprofile" )
|
testcover=( -cover -coverprofile "$coverprofile" )
|
||||||
fi
|
fi
|
||||||
( # we run "go test -i" ouside the "set -x" to provde cleaner output
|
|
||||||
cd "$dir"
|
|
||||||
go test -i -ldflags "$LDFLAGS" $BUILDFLAGS
|
|
||||||
)
|
|
||||||
(
|
(
|
||||||
set -x
|
set -x
|
||||||
cd "$dir"
|
cd "$dir"
|
||||||
|
|
|
@ -2,5 +2,5 @@
|
||||||
|
|
||||||
DEST=$1
|
DEST=$1
|
||||||
|
|
||||||
go build -a -o $DEST/docker-$VERSION -ldflags "$LDFLAGS $LDFLAGS_STATIC" $BUILDFLAGS ./docker
|
go build -o $DEST/docker-$VERSION -ldflags "$LDFLAGS $LDFLAGS_STATIC" $BUILDFLAGS ./docker
|
||||||
echo "Created binary: $DEST/docker-$VERSION"
|
echo "Created binary: $DEST/docker-$VERSION"
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
DEST=$1
|
DEST=$1
|
||||||
|
|
||||||
# dockerinit still needs to be a static binary, even if docker is dynamic
|
# dockerinit still needs to be a static binary, even if docker is dynamic
|
||||||
CGO_ENABLED=0 go build -a -o $DEST/dockerinit-$VERSION -ldflags "$LDFLAGS -d" $BUILDFLAGS ./dockerinit
|
CGO_ENABLED=0 go build -o $DEST/dockerinit-$VERSION -ldflags "$LDFLAGS -d" $BUILDFLAGS ./dockerinit
|
||||||
echo "Created binary: $DEST/dockerinit-$VERSION"
|
echo "Created binary: $DEST/dockerinit-$VERSION"
|
||||||
ln -sf dockerinit-$VERSION $DEST/dockerinit
|
ln -sf dockerinit-$VERSION $DEST/dockerinit
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue