Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions scripts/build/.variables
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,15 @@ if [ "$CGO_ENABLED" = "1" ] && [ "$GO_LINKMODE" = "static" ]; then
# compiling statically with CGO enabled requires osusergo and netgo to be set.
GO_BUILDTAGS="$GO_BUILDTAGS osusergo netgo"
fi
# XXX: Disable netgo on Windows and use Windows system resolver instead.
#
# go1.19 and newer added support for netgo on Windows (https://go.dev/doc/go1.19#net),
# which may not respect VPN adaptors (such as Twingate) due to resolver ordering,
# resulting in queries being sent through the local network adapter instead of the
# VPN tunnel. See https://github.com/docker/cli/issues/6665
if [ "$(go env GOOS)" = "windows" ]; then
GO_BUILDTAGS=$(echo "$GO_BUILDTAGS" | sed 's/\(^\| \)netgo\( \|$\)/\1/g')
fi
if [ -n "$GO_STRIP" ]; then
# if stripping enabled and building with llvm < 12 against darwin/amd64
# platform, it will fail with:
Expand Down
Loading