-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
hardware: add arm64?
#21107
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
hardware: add arm64?
#21107
Conversation
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.
Pull Request Overview
This PR introduces a new convenience method Hardware::CPU.arm64? to simplify checking for 64-bit ARM architecture. This replaces verbose checks like Hardware::CPU.arm? && Hardware::CPU.is_64_bit? and Hardware::CPU.arch == :arm64 with a single, more readable method call.
- Adds new
arm64?method to Hardware::CPU module - Updates all instances across the codebase to use the new method
- Improves code readability and reduces line length
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| Library/Homebrew/hardware.rb | Adds new arm64? public API method that checks if CPU is 64-bit ARM |
| Library/Homebrew/requirements/arch_requirement.rb | Replaces Hardware::CPU.arm? && Hardware::CPU.is_64_bit? with Hardware::CPU.arm64? |
| Library/Homebrew/extend/os/mac/hardware.rb | Replaces Hardware::CPU.arch == :arm64 with Hardware::CPU.arm64? |
| Library/Homebrew/extend/os/linux/extend/ENV/super.rb | Replaces Hardware::CPU.arch == :arm64 checks with Hardware::CPU.arm64? (2 instances) |
| Library/Homebrew/extend/os/linux/diagnostic.rb | Replaces Hardware::CPU.arm? && Hardware::CPU.is_64_bit? with Hardware::CPU.arm64? |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
e9c7f99 to
fc1c711
Compare
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.
Pull Request Overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
MikeMcQuaid
left a comment
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.
Makes sense, thanks!
I do think we should probably kill all use of/references to arm32 and PPC.
brew lgtm(style, typechecking and tests) with your changes locally?Provide a single method to check arm64. This should replace usage of both:
Hardware::CPU.arm? && Hardware::CPU.is_64_bit?Hardware::CPU.arch == :arm64And maybe other variations that we use to detect this given Linux arm32 is still considered supported at a lower tier.
Mainly want to reduce variations and line length on Homebrew/core side for a common check