Skip to content

fix: default BUILD_ARCH to amd64 instead of host architecture#2295

Merged
tomassrnka merged 1 commit intomainfrom
fix/build-arch-default-amd64
Apr 2, 2026
Merged

fix: default BUILD_ARCH to amd64 instead of host architecture#2295
tomassrnka merged 1 commit intomainfrom
fix/build-arch-default-amd64

Conversation

@tomassrnka
Copy link
Copy Markdown
Member

Summary

Default BUILD_ARCH to amd64 in all three service Makefiles (orchestrator, envd, client-proxy). Previously defaulted to $(shell go env GOARCH) which produces arm64 binaries on Apple Silicon Macs, breaking deployments to amd64 clusters.

Override with BUILD_ARCH=arm64 in .env.local or on the command line for ARM64 builds.

Test plan

  • make build-and-upload from Apple Silicon Mac produces amd64 binaries
  • BUILD_ARCH=arm64 make build-local still produces arm64 binaries

@cursor
Copy link
Copy Markdown

cursor bot commented Apr 2, 2026

PR Summary

Low Risk
Low risk: build configuration-only changes that affect which CPU architecture binaries are produced; main risk is producing the wrong arch if BUILD_ARCH/TARGETARCH is mis-set.

Overview
Defaults BUILD_ARCH to amd64 for client-proxy, envd, and orchestrator builds to avoid accidentally producing arm64 binaries on Apple Silicon hosts, while still allowing explicit overrides for ARM64.

Updates Docker builds for client-proxy and orchestrator to pass Docker’s TARGETARCH into the Makefile so GOARCH matches the requested --platform during image builds.

Written by Cursor Bugbot for commit de68fd0. This will update automatically on new commits. Configure here.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 83368c51ef

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Copy link
Copy Markdown
Member

@sitole sitole left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a heads-up: some services don't include multi-arch support (dashboard API, Nomad autoscaler, API, etc). I think they don't need to be necessarily multi-arch as they run on different nodes as orch/build services, but at the same time, the client proxy is also not running on client nodes, and it received multi-arch support.

Copy link
Copy Markdown

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — simple, correct default fix. The inline comment nit is minor and does not affect functionality.

Extended reasoning...

Overview

This PR makes a one-line change in three Makefiles (packages/orchestrator/Makefile, packages/envd/Makefile, packages/client-proxy/Makefile), switching BUILD_ARCH from $(shell go env GOARCH) to a hardcoded amd64 default. No production Go code, CI pipelines, or infrastructure definitions are touched.

Security Risks

None. This is a build-time variable affecting local developer builds and binary cross-compilation targets. There is no security surface here.

Level of Scrutiny

Low. The change is mechanical and the motivation is clear: Apple Silicon Macs were silently producing arm64 binaries that break amd64 cluster deployments. Hardcoding amd64 as the default eliminates this footgun. The ?= assignment means any .env.local or command-line override still works correctly, as confirmed by the test plan.

Other Factors

The sole bug reported is a documentation nit: the comments still read "Defaults to local arch" and show a now-redundant BUILD_ARCH=amd64 example. This is a cosmetic inaccuracy with zero functional impact — the build behavior is correct. Worth fixing in a follow-up, but not a blocker.

@tomassrnka tomassrnka force-pushed the fix/build-arch-default-amd64 branch 3 times, most recently from 45e1b83 to 48c764a Compare April 2, 2026 15:12
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

BUILD_ARCH defaulting to $(shell go env GOARCH) causes Apple Silicon
Macs to produce arm64 binaries when deploying to amd64 dev/staging
clusters. Default to amd64 since that's the current deployment target.

Override with BUILD_ARCH=arm64 for ARM64 builds (in .env.local or
on the command line).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@tomassrnka tomassrnka force-pushed the fix/build-arch-default-amd64 branch from 48c764a to de68fd0 Compare April 2, 2026 15:16
@tomassrnka tomassrnka merged commit a32133a into main Apr 2, 2026
36 checks passed
@tomassrnka tomassrnka deleted the fix/build-arch-default-amd64 branch April 2, 2026 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants