This is a followup to b68d2db, which added a check for updaters at
macro-expansion time. The problem is that, when running 'guix pull',
Guile-JSON is found, so the PyPi updater (say) is added to %UPDATERS,
but then at run time Guile-JSON might be missing.
Reported by orbea on #guix.
* guix/scripts/refresh.scm (maybe-updater): Rewrite as 'syntax-rules'.
Produce code that checks conditions at run time.
(list-updaters): Update docstring.
This fixes a bug whereby some options, such as #:substitute-urls, would
be passed to the daemon too late to have an effect.
* guix/scripts/environment.scm (build-inputs): Remove call to
'set-build-options-from-command-line*'.
(guix-environment): Add call to 'set-build-options-from-command-line' as
early as possible.
* guix/scripts/lint.scm (patch-file-name): New procedure.
(check-vulnerabilities): Use it to filter out patched vulnerabilities.
* tests/lint.scm ("cve: one patched vulnerability"): New test.
Suggested by Hynek Urban <hynek.urban@gmail.com>.
* guix/scripts/substitute.scm (fetch-narinfos): Move body to...
[do-fetch]: ... here. New procedure.
Emit a warning when CACHE-INFO's prefix does not match.
* guix/import/cabal.scm (is-test): Allow spaces between keyword and
parentheses.
(is-id): Add argument 'port'. Allow spaces between keyword and column.
(lex-word): Adjust call to 'is-id'.
* guix/import/cabal.scm (is-true, is-false, lex-true, lex-false): New procedures.
(lex-word): Use them.
(make-cabal-parser): Add TRUE and FALSE tokens.
(eval): Add entries for 'true and 'false symbols.
As measured with:
time sh -c 'for i in `seq 1 10` ; do guix package --search-paths ; done'
On my machine, when running:
strace -o ,,s guix package --search-paths
the number returned by:
grep -E '^(open|l?stat).*\.go' ,,s | wc -l
drops from 1610 to 837.
* guix/scripts/package.scm: Remove two unnecessary #:use-module forms.
Autoload (gnu packages ...) modules.
Fixes <http://bugs.gnu.org/21991>.
Reported by Jan Synáček <jan.synacek@gmail.com>.
* guix/scripts/download.scm (guix-download): Call 'leave' when OPTS does
not contain an 'argument' key.
* guix/ftp-client.scm (ftp-open): Change to use 'match' instead of
car/cdr, and fix off-by-one (was '(null? addresses)' instead of
'(null? (cdr addresses))'.)
Fixes <http://bugs.gnu.org/21958>.
* guix/scripts/environment.scm (status->exit-code): New procedure.
(exit/status, primitive-exit/status): Use it.
* tests/guix-environment-container.sh: Add test.
Fixes <http://bugs.gnu.org/21925>.
Regression introduced in 279ec1d.
Reported by Chris Marusich <cmmarusich@gmail.com>.
* guix/ftp-client.scm (ftp-open): Restrict sockets to
SOCK_STREAM/IPPROTO_IP.
* guix/build/graft.scm (rewrite-directory)[rewrite-leaf]: Change to take
a single parameter. Add call to 'lstat'. Factorize result of
'destination'.
Use 'find-files' instead of 'file-system-fold'.
* guix/scripts/lint.scm (probe-uri): Add #:timeout parameter. Pass it
to 'open-connection-for-uri' and 'ftp-open'.
(validate-uri): Pass #:timeout 3 to 'probe-uri'.
* guix/build/download.scm (open-socket-for-uri): Always pass
AI_ADDRCONFIG to 'getaddrinfo' as recommended in the fine Guile
manual.
* guix/ftp-client.scm (ftp-open): Ditto.
* guix/build/download.scm (ensure-uri): New procedure.
(current-http-proxy): New variable.
(open-socket-for-uri): Copy from Guile commit aaea5b2, but add #:timeout
parameter and use 'connect*' instead of 'connect'.
(open-connection-for-uri): Add #:timeout parameter and pass it to
'open-socket-for-uri'.
* guix/ftp-client.scm (catch-EINPROGRESS): New macro.
(connect*): New procedure.
(ftp-open): Add #:timeout parameter. Use 'connect*' instead of
'connect' and pass it TIMEOUT.
Fixes <http://bugs.gnu.org/21817>.
Reported by Petter Berntsen <petter@mykolab.ch>.
* guix/scripts/gc.scm (guix-gc)[assert-no-extra-arguments]: New
procedure.
Use it for actions 'collect-garbage', 'optimize', and 'verify'.
* tests/guix-gc.sh: Add tests.
Partly fixes <http://bugs.gnu.org/20255>.
* guix/scripts/package.scm (search-path-environment-variables): Change
'profile' to 'profiles'; expect it to be a list.
(display-search-paths): Likewise.
(%default-options): Remove 'profile' entry.
(%options) <--profile>: Keep previous values associated with 'profile'
in RESULT.
(guix-package)[process-actions, process-query]: Handle the possible
lack of 'profile' pair in OPTS.
Reported by Sleep_Walker and Mathieu Lirzin <mthl@gnu.org>.
* guix/scripts/refresh.scm (maybe-updater, list-updaters): New macros.
(%updaters): Use 'list-updaters' instead of 'list'. Make
%PYPI-UPDATER conditional.
Reported by Paul van der Walt <paul@denknerd.org>
in <http://bugs.gnu.org/21829>.
* guix/scripts/import/hackage.scm (guix-import-hackage): Add missing
argument in call to 'leave'.
* guix/scripts/container/exec.scm (partition-args): Reimplement such
that all args up to and including the PID are returned as the first of
the two values.
This is a followup to 0a7c5a0.
* guix/import/gnu.scm (preferred-archive-type): Use
'upstream-source-archive-types' instead of 'gnu-release-archive-types'.
(gnu-package->sexp): Use 'upstream-source-urls' et al. Update call to
'download-tarball'.
(gnu->guix-package): Use <upstream-source> instead of <gnu-release>.
* guix/upstream.scm (upstream-source-archive-types): Export.
Fixes <http://bugs.gnu.org/21068>.
Reported by Germano Gabbianelli <tyrion.mx@gmail.com>
and Mark H Weaver <mhw@netris.org>.
* guix/scripts/system.scm (perform-action): Always add GRUB.CFG to DRVS
for 'init' and 'reconfigure'.
Co-authored-by: Mark H Weaver <mhw@netris.org>
* gnu/services.scm (system-derivation): New procedure.
(system-service-type): New variable.
(boot-script-entry): New procedure.
(boot-service-type): Extend SYSTEM-SERVICE-TYPE.
(etc-entry): New procedure.
(etc-service-type): Extend SYSTEM-SERVICE-TYPE.
(fold-services): Change default #:target-type to SYSTEM-SERVICE-TYPE.
* gnu/system.scm (operating-system-directory-base-entries): New procedure.
(essential-services): Use it. Add an instance of
SYSTEM-SERVICE-TYPE.
(operating-system-boot-script): Pass #:target-type to 'fold-services'.
(operating-system-derivation): Rewrite in terms of 'fold-services'.
* gnu/system/linux-container.scm (system-container): Remove.
(container-script): Use 'operating-system-derivation'.
* guix/scripts/system.scm (export-extension-graph): Replace
BOOT-SERVICE-TYPE by SYSTEM-SERVICE-TYPE.
* doc/images/service-graph.dot: Add 'system' node and edges.
* doc/guix.texi (Service Composition): Mention SYSTEM-SERVICE-TYPE.
(Service Reference): Document it. Update 'fold-services'
documentation.
* guix/scripts/environment.scm (%default-options): Remove 'exec'
association.
(guix-environment): If the user didn't specify a command, use the
default shell, or use /bin/sh when a container is requested.
Benefits include: 'guix environment' more useful for ghc libraries, more
useful 'guix package --search-paths' for installed ghc libraries, cleaner
package recipes: no longer need to propagate runtime package dependencies.
* guix/build/haskell-build-system.scm (configure): Unset GHC_PACKAGE_PATH
around cabal configure.
(make-ghc-package-database): Use pattern directory search.
(register): Install complete package database for the current package.
* gnu/packages/haskell.scm (ghc): Add native-search-paths field.
This patch changes the --ad-hoc flag to be positional. That is, the
packages that appear before --ad-hoc are interpreted as packages whose
inputs should be in the environment; the packages that appear after are
interpreted as packages to be directly added to the environment.
* guix/scripts/environment.scm (tag-package-arg, compact): New
procedures.
(%options): Tweak the handlers for --load and --expression options.
(options/resolve-packages): Preserve package mode tag.
(parse-args): Tweak argument handler to use package tagging procedure.
(guix-environment): Apply ad-hoc behavior on a per package basis.
* tests/guix-environment.sh: Add test.
* doc/guix.texi ("invoking guix environment"): Document new behavior of
--ad-hoc.
Fixes <http://bugs.gnu.org/21773>.
Reported by Jan Synáček <jan.synacek@gmail.com>.
* guix/ui.scm (make-regexp*): New procedure.
* guix/scripts/package.scm (options->installable, guix-package): Use it
when processing user-provided regexps.
Partly fixes <http://bugs.gnu.org/20217>.
* guix/store.scm (set-build-options): Change #:substitute-urls to
default to #f. Send the 'substitute-urls' pair only if
SUBSTITUTE-URLS is true.
* guix/scripts/build.scm (set-build-options-from-command-line): Do not
default to %DEFAULT-SUBSTITUTE-URLS for #:substitute-urls.
* guix/scripts/size.scm (%default-options): Remove 'substitute-urls'.
* guix/scripts/substitute.scm (lookup-narinfos/diverse): New procedure.
(lookup-narinfo): Use it.
(process-query): Change #:cache-url to #:cache-urls.
[valid?]: Remove 'narinfo?' check, which is no longer necessary.
Use 'lookup-narinfos/diverse' instead of 'lookup-narinfos'.
(process-substitution): Change #:cache-url to #:cache-urls.
(%cache-url): Rename to...
(%cache-urls): ... this. Turn into a list.
(guix-substitute): Remove 'getaddrinfo' test with early exit. Adjust
calls to 'process-query' and 'process-substitution'.
* tests/substitute.scm: Change '%cache-url' to '%cache-urls'.
* guix/scripts/substitute.scm (lookup-narinfos): Filter out #f values
from CACHED, such that the end result is exactly a list of narinfos,
not interspersed with #f.
* guix/scripts/challenge.scm (discrepancies): Assume REMOTE is a list of
narinfos.
* guix/scripts/package.scm (delete-generations): Use
'delete-generation*' instead of 'delete-generation'.
(guix-package)[process-actions]: Use 'roll-back*' instead of
'roll-back' and 'switch-to-generation*' instead of
'switch-to-generation'.
(link-to-empty-profile, switch-to-generation,
switch-to-previous-generation, roll-back, delete-generation): Move
to...
* guix/profiles.scm: ... here. Adjust to not print messages and to
return values that can be used by user interfaces.
* guix/ui.scm (display-generation-change, roll-back*,
switch-to-generation*, delete-generation*): New procedures.
* guix/scripts/system.scm (<boot-parameters>): New record type.
(read-boot-parameters): New procedure.
(previous-grub-entries)[system->grub-entry]: Use it.
* guix/scripts/package.scm (guix-package)[process-query](list-generations):
Move part of the body to 'delete-generation' and
'display-profile-content'.
* guix/ui.scm (display-generation, display-profile-content): New
procedures.
For Cabal packages with "build-type: Configure", a configure shell
script is run to set up build parameters. These scripts need the
CONFIG_SHELL environment variable to be set to function properly.
* guix/build/haskell-build-system.scm (configure): Set CONFIG_SHELL if
necessary.
* guix/scripts/system.scm (specification->file-system-mapping): Move from
here...
* guix/ui.scm (specification->file-system-mapping): ... to here.
* guix/scripts/enviroment.scm (show-help): Show help for new options.
(%options): Add --container --network, --expose, and --share options.
(%network-configuration-files): New variable.
(launch-environment, launch-environment/container, requisites*,
inputs->requisites): New procedures.
(guix-environment): Spawn new process in a container when requested.
* doc/guix.texi (Invoking guix environment): Document it.
* tests/guix-environment-container.sh: New file.
* Makefile.am (SH_TESTS): Add it.
Update ghc-standard-libraries to match the output of `ghc-pkg list` when
using GHC 7.10.2.
* guix/import/hackage.scm (ghc-standard-libraries): Sort and update list
of core GHC libraries.
* guix/scripts/refresh.scm (%options, show-help): Add --type.
(lookup-updater): New procedure.
(update-package): Add 'updaters' parameter and honor it.
(guix-refresh)[options->updaters]: New procedure.
Use it, and honor --type.
* guix/import/elpa.scm (elpa-fetch-archive): Set %HTTP-CACHE-TTL to 6
hours.
(call-with-downloaded-file): Use 'http-fetch/cached' instead of
'url-fetch'.
* guix/gnu-maintenance.scm (<gnu-release>): Remove.
(coalesce-releases): Move to upstream.scm. Rename to
'coalesce-sources'; adjust callers.
(releases, latest-release): Return <upstream-source> objects instead
of <gnu-release> objects.
(latest-release*, non-emacs-gnu-package?): New procedures.
(gnu-release-archive-types): Remove.
(%gnu-updater): New variable.
(package-update-path, download-tarball, package-update,
update-package-source): Move to...
* guix/upstream.scm: ... here. New file.
* Makefile.am (MODULES): Add it.
* po/guix/POTFILES.in: Replace gnu-maintenance.scm with upstream.scm.
* guix/scripts/refresh.scm (%updaters): New variable.
(update-package): Adjust to new 'package-update' interface.
(guix-refresh): Adjust to new 'package-update-path'. Remove
'false-if-exception' around it.
* guix/scripts/archive.scm (show-help, %options): Add --extract.
(guix-archive): Honor it.
* tests/guix-archive.sh: Test it.
* doc/guix.texi (Invoking guix archive): Document it.
This speeds up operations like 'guix lint -c gnu-description'.
* guix/gnu-maintenance.scm (official-gnu-packages): Add 'fetch'
parameter and honor it. Default to 'http-fetch/cached'.
Fixes <http://bugs.gnu.org/21694>.
* guix/build/syscalls.scm (clone): Change 'syscall' parameter types to
LONG, UNSIGNED-LONG, or '*; make sure it has 6 parameters. Adjust
caller accordingly.
Fixes <http://bugs.gnu.org/21675>.
Reported by Cyril Roelandt <tipecaml@gmail.com>.
Before this change, the command:
guix build python2-oslo.utils -n --no-substitutes
would take 17.5s. After, it is down to 2.9s.
Likewise, the command:
guix graph python2-bandit | grep python2-setuptools.*Helve| wc -l
would return 412 nodes before, all functionally equivalent, and returns
a single one now.
* guix/build-system/python.scm (package-with-explicit-python): Remove
'p' parameter. Change to return a one-argument memoizing procedure.
(package-with-python2): Adjust accordingly.
Suggested by Ludovic Courtès <ludo@gnu.org>.
* guix/scripts.scm (build-package-source): New procedure.
* emacs/guix-devel.el (guix-devel-build-package-source): New command.
(guix-devel-keys-map): Add key binding for it.
* doc/emacs.texi (Emacs Development): Document it.
* guix/scripts/system.scm (perform-action): Add #:derivations-only?
parameter and honor it.
(show-help, %options): Add '--derivation'.
(guix-system): Pass #:derivations-only? to 'perform-action'.
* tests/guix-system.sh: Test it.
* doc/guix.texi (Invoking guix system): Document it.
* guix/gexp.scm (<scheme-file>): New record type.
(scheme-file, scheme-file-compiler): New procedures.
* tests/gexp.scm ("scheme-file"): New test.
* doc/guix.texi (G-Expressions): Document 'scheme-file'.
* guix/gexp.scm (<program-file>): New record type.
(program-file, program-file-compiler): New procedures.
* tests/gexp.scm ("program-file"): New test.
* doc/guix.texi (G-Expressions): Document it.
This allows for direct program invokation without needing a shell to act
as a command interpreter.
* guix/scripts/environment.scm (%default-shell): New variable.
(show-help): Adjust description. Remove '--exec' reference.
(%default-options): Use '%default-shell'.
(%options): Adjust '--exec' to run command via the default shell.
(parse-args): New procedure.
(guix-environment): Use 'parse-args'. Use 'system*' instead of
'system'.
* tests/guix-environment.sh: Add test for '--' command invokation.
* doc/guix.texi ("Invoking guix environment"): Use new syntax. Remove
'--exec' documentation.
A client closing the connection while reading from a /nar URL would
leave an open file descriptor in the server. This patch fixes it.
* guix/scripts/publish.scm (swallow-EPIPE): New macro.
(http-write): Use it around 'write-file' call.
* gnu/packages/base.scm (glibc)[native-search-paths]: Add
'lib/locale/VERSION' for 'GUIX_LOCPATH'.
(glibc-locales, glibc-utf8-locales): Write to a VERSION
sub-directory.
* guix/profiles.scm (ca-certificate-bundle): Adjust LOCPATH value
accordingly.
Suggested by Mark H Weaver <mhw@netris.org>.
* guix/store.scm (query-failed-paths, clear-failed-paths): New
procedures.
* tests/guix-daemon.sh: Add test with daemon started with
--cache-failures.
Fixes a regression introduced in 5d8d8f3.
* guix/scripts/lint.scm (check-description-style): When no exception is
thrown in 'check-texinfo-markup', return the rendered description.
* guix/scripts/lint.scm (check-description-style): Set 'field' parameter
when emitting a warning in 'check-texinfo-markup'. Catch any error
that may occur in during the 'texi->plain-text' conversion. This is a
followup to commit 2748ee3.
Fixes <http://bugs.gnu.org/21536>.
Reported by Alex Kost <alezost@gmail.com>.
* guix/ui.scm (texi->plain-text): Wrap body in 'with-fluids'.
* tests/ui.scm ("package-description-string vs. Unicode"): New test.
Fixes a regression introduced in a8be7b9a.
* guix/build/download.scm (store-path-abbreviation): Return STORE-PATH
if it's not an actual store path. Fixes an out-of-range exception
when running tests/substitute.scm and tests/store.scm.
* guix/build/download.scm
(string-pad-middle): Allow resulting padded string to overflow.
(store-url-abbreviation): Remove unnecessary procedure.
(progress-proc): Use BASENAME as default for parameter 'abbreviation'.
(url-fetch): Display extra newlines for readability.
Fixes a regression introduced in b7c7c03eb5.
* guix/build/emacs-build-system.scm (package-name-version->elpa-name-version):
Remove unused 'name' binding. Do not abuse 'strip-store-file-name' to
remove the "emacs-" prefix, which worked before b7c7c03eb5 but not after.