From ea2e4d73c4c753cdc99966e4dfe35143e79564ce Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Tue, 20 Jun 2017 16:55:40 -0400 Subject: [PATCH] remove cli concerns from hack/make Signed-off-by: Daniel Nephin --- hack/make.sh | 2 -- hack/make/.binary | 2 ++ hack/make/binary-daemon | 6 +----- hack/make/cross | 32 +++++++------------------------- hack/make/dynbinary-daemon | 2 -- 5 files changed, 10 insertions(+), 34 deletions(-) diff --git a/hack/make.sh b/hack/make.sh index 9c6ed6e036..b7d59ba94a 100755 --- a/hack/make.sh +++ b/hack/make.sh @@ -112,7 +112,6 @@ if [ ! "$GOPATH" ]; then exit 1 fi -DOCKER_BUILDTAGS+=" daemon" if ${PKG_CONFIG} 'libsystemd >= 209' 2> /dev/null ; then DOCKER_BUILDTAGS+=" journald" elif ${PKG_CONFIG} 'libsystemd-journal' 2> /dev/null ; then @@ -139,7 +138,6 @@ fi # Use these flags when compiling the tests and final binary IAMSTATIC='true' -source "$SCRIPTDIR/make/.go-autogen" if [ -z "$DOCKER_DEBUG" ]; then LDFLAGS='-w' fi diff --git a/hack/make/.binary b/hack/make/.binary index 7f353c1327..8d4265cb65 100644 --- a/hack/make/.binary +++ b/hack/make/.binary @@ -1,6 +1,8 @@ #!/usr/bin/env bash set -e +GO_PACKAGE='github.com/docker/docker/cmd/dockerd' +BINARY_SHORT_NAME='dockerd' BINARY_NAME="$BINARY_SHORT_NAME-$VERSION" BINARY_EXTENSION="$(binary_extension)" BINARY_FULLNAME="$BINARY_NAME$BINARY_EXTENSION" diff --git a/hack/make/binary-daemon b/hack/make/binary-daemon index a6b322b554..736f308a83 100644 --- a/hack/make/binary-daemon +++ b/hack/make/binary-daemon @@ -1,13 +1,9 @@ #!/usr/bin/env bash set -e -[ -z "$KEEPDEST" ] && \ - rm -rf "$DEST" +[ -z "$KEEPDEST" ] && rm -rf "$DEST" ( - source "${MAKEDIR}/.binary-setup" - export BINARY_SHORT_NAME="$DOCKER_DAEMON_BINARY_NAME" - export GO_PACKAGE='github.com/docker/docker/cmd/dockerd' source "${MAKEDIR}/.binary" copy_binaries "$DEST" 'hash' ) diff --git a/hack/make/cross b/hack/make/cross index a3d9c4c97e..85dd3c637f 100644 --- a/hack/make/cross +++ b/hack/make/cross @@ -1,24 +1,19 @@ #!/usr/bin/env bash set -e -# explicit list of os/arch combos that support being a daemon -declare -A daemonSupporting -daemonSupporting=( - [linux/amd64]=1 - [windows/amd64]=1 -) - # if we have our linux/amd64 version compiled, let's symlink it in if [ -x "$DEST/../binary-daemon/dockerd-$VERSION" ]; then arch=$(go env GOHOSTARCH) mkdir -p "$DEST/linux/${arch}" ( cd "$DEST/linux/${arch}" - ln -s ../../../binary-daemon/* ./ + ln -sf ../../../binary-daemon/* ./ ) echo "Created symlinks:" "$DEST/linux/${arch}/"* fi +DOCKER_CROSSPLATFORMS=${DOCKER_CROSSPLATFORMS:-"linux/amd64 windows/amd64"} + for platform in $DOCKER_CROSSPLATFORMS; do ( export KEEPDEST=1 @@ -26,22 +21,9 @@ for platform in $DOCKER_CROSSPLATFORMS; do export GOOS=${platform%/*} export GOARCH=${platform##*/} - if [ "$GOOS" != "solaris" ]; then - # TODO. Solaris cannot be cross build because of CGO calls. - - echo "Cross building: $DEST" - # go install docker/docker/pkg packages to ensure that - # they build cross platform. - go install github.com/docker/docker/pkg/... - - if [ -n "${daemonSupporting[$platform]}" ]; then - # Since tgz relies on the paths created by mkdir - # and we removed the clients, we don't want to mkdir - # for all the platforms, only the ones supported by the daemon. - mkdir -p "$DEST" - ABS_DEST="$(cd "$DEST" && pwd -P)" - source "${MAKEDIR}/binary-daemon" - fi - fi + echo "Cross building: $DEST" + mkdir -p "$DEST" + ABS_DEST="$(cd "$DEST" && pwd -P)" + source "${MAKEDIR}/binary-daemon" ) done diff --git a/hack/make/dynbinary-daemon b/hack/make/dynbinary-daemon index 1b7dbb45a8..d1c0070e62 100644 --- a/hack/make/dynbinary-daemon +++ b/hack/make/dynbinary-daemon @@ -2,8 +2,6 @@ set -e ( - export BINARY_SHORT_NAME='dockerd' - export GO_PACKAGE='github.com/docker/docker/cmd/dockerd' export IAMSTATIC='false' export LDFLAGS_STATIC_DOCKER='' export BUILDFLAGS=( "${BUILDFLAGS[@]/netgo /}" ) # disable netgo, since we don't need it for a dynamic binary