From 3e10b93106dea94e5747ab32fe4ac765aa22f9bc Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Wed, 1 Oct 2014 13:37:30 +1300 Subject: [PATCH 1/3] Use code generation to set IAMSTATIC instead of -X Signed-off-by: Michael Hudson-Doyle --- .gitignore | 1 + hack/make.sh | 3 ++- hack/make/binary | 11 +++++++++++ hack/make/dynbinary | 9 +++++++++ 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 2a86e41ca..6f6cfa168 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,4 @@ docs/AWS_S3_BUCKET docs/GIT_BRANCH docs/VERSION docs/GITCOMMIT +dockerversion/static.go diff --git a/hack/make.sh b/hack/make.sh index d6da3057f..5d0ddd879 100755 --- a/hack/make.sh +++ b/hack/make.sh @@ -94,6 +94,8 @@ if [ -z "$DOCKER_CLIENTONLY" ]; then DOCKER_BUILDTAGS+=" daemon" fi +rm -f dockerversion/static.go + # Use these flags when compiling the tests and final binary LDFLAGS=' -w @@ -115,7 +117,6 @@ TESTFLAGS+=" -test.timeout=${TIMEOUT}" EXTLDFLAGS_STATIC_DOCKER="$EXTLDFLAGS_STATIC -lpthread -Wl,--unresolved-symbols=ignore-in-object-files" LDFLAGS_STATIC_DOCKER=" $LDFLAGS_STATIC - -X $DOCKER_PKG/dockerversion.IAMSTATIC true -extldflags \"$EXTLDFLAGS_STATIC_DOCKER\" " diff --git a/hack/make/binary b/hack/make/binary index b97069a85..2c71f201b 100755 --- a/hack/make/binary +++ b/hack/make/binary @@ -3,6 +3,17 @@ set -e DEST=$1 +: ${IAMSTATIC:=true} + +cat > dockerversion/static.go < dockerversion/static.go < Date: Wed, 1 Oct 2014 14:56:45 +1300 Subject: [PATCH 2/3] use code generation for GITCOMMIT/VERSION too Signed-off-by: Michael Hudson-Doyle --- .gitignore | 1 + hack/make.sh | 17 +++++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 6f6cfa168..d7dae009d 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,4 @@ docs/GIT_BRANCH docs/VERSION docs/GITCOMMIT dockerversion/static.go +dockerversion/details.go diff --git a/hack/make.sh b/hack/make.sh index 5d0ddd879..eda96b5e2 100755 --- a/hack/make.sh +++ b/hack/make.sh @@ -94,14 +94,19 @@ if [ -z "$DOCKER_CLIENTONLY" ]; then DOCKER_BUILDTAGS+=" daemon" fi -rm -f dockerversion/static.go +rm -f dockerversion/static.go dockerversion/details.go +cat > dockerversion/details.go < Date: Wed, 8 Oct 2014 15:31:43 +1300 Subject: [PATCH 3/3] finally, use code generation for INITSHA1 & INITPATH too Signed-off-by: Michael Hudson-Doyle --- .gitignore | 1 + hack/make.sh | 2 +- hack/make/dynbinary | 11 ++++++++++- hack/make/dyntest-integration | 12 +++++++++--- hack/make/dyntest-unit | 12 +++++++++--- 5 files changed, 30 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index d7dae009d..21df574df 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,4 @@ docs/VERSION docs/GITCOMMIT dockerversion/static.go dockerversion/details.go +dockerversion/init.go diff --git a/hack/make.sh b/hack/make.sh index eda96b5e2..a841c1342 100755 --- a/hack/make.sh +++ b/hack/make.sh @@ -94,7 +94,7 @@ if [ -z "$DOCKER_CLIENTONLY" ]; then DOCKER_BUILDTAGS+=" daemon" fi -rm -f dockerversion/static.go dockerversion/details.go +rm -f dockerversion/static.go dockerversion/details.go dockerversion/init.go cat > dockerversion/details.go < dockerversion/init.go < dockerversion/init.go < dockerversion/init.go <