guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/04: time-travel-manifest: Use a separate Git checkout cache.


From: guix-commits
Subject: 02/04: time-travel-manifest: Use a separate Git checkout cache.
Date: Sun, 10 Jul 2022 18:19:14 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 5d0437ea8ce0147b47b9df866fa2413b48f71a1a
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Sun Jul 10 12:41:41 2022 +0200

    time-travel-manifest: Use a separate Git checkout cache.
    
    * etc/time-travel-manifest.scm (guix-instance-compiler): Parameterize
    %REPOSITORY-CACHE-DIRECTORY.
---
 etc/time-travel-manifest.scm | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/etc/time-travel-manifest.scm b/etc/time-travel-manifest.scm
index 3d7ecff370..f09659d20d 100644
--- a/etc/time-travel-manifest.scm
+++ b/etc/time-travel-manifest.scm
@@ -20,7 +20,11 @@
 ;;; releases from the current Guix, as per 'guix time-machine'.
 
 (use-modules (srfi srfi-9) (ice-9 match)
-             (guix channels) (guix gexp))
+             (guix channels) (guix gexp)
+             ((guix store) #:select (%store-monad))
+             ((guix monads) #:select (mparameterize return))
+             ((guix git) #:select (%repository-cache-directory))
+             ((guix build utils) #:select (mkdir-p)))
 
 ;; Representation of the latest channels.  This type exists just so we can
 ;; refer to such records in a gexp.
@@ -33,7 +37,14 @@
                                               system target)
   (match instance
     (($ <guix-instance> channels)
-     (latest-channel-derivation channels))))
+     ;; When this manifest is evaluated by Cuirass, make sure it does not
+     ;; fiddle with the cached checkout that Cuirass is also using since
+     ;; concurrent accesses are unsafe.
+     (mparameterize %store-monad ((%repository-cache-directory
+                                   (string-append (%repository-cache-directory)
+                                                  "/time-travel")))
+       (return (mkdir-p (%repository-cache-directory)))
+       (latest-channel-derivation channels)))))
 
 (define (guix-instance->manifest-entry instance)
   "Return a manifest entry for INSTANCE."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]