-
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
Allow dev_dependency register_toolchains calls #18248
Comments
I'd also like to note this is rather hard to work around. Fabian suggested creating an extension that creates a "middleman" repo. The extension detects if its the root module, and, if so, populates the middleman with references to the real toolchains. If not, then it puts a fake toolchain in so downstream users inheriting the register_toolchains() call don't break. Implementing this, however, is...well I haven't really figured out a good way, yet. You can't alias |
Fixes bazelbuild#18248 Closes bazelbuild#18253. PiperOrigin-RevId: 527858646 Change-Id: I544694bb55f466bd6e14660ae62f2d535c283563
Description of the feature request:
Allow
register_toolchains(dev_dependency=True)
so that MODULE files can register toolchains only necessary for development and testing.The specific case I'm dealing with is documentation generation: generating docs for my code is a dev-time only activity, but it uses tools that use toolchains.
Unfortunately, any
register_toolchains()
call in my module will propagate to consumers. This puts me in a catch-22: if I add register_toolchains(), my users are broken (because it'll try to register toolchains that were never setup). If I don't add it, my docgen tools can't run.This idea is easily expanded: One might have various tools only necessary for development purposes (lints, test runners, debuggers, type checkers, etc), and it makes sense those tools would rely on some language toolchain. But those toolchains aren't necessary for any users, nor should they depend on them in any way.
cc
@fmeum as he mentioned he proposed this idea in the past
@Wyverald pretty sure he owns bzlmod
What underlying problem are you trying to solve with this feature?
Making it possible to have dev-time only dependencies that rely on toolchains.
Which operating system are you running Bazel on?
linux
What is the output of
bazel info release
?release 6.1.2
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.No response
What's the output of
git remote get-url origin; git rev-parse master; git rev-parse HEAD
?Have you found anything relevant by searching the web?
nothing found
Any other information, logs, or outputs that you want to share?
No response
The text was updated successfully, but these errors were encountered: