Skip to content
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

[5.x] Compile Apple tools as fat binaries if possible #14181

Conversation

keith
Copy link
Member

@keith keith commented Oct 27, 2021

The Apple toolchain has 2 native binaries that are inputs to every
single action. Because of this if you want to share caches between Apple
Silicon machines and Intel machines, you either need to force them to be
x86_64 binaries and suffer the performance loss on Apple Silicon
machiens, or use fat binaries so the sha's match on both architectures,
which is what this change does. These binaries are so small that the
size impact of this doesn't matter. Since Apple Silicon support requires
Xcode 12 this falls back to compiling the single architecture binary if
it fails, under the assumption that means you're on Xcode 11 or lower.
We don't have a better indication at this point of what Xcode version
you're using, so this seems like a fine workaround until Xcode 12 is the
minimum supported version.

Closes #13452.

PiperOrigin-RevId: 405842940
(cherry picked from commit 80c56ff)

This just missed 5.x, original PR here #13452

The Apple toolchain has 2 native binaries that are inputs to every
single action. Because of this if you want to share caches between Apple
Silicon machines and Intel machines, you either need to force them to be
x86_64 binaries and suffer the performance loss on Apple Silicon
machiens, or use fat binaries so the sha's match on both architectures,
which is what this change does. These binaries are so small that the
size impact of this doesn't matter. Since Apple Silicon support requires
Xcode 12 this falls back to compiling the single architecture binary if
it fails, under the assumption that means you're on Xcode 11 or lower.
We don't have a better indication at this point of what Xcode version
you're using, so this seems like a fine workaround until Xcode 12 is the
minimum supported version.

Closes bazelbuild#13452.

PiperOrigin-RevId: 405842940
(cherry picked from commit 80c56ff)
@google-cla google-cla bot added the cla: yes label Oct 27, 2021
@keith
Copy link
Member Author

keith commented Oct 27, 2021

cc @Wyverald

@Wyverald Wyverald changed the base branch from master to release-5.0.0rc1 October 28, 2021 10:21
@Wyverald Wyverald merged commit de5fc19 into bazelbuild:release-5.0.0rc1 Oct 28, 2021
@r2r-dev r2r-dev mentioned this pull request Jan 22, 2022
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants