-
-
Notifications
You must be signed in to change notification settings - Fork 631
fix(toolchains): correctly register musl/freethreaded toolchains for workspace #3314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(toolchains): correctly register musl/freethreaded toolchains for workspace #3314
Conversation
Summary of ChangesHello @rickeylev, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request resolves a critical issue where musl and freethreaded Python runtimes were not being properly activated in Bazel WORKSPACE builds. The core problem stemmed from missing Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request correctly fixes an issue where musl and freethreaded toolchains were not being properly activated in WORKSPACE builds by ensuring target_settings
are passed during toolchain registration. This change aligns the WORKSPACE behavior with the bzlmod implementation.
A significant portion of this PR involves refactoring the test infrastructure to centralize platform definitions, which greatly improves maintainability. Additionally, a comprehensive new test suite has been added to verify correct toolchain resolution across various configurations, which is an excellent addition to ensure the fix is robust.
I've found one critical issue in the new test implementation that would likely cause it to fail and have provided a suggestion for a fix. Overall, this is a high-quality contribution.
4af90ca
to
bf68216
Compare
The musl/freethreaded runtimes weren't being activated when the flags were set. This was
because the toolchains weren't having
target_settings
set, which means extra settings,such as musl/freethreaded-ness were ignored when matching. The net result is the regular
toolchain, because it's registered earlier, would always match earlier.
To fix, set the target_settings in the toolchain() call. This matches the bzlmod behavior.
Also update the toolchain resolution tests to verify resolution.
Fixes #3262