From e4d2ff3bd9622ea43b72f264e31e362ad0a14f5e Mon Sep 17 00:00:00 2001 From: Hitoshi Mitake Date: Tue, 9 Feb 2016 14:11:44 +0900 Subject: [PATCH] build, test: don't pass -a flag for go build during ordinal building ./build takes long time. On my Core i5 box, it requires almost 25 seconds. Without -a flag, it takes almost 15 seconds. Therefore this commit reduces the flag in default. ./test activates -a via a new env var GO_BUILD_FLAGS. --- build | 4 ++-- test | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/build b/build index ac6e37c5ff5..e08bcc4efd7 100755 --- a/build +++ b/build @@ -29,5 +29,5 @@ else fi # Static compilation is useful when etcd is run in a container -CGO_ENABLED=0 go build -a -installsuffix cgo -ldflags "-s -X ${REPO_PATH}/version.GitSHA${LINK_OPERATOR}${GIT_SHA}" -o bin/etcd ${REPO_PATH} -CGO_ENABLED=0 go build -a -installsuffix cgo -ldflags "-s" -o bin/etcdctl ${REPO_PATH}/etcdctl +CGO_ENABLED=0 go build $GO_BUILD_FLAGS -installsuffix cgo -ldflags "-s -X ${REPO_PATH}/version.GitSHA${LINK_OPERATOR}${GIT_SHA}" -o bin/etcd ${REPO_PATH} +CGO_ENABLED=0 go build $GO_BUILD_FLAGS -installsuffix cgo -ldflags "-s" -o bin/etcdctl ${REPO_PATH}/etcdctl diff --git a/test b/test index ef38452ffe9..afcf39f69c5 100755 --- a/test +++ b/test @@ -13,6 +13,7 @@ set -e # Invoke ./cover for HTML output COVER=${COVER:-"-cover"} +GO_BUILD_FLAGS=-a source ./build # Hack: gofmt ./ will recursively check the .git directory. So use *.go for gofmt.