https://pantsbuild.org/ logo
h

happy-kitchen-89482

07/17/2020, 9:56 PM
Background is I want to introduce an uncacheable rule as distinct from a goal_rule
🔥 1
a

aloof-angle-91616

07/17/2020, 9:57 PM
i think this is reasonable. in cases where we have to call some python code that e.g. touches a real filesystem for some reason, we might want to “sandbox” that by making it uncacheable. this technique is used in the --query PR for invoking git
w

witty-crayon-22786

07/17/2020, 9:58 PM
but we have an alternate solution for that, mentioned on that PR
👍 1
a

aloof-angle-91616

07/17/2020, 9:59 PM
that’s correct
w

witty-crayon-22786

07/17/2020, 10:00 PM
@happy-kitchen-89482: so, actually… another alternative is a UUID generator intrinsic
👍 1
h

happy-kitchen-89482

07/17/2020, 10:00 PM
aha
yes
a

aloof-angle-91616

07/17/2020, 10:00 PM
h

happy-kitchen-89482

07/18/2020, 12:03 AM
Yes, an intrinsic could be just the thing
But would require some rust-side work?
Or can we have python-side intrinsics?
a

aloof-angle-91616

07/18/2020, 12:04 AM
i would assume on the rust side
it would possibly make it easier to optimize later e.g. if we wanted to mix in a uuid to some objects' identities
w

witty-crayon-22786

07/18/2020, 12:05 AM
Would be rust side, yea. But hacking in access to the
cacheable
flag for internal-only use from python would be roughly equivalent.
👍 1
So, might depend on whether we can see a long term usage for a UUID generator even after the ternary that @hundreds-breakfast-49010 will be adding. It does feel like a fairly fundamental operation.
👍 1
a

aloof-angle-91616

07/18/2020, 12:08 AM
i like that it doesn't require adding special-case logic to the rule graph or the product graph for invalidation
h

hundreds-breakfast-49010

07/18/2020, 12:10 AM
@witty-crayon-22786 what "ternary" thing are you talking about?
w

witty-crayon-22786

07/18/2020, 12:11 AM
The "`Process` is cacheable: yes/no/maybe" thing from #10129
Away from computer, but see my comment there
h

hundreds-breakfast-49010

07/18/2020, 12:12 AM
ah
I'm not sure if that's a "ternary" operation; without having spent much time on it yet, it seems like it would be an additional boolean
h

happy-kitchen-89482

07/18/2020, 2:01 AM
So I have a uuid intrinsic sort-of working (my rust cargo-culting skills got somewhat better in the last hour...) but I still can't get this to work.
What about the intrinsic interacts with memoization differently than a python-side rule?
w

witty-crayon-22786

07/18/2020, 2:05 AM
@happy-kitchen-89482: you'd have a Node(Key) for this intrinsic, and you'd mark it uncacheable in the trait
h

happy-kitchen-89482

07/18/2020, 2:06 AM
That was the missing bit
Thanks!
w

witty-crayon-22786

07/18/2020, 2:07 AM
Good luck!
h

happy-kitchen-89482

07/18/2020, 2:08 AM
Oh man, this is like the programming equivalent of trying speaking Italian when you only know Spanish
Sort of close in some respects, but also so not
w

witty-crayon-22786

07/18/2020, 2:31 AM
Heh. Lemme know if you have questions.
h

happy-kitchen-89482

07/19/2020, 6:30 AM
I gave up on that, I more-or-less figured out what it would take, but I don't think my Rust non-skills are up to it. It was much easier to implement entirely in Python by introducing an
uncacheable_rule
annotation, so I did that instead... PR to follow.