got a question about how the content-addressable c...
# general
a
got a question about how the content-addressable cache stuff works. How much depends on the cache? if I have a chain of rules
a -> b -> c
and
a
's output is a random number. (i.e.
a() -> uuid4()
) and B's output is a constant. (i.e.
b(a_out) -> 0
) what happens to C (
c(b_out) -> ...
) Would
c
always get a cache miss because
a
isn't deterministic? or would
c
always get a cache hit, because
b
returns a constant value?
h
Rules are required to be deterministic and have no side effects, since they are cached on their inputs.
So c will always get a cache hit
In fact, b will always get a cache hit on a (unless a's inputs change)
a
cool. good to know thanks. Trying to work out how to structure some internal plugins, that need to be rewritten to get around some dumb technical constraints. AND not have our cache get invalidated every time we run
pants test