[Top][All Lists]

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

01/04: challenge: Do nothing when passed zero arguments.

From: guix-commits
Subject: 01/04: challenge: Do nothing when passed zero arguments.
Date: Sat, 2 Jul 2022 19:43:35 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit e7ab3d33aec3993737cdbc4396a9c44a54a3ce84
Author: Ludovic Court├Ęs <>
AuthorDate: Sun Jun 19 15:50:50 2022 +0200

    challenge: Do nothing when passed zero arguments.
    Previously, 'guix challenge' without arguments would list live store
    items that had been locally built.  This was deemed confusing,
    especially since 'list-live' is an expensive operation.
    * guix/scripts/challenge.scm (guix-challenge): Warn and exit with 0 when
    FILES is empty.
    * doc/guix.texi (Invoking guix challenge): Update accordingly.
 doc/guix.texi              | 38 ++++++++++++++++++++++----------------
 guix/scripts/challenge.scm |  5 +++--
 2 files changed, 25 insertions(+), 18 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index cf373b6cbd..9d9cb3dc07 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -14941,7 +14941,9 @@ any given store item.
 The command output looks like this:
-$ guix challenge --substitute-urls="https://@value{SUBSTITUTE-SERVER-1}";
+$ guix challenge \
+  --substitute-urls="https://@value{SUBSTITUTE-SERVER-1}"; \
+  openssl git pius coreutils grep
 updating substitutes from 'https://@value{SUBSTITUTE-SERVER-1}'... 100.0%
 updating substitutes from ''... 100.0%
 /gnu/store/@dots{}-openssl-1.0.2d contents differ:
@@ -14968,18 +14970,20 @@ updating substitutes from 
''... 100.0%
-6,406 store items were analyzed:
-  - 4,749 (74.1%) were identical
-  - 525 (8.2%) differed
-  - 1,132 (17.7%) were inconclusive
+5 store items were analyzed:
+  - 2 (40.0%) were identical
+  - 3 (60.0%) differed
+  - 0 (0.0%) were inconclusive
 @end smallexample
-In this example, @command{guix challenge} first scans the store to
-determine the set of locally-built derivations---as opposed to store
-items that were downloaded from a substitute server---and then queries
-all the substitute servers.  It then reports those store items for which
-the servers obtained a result different from the local build.
+In this example, @command{guix challenge} queries all the substitute
+servers for each of the fives packages specified on the command line.
+It then reports those store items for which the servers obtained a
+result different from the local build (if it exists) and/or different
+from one another; here, the @samp{local hash} lines indicate that a
+local build result was available for each of these packages and shows
+its hash.
 @cindex non-determinism, in package builds
 As an example, @code{} always gets a different answer.
@@ -15035,19 +15039,21 @@ whether @code{@value{SUBSTITUTE-SERVER-1}} and other 
substitute servers obtain t
 same build result as you did with:
-$ guix challenge @var{package}
+guix challenge @var{package}
 @end example
-where @var{package} is a package specification such as
-@code{guile@@2.0} or @code{glibc:debug}.
 The general syntax is:
-guix challenge @var{options} [@var{packages}@dots{}]
+guix challenge @var{options} @var{argument}@dots{}
 @end example
+where @var{argument} is a package specification such as
+@code{guile@@2.0} or @code{glibc:debug} or, alternatively, a store file
+name as returned, for example, by @command{guix build} or @command{guix
+gc --list-live}.
 When a difference is found between the hash of a locally-built item and
 that of a server-provided substitute, or among substitutes provided by
 different servers, the command displays it as in the example above and
diff --git a/guix/scripts/challenge.scm b/guix/scripts/challenge.scm
index 5c0f837d13..f1e5f67dab 100644
--- a/guix/scripts/challenge.scm
+++ b/guix/scripts/challenge.scm
@@ -537,8 +537,9 @@ Challenge the substitutes for PACKAGE... provided by one or 
more servers.\n"))
                         (current-terminal-columns (terminal-columns)))
            (let ((files (match files
-                           (filter (cut locally-built? store <>)
-                                   (live-paths store)))
+                           (warning
+                            (G_ "no arguments specified, nothing to do~%"))
+                           (exit 0))
              (set-build-options store

reply via email to

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