From d8182d4b38150a5a3c133330c9376e359ae66288 Mon Sep 17 00:00:00 2001 From: Nikita Vaniasin Date: Tue, 14 Feb 2023 12:11:35 +0100 Subject: [PATCH] Remove `netgo` build tag for Windows to disable new Go resolver behaviour (#352) In go1.19 there is no support for 'hosts' file for Windows: https://github.com/golang/go/issues/57757 Disabling netgo will revert behaviour to go1.18 for resolving names --- CHANGELOG.md | 1 + Makefile | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 014ca5da..65fe65d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Improve deprecated notice for old passthrough flags - Improve detection of arangod binary when running local installation (use --server.use-local-bin) - Upgrade base Alpine image and Go dependencies to fix CVEs +- Remove `netgo` build tag for Windows to disable new Go resolver behaviour: https://github.com/golang/go/issues/57757 ## [0.15.6](https://github.com/arangodb-helper/arangodb/tree/0.15.6) (2023-01-20) - Fix restarting cluster with arangosync enabled diff --git a/Makefile b/Makefile index d17e60da..4addf17a 100644 --- a/Makefile +++ b/Makefile @@ -162,7 +162,11 @@ binaries-test: $(BIN): $(GOBUILDDIR) $(GO_SOURCES) @mkdir -p $(BINDIR) +ifeq ($(GOOS),windows) + $(DOCKER_CMD) go build -ldflags "-X main.projectVersion=$(VERSION) -X main.projectBuild=$(COMMIT)" -o "$(BUILD_BIN)" . +else $(DOCKER_CMD) go build -installsuffix netgo -tags netgo -ldflags "-X main.projectVersion=$(VERSION) -X main.projectBuild=$(COMMIT)" -o "$(BUILD_BIN)" . +endif $(TESTBIN): $(GOBUILDDIR) $(TEST_SOURCES) $(BIN) @mkdir -p $(BINDIR)