inferior: Fix concurrent cached-profile calls.
authorMathieu Othacehe <othacehe@gnu.org>
Fri, 5 Mar 2021 11:49:06 +0000 (12:49 +0100)
committerMathieu Othacehe <othacehe@gnu.org>
Wed, 10 Mar 2021 07:49:48 +0000 (08:49 +0100)
* guix/inferior.scm (cached-profile): Do not create the profile symlink if it
already exists.

guix/inferior.scm

index 714e1e1..d0cd1cc 100644 (file)
@@ -755,8 +755,9 @@ seconds.  This procedure opens a new connection to the build daemon."
             (built-derivations (list profile))
             ;; Note: Caching is fine even when AUTHENTICATE? is false because
             ;; we always call 'latest-channel-instances?'.
-            (symlink* (derivation->output-path profile) cached)
-            (add-indirect-root* cached)
+            (unless (file-exists? cached)
+              (symlink* (derivation->output-path profile) cached)
+              (add-indirect-root* cached))
             (return cached))))))
 
 (define* (channels->cached-profile store channels