Skip to content

Commit 7d8fa76

Browse files
e2bclaude
authored andcommitted
fix: replace remaining hardcoded GOARCH=amd64 with arch-aware defaults
Five files still had hardcoded amd64 references: - nomad-nodepool-apm/Makefile: GOARCH=amd64 → GOARCH=$(BUILD_ARCH) - clickhouse/Makefile: --platform linux/amd64 → linux/$(BUILD_ARCH) - dashboard-api/Makefile: --platform linux/amd64 → linux/$(BUILD_ARCH) - docker-reverse-proxy/Makefile: --platform linux/amd64 → linux/$(BUILD_ARCH) - smoketest/smoke_test.go: GOARCH=amd64 → runtime.GOARCH Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 2ea83df commit 7d8fa76

File tree

5 files changed

+6
-5
lines changed

5 files changed

+6
-5
lines changed

packages/clickhouse/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ migrate-local:
3333

3434
.PHONY: build
3535
build:
36-
@docker build --platform linux/amd64 --tag "$(CLICKHOUSE_MIGRATOR_IMAGE)" .
36+
@docker build --platform linux/$(or $(BUILD_ARCH),$(shell go env GOARCH)) --tag "$(CLICKHOUSE_MIGRATOR_IMAGE)" .
3737

3838
.PHONY: build-and-upload
3939
build-and-upload:build

packages/dashboard-api/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ build:
2828
build-and-upload:
2929
$(eval COMMIT_SHA := $(shell git rev-parse --short HEAD))
3030
$(eval EXPECTED_MIGRATION_TIMESTAMP := $(expectedMigration))
31-
@ docker build --platform linux/amd64 --tag $(IMAGE_REGISTRY) --push --build-arg COMMIT_SHA="$(COMMIT_SHA)" --build-arg EXPECTED_MIGRATION_TIMESTAMP="$(EXPECTED_MIGRATION_TIMESTAMP)" -f ./Dockerfile ..
31+
@ docker build --platform linux/$(or $(BUILD_ARCH),$(shell go env GOARCH)) --tag $(IMAGE_REGISTRY) --push --build-arg COMMIT_SHA="$(COMMIT_SHA)" --build-arg EXPECTED_MIGRATION_TIMESTAMP="$(EXPECTED_MIGRATION_TIMESTAMP)" -f ./Dockerfile ..
3232

3333
.PHONY: run
3434
run:

packages/docker-reverse-proxy/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ build-debug:
2121
.PHONY: build-and-upload
2222
build-and-upload:
2323
$(eval COMMIT_SHA := $(shell git rev-parse --short HEAD))
24-
@docker buildx build --platform linux/amd64 --tag $(IMAGE_REGISTRY) --push --build-arg COMMIT_SHA="$(COMMIT_SHA)" -f ./Dockerfile ..
24+
@docker buildx build --platform linux/$(or $(BUILD_ARCH),$(shell go env GOARCH)) --tag $(IMAGE_REGISTRY) --push --build-arg COMMIT_SHA="$(COMMIT_SHA)" -f ./Dockerfile ..
2525

2626
.PHONY: test
2727
test:

packages/nomad-nodepool-apm/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ BINARY := $(BIN_DIR)/$(PLUGIN_NAME)
1111
.PHONY: build
1212
build:
1313
@mkdir -p $(BIN_DIR)
14-
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o $(BINARY) .
14+
CGO_ENABLED=0 GOOS=linux GOARCH=$(or $(BUILD_ARCH),$(shell go env GOARCH)) go build -o $(BINARY) .
1515

1616
.PHONY: clean
1717
clean:

packages/orchestrator/cmd/smoketest/smoke_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"os"
99
"os/exec"
1010
"path/filepath"
11+
"runtime"
1112
"testing"
1213
"time"
1314

@@ -282,7 +283,7 @@ func findOrBuildEnvd(t *testing.T) string {
282283

283284
cmd := exec.CommandContext(t.Context(), "go", "build", "-o", binPath, ".") //nolint:gosec // trusted input
284285
cmd.Dir = envdDir
285-
cmd.Env = append(os.Environ(), "CGO_ENABLED=0", "GOOS=linux", "GOARCH=amd64")
286+
cmd.Env = append(os.Environ(), "CGO_ENABLED=0", "GOOS=linux", "GOARCH="+runtime.GOARCH)
286287
out, err := cmd.CombinedOutput()
287288
if err != nil {
288289
t.Skipf("failed to build envd: %v\n%s", err, out)

0 commit comments

Comments
 (0)