aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathieu Othacehe <othacehe@gnu.org>2021-03-05 12:49:06 +0100
committerMathieu Othacehe <othacehe@gnu.org>2021-03-10 08:49:48 +0100
commit6ee7e3d26b8f5d2a234518cc2ab1bfeba7cd7c18 (patch)
tree241d99071853313c5392b9be180b7a4cd7def53d
parent7d63b775513e7049047222dbe403a4181f63828d (diff)
downloadguix-6ee7e3d26b8f5d2a234518cc2ab1bfeba7cd7c18.tar.gz
guix-6ee7e3d26b8f5d2a234518cc2ab1bfeba7cd7c18.zip
inferior: Fix concurrent cached-profile calls.
* guix/inferior.scm (cached-profile): Do not create the profile symlink if it already exists.
-rw-r--r--guix/inferior.scm5
1 files changed, 3 insertions, 2 deletions
diff --git a/guix/inferior.scm b/guix/inferior.scm
index 714e1e1eae..d0cd1ccee7 100644
--- a/guix/inferior.scm
+++ b/guix/inferior.scm
@@ -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