Skip to content

Infer Xcode 26.x versions from clang builds - #24178

Merged
p-linnane merged 1 commit into
mainfrom
xcode-version-from-clang-build
Oct 6, 2026
Merged

p-linnane merged 1 commit into
mainfrom
xcode-version-from-clang-build

Conversation

@p-linnane

Copy link
Copy Markdown
Contributor

With only the Command Line Tools installed, MacOS::Xcode.version is inferred from clang. Xcode 26.4 to 26.6 and 27 all report clang 21.0.0, so CLT 26.4 to 26.6 installs were reported as Xcode 27.0, including on Intel where Xcode 27 isn't available. That value ends up as built_on.xcode in install receipts and SBOMs.

The full clang build does differ: 2100.0.x for 26.4, 2100.1.x for 26.5 and 26.6 and 2100.3.x for 27. Pass it through and map it to the newest matching Xcode, as the existing table does, so 26.5 and 26.6 both map to 26.6. DevelopmentTools.clang_build_version is unchanged.

I checked the CLT 26.5 and 26.6 packages from Apple's Software Update catalog (both clang-2100.1.1.101) and an installed CLT 27.0 (clang-2100.3.34.2). CLT 26.4.1 is no longer in the catalog, so 2100.0.x relies on Xcode 26.4.1's clang-2100.0.123.102.


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

Claude Code (Opus 5.5) drafted the implementation and tests and GPT-6 Astra reviewed them; I reviewed the diff, verified the new tests fail without the change and pass with it, and ran brew lgtm --online plus targeted specs.


Signed-off-by: Patrick Linnane <patrick@linnane.io>
Copilot AI lite review requested due to automatic review settings October 6, 2026 02:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

馃煝 Approval recommended

No unresolved review issues were identified.

Review effort: Lite
Findings: None

What changed in this PR

Updates Xcode version inference to use full Apple Clang build identifiers, distinguishing Xcode 26.4, 26.6, and 27.

Changes:

  • Passes full Clang build information through detection.
  • Maps builds to the corresponding Xcode versions.
  • Adds coverage for relevant CLT builds.
File Description
Library/鈥婬omebrew/鈥媡est/鈥媜s/鈥媘ac/鈥媥code_spec.rb Tests compiler-build mappings.
Library/鈥婬omebrew/鈥媜s/鈥媘ac/鈥媥code.rb Infers Xcode versions from full Clang builds.

馃挕 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@p-linnane
p-linnane added this pull request to the merge queue Oct 6, 2026
Merged via the queue into main with commit 4ee6262 Oct 6, 2026
57 checks passed
@p-linnane
p-linnane deleted the xcode-version-from-clang-build branch October 6, 2026 03:18
@MikeMcQuaid

Copy link
Copy Markdown
Member

@p-linnane Thanks! We should probably think about this "Xcode detected from Clang version" logic; maybe we can remove it entirely in favour of just using Xcode and CLT versions now?

@p-linnane p-linnane mentioned this pull request Oct 6, 2026
7 of 8 tasks
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.

4 participants