utils/clang: allow Version type for kernel_version - #23536
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts Utils::Clang.write_system_config_files鈥檚 Sorbet signature to accept a Version for kernel_version, addressing a Sorbet runtime TypeError seen when LLVM formulae pass MacOSVersion.kernel_major_version (a Version) during builds.
Changes:
- Extend the
kernel_versionparameter type toT.any(String, Integer, Version)inLibrary/Homebrew/utils/clang.rb.
馃挕 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Fixes type error in LLVM formulae: ``` TypeError: Parameter 'kernel_version': Expected type T.any(Integer, String), got type Version with value #<Version 27> ``` As `MacOSVersion.kernel_major_version` returns a `Version` which all LLVM formulae currently use during build.
cho-m
force-pushed
the
clang-kernel_version-type
branch
from
August 15, 2026 22:01
7e8b4a7 to
48dfc81
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Suppressed comments (1)
Library/Homebrew/utils/clang.rb:12
- The updated Sorbet signature no longer accepts Integer values for
kernel_version(it used to beT.any(String, Integer)). Since the method implementation only interpolates the value into filenames (i.e.to_s), it can safely accept both the newVersionand the previousIntegerto avoid breaking any existing callers that still pass an integer kernel major.
config_dir: Pathname,
macos_version: T.any(String, MacOSVersion),
kernel_version: T.any(String, Version),
arch: Symbol,
).void
cho-m
enabled auto-merge
August 15, 2026 22:40
This was referenced Aug 15, 2026
carlocab
approved these changes
Aug 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes type error in LLVM formulae:
As
MacOSVersion.kernel_major_versionreturns aVersionwhich all LLVM formulae currently use during build.Seen in
brewcommands to reproduce the bug?brew lgtm(style, typechecking and tests) locally?