Skip to content

Commit

Permalink
scripts/build/plugins: don't override CGO_ENABLED
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastiaan van Stijn <[email protected]>
  • Loading branch information
thaJeztah committed Sep 3, 2024
1 parent 78e1090 commit 30f6958
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions scripts/build/binary
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@

set -eu

# Disable CGO - we don't need it for these plugins.
#
# Important: this must be done before sourcing "./scripts/build/.variables",
# because some other variables are conditionally set whether CGO is enabled.
CGO_ENABLED=0

. ./scripts/build/.variables

if [ "$CGO_ENABLED" = "1" ] && [ "$(go env GOOS)" != "windows" ]; then
Expand Down
2 changes: 1 addition & 1 deletion scripts/build/plugins
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ for p in cli-plugins/examples/* "$@" ; do
mkdir -p "$(dirname "${TARGET_PLUGIN}")"

echo "Building $GO_LINKMODE $(basename "${TARGET_PLUGIN}")"
(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}")
(set -x ; GO111MODULE=auto go build -o "${TARGET_PLUGIN}" -tags "${GO_BUILDTAGS}" -ldflags "${GO_LDFLAGS}" ${GO_BUILDMODE} "github.com/docker/cli/${p}")
done

0 comments on commit 30f6958

Please sign in to comment.