Merge pull request #45604 from neersighted/backport/45603/24.0
[24.0 backport] hack/make/.binary: don't use "netgo" when building Windows binaries
This commit is contained in:
commit
7d50989467
1 changed files with 12 additions and 0 deletions
|
@ -51,6 +51,18 @@ source "${MAKEDIR}/.go-autogen"
|
|||
fi
|
||||
fi
|
||||
|
||||
# XXX: Disable netgo on Windows and use Window's system resolver instead.
|
||||
#
|
||||
# go1.19 and newer added support for netgo on Windows (https://go.dev/doc/go1.19#net),
|
||||
# which won't ask Windows for DNS results, and hence may be ignoring
|
||||
# custom "C:\Windows\System32\drivers\etc\hosts".
|
||||
# See https://github.com/moby/moby/issues/45251#issuecomment-1561001817
|
||||
# https://github.com/moby/moby/issues/45251, and
|
||||
# https://go-review.googlesource.com/c/go/+/467335
|
||||
if [ "$(go env GOOS)" = "windows" ]; then
|
||||
BUILDFLAGS=("${BUILDFLAGS[@]/netgo/}")
|
||||
fi
|
||||
|
||||
# only necessary for non-sandboxed invocation where TARGETPLATFORM is empty
|
||||
PLATFORM_NAME=$TARGETPLATFORM
|
||||
if [ -z "$PLATFORM_NAME" ]; then
|
||||
|
|
Loading…
Add table
Reference in a new issue