Gentoo Archives: gentoo-user

From: "Florian Gamböck" <ml@×××××.de>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Curious about order that emerge -u builds/installs
Date: Fri, 04 Jun 2021 09:13:02
Message-Id: YLnukvH8mz+uq/u+@furore
In Reply to: [gentoo-user] Curious about order that emerge -u builds/installs by Grant Edwards
1 Hi Grant,
2
3 On 2021-06-02 15:22, Grant Edwards wrote:
4 > The order of package bilds often seems to be quite different after the
5 > interruption than it was the first time -- often X is a fair ways down
6 > the list.
7 >
8 > Why is that?
9
10 it might possibly be related to hash randomization. I experienced a
11 similar "problem" during work some time ago, where I couldn't reliably
12 compare a set of values with a predefined list, without sorting it
13 first.
14
15 You can try the following Bash script to demonstrate the effects of hash
16 randomization in Python:
17
18 for _ in {1..5}; do python -c "print(set(['a', 'b', 'c']))"; done
19
20 Chances are high that you will get five completely differently sorted
21 sets.
22
23 Since Portage is programmed in Python, it might be the same effect here,
24 the packages are built up in a set or a dictionary and are therfore
25 affected by the random seed.
26
27 More information and pointers on this topic can be found in the Python
28 documentation: https://docs.python.org/3/using/cmdline.html#cmdoption-r
29
30 --
31 Regards and all the best
32
33 Flo