Subject: [bug#38649] [PATCH] Parallelize `guix package`

From: Ludovic Courtès <[email-masked]>
Date: Tue, 17 Dec 2019 15:32:10 +0100

Hi Leo,

(Cc: Julien, who worked on this part.)

Leo Prikler <[email-masked]> skribis:

> Yesterday I had an interesting conversation on IRC about the behaviour
> of multiple `guix package` processes running in parallel. 
> Specifically, when two transactions target the same profile (usually
> /var/guix/profiles/per-user/$USER/guix-profile) at the same time, one
> of them will fail to claim the lock and abort.  0001 makes it so that
> the process waits for the lock.  0002 makes it so that packages
> specified via -i can be built in parallel.

I actually like the current behavior, FWIW.  Julien came up with this
locking mostly so that people do not inadvertently attempt to perform
several operations concurrently.

The key word here is “inadvertently”: IMO, there’s no reason to run
multiple ‘guix package’ on the same profile concurrently.  With a
wait-for-lock policy, the result would be non-deterministic: you cannot
tell which one of the two processes will complete first.

WDYT?

Thanks,
Ludo’.