Previously, 'guix gc --delete-generations' would crash: the "" pattern
would be passed to 'matching-generations', which would return #f instead
of returning a list.
Reported by Raghav Gururajan <rvgn@disroot.org>
in <https://bugs.gnu.org/36466>.
* guix/ui.scm (matching-generations): Raise an error when passed an
invalid pattern.
* guix/scripts/gc.scm (delete-old-generations): Check if PATTERN is
true.
(%options): Leave ARG as-is for 'delete-generations'.
(guix-gc): Use 'assq' instead of 'assoc-ref' for 'delete-generations'.
* guix/scripts/package.scm (delete-matching-generations):
Replace (string-null? pattern) with (not pattern). Remove 'else'
clause.
(%options): Leave ARG as-is for 'delete-generations'.
* guix/scripts/pull.scm (%options): Leave ARG as-is for
'list-generations'.
(process-query): Replace (string-null? pattern) with (not pattern).
* guix/scripts/system.scm (list-generations): Likewise, and remove
'else' clause.
(process-command): Use #f instead of "" when no pattern is given.
* guix/ui.scm (display-search-results): New procedure.
* guix/scripts/package.scm (find-packages-by-description): Remove
'unzip2' call and return a list of pairs.
(process-query): Change to use 'display-search-results'.
* guix/scripts/system/search.scm (find-service-types): Remove 'unzip2'
call and return a list of pairs.
(guix-system-search): Use 'display-search-results'.
Fixes <https://bugs.gnu.org/35942>.
* guix/scripts/package.scm (display-search-paths): Rename to...
(display-search-path-hint): ... this. Adjust callers.
Remove #:kind parameter. Replace the list of environment variables with
an invitation to source $GUIX_PROFILE/etc/profile or run 'guix package
--search-paths'.
* guix/ui.scm (relevance): Allow the "field" procedure of a metric to
return a list, and handle that case appropriately. Update docstring.
(%package-metrics): Add a metric for package outputs.
* guix/scripts/package.scm (find-packages-by-description): Update
docstring.
* tests/guix-package.sh: Add a test case to verify that package outputs are
included in search results.
Co-authored-by: Tobias Geerinckx-Rice <me@tobias.gr>
Fixes a regression introduced in
0ea939fb79.
* guix/scripts/package.scm (process-query) <'list-available>: Change
#:superseded? to #:deprecated? since that's what
'fold-available-packages' passes.
* gnu/packages.scm (fold-available-packages): New procedure.
* guix/scripts/package.scm (process-query): Use it instead of
'fold-packages'.
* tests/packages.scm ("fold-available-packages with/without cache"):
New test.
* gnu/packages.scm (cache-is-authoritative?, load-package-cache)
(cache-lookup, generate-package-cache): New procedures.
(%package-cache-file): New variable.
(find-packages-by-name): Rename to...
(find-packages-by-name/direct): ... this.
(find-packages-by-name): Rewrite to use the package cache when
'cache-is-authoritative?' returns true.
* tests/packages.scm ("find-packages-by-name + version, with cache")
("find-packages-by-name with cache"): New tests.
* guix/channels.scm (package-cache-file): New procedure.
(%channel-profile-hooks): New variable.
(channel-instances->derivation): Use it in #:hooks.
* guix/scripts/package.scm (build-and-use-profile): Add #:hooks and
honor it.
* guix/scripts/pull.scm (build-and-install): Pass #:hooks to
UPDATE-PROFILE.
Fixes <https://bugs.gnu.org/31142>.
Reported by Chris Marusich <cmmarusich@gmail.com>.
* guix/scripts/package.scm (options->installable)[upgraded]: Use 'fold'
instead of 'fold-right'. This reverts
eca16a3d1d.
* tests/guix-package-net.sh: Add 'guix package u' test.
The previous '--verbosity' option was misleading and rarely what users
were looking for. The new option provides a consistent way to choose
whether or not to display the build log.
* guix/scripts/build.scm (show-build-options-help): Remove "--verbosity"
and add "--debug".
(set-build-options-from-command-line): Use the 'debug key of OPTS for
#:verbosity.
(%standard-build-options): Change "verbosity" to "debug". Use
'string->number*' instead of 'string->number'.
(%default-options): Change 'verbosity to 'debug and add a 'verbosity
key.
(show-help): Add '--verbosity'.
(%options): Likewise, and change '--quiet' to set the 'verbosity key of
RESULT.
(guix-build): Use 'with-status-verbosity' instead of parameterizing
CURRENT-BUILD-OUTPUT-PORT, honor the 'verbosity key of OPTS, and remove
'quiet?'.
* guix/scripts/environment.scm (show-help, %options): Add '--verbosity'.
(%default-options): Add 'debug'.
(guix-environment): Honor the 'verbosity key of OPTS.
* guix/scripts/pack.scm (%default-options): Add 'debug.
(%options, show-help): Add '--verbosity'.
(guix-pack): Honor the 'verbosity key of OPTS.
* guix/scripts/package.scm (%default-options): Add 'debug.
(show-help, %options): Add '--verbosity'. Mark '--verbose' as
deprecated and change it to set 'verbosity.
(guix-package): Honor the 'verbosity key of OPTS and remove 'verbose?'.
* guix/scripts/pull.scm (%default-options): Add 'debug.
(show-help, %options): Add '--verbosity'.
(guix-pull): Honor the 'verbosity key of OPTS.
* guix/scripts/system.scm (show-help, %options): Add '--verbosity'.
(%default-options): Add 'debug.
(guix-system): Honor the 'verbosity key of OPTS.
* guix/scripts/archive.scm (%default-options): Add 'debug,
'print-build-trace?, 'print-extended-build-trace?, and
'multiplexed-build-output?.
(show-help, %options): Add '--verbosity'.
(export-from-store): Remove call to 'set-build-options-from-command-line'.
(guix-archive): Wrap body in 'with-status-verbosity'. Add call to
'set-build-options-from-command-line.
* doc/guix.texi (Common Build Options): Document '--verbosity' and
'--debug'.
(Additional Build Options): Adjust description of '--quiet'.
Fixes <https://bugs.gnu.org/33323>.
Reported by swedebugia <swedebugia@riseup.net>.
* guix/scripts/package.scm (process-query): Call 'leave' when
'find-packages-by-name' returns the empty list.
* tests/guix-package.sh: Test it.
* guix/scripts.scm (%disk-space-warning): New variable.
(warn-about-disk-space): New procedure.
* guix/scripts/package.scm (build-and-use-profile): Use it.
* guix/scripts/system.scm (process-action): Likewise.
This allows for more accurate status tracking and parsing of extended
build traces.
* guix/status.scm (multiplexed-output-supported?): New procedure.
(print-build-event): Don't print \r when PRINT-LOG? is true.
Adjust 'build-log' handling for when 'multiplexed-output-supported?'
returns true.
(bytevector-index, split-lines): New procedures.
(build-event-output-port)[%build-output-pid, %build-output]
[%build-output-left]: New variables.
[process-line]: Handle "@ build-output" traces.
[process-build-output]: New procedure.
[write!]: Add case for when %BUILD-OUTPUT-PID is true. Use
'bytevector-index' rather than 'string-index'.
(compute-status): Add #:derivation-path->output-path. Use it.
* tests/status.scm ("compute-status, multiplexed build output"):
New test.
("build-output-port, UTF-8")
("current-build-output-port, UTF-8 + garbage"): Adjust to new
'build-log' output.
* guix/scripts/build.scm (set-build-options-from-command-line):
Pass #:multiplexed-build-output?.
(%default-options): Add 'multiplexed-build-output?'.
* guix/scripts/environment.scm (%default-options): Likewise.
* guix/scripts/pack.scm (%default-options): Likewise.
* guix/scripts/package.scm (%default-options): Likewise.
* guix/scripts/pull.scm (%default-options): Likewise.
* guix/scripts/system.scm (%default-options): Likewise.
Reported-by: Ludovic Courtès <ludo@gnu.org>.
* guix/scripts/build.scm (guix-build),
guix/scripts/package.scm (guix-package): Duplicate port before handing it to
build-output-port.
* guix/profiles.scm (package->manifest-entry): Add #:properties and
honor it.
* guix/scripts/package.scm (package-provenance)
(package->manifest-entry*): New procedures.
(transaction-upgrade-entry, options->installable): Use
'package->manifest-entry*' instead of 'package->manifest-entry'.
Reported by Roel Janssen <roel@gnu.org>
at <https://lists.gnu.org/archive/html/guix-devel/2018-07/msg00036.html>.
* guix/profiles.scm (switch-to-generation): Use (basename generation) as
the symlink target.
* guix/scripts/package.scm (build-and-use-profile): Likewise,
use (basename name) as the symlink target.
* tests/guix-package.sh: Adjust --roll-back test accordingly. Add
explicitly test with '-p foo/prof'.
Fixes <http://bugs.gnu.org/27157>.
Having a finite default `max-silent-time' value for scripts such as 'guix
environment' could lead to timeouts when building subtitutes; this was
undesirable.
This change also fixes client behavior to match the documentation, which
is that by default the daemon's settings are honored.
* guix/scripts/archive.scm (%default-options): Remove max-silent-time entry.
* guix/scripts/copy.scm (%default-options): Likewise.
* guix/scripts/environment.scm (%default-options): Likewise.
* guix/scripts/pack.scm (%default-options): Likewise.
* guix/scripts/package.scm (%default-options): Likewise.
* guix/scripts/pull.scm (%default-options): Likewise.
* guix/scripts/system.scm (%default-options): Likewise.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Fixes <https://bugs.gnu.org/27820>.
Reported by Hartmut Goebel <h.goebel@crazy-compilers.com>.
* guix/scripts/package.scm (%options) <"-u">: Emit a warning when ARG
starts with "-".
Fixes <https://bugs.gnu.org/25762>.
Reported by Ricardo Wurmus <rekado@elephly.net>.
* guix/scripts/package.scm (canonicalize-profile): Trim trailing slashes
from PROFILE.
Fixes <http://bugs.gnu.org/27262>.
Reported by Mark H Weaver <mhw@netris.org>.
* guix/scripts/package.scm (transaction-upgrade-entry): Check if ENTRY
matches 'manifest-transaction-removal-candidate?' and return TRANSACTION
if it does.
(process-actions): Move 'options->removable' from step 2 to step 1.
Fixes <http://bugs.gnu.org/27261>.
Reported by Mark H Weaver <mhw@netris.org>.
* guix/scripts/package.scm (transaction-upgrade-entry): Add call to
'warning' when NAME cannot be found in the package set.
* guix/scripts/package.scm (find-packages-by-description): Rewrite to
compute a score based on the number of regexps matched and the number of
matches for each regexp. Sort according to this score and return it as
a second value.
(process-query) <'search>: Capture the two return values of
'find-packages-by-description'. Pass #:extra-fields to
'package->recutils'.
* doc/guix.texi (Invoking guix package): Mention relevance, give an
example.
Fixes <http://bugs.gnu.org/27017>.
Reported by Alex Vong <alexvong1995@gmail.com>.
* guix/scripts/package.scm (process-query) <'list-generations>: Wrap
body in 'leave-on-EPIPE'.
Fixes <http://bugs.gnu.org/25852>.
Suggested by Mark H Weaver <mhw@netris.org>.
* guix/scripts.scm (%distro-age-warning): New variable.
(warn-about-old-distro): New procedure.
* guix/scripts/package.scm (process-actions): Call
'warn-about-old-distro'.
* guix/scripts/system.scm (process-action): Likewise.