From 5675026e23e454873e5583d859d4b0fe5442a4d6 Mon Sep 17 00:00:00 2001 From: Alvin Huang Date: Wed, 20 Mar 2019 15:19:17 -0400 Subject: [PATCH] add optional parallel flag to gox --- build-support/functions/20-build.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build-support/functions/20-build.sh b/build-support/functions/20-build.sh index 9dd02bf36c..21dd4ec4c1 100644 --- a/build-support/functions/20-build.sh +++ b/build-support/functions/20-build.sh @@ -367,7 +367,8 @@ function build_consul_local { # If the XC_OS or the XC_ARCH environment vars are present then only those platforms/architectures # will be built. Otherwise all supported platform/architectures are built # The NOGOX environment variable will be used if present. This will prevent using gox and instead - # build with go install + # build with go install. + # The GOXPARALLEL environment variable is used if set if ! test -d "$1" then @@ -427,6 +428,7 @@ function build_consul_local { -arch="${build_arch}" \ -osarch="!darwin/arm !darwin/arm64 !freebsd/arm" \ -ldflags="${GOLDFLAGS}" \ + -parallel="${GOXPARALLEL:-"-1"}" \ -output "pkg.bin.new/${extra_dir}{{.OS}}_{{.Arch}}/consul" \ -tags="${GOTAGS}" \ .