https://pantsbuild.org/ logo
#development
Title
# development
h

happy-kitchen-89482

08/01/2019, 10:05 PM
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

aloof-angle-91616

08/01/2019, 10:08 PM
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

witty-crayon-22786

08/01/2019, 10:24 PM
@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

happy-kitchen-89482

08/01/2019, 10:31 PM
shipit given 🙂
Thanks!
e

early-needle-54791

08/01/2019, 10:33 PM
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?