-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
toolchain resolution fails for non-workspace prefixed toolchain_types if workspace name used --extra_toolchains #13381
Comments
Good news! This was recently fixed in d23e0a1, and in a long chain of preceeding changes which, unfortunately, are captured in an internal-only issue. I should have copied it into an externally visible one. For reference, the changes are:
Please try this with bazel build from head (or the latest green build with bazelisk) and it should be fixed. |
It doesn't look like this is fixed at last_green:
It's easy enough to workaround, though. |
I'll take a look, thanks. |
Debugging this, the two failing cases have the same behavior:
These don't match, and so there's a failure in resolution. @c-parsons: You were telling me recently that you wanted to change repo mapping, would this be handled by the replacement? |
This is indeed the same issue I was running into with regards to cc toolchain resolution if I recall correctly. (whether or not the toolchain type was under |
@c-parsons Is there a way for toolchain resolution to know that |
I don't recall off the top of my head, apologies. My memory and understanding of general toolchain resolution logic has faded over the last several months. Some of the toolchain-checking logic specific to rules_cc is inflexible with regards to repo renaming (example), and this is what we had to hack around. |
Sorry, I wasn't clear. I'm not worried about the toolchain resolution part, I can handle that. But, given two labels that are in different repositories, what do I need to do to discover that they are actually pointing to the same target? |
I talked to @c-parsons some more, he's not sure if there's a helpful API. I'm going to investigate further. |
Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 14 days unless any other activity occurs or one of the following labels is added: "not stale", "awaiting-bazeler". Please reach out to the triage team ( |
This should be fixed with Bazel 6, which applies the repo mapping to all command line options. |
Description of the problem / feature request:
When specifying a toolchain via --extra_toolchains which includes a workspace name, toolchain resolution fails to include that toolchain if it toolchain doesn't include a workspace prefix in the toolchain_type attribute.
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Given a trivial build file and rule implementation (in
dummy_toolchain.bzl
):And corresponding
BUILD
file:If the workspace name is included when specifying a toolchain via
--extra_toolchains
, only toolchains which include a workspace prefix will work. For example, given the above:Gives the results:
What operating system are you running Bazel on?
Ubuntu Linux
What's the output of
bazel info release
?release 4.0.0
What's the output of
git remote get-url origin ; git rev-parse master ; git rev-parse HEAD
?git@github.com:shahms/kythe.git
160b28af24a477fd75458e033523cf9ce81733ee
160b28af24a477fd75458e033523cf9ce81733ee
Have you found anything relevant by searching the web?
No, although I found #10927 which may be related.
The text was updated successfully, but these errors were encountered: