https://pantsbuild.org/ logo
a

ambitious-actor-36781

06/16/2022, 2:02 AM
So Pants is made up with a network of rules. Those rules are 'run' when we call
Get(Result, Request, data)
Pants assumes that
data
is immutable, and forces
data
to be hashable. This then allows Pants to memoise/cache calls to
Get
so no matter how many times
Get(Result, Request, 1)
is called, the rule will only ever get executed once. Oh and everything is async. How does Pants handle
MultiGet( Get(Result, Request, 1), Get(Result, Request 1) )
? Is this undefined behaviour? or can we still trust that the rule will only be ran once?
1
h

hundreds-father-404

06/16/2022, 2:03 AM
Still only run once 🙂 It happens pretty frequently that multiple rules need the same thing at the same time, like downloading PEX
a

ambitious-actor-36781

06/16/2022, 2:04 AM
sweet
I didn't want to assume.
but I thought that was the case.
h

hundreds-father-404

06/16/2022, 2:05 AM
Btw that deduplication happens regardless of Pantsd -- the difference with Pantsd is we preserve the memoization across "sessions" (
./pants
invokes)
a

ambitious-actor-36781

06/16/2022, 2:06 AM
neato