Skip to content

Use the launcher_maker toolchain if available #2919

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

fmeum
Copy link
Member

@fmeum fmeum commented May 20, 2025

PR Instructions/requirements

  • Title uses type: description format. See CONTRIBUTING.md for types.
    • Common types are: build, docs, feat, fix, refactor, revert, test
    • Update CHANGELOG.md as 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

@fmeum fmeum force-pushed the launcher-maker-toolchain branch from b01c964 to 4769ba5 Compare May 20, 2025 20:10
@rickeylev
Copy link
Collaborator

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": ...,
  })
)

@fmeum fmeum force-pushed the launcher-maker-toolchain branch from 4769ba5 to 0d2cf67 Compare May 21, 2025 08:31
@fmeum
Copy link
Member Author

fmeum commented May 21, 2025

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants