-
Notifications
You must be signed in to change notification settings - Fork 536
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
No matching toolchains when using current_py_cc_headers
with WORKSPACE.
#1669
Comments
Ah, i think what's happening is the workspace code path registers a specific target instead of Should be a simple fix to have it register the additional toolchain. In the meantime, you can work around this by adding native.register_toolchain() to your workspace. Something like |
The workspace `python_register_toolchains()` only registered the plain Python toolchain by its specific name. The py cc toolchain wasn't also being named. This meant things like `//python/cc:current_py_cc_headers` couldn't find their toolchain. Bzlmod doesn't have this problem because it uses the `:all` pattern to register everything. To fix, also register the py cc toolchain where the plain Python toolchain is registered, which makes it available. Fixes bazelbuild#1669
The workspace `python_register_toolchains()` only registered the plain Python toolchain by its specific name. The py cc toolchain wasn't also being named. This meant things like `//python/cc:current_py_cc_headers` couldn't find their toolchain. Bzlmod doesn't have this problem because it uses the `:all` pattern to register everything. To fix, also register the py cc toolchain where the plain Python toolchain is registered, which makes it available. Fixes bazelbuild#1669
The workspace `python_register_toolchains()` only registered the plain Python toolchain by its specific name. The py cc toolchain wasn't also being named. This meant things like `//python/cc:current_py_cc_headers` couldn't find their toolchain. Bzlmod doesn't have this problem because it uses the `:all` pattern to register everything. To fix, also register the py cc toolchain where the plain Python toolchain is registered, which makes it available. Fixes bazelbuild#1669
The workspace `python_register_toolchains()` function only registered the plain Python toolchain by its specific name. The py cc toolchain wasn't also being named. This meant things like `//python/cc:current_py_cc_headers` couldn't find their toolchain. Bzlmod doesn't have this problem because it uses the `:all` pattern to register everything. To fix, also register the py cc toolchain where the plain Python toolchain is registered, which makes it available. Fixes #1669
🐞 bug report
Description
Can not use
@rules_python//python/cc:current_py_cc_headers
in WORKSPACE mode because the toolchain fails to resolve. The WORKSPACE file is setting up a hermetic interpreter viapython_register_toolchains
.Note that the target works as expected when using a MODULE.bazel.
🔬 Minimal Reproduction
See repro repo: https://github.com/lalten/current_py_cc_headers
🔥 Exception or Error
@@rules_python//python/cc:current_py_cc_headers (5b7f3da): No matching toolchains found for types @@rules_python//python/cc:toolchain_type.
🌍 Your Environment
Operating System:
ubuntu-latest
Output of
bazel version
:7.0.0
Rules_python version:
0.27.1
The text was updated successfully, but these errors were encountered: