From 9af7f9fd23602cc8df13f84c522c6ea6525b9e52 Mon Sep 17 00:00:00 2001 From: Steve Kuznetsov Date: Mon, 18 Apr 2016 11:41:28 -0400 Subject: [PATCH] refactored binary build subshell invocation Signed-off-by: Steve Kuznetsov --- hack/common.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/hack/common.sh b/hack/common.sh index a11404373ab8..5975441196dd 100755 --- a/hack/common.sh +++ b/hack/common.sh @@ -252,7 +252,17 @@ os::build::build_static_binaries() { # then just the host architecture is built. os::build::build_binaries() { # Create a sub-shell so that we don't pollute the outer environment - ( + ( os::build::internal::build_binaries "$@" ) +} + +# Build binaries targets specified. Should always be run in a sub-shell so we don't leak GOBIN +# +# Input: +# $@ - targets and go flags. If no targets are set then all binaries targets +# are built. +# OS_BUILD_PLATFORMS - Incoming variable of targets to build for. If unset +# then just the host architecture is built. +os::build::internal::build_binaries() { # Check for `go` binary and set ${GOPATH}. os::build::setup_env @@ -319,7 +329,6 @@ os::build::build_binaries() { "$(dirname ${test})" done done - ) } # Generates the set of target packages, binaries, and platforms to build for.