but you can `yield` that `Get` within a rule, it j...
# development
a
but you can
yield
that
Get
within a rule, it just won't be checked at compile time and may fail if the Get can't be satisfied, i think
h
I'm currently trying to make use of a
Get
rule in a function that isn't itself a rule
it's used by a rule
and I'm not sure if that even makes sense to do
a
it might make sense to do, i didn't think it would but after i thought about it i think the only special thing about gets in rules is that it announces the possibility of that Get to the engine
i don't know what control flow you're thinking of
h
I have a list of directory paths
I want to turn those into a list of
PathGlobs
and then get a list of
Snapshots
from those, which I don't know how to do other than with
yield Get
basically I want to see which of those paths actually exists on the filesystem in a v2-compatible way
hm, does
yield Get
do basically teh same thing as
scheduler.product_request
?
in general if I have an
@rule
, and that
@rule
invokes a non-
@rule
function that internally uses
yield Get
is there a way I can pass something from the
@rule
to the non-
@rule
in order to make the
yield
work?
a
hm, does
yield Get
do basically teh same thing as
scheduler.product_request
?
yes!
you can make multiple rules here, and i would actually recommend it! you can see how this is done in https://github.com/pantsbuild/pants/blob/master/src/python/pants/backend/native/subsystems/native_toolchain.py, where intermediate types are used to represent phases of preparing the compiler and linker
is there a reason that wouldn't work?