-
Notifications
You must be signed in to change notification settings - Fork 519
Simplify output flavor with starlark configuration #2162
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
Comments
This feels similar to the recent work to move some tsconfig into a starlark dict/rule, but using transitions instead. Do you feel like transitions provide a certain advantage, or was it just top-of-mind? |
There should be lots of advantages over the current implementation.
|
How is this different from |
Well, I'd say completely different.
Also, if multiple outputs were required, users must add those actions as rules in build files -- which is tedious, error-prone, and doing things bazel is capable of doing (pretty much the definition of toil). Most importantly, We can discuss more on slack -- if you have time. |
To clarify, the "output dir" is the top-level bazel output directory right under the bazel-out:
|
No longer in scope for rules_nodejs which only supplies the Node.js toolchain as of v6.0.0. Downstream canonical JavaScript + Node.js ruleset is now https://github.com/aspect-build/rules_js. |
🚀 feature request
Relevant Rules
ts_library
and potentially other rulesDescription
Currently, all the javascript rules use providers to differentiate outputs for different modes, eg. AMD, ESM. Consumers will then pick the right output based on their needs by using a provider or add a proxy filegroup to pick the right output_group.
However, this approach requires that the output files of different flavors be unique, and there is no simple way to create a target that consumes a dependency tree of specific flavor outputs. Consumers must know the right way to pick the output flavor they want.
Describe the solution you'd like
Use build settings API to transparently determine the output of a dependency
ts_library
.ts_library
always produces the output with the same name, and the content may vary based on the build settings.This could also enable possibilities like build nodejs/browser targets with the same dependency graph (eg. #2073).
See bazel doc and example from rules_go.
Describe alternatives you've considered
The text was updated successfully, but these errors were encountered: