Revert "Use code generation to set IAMSTATIC instead of -X"
This reverts commit 3e10b93106
.
Conflicts:
.gitignore
hack/make.sh
hack/make/dynbinary
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
This commit is contained in:
parent
d176d1bfb4
commit
17e0a15386
|
@ -27,6 +27,3 @@ docs/AWS_S3_BUCKET
|
||||||
docs/GIT_BRANCH
|
docs/GIT_BRANCH
|
||||||
docs/VERSION
|
docs/VERSION
|
||||||
docs/GITCOMMIT
|
docs/GITCOMMIT
|
||||||
dockerversion/static.go
|
|
||||||
dockerversion/details.go
|
|
||||||
dockerversion/init.go
|
|
||||||
|
|
12
hack/make.sh
12
hack/make.sh
|
@ -94,17 +94,6 @@ if [ -z "$DOCKER_CLIENTONLY" ]; then
|
||||||
DOCKER_BUILDTAGS+=" daemon"
|
DOCKER_BUILDTAGS+=" daemon"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -f dockerversion/static.go dockerversion/details.go dockerversion/init.go
|
|
||||||
cat > dockerversion/details.go <<EOF
|
|
||||||
// AUTOGENERATED FILE; see hack/make.sh
|
|
||||||
package dockerversion
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
GITCOMMIT = "$GITCOMMIT"
|
|
||||||
VERSION = "$VERSION"
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# Use these flags when compiling the tests and final binary
|
# Use these flags when compiling the tests and final binary
|
||||||
LDFLAGS='-w'
|
LDFLAGS='-w'
|
||||||
LDFLAGS_STATIC='-linkmode external'
|
LDFLAGS_STATIC='-linkmode external'
|
||||||
|
@ -122,6 +111,7 @@ TESTFLAGS+=" -test.timeout=${TIMEOUT}"
|
||||||
EXTLDFLAGS_STATIC_DOCKER="$EXTLDFLAGS_STATIC -lpthread -Wl,--unresolved-symbols=ignore-in-object-files"
|
EXTLDFLAGS_STATIC_DOCKER="$EXTLDFLAGS_STATIC -lpthread -Wl,--unresolved-symbols=ignore-in-object-files"
|
||||||
LDFLAGS_STATIC_DOCKER="
|
LDFLAGS_STATIC_DOCKER="
|
||||||
$LDFLAGS_STATIC
|
$LDFLAGS_STATIC
|
||||||
|
-X $DOCKER_PKG/dockerversion.IAMSTATIC true
|
||||||
-extldflags \"$EXTLDFLAGS_STATIC_DOCKER\"
|
-extldflags \"$EXTLDFLAGS_STATIC_DOCKER\"
|
||||||
"
|
"
|
||||||
|
|
||||||
|
|
|
@ -3,17 +3,6 @@ set -e
|
||||||
|
|
||||||
DEST=$1
|
DEST=$1
|
||||||
|
|
||||||
: ${IAMSTATIC:=true}
|
|
||||||
|
|
||||||
cat > dockerversion/static.go <<EOF
|
|
||||||
// AUTOGENERATED FILE; see hack/make/binary and hack/make/dynbinary
|
|
||||||
package dockerversion
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
IAMSTATIC = $IAMSTATIC
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
|
|
||||||
go build \
|
go build \
|
||||||
-o "$DEST/docker-$VERSION" \
|
-o "$DEST/docker-$VERSION" \
|
||||||
"${BUILDFLAGS[@]}" \
|
"${BUILDFLAGS[@]}" \
|
||||||
|
|
|
@ -5,14 +5,6 @@ DEST=$1
|
||||||
|
|
||||||
if [ -z "$DOCKER_CLIENTONLY" ]; then
|
if [ -z "$DOCKER_CLIENTONLY" ]; then
|
||||||
# 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
|
||||||
cat > dockerversion/static.go <<EOF
|
|
||||||
// AUTOGENERATED FILE; see hack/make/binary and hack/make/dynbinary
|
|
||||||
package dockerversion
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
IAMSTATIC = true
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
go build \
|
go build \
|
||||||
-o "$DEST/dockerinit-$VERSION" \
|
-o "$DEST/dockerinit-$VERSION" \
|
||||||
"${BUILDFLAGS[@]}" \
|
"${BUILDFLAGS[@]}" \
|
||||||
|
@ -47,17 +39,7 @@ fi
|
||||||
# exported so that "dyntest" can easily access it later without recalculating it
|
# exported so that "dyntest" can easily access it later without recalculating it
|
||||||
|
|
||||||
(
|
(
|
||||||
export LDFLAGS_STATIC_DOCKER=""
|
export LDFLAGS_STATIC_DOCKER="-X $DOCKER_PKG/dockerversion.INITSHA1 \"$DOCKER_INITSHA1\" -X $DOCKER_PKG/dockerversion.INITPATH \"$DOCKER_INITPATH\""
|
||||||
cat > dockerversion/init.go <<EOF
|
|
||||||
// AUTOGENERATED FILE; see hack/make/dynbinary, hack/make/dyntest-integration and dyntest-unit
|
|
||||||
package dockerversion
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
INITSHA1 = "$DOCKER_INITSHA1"
|
|
||||||
INITPATH = "$DOCKER_INITPATH"
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
export IAMSTATIC=false
|
|
||||||
export BUILDFLAGS=( "${BUILDFLAGS[@]/netgo /}" ) # disable netgo, since we don't need it for a dynamic binary
|
export BUILDFLAGS=( "${BUILDFLAGS[@]/netgo /}" ) # disable netgo, since we don't need it for a dynamic binary
|
||||||
source "$(dirname "$BASH_SOURCE")/binary"
|
source "$(dirname "$BASH_SOURCE")/binary"
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue