Skip to content

Don't flag newer CLT releases as outdated - #24314

Merged
MikeMcQuaid merged 1 commit into
mainfrom
clt-newer-release-guard
Oct 21, 2026
Merged

MikeMcQuaid merged 1 commit into
mainfrom
clt-newer-release-guard

Conversation

@p-linnane

Copy link
Copy Markdown
Contributor

MacOS::CLT.outdated? only compared clang build numbers, but Apple's builds can go backwards between releases: the Command Line Tools 27.2 package (27.2.0.0.1792148227) ships clang 2100.3.34.1, below the 2100.3.34.2 in 27.0, so brew doctor on macOS 27 said a newer release was available and recommended downloading 27.0. A package receipt whose release is newer than MacOS::CLT.latest_version is now treated as current; otherwise the clang check still runs, so a receipt for the recommended release with an older compiler and installations without a receipt are still reported.


  • Have you followed our Contributing guidelines?
  • Have you checked for other open Pull Requests for the same change?
  • Have you explained what your changes do? Performance claims (e.g. "this is faster") must include brew benchmark results.
  • Have you explained why you'd like these changes included, not just what they do?
  • For bug fixes, have you given step-by-step brew commands to reproduce the bug?
  • Have you written new tests (excluding integration tests)? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) locally?

  • I did not use AI/LLM to create this PR, or I disclosed the tool/model below and reviewed its output; I did not attribute commits to AI and will answer maintainer questions and review comments myself without AI/LLM.

Codex (GPT-6 Astra) wrote the change and tests, checked that the new examples fail without the change, compared brew doctor output before and after on an affected macOS 27 machine and ran brew lgtm. Claude Code (Opus 5.5) reviewed it, suggested the older-release example after finding that replacing > with != still passed every example, checked the final examples against that and other mutations of the guard and confirmed that the patched MacOS::CLT.outdated? returns false on the same machine.


- `CLT.outdated?` only compared clang builds, but Apple's build numbers
  can go backwards: the 27.2 release candidate ships `2100.3.34.1`,
  below 27.0's `2100.3.34.2`.
- Treat a package release newer than `latest_version` as current and
  keep the clang check otherwise, so betas of the recommended release
  are still flagged.

Signed-off-by: Patrick Linnane <patrick@linnane.io>
@coderabbitai

coderabbitai Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: eb1f41ee-dcc0-46cf-a950-3b99feaccb83
📥 Commits

Reviewing files that changed from the base of the PR and between 332963d and d264b9c.

📒 Files selected for processing: 2
  • Library/Homebrew/os/mac/xcode.rb
  • Library/Homebrew/test/os/mac/xcode_spec.rb

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

📝 Summary

Summary by CodeRabbit

  • Bug Fixes
    • Improved detection of outdated Xcode Command Line Tools.
    • Newer installed package versions are correctly recognised as current.
    • Missing compiler information no longer incorrectly marks tools as outdated.
    • Older releases and timestamp-only updates continue to receive accurate status checks.

OS::Mac::CLT.outdated? now skips the Clang version comparison when the installed package version is newer than latest_version. Tests cover missing compiler metadata and package and compiler version combinations.

Changes: CLT outdatedness

Layer / File(s) Summary
Package version and compiler checks
Library/Homebrew/os/mac/xcode.rb, Library/Homebrew/test/os/mac/xcode_spec.rb
The check bypasses Clang version comparison when the installed package version is newer than latest_version. Tests cover missing compiler metadata, newer and older package versions, timestamp-only updates, and the recommended release with the current compiler.

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to d264b

The change appears ready to merge after normal checks; no actionable issue was identified.

Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title clearly summarises the main change: newer Command Line Tools releases are no longer flagged as outdated.
Description check Passed The description explains the bug, the cause, the implemented behaviour, test coverage, and validation steps. It is directly related to the changeset.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@MikeMcQuaid MikeMcQuaid left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@MikeMcQuaid
MikeMcQuaid added this pull request to the merge queue Oct 21, 2026
Merged via the queue into main with commit 1ef73bb Oct 21, 2026
58 checks passed
@MikeMcQuaid
MikeMcQuaid deleted the clt-newer-release-guard branch October 21, 2026 07: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.

2 participants

⌂ 换网址