-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build xcode-locator as a universal binary #14168
Build xcode-locator as a universal binary #14168
Conversation
Related, though different: #13452 |
yea mine doesn't touch this tool, I was just allowing this one to run with rosetta for now |
This CI issue looks unrelated, I filed bazelbuild/continuous-integration#1269 |
so this compile isn't hermetic because of an issue with linking on the M1, you have to use the same approach I did here to resolve that for now https://github.com/bazelbuild/bazel/pull/13452/files#diff-a974c428038be37758ceec95a81b78f4fd5cb7051e8d6c9e20c13a8337b0c8ddR112 by passing |
That is why the test is failing here |
Interesting. I just added |
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.
980ab9e
to
447f012
Compare
Ah! You also need |
You shouldn't need that as well since the default is to produce a UUID based on the contents 🤔 |
Ok I debugged that and verified it's a bug in ld64 that leads to non hermetic links. I filed FB9727658 with apple and also submitted swiftlang/llvm-project#3483 as a cherry pick to attempt to get the fix into Xcode sooner. But passing |
So the reason I hadn't reproduced this is because there was a difference in this behavior based on whether the I think this current solution is the right move just to be safe |
The content based uuid embedded by ld64 contains the basename of the file being built. In the case of multiarch builds this filename is randomly generated. This doesn't hit in all cases based on the order of the arguments to clang, but since this shouldn't have a downside for this use case, it's safer to exclude this for the future. More conversation bazelbuild#14168 Filed with apple as FB9727658
The content based uuid embedded by ld64 contains the basename of the file being built. In the case of multiarch builds this filename is randomly generated. This doesn't hit in all cases based on the order of the arguments to clang, but since this shouldn't have a downside for this use case, it's safer to exclude this for the future. More conversation bazelbuild#14168 Filed with apple as FB9727658 (cherry picked from commit d2aab87)
@oquenchil can you review? |
The content based uuid embedded by ld64 contains the basename of the file being built. In the case of multiarch builds this filename is randomly generated. This doesn't hit in all cases based on the order of the arguments to clang, but since this shouldn't have a downside for this use case, it's safer to exclude this for the future. More conversation #14168 Filed with apple as FB9727658 Closes #14190. PiperOrigin-RevId: 407784532
The content based uuid embedded by ld64 contains the basename of the file being built. In the case of multiarch builds this filename is randomly generated. This doesn't hit in all cases based on the order of the arguments to clang, but since this shouldn't have a downside for this use case, it's safer to exclude this for the future. More conversation #14168 Filed with apple as FB9727658 (cherry picked from commit d2aab87)
Ping! Would be nice if this ended up in Bazel 5. |
An internal test is failing with:
Can you help fixing this? Maybe related to Update: the change submitted successfully, maybe it's a false alarm. |
@EdSchouten Can you make a PR to release-5.0.0rc2? |
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 (cherry picked from commit 76b3c24)
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 #14168. PiperOrigin-RevId: 412864310 (cherry picked from commit 76b3c24) Co-authored-by: Ed Schouten <eschouten@apple.com>
Merged into release-5.0.0rc2 |
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
Just observed that the resulting executable is not deterministic with either Xcode 13.4 or 14.0. |
There's a known bug in the linker. It has been reported. I don't know of a
workaround
|
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:
Let's address this by shipping a copy of xcode-locator that is built
both for ARM64 and x86-64.