guix-commits
[Top][All Lists]
Advanced

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

03/04: guix gc: Add '--list-failures' and '--clear-failures'.


From: Ludovic Courtès
Subject: 03/04: guix gc: Add '--list-failures' and '--clear-failures'.
Date: Mon, 28 Sep 2015 20:58:13 +0000

civodul pushed a commit to branch master
in repository guix.

commit 30d9aa54229b413e52a2ed00032fa5179e4905ec
Author: Ludovic Courtès <address@hidden>
Date:   Mon Sep 28 21:45:46 2015 +0200

    guix gc: Add '--list-failures' and '--clear-failures'.
    
    Suggested by Mark H Weaver <address@hidden>.
    
    * guix/scripts/gc.scm (show-help, %options): Add --list-failures and
      --clear-failures.
      (guix-gc): Honor them.
    * doc/guix.texi (Invoking guix gc): Document them.
      (Invoking guix-daemon): Mention them.
---
 doc/guix.texi       |   18 ++++++++++++++++++
 guix/scripts/gc.scm |   17 +++++++++++++++++
 2 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index afb4108..6a3765f 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -814,6 +814,11 @@ builds to other machines (@pxref{Daemon Offload Setup}).
 @item --cache-failures
 Cache build failures.  By default, only successful builds are cached.
 
+When this option is used, @command{guix gc --list-failures} can be used
+to query the set of store items marked as failed; @command{guix gc
+--clear-failures} removes store items from the set of cached failures.
address@hidden guix gc}.
+
 @item address@hidden
 @itemx -c @var{n}
 Use @var{n} CPU cores to build each derivation; @code{0} means as many
@@ -1674,6 +1679,19 @@ Attempt to delete all the store files and directories 
specified as
 arguments.  This fails if some of the files are not in the store, or if
 they are still live.
 
address@hidden --list-failures
+List store items corresponding to cached build failures.
+
+This prints nothing unless the daemon was started with
address@hidden (@pxref{Invoking guix-daemon,
address@hidden).
+
address@hidden --clear-failures
+Remove the specified store items from the failed-build cache.
+
+Again, this option only makes sense when the daemon is started with
address@hidden  Otherwise, it does nothing.
+
 @item --list-dead
 Show the list of dead files and directories still present in the
 store---i.e., files and directories no longer reachable from any root.
diff --git a/guix/scripts/gc.scm b/guix/scripts/gc.scm
index 7e06c72..89a68d5 100644
--- a/guix/scripts/gc.scm
+++ b/guix/scripts/gc.scm
@@ -62,6 +62,10 @@ Invoke the garbage collector.\n"))
       --verify[=OPTS]    verify the integrity of the store; OPTS is a
                          comma-separated combination of 'repair' and
                          'contents'"))
+  (display (_ "
+      --list-failures    list cached build failures"))
+  (display (_ "
+      --clear-failures   remove PATHS from the set of cached failures"))
   (newline)
   (display (_ "
   -h, --help             display this help and exit"))
@@ -130,6 +134,14 @@ Invoke the garbage collector.\n"))
         (option '("referrers") #f #f
                 (lambda (opt name arg result)
                   (alist-cons 'action 'list-referrers
+                              (alist-delete 'action result))))
+        (option '("list-failures") #f #f
+                (lambda (opt name arg result)
+                  (alist-cons 'action 'list-failures
+                              (alist-delete 'action result))))
+        (option '("clear-failures") #f #f
+                (lambda (opt name arg result)
+                  (alist-cons 'action 'clear-failures
                               (alist-delete 'action result))))))
 
 
@@ -200,6 +212,11 @@ Invoke the garbage collector.\n"))
             (verify-store store
                           #:check-contents? (memq 'contents options)
                           #:repair? (memq 'repair options)))))
+        ((list-failures)
+         (for-each (cut simple-format #t "~a~%" <>)
+                   (query-failed-paths store)))
+        ((clear-failures)
+         (clear-failed-paths store (map direct-store-path paths)))
         ((list-dead)
          (for-each (cut simple-format #t "~a~%" <>)
                    (dead-paths store)))



reply via email to

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