public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] Curious about order that emerge -u builds/installs
@ 2021-06-02 15:22 Grant Edwards
  2021-06-03 17:12 ` Walter Dnes
  2021-06-04  9:12 ` Florian Gamböck
  0 siblings, 2 replies; 3+ messages in thread
From: Grant Edwards @ 2021-06-02 15:22 UTC (permalink / raw
  To: gentoo-user

I've noticed something surprising (to me) about the order that 'emerge -auvND world'
decides to install/upgrade/reinstall packages. The situation is as follows:

 * A large number of packages need to be build/installed/reinstalled
 * Hit control-C during the build of package X
 * Restart 'emerge -auvND world'

I expect that it will start by building package X and resume with the
remainder of the packages in the same order as before. Often it does
not.  The order of package bilds often seems to be quite different
after the interruption than it was the first time -- often X is a fair
ways down the list.

Why is that?

--
Grant






^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gentoo-user] Curious about order that emerge -u builds/installs
  2021-06-02 15:22 [gentoo-user] Curious about order that emerge -u builds/installs Grant Edwards
@ 2021-06-03 17:12 ` Walter Dnes
  2021-06-04  9:12 ` Florian Gamböck
  1 sibling, 0 replies; 3+ messages in thread
From: Walter Dnes @ 2021-06-03 17:12 UTC (permalink / raw
  To: gentoo-user

On Wed, Jun 02, 2021 at 03:22:58PM -0000, Grant Edwards wrote
> I've noticed something surprising (to me) about the order that 'emerge -auvND world'
> decides to install/upgrade/reinstall packages. The situation is as follows:
> 
>  * A large number of packages need to be build/installed/reinstalled
>  * Hit control-C during the build of package X
>  * Restart 'emerge -auvND world'
> 
> I expect that it will start by building package X and resume with the
> remainder of the packages in the same order as before. Often it does
> not.  The order of package bilds often seems to be quite different
> after the interruption than it was the first time -- often X is a fair
> ways down the list.
> 
> Why is that?

  See the "Emerge order not deterministic !?" thread from way back in 2015.
https://linux.gentoo.user.narkive.com/YlGA5QBQ/gentoo-user-emerge-order-not-deterministic
I remember it, because I was the OP on that thread.  Basically, if there
isn't a dependancy requirement between two packages, there's no
guarantee which one gets emerged first.

-- 
Walter Dnes <waltdnes@waltdnes.org>
I don't run "desktop environments"; I run useful applications


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gentoo-user] Curious about order that emerge -u builds/installs
  2021-06-02 15:22 [gentoo-user] Curious about order that emerge -u builds/installs Grant Edwards
  2021-06-03 17:12 ` Walter Dnes
@ 2021-06-04  9:12 ` Florian Gamböck
  1 sibling, 0 replies; 3+ messages in thread
From: Florian Gamböck @ 2021-06-04  9:12 UTC (permalink / raw
  To: gentoo-user

Hi Grant,

On 2021-06-02 15:22, Grant Edwards wrote:
> The order of package bilds often seems to be quite different after the 
> interruption than it was the first time -- often X is a fair ways down 
> the list.
>
> Why is that?

it might possibly be related to hash randomization. I experienced a 
similar "problem" during work some time ago, where I couldn't reliably 
compare a set of values with a predefined list, without sorting it 
first.

You can try the following Bash script to demonstrate the effects of hash 
randomization in Python:

     for _ in {1..5}; do python -c "print(set(['a', 'b', 'c']))"; done

Chances are high that you will get five completely differently sorted 
sets.

Since Portage is programmed in Python, it might be the same effect here, 
the packages are built up in a set or a dictionary and are therfore 
affected by the random seed.

More information and pointers on this topic can be found in the Python 
documentation: https://docs.python.org/3/using/cmdline.html#cmdoption-r

-- 
Regards and all the best

Flo


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-06-04  9:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-02 15:22 [gentoo-user] Curious about order that emerge -u builds/installs Grant Edwards
2021-06-03 17:12 ` Walter Dnes
2021-06-04  9:12 ` Florian Gamböck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox