guix_mirror_bot pushed a commit to branch master
in repository guix.
commit 8294c5288f258b2f4e39696efbddca4b892c6c37
Author: Jelle Licht <[email protected]>
AuthorDate: Thu Oct 15 14:28:10 2026 +0200
tests: Copy bootstrap binaries atomically.
Tests run in parallel could copy the same binary at the same time.
* guix/tests.scm (search-bootstrap-binary): Copy to a temporary file and
rename it.
---
guix/tests.scm | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/guix/tests.scm b/guix/tests.scm
index 4be360a7798..68a19764e36 100644
--- a/guix/tests.scm
+++ b/guix/tests.scm
@@ -135,9 +135,13 @@ found."
(bootstrap-executable file-name
system))))
(mbegin %store-monad
(built-derivations (list drv))
- (begin
+ (let ((temporary (string-append file "."
+ (number->string (getpid)))))
+ ;; Tests run in parallel may get here at the same time.
(mkdir-p (dirname file))
- (copy-file (derivation->output-path drv) file)
+ (false-if-exception (delete-file temporary))
+ (copy-file (derivation->output-path drv) temporary)
+ (rename-file temporary file)
(return file)))))))))
(define (call-with-external-store proc)