To verify my understanding, true or false: a `Get(...
# development
h
To verify my understanding, true or false: a
Get()
can only have exactly one argument? So if I want to yield to a rule that takes multiple arguments I have to bundle them in a datatype?
a
i think right now yes, but there's no reason that can't change. in particular we have
Params()
which is already used to specify multiple inputs at once, but that only works when doing a
self.context._scheduler.product_request()
as of right now -- i don't think there's any reason we can't allow using
Params()
in a
Get()
. i prototyped what this would be a bit ago but can't seem to find it
w
@happy-kitchen-89482: yes. until https://github.com/pantsbuild/pants/issues/7490
@happy-kitchen-89482: but, as described in the readme update (https://github.com/pantsbuild/pants/blob/2869046314f47d0bcd32eb448cc1198608cfcb75/src/python/pants/engine/README.md#advanced-param-usage : which i'd love a shipit on!), Params also can come from a @rule's callers.
so if the other things that a rule needs are already in scope while you run, you don't need to echo/repeat them to rules you are consuming
cc @early-needle-54791: ^
h
shipit given 🙂
Thanks!
e
So in my use case I want to yield a new type ( a collection of requests). The consumer will also need to get a Platform from somewhere therefore that rule will have multiple params but I will only be yielding one from above in the graph. Will that work?