Background is I want to introduce an uncacheable r...
# development
h
Background is I want to introduce an uncacheable rule as distinct from a goal_rule
🔥 1
a
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
but we have an alternate solution for that, mentioned on that PR
đź‘Ť 1
a
that’s correct
w
@happy-kitchen-89482: so, actually… another alternative is a UUID generator intrinsic
đź‘Ť 1
h
aha
yes
a
h
Yes, an intrinsic could be just the thing
But would require some rust-side work?
Or can we have python-side intrinsics?
a
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
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
i like that it doesn't require adding special-case logic to the rule graph or the product graph for invalidation
h
@witty-crayon-22786 what "ternary" thing are you talking about?
w
The "`Process` is cacheable: yes/no/maybe" thing from #10129
Away from computer, but see my comment there
h
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
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
@happy-kitchen-89482: you'd have a Node(Key) for this intrinsic, and you'd mark it uncacheable in the trait
h
That was the missing bit
Thanks!
w
Good luck!
h
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
Heh. Lemme know if you have questions.
h
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.