Skip to content

Commit 0feba9c

Browse files
manusaclaude
andcommitted
fix(build): derive xgo image tag from GO_VERSION
The Go version was pinned in three places and #422 updated only two: native/go.mod, GO_VERSION in the workflows, and the hardcoded xgo image tag here (left at go-1.25.10). Once go.mod requires go >= 1.26.0, the toolchain inside the go-1.25.10 container auto-downloads Go 1.26.0 and runs its linker against that image's older GNU binutils, which cannot parse the .def file Go 1.26 emits. The Windows DLL then fails to link and the enforcer reports the missing file as the symptom. Deriving the tag from GO_VERSION removes the drift: CI already exports it, and make's `?=` prefers the environment value. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Marc Nuri <marc@marcnuri.com>
1 parent af56650 commit 0feba9c

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

‎Makefile‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
.DEFAULT_GOAL := help
55

66
CGO_ENABLED = 1
7+
# Go toolchain version. CI exports GO_VERSION (see .github/workflows/*.yml), which
8+
# overrides this default, so the two cannot drift apart.
9+
# The xgo image must ship a Go >= the `go` directive in native/go.mod. Otherwise the
10+
# container silently downloads a newer toolchain whose linker is incompatible with
11+
# that image's mingw-w64 binutils, and the Windows DLL fails to link.
12+
GO_VERSION ?= 1.26.7
13+
XGO_IMAGE = ghcr.io/techknowlogick/xgo:go-$(GO_VERSION)
714
LD_FLAGS = -s -w
815
COMMON_BUILD_ARGS = -ldflags "$(LD_FLAGS)" -buildmode=c-shared
916
MAVEN_OPTIONS =
@@ -59,7 +66,7 @@ build-native: ## Build the native shared library for the current platform
5966
.PHONY: build-native-cross-platform
6067
build-native-cross-platform: ## Build native shared libraries for all 5 supported platforms (requires Docker)
6168
go install src.techknowlogick.com/xgo@latest
62-
xgo -image ghcr.io/techknowlogick/xgo:go-1.25.10 $(COMMON_BUILD_ARGS) -out native/out/helm --targets */arm64,*/amd64 ./native
69+
xgo -image $(XGO_IMAGE) $(COMMON_BUILD_ARGS) -out native/out/helm --targets */arm64,*/amd64 ./native
6370

6471
.PHONY: build-java
6572
build-java: ## Build and verify the Java artifacts (mvn clean verify)

0 commit comments

Comments
 (0)