Skip to content

Conversation

@cho-m
Copy link
Member

@cho-m cho-m commented Nov 10, 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 style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

Remove some more code that is no longer used. This includes older macOS conditional cases and some Xcode 2 handling.

There is some other code for separate_header_package? and provides_sdk? which I need to check if it is safe to make always true.

Copilot AI review requested due to automatic review settings November 10, 2025 13:48
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 removes legacy code related to older macOS versions that are no longer supported. The changes clean up conditional logic that was specific to macOS versions prior to Catalina (10.15), which is now the oldest allowed version according to HOMEBREW_MACOS_OLDEST_ALLOWED.

Key changes:

  • Removed Xcode 2.x version detection code
  • Simplified version checks by removing conditions for pre-Catalina macOS versions
  • Standardized behavior across all supported macOS versions

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
Library/Homebrew/os/mac/xcode.rb Removed Xcode 2.x version detection logic and simplified separate_header_package? to remove macOS version check
Library/Homebrew/extend/os/mac/hardware.rb Simplified oldest_cpu method to return :nehalem for all non-Ventura+ versions
Library/Homebrew/extend/os/mac/dev-cmd/bottle.rb Removed macOS version check in tar_args to always use modern tar flags

💡 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.

Thanks! A few questions but can self-merge if I'm wrong.

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.

Thanks, looks good once feedback addressed!

@cho-m cho-m marked this pull request as draft November 10, 2025 16:03
Copilot AI review requested due to automatic review settings November 10, 2025 16:09
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 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings November 10, 2025 16:19
@cho-m cho-m marked this pull request as ready for review November 10, 2025 16:20
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.

Comments suppressed due to low confidence (1)

Library/Homebrew/os/mac.rb:171

  • The comment describing expected results for sdk_path_if_needed is now outdated. Since sdk_root_needed? always returns true and the logic no longer checks for separate_header_package?, cases 2-5 no longer apply. The method now always returns the SDK path (either Xcode or CLT) when either is installed. The comment should be updated to reflect the simplified behavior.
    def self.sdk_path_if_needed(version = nil)
      # Prefer CLT SDK when both Xcode and the CLT are installed.
      # Expected results:
      # 1. On Xcode-only systems, return the Xcode SDK.
      # 2. On Xcode-and-CLT systems where headers are provided by the system, return nil.
      # 3. On CLT-only systems with no CLT SDK, return nil.
      # 4. On CLT-only systems with a CLT SDK, where headers are provided by the system, return nil.
      # 5. On CLT-only systems with a CLT SDK, where headers are not provided by the system, return the CLT SDK.

      return unless sdk_root_needed?

      sdk_path(version)
    end

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@cho-m
Copy link
Member Author

cho-m commented Nov 10, 2025

I'll look into sdk_root_needed? in a follow up as that is always true.

It is used in Homebrew/core so will need to clean up formulae first (LLVM and PostgreSQL)

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.

Looks good, thanks!

@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Nov 10, 2025
Merged via the queue into main with commit b652f7b Nov 10, 2025
44 checks passed
@MikeMcQuaid MikeMcQuaid deleted the cleanup-old-code branch November 10, 2025 17:52
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