Skip to content

latest-clang#343

Open
sbSteveK wants to merge 8 commits intomainfrom
latest-clang
Open

latest-clang#343
sbSteveK wants to merge 8 commits intomainfrom
latest-clang

Conversation

@sbSteveK
Copy link
Copy Markdown
Contributor

@sbSteveK sbSteveK commented Feb 27, 2026

Allow CI to specify latest-clang and dynamically check llvm for its latest qualification version of clang to build against.

When latest is used, we will parse for the latest qualification branch from llvm and use that. Sometimes the latest version that is listed (whether qualification or stable) isn't actually available for the specific codename we are using so we do a check in order of versions we want before selecting and using it.

Also removed hardcoding of versions past 8 to be dynamically set so that we don't need to continually update builder for later version support. Left comments in case it breaks and we need to return to hardcoding but that shouldn't be necessary.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

# - Supports any future version (8+) dynamically
# - Removes the need for clangd, lldb

LLVM_SH = """\
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.

Why do we do this rather than a separate file?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Unsure, I touched as little of the existing framework as I could because I didn't want to break anything else. A lot of this felt pretty hacky. If you mean the entire implementation as a whole, it does still feel like the changes should be in this file since we're parsing the arguments for clang here.

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.

have you tried the latest https://apt.llvm.org/llvm.sh?
Look into this, it seems to be outdated comparing to what I just downloaded.

Does the latest script supports future version (8+)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Two immediate problems are that the latest doesn't have immediate support for anything lower than clang-9 (so we'd need to hardcode earlier versions) and it has its version hardcoded up to 21 so later versions as things change will need to be manually addressed which is what I'm trying avoid doing here. We might be able to use this as a NEW base to work off but I don't see a strong reason why we should.

Comment on lines 185 to +186
""" Finds clang, clang-tidy, lld, etc at a specific version, or the
latest one available """
versions = [version] if version else _clang_versions()
latest one available. If version is 'latest', resolves it dynamically. """
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.

So, we are trying to resolve the latest one available when the version is not set, but we are also introducing a new latest version?
Sounds like we should just resolve the latest version dynamically when the version is None instead of the latest one in the hard-coded list?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We introduce latest to be explicit about what we want to do when calling from CI; find the latest version of clang that can be used from llvm. None simply asks to use any available version and doesn't go through the process of looking for latest from llvm. I think we should keep this separation in behavior.

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