Skip to content

Commit

Permalink
Merge pull request #5395 from thaJeztah/27.x_backport_fix_plugins_CGO…
Browse files Browse the repository at this point in the history
…_ENABLED

[27.x backport] scripts/build/plugins: don't override CGO_ENABLED set by .variables
  • Loading branch information
thaJeztah authored Sep 3, 2024
2 parents c5d8467 + de2b49b commit 3a15d5a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion scripts/build/plugins
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@

set -eu -o pipefail

# 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.
export CGO_ENABLED=0

source ./scripts/build/.variables

for p in cli-plugins/examples/* "$@" ; do
Expand All @@ -15,5 +21,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 3a15d5a

Please sign in to comment.