-
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
toolchains
attribute requires toolchain_type
target to expose provider which it can't
#14009
Comments
/cc @katre @gregestren |
This is an unfortunate wart of Bazel. The This was named separately from the In an ideal world, toolchain resolution would also consult the One workaround is to add a simple rule which does declare the toolchain type of |
…stand toolchain_type This lets genrule interop with the node toolchain Workaround for bazelbuild/bazel#14009, thanks @katre
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 90 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 ( |
@bazelbuild/triage - this is still relevant |
The problem is that the Ideally we'd fix this to also take a toolchain type, perform toolchain resolution, and then get the make variables from the toolchain, but this is actually pretty complex (right now the set of toolchain types for a rule is static, this would make it dynamic). |
Description of the problem / feature request:
As far as I can tell, there's no way for a starlark-defined toolchain to be consumed for make variable expansion.
I wanted to use
perl
from a Perl toolchain fromrules_perl
in a genrule:Unfortunately, this doesn't quite work for two reasons.
As far as I can tell, there's no way for a
toolchain_type
to expose extra providers. I can substitute in the concrete toolchain target:"@perl_darwin_amd64//:toolchain_impl"
, but this feels like it's subverting toolchain selection. Shouldn't thetoolchain_type
target proxy its providers through?tools = ["@perl_darwin_amd64//:runtime"]
to the target, and then the files are present.So this target actually works:
What operating system are you running Bazel on?
macOS
What's the output of
bazel info release
?release 4.2.1
Here's my WORKSPACE file to repro:
The text was updated successfully, but these errors were encountered: