bazelbuild / bazelbuild/reclient
mac: Building with --cpu=darwin_arm64 generates x86_64 binaries
- Dominant language
- Go
- Stars
- 114
- Forks
- 25
- PR merge metrics
- No merged PRs in 30d
Description
Building on MacOS 14.7 (Apple M1) with Xcode 16.2.
Steps to reproduce:
1. Build main branch with `bazelisk build --config=goma //:artifacts_tar --cpu=darwin_arm64`
2. Check the resulting binary architecture:
```
% file /private/var/tmp/_bazel_marshall/15a38429f9b5a1eebde75709bdec5b6b/execroot/_main/bazel-out/darwin_arm64-opt/bin/artifacts/rewrapper
/private/var/tmp/_bazel_marshall/15a38429f9b5a1eebde75709bdec5b6b/execroot/_main/bazel-out/darwin_arm64-opt/bin/artifacts/rewrapper: Mach-O 64-bit executable x86_64
```
Actual vs expected result:
Resulting binaries should be arm64 instead of x86_64.
Additional details:
Adding the `--macos_cpus=arm64` flag doesn't help.
Switching between x86_64 and arm64 bazelisk/bazel binaries (installed via Homebrew) doesn't help.
Contributor guide
Research direction
Reproduce the report on macOS 14.7 with `bazelisk build --config=goma //:artifacts_tar --cpu=darwin_arm64`, then inspect the generated `artifacts/rewrapper` with `file`. Trace the build configuration that selects the binary architecture; done means the resulting binaries report arm64 rather than x86_64, including when `--macos_cpus=arm64` is omitted.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- macos
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100