guix-commits
[Top][All Lists]
Advanced

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

01/06: gnu: guix: Ensure the bootstrap binary tarballs aren't GC'd.


From: guix-commits
Subject: 01/06: gnu: guix: Ensure the bootstrap binary tarballs aren't GC'd.
Date: Mon, 6 Jan 2020 10:32:16 -0500 (EST)

civodul pushed a commit to branch master
in repository guix.

commit 9961cde3835743643e562e0034a73356b1d1eb0f
Author: Ludovic Courtès <address@hidden>
AuthorDate: Mon Jan 6 15:09:31 2020 +0100

    gnu: guix: Ensure the bootstrap binary tarballs aren't GC'd.
    
    Previously, they could be GC'd by 'tests/guix-gc.sh' for instance, and
    thus lacking by the time 'tests/guix-daemon.sh' runs, thereby leading to
    a test failure.
    
    Reported by Gábor Boskovits.
    
    * gnu/packages/package-management.scm (guix)[arguments]: In
    'copy-bootstrap-guile' phase, change 'intern' to register a GC root.
---
 gnu/packages/package-management.scm | 33 ++++++++++++++++++++++-----------
 1 file changed, 22 insertions(+), 11 deletions(-)

diff --git a/gnu/packages/package-management.scm 
b/gnu/packages/package-management.scm
index 0e4f644..6becdb2 100644
--- a/gnu/packages/package-management.scm
+++ b/gnu/packages/package-management.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès 
<address@hidden>
+;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès 
<address@hidden>
 ;;; Copyright © 2015, 2017 Ricardo Wurmus <address@hidden>
 ;;; Copyright © 2017 Muriithi Frederick Muriuki <address@hidden>
 ;;; Copyright © 2017, 2018 Oleg Pykhalov <address@hidden>
@@ -176,16 +176,27 @@
                         ;; Copy the bootstrap guile tarball in the store used
                         ;; by the test suite.
                         (define (intern file recursive?)
-                          (let ((base (strip-store-file-name file)))
-                            ;; Note: don't use 'guix download' here because we
-                            ;; need to set the 'recursive?' argument.
-                            (invoke "./test-env" "guile" "-c"
-                                    (object->string
-                                     `(begin
-                                        (use-modules (guix))
-                                        (with-store store
-                                          (add-to-store store ,base ,recursive?
-                                                        "sha256" ,file)))))))
+                          ;; Note: don't use 'guix download' here because we
+                          ;; need to set the 'recursive?' argument.
+                          (define base
+                            (strip-store-file-name file))
+
+                          (define code
+                            `(begin
+                               (use-modules (guix))
+                               (with-store store
+                                 (let* ((item (add-to-store store ,base
+                                                            ,recursive?
+                                                            "sha256" ,file))
+                                        (root (string-append "/tmp/gc-root-"
+                                                             (basename item))))
+                                   ;; Register a root so that the GC tests
+                                   ;; don't delete those.
+                                   (symlink item root)
+                                   (add-indirect-root store root)))))
+
+                          (invoke "./test-env" "guile" "-c"
+                                  (object->string code)))
 
                         (intern (assoc-ref inputs "boot-guile") #f)
 



reply via email to

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