Skip to content

Commit 623af46

Browse files
authored
Merge pull request #5393 from thaJeztah/fix_plugins_CGO_ENABLED
scripts/build/plugins: don't override CGO_ENABLED set by .variables
2 parents e3676d2 + 9e29967 commit 623af46

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

scripts/build/plugins

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55

66
set -eu -o pipefail
77

8+
# Disable CGO - we don't need it for these plugins.
9+
#
10+
# Important: this must be done before sourcing "./scripts/build/.variables",
11+
# because some other variables are conditionally set whether CGO is enabled.
12+
export CGO_ENABLED=0
13+
814
source ./scripts/build/.variables
915

1016
for p in cli-plugins/examples/* "$@" ; do
@@ -15,5 +21,5 @@ for p in cli-plugins/examples/* "$@" ; do
1521
mkdir -p "$(dirname "${TARGET_PLUGIN}")"
1622

1723
echo "Building $GO_LINKMODE $(basename "${TARGET_PLUGIN}")"
18-
(set -x ; CGO_ENABLED=0 GO111MODULE=auto go build -o "${TARGET_PLUGIN}" -tags "${GO_BUILDTAGS}" -ldflags "${GO_LDFLAGS}" ${GO_BUILDMODE} "github.com/docker/cli/${p}")
24+
(set -x ; GO111MODULE=auto go build -o "${TARGET_PLUGIN}" -tags "${GO_BUILDTAGS}" -ldflags "${GO_LDFLAGS}" ${GO_BUILDMODE} "github.com/docker/cli/${p}")
1925
done

0 commit comments

Comments
 (0)