Fix clang version parsing on Windows.#626
Open
polasek wants to merge 2 commits intobazelbuild:mainfrom
Open
Conversation
| version_start = first_line.find("clang version ") | ||
| if version_start == -1: | ||
| auto_configure_fail("Failed to get clang version: unknown version string format: \"%s\"" % first_line) | ||
| return first_line[version_start + len("clang version "):].split(" ")[0] |
Collaborator
There was a problem hiding this comment.
Please use a shared variable rather than duplicating "clang version ".
armandomontanez
approved these changes
Mar 11, 2026
Collaborator
armandomontanez
left a comment
There was a problem hiding this comment.
Thanks!
This will merge per the merge process pending additional approvals.
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.
The official Windows release of Clang 22 changed the output format of
-v.This makes version parsing fail, and in turn leads to failed compilation for basically any C++ code as the version is used for
cxx_builtin_include_directories. Without the change in this PR, I getinstead of
"C:\\Program Files\\LLVM\\lib\\clang\\22\\include"in the autoconfigured toolchain.Compiling
then fails with:
I didn't find any tests for this or any easy way of adding them but please let me know if I missed something.