From cb9ee7320b1be15ba4ae9147331fc1fadc817b0e Mon Sep 17 00:00:00 2001 From: Anthony Romano Date: Sat, 16 Jul 2016 10:10:41 -0700 Subject: [PATCH] build: build cross-compiled binaries in bin/ by default Otherwise GOARCH=386 PASSES="build integration" ./test fail on amd64 because the e2e tests can't find the binaries. Added a BINDIR option for writing the build output to somewhere else, in case it's needed. --- build | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/build b/build index d390013519d..efa58314938 100755 --- a/build +++ b/build @@ -27,11 +27,8 @@ toggle_failpoints() { } etcd_build() { - if [ -z "${GOARCH}" ] || [ "${GOARCH}" = "$(go env GOHOSTARCH)" ]; then - out="bin" - else - out="bin/${GOARCH}" - fi + out="bin" + if [ -n "${BINDIR}" ]; then out="${BINDIR}"; fi toggle_failpoints # Static compilation is useful when etcd is run in a container CGO_ENABLED=0 go build $GO_BUILD_FLAGS -installsuffix cgo -ldflags "-s -X ${REPO_PATH}/cmd/vendor/${REPO_PATH}/version.GitSHA=${GIT_SHA}" -o ${out}/etcd ${REPO_PATH}/cmd