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
Make Homebrew work with Xcode 12 Beta 2 on Apple Silicon #7945
Conversation
Starting with Xcode 12 Beta 2, builds that used to work on Apple Silicon now break due to `Hardware#oldest_cpu` returning `:nehalem` [1]. This commit is the first in a series of improvements to `Hardware#oldest_cpu`. It resolves the Xcode 12 Beta 2 issue for now. [1]: #7857 (comment)
Hardware.oldest_cpu
depend on architecturenehalem: "-march=nehalem", | ||
core2: "-march=core2", | ||
core: "-march=prescott", | ||
arm_vortex_tempest: "", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine leaving this blank now. We can revisit it later if need be.
unless Hardware::CPU.intel? | ||
raise "Unexpected architecture: #{Hardware::CPU.arch}. This only works with Intel architecture." | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's an interesting one this. I spent a few minutes debating with myself wheether this should instead return false
.
In some cases raising makes sense as the formula might need some intention, in other cases returning false
might actually make some formulae just work out-of-the-box.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I agree. My rationale was that I’ve found a couple of formulae on homebrew-core doing stuff like: https://github.com/Homebrew/homebrew-core/blob/9e6f3fd50144b07f4bda3fdfed77f594c207a59e/Formula/john-jumbo.rb#L46
(requires_sse4?
is an alias to requires_nehalem_cpu?
.)
All similar usages I’ve found on homebrew-core do something unless requires_sse4?
, just like in the example. So I thought we’d rather want those to fail safely.
Thanks @Bo98 for the feedback! |
Thanks for the fix @claui! |
brew style
with your changes locally?brew tests
with your changes locally?Starting with Xcode 12 Beta 2, builds that used to work on Apple Silicon now break due to
Hardware#oldest_cpu
returning:nehalem
.This PR is the first in a series of improvements to
Hardware#oldest_cpu
. It resolves the Xcode 12 Beta 2 issue for now.Update: Confirmed to work on Xcode 12 Beta 1 (Apple Silicon), Xcode 12 Beta 2 (Apple Silicon) and Intel Macs.