Skip to content

Conversation

@cho-m
Copy link
Member

@cho-m cho-m commented Nov 18, 2025

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run 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 == :arm64

And 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

Copilot AI review requested due to automatic review settings November 18, 2025 14:32
Copilot finished reviewing on behalf of cho-m November 18, 2025 14:35
Copy link
Contributor

Copilot AI left a 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.

@cho-m cho-m force-pushed the arm64-check branch 2 times, most recently from e9c7f99 to fc1c711 Compare November 18, 2025 14:43
Copilot AI review requested due to automatic review settings November 18, 2025 14:43
Copilot finished reviewing on behalf of cho-m November 18, 2025 14:46
Copy link
Contributor

Copilot AI left a 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.

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a 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.

@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Nov 18, 2025
Merged via the queue into main with commit caacda1 Nov 18, 2025
37 checks passed
@MikeMcQuaid MikeMcQuaid deleted the arm64-check branch November 18, 2025 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants