hundreds-father-404
11/07/2019, 6:29 PMFrozenSet
. Even though it's immutable, it's not deterministic so messes up caching.
https://github.com/pantsbuild/pants/pull/8577 changed PexRequirements
to use FrozenSet
instead of Tuple
, which means that resolve requirements are almost never cached nowaverage-vr-56795
11/07/2019, 6:30 PMearly-needle-54791
11/07/2019, 6:32 PMhundreds-breakfast-49010
11/07/2019, 6:35 PMhundreds-father-404
11/07/2019, 6:37 PM./pants --no-v1 --v2 test tests/python/pants_test/util:osutil
locally. It takes 60 seconds to resolve the requirements for that. On master, it will take the same amount of time. (I used simple print()
and time.time()
to measure this). With the PR I'm about to put up, the second time is less than a secondearly-needle-54791
11/07/2019, 6:38 PMhundreds-father-404
11/07/2019, 6:40 PMearly-needle-54791
11/07/2019, 6:42 PMhappy-kitchen-89482
11/07/2019, 7:08 PMaverage-vr-56795
11/07/2019, 7:09 PMhappy-kitchen-89482
11/07/2019, 7:09 PMaverage-vr-56795
11/07/2019, 7:10 PMhundreds-father-404
11/07/2019, 7:11 PMWhat do you mean by "deterministic" here?How the data is stored. There's no guarantee that the ordering will be the same, even if
__eq__
and __hash__
work
This is how dictionaries worked with Python until 3.6happy-kitchen-89482
11/07/2019, 7:14 PMfrozenset
as a value, just not on an iteration over its members.hundreds-father-404
11/07/2019, 7:27 PMIt should be safe to cache onI agree. I'm trying to find how to fix this and am not sure where we go fromas a value, just not on an iteration over its members.frozenset
Python->Rust
. Changing native.py
didn't do anythinghappy-kitchen-89482
11/07/2019, 7:29 PMfrozenset
, because that is a deep category error...hundreds-father-404
11/07/2019, 7:34 PMBasically, we should figure out why we're relying on order in aWe probably just haven't special cased sets yet. Order does matter for other data structures:, because that is a deep category error...frozenset
(1, "hello") != ("hello", 1)
for tuples.happy-kitchen-89482
11/08/2019, 7:46 PM