From 862ab9b3705ac294f7da36bab5b76a350126e641 Mon Sep 17 00:00:00 2001 From: leigh capili Date: Mon, 8 Jun 2026 01:27:44 -0600 Subject: [PATCH] build: target host architecture for local builds and envtest Local container image builds and envtest binaries were pinned to amd64, forcing emulation (e.g. Rosetta) on Apple Silicon and other arm64 hosts. This produced amd64 images/test binaries locally, which can surface subtle runtime bugs. envtest now publishes arm64 binaries (including darwin/arm64), so the historical amd64 pin (and the Darwin-specific override) is no longer needed. Derive the architecture from the host Go toolchain (go env GOARCH) so local builds are native, while keeping both values overridable for cross-arch builds. Multi-arch release images are built by the fluxcd/gha-workflows release workflow, not by "make docker-build", so release artifacts are unaffected. Signed-off-by: leigh capili --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 5cfdad95..2f6752a7 100644 --- a/Makefile +++ b/Makefile @@ -2,8 +2,9 @@ VERSION?=$(shell grep 'VERSION' cmd/flux/main.go | awk '{ print $$4 }' | head -n DEV_VERSION?=0.0.0-$(shell git rev-parse --abbrev-ref HEAD)-$(shell git rev-parse --short HEAD)-$(shell date +%s) EMBEDDED_MANIFESTS_TARGET=cmd/flux/.manifests.done TEST_KUBECONFIG?=/tmp/flux-e2e-test-kubeconfig -# Architecture to use envtest with -ENVTEST_ARCH ?= amd64 +# Architecture to use envtest with; defaults to the host architecture. +LOCALARCH ?= $(shell go env GOARCH) +ENVTEST_ARCH ?= $(LOCALARCH) # Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set) ifeq (,$(shell go env GOBIN))