Skip to content

Commit

Permalink
Build xcode-locator as a universal binary
Browse files Browse the repository at this point in the history
One of Buildbarn's users is attempting to build it on a Mac M1 system
that does not have Rosetta installed:

buildbarn/bb-remote-execution#89

This currently fails with the following error message:

    ERROR: <storage>/external/com_google_protobuf/BUILD:130:11: Compiling src/google/protobuf/extension_set.cc failed: I/O exception during sandboxed execution: com.google.devtools.build.lib.shell.ExecFailedException: java.io.IOException: Cannot run program "<tmp>/install/71ed47cad951a20fff87381f54639763/xcode-locator": error=86, Bad CPU type in executable

Let's address this by shipping a copy of xcode-locator that is built
both for ARM64 and x86-64.

Closes bazelbuild#14168.

PiperOrigin-RevId: 412864310
  • Loading branch information
EdSchouten authored and Copybara-Service committed Nov 29, 2021
1 parent cd4bc7c commit 76b3c24
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tools/osx/BUILD
Expand Up @@ -29,7 +29,8 @@ exports_files([

DARWIN_XCODE_LOCATOR_COMPILE_COMMAND = """
/usr/bin/xcrun --sdk macosx clang -mmacosx-version-min=10.9 -fobjc-arc -framework CoreServices \
-framework Foundation -o $@ $<
-framework Foundation -arch arm64 -arch x86_64 -Wl,-no_adhoc_codesign -Wl,-no_uuid -o $@ $< && \
env -i codesign --identifier $@ --force --sign - $@
"""

genrule(
Expand Down

0 comments on commit 76b3c24

Please sign in to comment.