Under what conditions might we get two different P...
# development
h
Under what conditions might we get two different Python instances representing the same target? Seeing this happen intermittently in a test (and breaking that test) but it is inconsistent and appears to be subject to a race condition.
Specifically, this happens when we request Targets from RawSpecs - we may or may not get the same instances of those targets that were already in play
I can fix the test issue by adding proper equality semantics to PythonArtifact, but I’m curious why this is happening intermittently and not consistently
w
if equality/hashing are broken, many bets are off. race conditions of “who set the value first” come into play
but would need more context
h
PythonArtifact (the value of
provides=
on
python_distribution
) has broken equality/hashing, indeed
But it is the
python_distribution
target itself that is sometimes different
w
well, if the effect is that two different
python_distribution
instances have the “same” value from an eq/hash perspective, then memoization might give you back one of the values when you’re expecting the other.
h
The break was the other way (two semantically identical PythonArtifacts appeared to be inequal), but yeah, something like that was happening
Fix is easy enough