How to forward inputs when transitioning a target?
- Dominant language
- Rust
- Stars
- 4.4k
- Forks
- 394
- PR merge metrics
- No merged PRs in 30d
Description
Say I work around https://github.com/facebook/buck2/issues/832 by writing a rule like:
```python
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!
Contributor guide
Assessment
This issue has not been assessed yet.