From d72363d8d135b4da265f9933b2d17f42e0374389 Mon Sep 17 00:00:00 2001 From: Kent Dong Date: Mon, 20 Apr 2026 11:24:20 +0800 Subject: [PATCH] fix(build): Make sure golang-filter is built with the correct TARGET_ARCH (#3682) Co-authored-by: EndlessSeeker <153817598+EndlessSeeker@users.noreply.github.com> --- Makefile.core.mk | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile.core.mk b/Makefile.core.mk index 33c021832..789a10772 100644 --- a/Makefile.core.mk +++ b/Makefile.core.mk @@ -23,6 +23,11 @@ export GOPROXY ?= https://proxy.golang.org,direct TARGET_ARCH ?= amd64 +VALID_ARCHS := amd64 arm64 +ifeq ($(filter $(TARGET_ARCH),$(VALID_ARCHS)),) + $(error "TARGET_ARCH must be one of: $(VALID_ARCHS)") +endif + GOARCH_LOCAL := $(TARGET_ARCH) GOOS_LOCAL := $(TARGET_OS) RELEASE_LDFLAGS='$(GO_LDFLAGS) -extldflags -static -s -w' @@ -166,7 +171,7 @@ build-gateway: prebuild buildx-prepare build-golang-filter USE_REAL_USER=1 TARGET_ARCH=arm64 DOCKER_TARGETS="docker.proxyv2" ./tools/hack/build-istio-image.sh init DOCKER_TARGETS="docker.proxyv2" IMG_URL="${IMG_URL}" ./tools/hack/build-istio-image.sh docker.buildx -build-gateway-local: prebuild build-golang-filter-amd64 +build-gateway-local: prebuild $(if $(filter amd64,$(TARGET_ARCH)),build-golang-filter-amd64,build-golang-filter-arm64) TARGET_ARCH=${TARGET_ARCH} DOCKER_TARGETS="docker.proxyv2" ./tools/hack/build-istio-image.sh docker build-golang-filter-amd64: