rules_python
rules_python copied to clipboard
Use the `launcher_maker` toolchain if available
PR Instructions/requirements
- Title uses
type: descriptionformat. See CONTRIBUTING.md for types.- Common types are: build, docs, feat, fix, refactor, revert, test
- Update
CHANGELOG.mdas applicable
- Breaking changes include "!" after the type and a "BREAKING CHANGES:" section at the bottom. See CONTRIBUTING.md for our breaking changes process.
- Body text describes:
- Why this change is being made, briefly.
- Before and after behavior, as applicable
- References issue number, as applicable
- Update docs and tests, as applicable
- Delete these instructions prior to sending the PR
fwiw/fyi: we have a CI job that uses bazel-rolling, in case that's helpful.
Also, a fun trick is using FeatureFlagInfo to detect if a toolchain is present. Something like:
def impl(ctx):
return FeatureFlagInfo(value=str(ctx.toolchains["foo"] == None))
has_tc = rule(
implementation = impl,
toolchains = [toolchain_type("foo", mandatory=False)]
has_tc(name="has_tc")
config_setting("is_has_tc_true", flag_values = {":has_tc": "True"})
alias("launcher_maker", actual = select({
"is_has_tc_true": ...,
})
)
Adding a dep on bazel_features isn't easy with rules_python's WORKSPACE setup since it doesn't use two levels of macros. Can we add a call to bazel_features_deps to the relnotes?