Skip to content

mac: Building with --cpu=darwin_arm64 generates x86_64 binaries #137

@magreenblatt

Description

@magreenblatt

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions