Skip to content

Commit

Permalink
refactored binary build subshell invocation
Browse files Browse the repository at this point in the history
Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
  • Loading branch information
stevekuznetsov committed Apr 20, 2016
1 parent 9d6645a commit 9af7f9f
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions hack/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -319,7 +329,6 @@ os::build::build_binaries() {
"$(dirname ${test})"
done
done
)
}

# Generates the set of target packages, binaries, and platforms to build for.
Expand Down

0 comments on commit 9af7f9f

Please sign in to comment.