Skip to content

Commit

Permalink
Fix more instances of "dotcloud/docker" in hack/ (and add a DOCKER_PK…
Browse files Browse the repository at this point in the history
…G environment variable to simplify references to our "package path" in our bundlescripts)

Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
  • Loading branch information
tianon committed Jul 30, 2014
1 parent 19c8e74 commit 3a14eb0
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 13 deletions.
18 changes: 10 additions & 8 deletions hack/make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ set -e

set -o pipefail

export DOCKER_PKG='github.com/docker/docker'

# We're a nice, sexy, little shell script, and people might try to run us;
# but really, they shouldn't. We want to be in a container!
if [ "$(pwd)" != '/go/src/github.com/docker/docker' ] || [ -z "$DOCKER_CROSSPLATFORMS" ]; then
if [ "$(pwd)" != "/go/src/$DOCKER_PKG" ] || [ -z "$DOCKER_CROSSPLATFORMS" ]; then
{
echo "# WARNING! I don't seem to be running in the Docker container."
echo "# The result of this command might be an incorrect build, and will not be"
Expand Down Expand Up @@ -77,8 +79,8 @@ fi

if [ "$AUTO_GOPATH" ]; then
rm -rf .gopath
mkdir -p .gopath/src/github.com/docker
ln -sf ../../../.. .gopath/src/github.com/docker/docker
mkdir -p .gopath/src/"$(dirname "${DOCKER_PKG}")"
ln -sf ../../../.. .gopath/src/"${DOCKER_PKG}"
export GOPATH="$(pwd)/.gopath:$(pwd)/vendor"
fi

Expand All @@ -91,8 +93,8 @@ fi
# Use these flags when compiling the tests and final binary
LDFLAGS='
-w
-X github.com/docker/docker/dockerversion.GITCOMMIT "'$GITCOMMIT'"
-X github.com/docker/docker/dockerversion.VERSION "'$VERSION'"
-X '$DOCKER_PKG'/dockerversion.GITCOMMIT "'$GITCOMMIT'"
-X '$DOCKER_PKG'/dockerversion.VERSION "'$VERSION'"
'
LDFLAGS_STATIC='-linkmode external'
EXTLDFLAGS_STATIC='-static'
Expand All @@ -103,7 +105,7 @@ BUILDFLAGS=( -a -tags "netgo static_build $DOCKER_BUILDTAGS" )
EXTLDFLAGS_STATIC_DOCKER="$EXTLDFLAGS_STATIC -lpthread -Wl,--unresolved-symbols=ignore-in-object-files"
LDFLAGS_STATIC_DOCKER="
$LDFLAGS_STATIC
-X github.com/docker/docker/dockerversion.IAMSTATIC true
-X $DOCKER_PKG/dockerversion.IAMSTATIC true
-extldflags \"$EXTLDFLAGS_STATIC_DOCKER\"
"

Expand Down Expand Up @@ -150,7 +152,7 @@ go_test_dir() {
testcover=( -cover -coverprofile "$coverprofile" $coverpkg )
fi
(
echo '+ go test' $TESTFLAGS "github.com/docker/docker${dir#.}"
echo '+ go test' $TESTFLAGS "${DOCKER_PKG}${dir#.}"
cd "$dir"
go test ${testcover[@]} -ldflags "$LDFLAGS" "${BUILDFLAGS[@]}" $TESTFLAGS
)
Expand Down Expand Up @@ -178,7 +180,7 @@ go_compile_test_dir() {
[ $? -ne 0 ] && return 1
mkdir -p "$(dirname "$out_file")"
mv "$dir/$(basename "$dir").test" "$out_file"
echo "Precompiled: github.com/dotcloud/docker${dir#.}"
echo "Precompiled: ${DOCKER_PKG}${dir#.}"
}

# This helper function walks the current directory looking for directories
Expand Down
2 changes: 1 addition & 1 deletion hack/make/dynbinary
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ fi
# exported so that "dyntest" can easily access it later without recalculating it

(
export LDFLAGS_STATIC_DOCKER="-X github.com/docker/docker/dockerversion.INITSHA1 \"$DOCKER_INITSHA1\" -X github.com/docker/docker/dockerversion.INITPATH \"$DOCKER_INITPATH\""
export LDFLAGS_STATIC_DOCKER="-X $DOCKER_PKG/dockerversion.INITSHA1 \"$DOCKER_INITSHA1\" -X $DOCKER_PKG/dockerversion.INITPATH \"$DOCKER_INITPATH\""
export BUILDFLAGS=( "${BUILDFLAGS[@]/netgo /}" ) # disable netgo, since we don't need it for a dynamic binary
source "$(dirname "$BASH_SOURCE")/binary"
)
2 changes: 1 addition & 1 deletion hack/make/dyntest-integration
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fi
(
export TEST_DOCKERINIT_PATH="$INIT"
export LDFLAGS_STATIC_DOCKER="
-X github.com/docker/docker/dockerversion.INITSHA1 \"$DOCKER_INITSHA1\"
-X $DOCKER_PKG/dockerversion.INITSHA1 \"$DOCKER_INITSHA1\"
"
source "$(dirname "$BASH_SOURCE")/test-integration"
)
2 changes: 1 addition & 1 deletion hack/make/dyntest-unit
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fi
(
export TEST_DOCKERINIT_PATH="$INIT"
export LDFLAGS_STATIC_DOCKER="
-X github.com/docker/docker/dockerversion.INITSHA1 \"$DOCKER_INITSHA1\"
-X $DOCKER_PKG/dockerversion.INITSHA1 \"$DOCKER_INITSHA1\"
"
source "$(dirname "$BASH_SOURCE")/test-unit"
)
2 changes: 1 addition & 1 deletion hack/make/test-integration
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ DEST=$1

bundle_test_integration() {
LDFLAGS="$LDFLAGS $LDFLAGS_STATIC_DOCKER" go_test_dir ./integration \
"-coverpkg $(find_dirs '*.go' | sed 's,^\.,github.com/docker/docker,g' | paste -d, -s)"
"-coverpkg $(find_dirs '*.go' | sed 's,^\.,'$DOCKER_PKG',g' | paste -d, -s)"
}

# this "grep" hides some really irritating warnings that "go test -coverpkg"
Expand Down
2 changes: 1 addition & 1 deletion hack/make/test-unit
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ go_run_test_dir() {
TESTS_FAILED=()
while read dir; do
echo
echo '+ go test' $TESTFLAGS "github.com/dotcloud/docker${dir#.}"
echo '+ go test' $TESTFLAGS "${DOCKER_PKG}${dir#.}"
precompiled="$DEST/precompiled/$dir.test"
if ! ( cd "$dir" && "$precompiled" ); then
TESTS_FAILED+=("$dir")
Expand Down

0 comments on commit 3a14eb0

Please sign in to comment.