Skip to content

Commit

Permalink
ci/build-binaries: Don't enable cgo for Darwin
Browse files Browse the repository at this point in the history
Previously, it was necessary to enable cgo
and use the system's DNS resolver on macOS.
In Go 1.20, the `net` package was rewritten
to not use cgo at all,
so CGO_ENABLED no longer has any effect there.

In fact, ever since 3898600,
this setting has been meaningless
because we've been building Darwin binaries
on Ubuntu machines (so cgo can't be enabled anyway).

This commit just deletes this now-unused block.
  • Loading branch information
abhinav committed Jun 29, 2023
1 parent 572a610 commit 2489599
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions scripts/go-wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,6 @@ COVER_PACKAGES=( \
# Join COVER_PACKAGES with commas.
COVERPKG=$(IFS=,; echo "${COVER_PACKAGES[*]}")

# If it's a production or local build - building for macOS on macOS - use CGO for DNS resolver functionality.
#
# See: https://github.com/golang/go/issues/12524
if [ "$(go env GOOS)" = "darwin" ] && [ "$(uname)" = "Darwin" ]; then
# `go env GOOS` returns "darwin" when cross-compiling to macOS
# `uname` returns "Darwin" on macOS
export CGO_ENABLED=1
else
export CGO_ENABLED=0
fi

case "$1" in
build)
MODE="$PULUMI_BUILD_MODE"
Expand Down

0 comments on commit 2489599

Please sign in to comment.