Skip to content
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

How to forward inputs when transitioning a target? #834

Open
cbarrete opened this issue Jan 8, 2025 · 0 comments
Open

How to forward inputs when transitioning a target? #834

cbarrete opened this issue Jan 8, 2025 · 0 comments

Comments

@cbarrete
Copy link
Contributor

cbarrete commented Jan 8, 2025

Say I work around #832 by writing a rule like:

my_transitioned_target = rule(
    impl = lambda ctx: ctx.attrs.base.providers,
    attrs = {
        # `my_transition` just adds `my_constraint` to the configuration.
        "base": attrs.transition_dep(cfg = my_transition),
        "my_constraint": attrs.label(),
    },
)

If I add a target using this rule and query its inputs (using either the CLI or BXL), I get an empty list. This kind of makes sense to me, but from an end-user perspective, I'd like my transitioned target to mostly behave like the base one, including carrying the same inputs. Is there a way that I can achieve that?

I've tried working around that by adding an arg attr that I populate with a $(query_outputs inputs(:my_base_target)) string parameter macro, but then I run into configuration incompatibility issues because the base and transitioned targets are incompatible.

Any help would be greatly appreciated!

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

No branches or pull requests

1 participant