1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

finally, use code generation for INITSHA1 & INITPATH too

Signed-off-by: Michael Hudson-Doyle <michael.hudson@linaro.org>
This commit is contained in:
Michael Hudson-Doyle 2014-10-08 15:31:43 +13:00
parent 85744a35de
commit c7c620dd9f
5 changed files with 30 additions and 8 deletions

1
.gitignore vendored
View file

@ -29,3 +29,4 @@ docs/VERSION
docs/GITCOMMIT
dockerversion/static.go
dockerversion/details.go
dockerversion/init.go

View file

@ -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 <<EOF
// AUTOGENERATED FILE; see hack/make.sh
package dockerversion

View file

@ -47,7 +47,16 @@ fi
# exported so that "dyntest" can easily access it later without recalculating it
(
export LDFLAGS_STATIC_DOCKER="-X $DOCKER_PKG/dockerversion.INITSHA1 \"$DOCKER_INITSHA1\" -X $DOCKER_PKG/dockerversion.INITPATH \"$DOCKER_INITPATH\""
export LDFLAGS_STATIC_DOCKER=""
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
source "$(dirname "$BASH_SOURCE")/binary"

View file

@ -11,8 +11,14 @@ fi
(
export TEST_DOCKERINIT_PATH="$INIT"
export LDFLAGS_STATIC_DOCKER="
-X $DOCKER_PKG/dockerversion.INITSHA1 \"$DOCKER_INITSHA1\"
"
export LDFLAGS_STATIC_DOCKER=""
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"
}
EOF
source "$(dirname "$BASH_SOURCE")/test-integration"
)

View file

@ -11,8 +11,14 @@ fi
(
export TEST_DOCKERINIT_PATH="$INIT"
export LDFLAGS_STATIC_DOCKER="
-X $DOCKER_PKG/dockerversion.INITSHA1 \"$DOCKER_INITSHA1\"
"
export LDFLAGS_STATIC_DOCKER=""
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"
}
EOF
source "$(dirname "$BASH_SOURCE")/test-unit"
)