* guix/scripts/publish.scm (show-help): Add --user.
(%options): Likewise.
(run-publish-server): Change 'port' parameter to 'socket'. Pass
#:socket instead of #:addr and #:port to 'run-server'. Update caller
accordingly.
(open-server-socket, gather-user-privileges): New procedures.
(guix-publish): Use them. Force %PRIVATE-KEY and %PUBLIC-KEY early
on. Warn when running as root.
* doc/guix.texi (Invoking guix publish): Document --user.
Reported by 宋文武 <iyzsong@gmail.com>.
* guix/build/profiles.scm (build-etc/profile,
ensure-writable-directory): New procedures.
(build-profile): Use them.
* tests/profiles.scm ("etc/profile when etc/ already exists"): New test.
* guix/build/profiles.scm: New file.
* Makefile.am (MODULES): Add it.
* guix/profiles.scm (profile-derivation)[builder]: Call out to
'build-profile'.
Add (guix build profiles) to the #:modules argument.
Previously, code using directly (guix build download) was still affected
by <http://bugs.gnu.org/15368>. This includes source derivations, the
'guix download' command, and (guix gnu-maintenance).
'guix substitute' was unaffected since it used (guix http-client), which
already had the fix.
* guix/http-client.scm (open-socket-for-uri): Remove.
(http-fetch): Remove #:buffered? argument to 'open-socket-for-uri';
use 'setvbuf' instead.
* guix/scripts/substitute.scm (fetch): Likewise.
* guix/build/download.scm (open-socket-for-uri): New procedure, taken
from guix/http-client.scm, but without the #:buffered? parameter.
* guix/search-paths.scm (search-path-definition): New procedure.
* guix/scripts/environment.scm (for-each-search-path): Rename to...
(evaluate-input-search-paths): ... this. Remove 'proc' and 'pure?'
parameters, and return directly the list of search-path/value pairs.
(create-environment): Use 'for-each' and 'evaluate-input-search-paths'
instead of 'for-each-search-path'.
(show-search-paths): Use 'for-each', 'search-path-definition', and
'evaluate-search-paths' instead of 'for-each-search-path'.
This allows 'guix environment' to correctly handle non-directory
and/or pattern search-path specifications, such as that for
'XML_CATALOG_FILES'.
* guix/scripts/environment.scm (for-each-search-path): Use
'evaluate-search-paths' instead of 'search-path-as-list' & co.
* guix/scripts/package.scm (evaluate-search-paths): New procedure, with
most of the code formerly in 'search-path-environment-variables'.
(search-path-environment-variables): Use it.
* guix/scripts/package.scm (user-friendly-profile): New procedure.
(search-path-environment-variables): Remove 'profile' local variable.
(display-search-paths): Explicitly call 'user-friendly-profile' for
the argument to 'search-path-environment-variables'.
(guix-package)[process-query]: Likewise.
Discussed in <http://bugs.gnu.org/20255>.
* guix/packages.scm (sexp->search-path-specification): New variable.
* guix/profiles.scm (<manifest-entry>)[search-paths]: New field.
(package->manifest-entry): Initialize it.
(manifest->gexp): Match it. Wrap #$deps in (propagated-inputs ...).
Emit (search-paths ...). Increment version.
(find-package): New procedure.
(sexp->manifest)[infer-search-paths]: New procedure.
Use it to initialize the 'search-paths' field for versions 0 and 1.
Add case for version 2.
* guix/scripts/package.scm (search-path-environment-variables)[manifest-entry->package]:
Remove.
Use 'manifest-entry-search-paths' instead of 'manifest-entry->package'
plus 'package-native-search-paths'.
* tests/profiles.scm ("profile-manifest, search-paths"): New test.
* guix/serialization.scm (read-maybe-utf8-string): Use
'set-port-encoding!' and 'set-port-conversion-strategy!' instead of
setting '%default-port-encoding' and
'%default-port-conversion-strategy'. This accounts for Guile commit
d574d96, which changes bytevector input ports to use ISO-8859-1.
In practice we would not leak much since we reconnect after ~100
requests (with nginx running on hydra.gnu.org.)
* guix/scripts/substitute.scm (http-multiple-get): Call 'close-port'
before 'connect'.
Partly fixes <http://bugs.gnu.org/20402>.
Reported by Joshua Randall <jcrandall@alum.mit.edu>.
* guix/build/download.scm (open-connection-for-uri): Rewrite to be a
small wrapper around 'open-socket-for-uri'. This procedure was
initially introduced in d14ecda to work around the lack of NSS modules
during bootstrap but that has become unnecessary since 0621349, which
introduced a bootstrap Guile that uses static NSS modules (from commit
d3b5972.)
On Guile >= 2.0.10, this allows the 'http_proxy' environment variable
to be used.
* guix/build-system/cmake.scm (cmake-build): Add #:validate-runpath?
parameter and pass it to BUILDER.
* guix/build-system/glib-or-gtk.scm (glib-or-gtk-build): Likewise.
Fixes <http://bugs.gnu.org/20081>.
Reported by Tomáš Čech <tcech@suse.cz>.
* guix/build/gnu-build-system.scm (patch-source-shebangs): Remove files
that don't pass 'file-exists?'.
(patch-generated-file-shebangs): Likewise.
* guix/build/gremlin.scm (expand-variable, expand-origin): New
procedures.
(validate-needed-in-runpath): Map 'expand-origin' to the RUNPATH field
of DYNINFO.
* tests/gremlin.scm ("expand-origin"): New test.
* guix/packages.scm (supported-package?): New procedure.
* tests/packages.scm ("supported-package?"): New test.
* build-aux/hydra/gnu-system.scm (package->job): Use it instead of
'package-transitive-supported-systems'.
* guix/scripts/refresh.scm (guix-refresh): Use 'specification->package'
instead of 'find-packages-by-name'. This allows users to specify
things like "qt-4.8.6".
* doc/guix.texi (Invoking guix refresh): Add an example.
Fixes a regression whereby haskell-build-system was using an incomplete
module list.
* guix/build-system/haskell.scm (%haskell-build-system-modules): New
variable.
(haskell-build): Use it as the default value of #:imported-modules.
* guix/scripts/package.scm (%options): Add the '--do-not-upgrade' option.
(show-help): Document it.
(options->installable): Add 'do-not-upgrade-regexps' variable.
Use it in 'packages-to-upgrade'.
* doc/guix.texi (Invoking guix package): Document the '--do-not-upgrade'
option.
Reported by Federico Beffa.
* guix/packages.scm (package-transitive-supported-systems): Use
bag-direct-inputs + package->bag rather than package-direct-inputs.
* tests/packages.scm ("package-transitive-supported-systems"): Add
explicit 'build-system' field to each 'dummy-package' form.
("package-transitive-supported-systems, implicit inputs"): New test.
Reported by Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>.
* guix/http-client.scm (make-delimited-input-port): New procedure.
Install it in (web response) for Guile <= 2.0.9.
* guix/profiles.scm (ghc-package-cache-file): New procedure.
(profile-derivation): Add 'ghc-package-cache?' keyword argument. If true
(the default), add the result of 'ghc-package-cache-file' to 'inputs'.
* guix/scripts/package.scm (guix-package)[process-actions]: Pass
#:ghc-package-cache? to 'profile-generation'.
* tests/packages.scm ("--search-paths with pattern"): Likewise.
* tests/profiles.scm ("profile-derivation"): Likewise.
* guix/build/haskell-build-system.scm (%standard-phases): move 'haddock phase
before 'install phase.
* guix/build/haskell-build-system.scm (haddock): Simplify it as the 'install
phase takes care of copying files.
* guix/build/haskell-build-system.scm (configure): Add '--libsubdir' flag.
Fix use of '--extra-include-dirs' and '--extra-lib-dirs' flags. Use 'doc',
'bin' and 'lib' outputs if they are defined.
* guix/build/haskell-build-system.scm (make-ghc-package-database, register):
Aligh location of 'package.conf.d' directory with '--libsubdir' flag.
* guix/ui.scm (warn-about-load-error): New procedure.
* gnu/packages.scm (package-modules): Wrap 'resolve-interface' call in
'catch #t', and call 'warn-about-load-error' in handler.
* guix/scripts/system.scm (read-operating-system): Replace error
handling code by a call to 'report-load-error'.
* guix/ui.scm (report-load-error): New procedure.
Fixes <http://bugs.gnu.org/20081>.
Reported by Tomáš Čech <sleep_walker@suse.cz>.
* guix/build/utils.scm (find-files): Add #:stat parameter. Pass it as
last argument to 'file-system-fold'.
* guix/scripts/package.scm (delete-matching-generations): Remove call to
'exit' when PATTERN is "0". Call 'leave' instead of 'exit'
when (null-list? number).
Fixes <http://bugs.gnu.org/19978>.
Reported by taylanbayirli@gmail.com (Taylan Ulrich Bayırlı/Kammer).
* guix/scripts/package.scm (delete-matching-generations): Warn when
CURRENT is in NUMBERS, and always remove it before calling
'delete-generations'.
* tests/guix-package.sh: Add --switch-generation=2 invocation before
--delete-generations=3 invocation.
Add --delete-generations=1.. test case.
* guix/scripts/package.scm (delete-matching-generations): New procedure,
with code formerly found...
(guix-package)[process-actions]: ... here. Use it.
Remove 'current-generation-number'.
* guix/build/gremlin.scm (validate-needed-in-runpath)[runpath]:
Add (filter absolute-file-name? ...).
Emit a warning when RUNPATH file names that do not match
'store-file-name?'. Change format of error message to begin with file
name.
* guix/build/utils.scm (store-file-name?): New procedure.
* guix/store.scm (<path-info>): New record type.
(read-path-info): New procedure.
(read-arg): Add 'path-info' syntax.
(query-path-info): New variable.
* tests/store.scm ("query-path-info"): New test.
* guix/build/glib-or-gtk-build-system.scm (wrap-all-programs): Also
wrap binaries in libexec/, such as those launched by dbus services.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* guix/build-system/gnu.scm (%default-modules): Rename to...
(%gnu-build-system-modules): ... this.
(%default-modules): New variable.
(dist-package, gnu-build): Use %GNU-BUILD-SYSTEM-MODULES for
#:imported-modules.
(gnu-cross-build): Likewise, and use %DEFAULT-MODULES for #:modules.
* guix/build-system/cmake.scm (%cmake-build-system-modules): New
variable.
(cmake-build): Use it for #:imported-modules.
* guix/build-system/glib-or-gtk.scm (%default-imported-modules): Rename
to...
(%glib-or-gtk-build-system-modules): ... this. Refer to
%GNU-BUILD-SYSTEM-MODULES. Adjust uses.
* guix/build-system/perl.scm (%perl-build-system-modules): New
variable.
(perl-build): Use it for #:imported-modules.
* guix/build-system/python.scm (%python-build-system-modules): New
variable.
(python-build): Use it for #:imported-modules.
* guix/build-system/ruby.scm (%ruby-build-system-modules): New variable.
(ruby-build): Use it for #:imported-modules.
* guix/build-system/waf.scm (%waf-build-system-modules): New variable.
(waf-build): Use it for #:imported-modules.
* guix/build/gremlin.scm (&elf-error, &invalid-segment-size): New error
condition types.
(dynamic-link-segment): Compare SEGMENT's offset + size to ELF's total
size.
(validate-needed-in-runpath): Wrap body in 'guard' form.
* guix/build/utils.scm (file-name-predicate): New procedure.
(find-files): Rename second parameter to 'pred'. When 'pred' is not a
procedure, call 'file-name-predicate'. Use PRED instead of
'regexp-exec' in the leaf procedure.
* guix/gexp.scm (<local-file>): New record type.
(local-file): New procedure.
(local-file-compiler): New compiler.
(gexp->sexp) <struct? thing>: Handle the case where 'lower' returns a
file name.
(text-file*): Update docstring.local-file doc
* tests/gexp.scm ("one local file", "gexp->derivation, local-file"): New
tests.
* doc/guix.texi (G-Expressions): Mention local files early. Document
'local-file'. Update 'text-file*' documentation.
Before that, "guix build qt", when only qt itself is missing, would lead
'substitution-oracle' to call 'substitutable-paths' with 318 items.
Now, this is down to 6 items, because it doesn't ask about prerequisites
that are already valid.
* guix/derivations.scm (substitution-oracle)[valid-input?,
dependencies]: New procedures.
Use 'dependencies' and remove call to 'remove'.
* guix/derivations.scm (valid-derivation-input?): New procedure.
(derivation-prerequisites): Add 'cut?' parameter and honor it.
* tests/derivations.scm ("derivation-prerequisites and
derivation-input-is-valid?"): New test.
Fixes <http://bugs.gnu.org/20188>.
Reported by Mark H Weaver <mhw@netris.org>.
* guix/derivations.scm (substitution-oracle): Add 'valid?' procedure.
Remove 'valid?' items from PATHS.
Fixes <http://bugs.gnu.org/20163>.
Reported by Mark H Weaver <mhw@netris.org>.
* guix/store.scm (%default-substitute-urls): New variable.
(set-build-options): Change default value of #:substitute-urls to
%DEFAULT-SUBSTITUTE-URLS.
* guix/gexp.scm (gexp-inputs): Remove 'references' parameter; add
#:native? and honor it.
[add-reference-inputs]: Distinguish between native gexp inputs, and
non-native gexp inputs. Honor 'native?' field of list inputs.
* tests/gexp.scm ("ungexp + ungexp-native, nested"): New test.
Before that, the 'references' and 'natives' or the outer gexp in an
expression like #~#+#~#$coreutils would include those of the inner
gexp.
* guix/gexp.scm (gexp)[collect-escapes]: Ignore everything below
'ungexp-native' or 'ungexp-native-splicing'.
[collect-native-escapes]: Ignore everything below 'ungexp' or
'ungexp-splicing'.
Fixes build issues whereby #:inputs would be #f. See
<http://hydra.gnu.org/build/320333/nixlog/4/tail-reload>.
* guix/packages.scm (patch-and-repack): #:input defaults to #f.
[lookup-input]: When INPUTS is #f, use (%standard-patch-inputs).
* gnu/packages/commencement.scm (glibc-utf8-locales-final): Make public.
* guix/packages.scm (%standard-patch-inputs): Use
GLIBC-UTF8-LOCALES-FINAL instead of GLIBC-UTF8-LOCALES.
Before that it would sort them by name only, so the order in which two
packages with the same name but a different version would appear was
non-deterministic.
Reported by Tomáš Čech <sleep_walker@gnu.org>.
* guix/scripts/package.scm (find-packages-by-description)[version<?]:
New variable.
Change the 2nd argument to 'sort' to use 'string-compare' and resort
to 'version<?' when P1 and P2 have the same name.
Before that, 'guix package -s foobarbaz' would display only one package
when several match but they have the same location (which is common when
using 'inherit'.)
The original rationale was given at
<http://lists.gnu.org/archive/html/bug-guix/2013-01/msg00280.html> but
it was arguably misguided because it led to "real" packages being
hidden.
Reported by Tomáš Čech <sleep_walker@gnu.org>.
* guix/scripts/package.scm (find-packages-by-description)[same-location?]:
Remove.
Remove call to 'delete-duplicates'.
* guix/packages.scm (patch-and-repack): Remove 'store' parameter and
change default value of #:inputs to (%standard-patch-inputs).
[lookup-input, instantiate-patch]: New procedures.
[patch-inputs]: Remove.
[builder]: Rename to...
[build]: ... this. Use gexps instead of sexps.
(patch-and-repack*): Remove.
(origin->derivation): Use 'patch-and-repack' instead of
'patch-and-repack*'.
* tests/packages.scm ("package-source-derivation,
snippet")[source](snippet): Remove references to '%build-inputs' and
'%outputs'.
* guix/store.scm (set-build-options): Rename #:binary-caches to
#:substitute-urls. Actually pass it in 'pairs' under the
"substitute-urls" key.
* guix/scripts/substitute-binary.scm (%cache-url): Add comment for
"untrusted-substitute-urls".
From now own, (guix packages) depends on (guix gexps); it was the other
way around now. This means that (guix packages) code can use gexps.
* guix/gexp.scm (origin-compiler, package-compiler): Remove.
(default-guile-derivation): New procedure.
(gexp->derivation): Use it instead of 'default-guile' +
'package->derivation'.
* guix/packages.scm (default-guile-derivation): New procedure.
(package-compiler, origin-compiler): New variables.
* doc/guix.texi (G-Expressions): Mention extensibility.
* guix/gexp.scm (<gexp-compiler>): New record type.
(%gexp-compilers): New variable.
(register-compiler!, lookup-compiler): New procedures.
(define-gexp-compiler): New macro.
(origin-compiler, package-compiler): New compilers.
(lower-inputs): Remove clauses for 'origin?' and 'package?'. Add
clause with 'lookup-compiler' instead.
(lower-references): Likewise.
(gexp-inputs)[add-reference-inputs]: Likewise.
(gexp->sexp)[reference->sexp]: Likewise.
* guix/gexp.scm (gexp-inputs)[add-reference-inputs]: Remove clause for
inputs of the form (PACKAGE OUTPUT).
(gexp->sexp)[reference->sexp]: Likewise.
* tests/gexp.scm ("input list splicing"): Change 'list' to 'gexp-input'
for glibc:debug.
("text-file*"): Likewise for %bootstrap-guile:out.
("input list splicing + gexp-input + ungexp-native-splicing"): Remove,
now redundant.
* guix/profiles.scm (package->manifest-entry): Use 'gexp-input' instead
of two-element lists to denote specific package outputs.
(manifest-inputs): Likewise.
(profile-derivation)[info-dir]: Likewise.
* guix/gexp.scm (<gexp-input>)[gexp-input]: Rename to...
[%gexp-input]: ... this. Adjust callers accordingly.
(gexp-input): New procedure.
(gexp-inputs)[add-reference-inputs]: When the input is a list, check
whether each item is already 'gexp-input?' and to not rewrap those.
(gexp-outputs)[add-reference-output]: Likewise.
(gexp->sexp): Likewise.
* tests/gexp.scm ("input list splicing + gexp-input +
ungexp-native-splicing"): New test.
* guix/gexp.scm (<gexp-input>): New record type.
(gexp-inputs)[add-reference-inputs]: Adjust clauses to expect
<gexp-input> objects.
(gexp-outputs)[add-reference-output]: Likewise.
(gexp->sexp)[reference->sexp]: Likewise.
(canonicalize-reference): Remove.
(gexp)[escape->ref]: Use 'gexp-input' for all the references.
Remove use of 'canonicalize-reference'.
CMAKE_LIBRARY_PATH and CMAKE_INCLUDE_PATH from the cmake build system.
* gnu/packages/cmake.scm (cmake)[native-search-paths]: New field.
* guix/build/cmake-build-system.scm (configure): Drop environment variables
CMAKE_LIBRARY_PATH and CMAKE_INCLUDE_PATH.
This fixes a bug whereby uses of 'package-with-python2' at the top-level
in modules other than (gnu packages python) could lead to an "Unbound
variable: python2" error due to the circular references.
Reported by Tomáš Čech.
* guix/build-system/python.scm (package-with-explicit-python)[arguments]:
Check whether PYTHON is a promise, and force it if it is.
(package-with-python2): Wrap 'default-python2' call in 'delay'.
* guix/serialization.scm (read-maybe-utf8-string): New procedure.
* guix/store.scm (process-stderr): Use it for the build log and errors.
* tests/store.scm ("current-build-output-port, UTF-8",
"current-build-output-port, UTF-8 + garbage"): New tests.
This fixes a regression introduced in commit 536c3ee.
* guix/profiles.scm (ca-certificate-bundle): When MANIFEST is empty,
make a trivial derivation.
* guix/scripts/package.scm (guix-package)[process-actions]: Pass
#:ca-certificate-bundle? to 'profile-generation'.
* tests/packages.scm ("--search-paths with pattern"): Likewise.
* tests/profiles.scm ("profile-derivation"): Likewise.
* guix/profiles.scm (ca-certificate-bundle): New procedure.
(profile-derivation): Add 'ca-certificate-bundle?' keyword argument. If
true (the default), add the result of 'ca-certificate-bundle' to 'inputs'.
Co-Authored-By: Ludovic Courtès <ludo@gnu.org>
* guix/build/gnu-build-system.scm (gnu-build): Leave
%DEFAULT-PORT-CONVERSION-STRATEGY unchanged when 'string->bytevector'
fails to convert to ISO-8859-1. This is an attempt to work around the
build failures at <http://hydra.gnu.org/build/263002>.
Suggested by Mark H Weaver.
* guix/build/gnu-build-system.scm (gnu-build): Set
%DEFAULT-PORT-CONVERSION-STRATEGY to 'error.
* guix/packages.scm (patch-and-repack)[builder]: Likewise.
* guix/build/utils.scm (get-char*): New procedure.
(patch-shebang): Use it instead of 'read-char'.
(fold-port-matches): Remove local 'get-char' and use 'get-char*'
instead.
Suggested by Mark H Weaver.
* guix/build/utils.scm (locale-category->string): New procedure.
* guix/build/gnu-build-system.scm (install-locale): Add 'setenv' call.
* guix/packages.scm (%standard-patch-inputs): Add "locales".
(patch-and-repack)[builder]: Add 'locales' variable. When it is true,
call 'setenv' and 'setlocale'.
* guix/build/gnu-build-system.scm (install-locale): New procedure.
(%standard-phases): Add it.
* guix/build-system/gnu.scm (gnu-build): Add #:locale and pass it to
the build script.
(gnu-cross-build): Likewise.
Fixes <http://bugs.gnu.org/19866>.
Reported by Andreas Enge <andreas@enge.fr>.
* guix/build/gnu-build-system.scm (unpack): Use 'unzip' when SOURCE ends
in '.zip'.
Reported by Alex Kost <alezost@gmail.com>
at <http://lists.gnu.org/archive/html/guix-devel/2015-02/msg00702.html>.
* guix/ui.scm (parse-command-line)[parse-options-from]: Add 'seeds'
parameter.
Thread the result of the first 'parse-options-from' call to the
second.
* guix/build/download.scm: Do not attempt to support relative URIs in
"Location" headers if 'declare-relative-uri-header!' is not present.
This is the case for Guile 2.0.6 or earlier.
Reported by Daniel Kochmański <dkochmanski@hellsgate.pl>.
Fixes <http://bugs.gnu.org/19888>.
* guix/tests.scm (shebang-too-long?): New procedure.
* tests/builders.scm ("gnu-build"): Conditionalize on
not (shebang-too-long?).
* tests/packages.scm ("GNU Make, bootstrap"): Likewise.
* tests/guix-package.sh (shebang_not_too_long): New function.
Use it to determine whether to build 'gnu-make-boot0'.
* guix/tests.scm (network-reachable?): New procedure.
* tests/builders.scm (network-reachable?): Remove.
Replace references to it with calls to the new 'network-reachable?'
procedure.
* tests/derivations.scm (%coreutils): Use 'network-reachable?' instead
of 'getaddrinfo'.
* tests/packages.scm: Likewise.
* tests/union.scm: Likewise.
Fixes compilation failures in 'guix pull'.
* guix/import/cpan.scm (%corelist): Change it to a promise by wrapping it with
'delay'.
(cpan-module->sexp): Adapt uses of %corelist by wrapping with 'force'.
Fixes <http://bugs.gnu.org/19840>.
Reported by Ricardo Wurmus <rekado@elephly.net>.
* guix/build/download.scm: On Guile 2.0.11 or earlier, redefine the http
"Location" header to accept relative URIs.
(resolve-uri-reference): New exported procedure.
(http-fetch): Use 'resolve-uri-reference' to resolve redirections.
* guix/http-client.scm (http-fetch): Use 'resolve-uri-reference'
* guix/build/utils.scm (wrap-program): Preserve symbolic links instead of
copying the contents of the link.
Co-authored-by: Ludovic Courtès <ludo@gnu.org>
Closes <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19743>.
* guix/build/utils.scm (wrap-program): Create scripts that use $0 (which is
usually just the base name) instead of the absolute path to the original
program. Alternative implementation of 2ed11b3.
Co-authored-by: Ludovic Courtès <ludo@gnu.org>
Closes <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19742>.
* guix/store.scm (text-file): Add optional 'references' parameter. Pass
it to 'add-text-to-store'.
* doc/guix.texi (The Store Monad): Adjust accordingly.
Reported by Andreas Enge <andreas@enge.fr>
at <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19764#19>.
* guix/profiles.scm (manifest-transaction-effects): Use 'version>=?'
instead of 'version>?'.
* tests/profiles.scm ("manifest-transaction-effects and
pseudo-upgrades"): New test.
Fixes <http://bugs.gnu.org/19756>.
Reported by <sleep_walker@suse.cz>.
* guix/serialization.scm (currently-restored-file): New variable.
(get-bytevector-n*): New procedure.
(read-int, read-long-long, read-string, read-latin1-string,
read-contents): Use it instead of 'get-bytevector-n'.
(restore-file): Parameterize 'currently-restored-file' and set it.
* tests/nar.scm ("restore-file with incomplete input"): New test.
Before that, any profile generation built when '-p' is used would
effectively become a permanent GC root because the symlink in
/var/guix/gcroots/auto would point directly to /gnu/store/...-profile.
* guix/scripts/package.scm (maybe-register-gc-root): Rename to...
(register-gc-root): ... this. Remove conditional, and replace call to
'canonicalize-path' with (string-append (getcwd) "/" ...).
(guix-package): Call 'register-gc-root' only if PROFILE is different
from %CURRENT-PROFILE.
* tests/guix-package.sh: Add test case.
Before that, if two users on the same machine ran 'guix pull', the
second one would have the "Guix already up to date" message and their
~/.config/guix/latest link would be left unchanged---effectively
preventing them from updating.
* guix/scripts/pull.scm (build-and-install): Install the 'latest'
symlink regardless of whether TO-DO? is true or false.
Suggested by Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>.
* guix/scripts/offload.scm (register-gc-root)[script]: Replace
'false-if-exception' with a finer-grain 'system-error handler.
Provide the name of MACHINE in 'leave' error message.
Suggested by Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>.
* guix/scripts/offload.scm (remote-pipe): Remove unneeded 'catch'.
(machine-load): Check the exit value upon (close-pipe pipe). Call
'warning' when it is non-zero.
* guix/scripts/environment.scm (for-each-search-path): Iterate over all
derivation output paths.
(packages->transitive-inputs): Process inputs that specify an output, too.
* guix/store.scm (operation-id): Rename 'build-derivations' to
'build-things', as per Nix commit 1aba0bf0.
(build-derivations): Rename to...
(build-things): ... this. Keep 'build-derivations' as an alias.
(build): New procedure.
* tests/store.scm ("build-things with output path",
"substitute + build-things with output path"): New tests.
* guix/tests.scm (%substitute-directory): New variable.
(call-with-derivation-narinfo): Use it.
(call-with-derivation-substitute): New procedure.
(with-derivation-substitute): New macro.
* tests/store.scm ("substitute"): Use 'with-derivation-substitute'.
("substitute, corrupt output hash"): Likewise.
* guix/tests.scm (derivation-narinfo): Turn 'nar' into a keyword
parameter. Add #:sha256 parameter, and honor it.
(call-with-derivation-narinfo): Add #:sha256 and pass it to
'derivation-narinfo'.
(with-derivation-narinfo): Extend with support for (sha256 => value).
* tests/store.scm ("substitute query"): Use 'with-derivation-narinfo'.
("substitute"): Likewise.
("substitute, corrupt output hash"): Likewise.
("substitute --fallback"): Likewise.
* tests/derivations.scm: Remove Emacs local variable.
* guix/scripts/lint.scm (%options) <--checkers>: Remove 'arg-handler'
parameter, and return a single value.
(guix-lint)[parse-options]: Remove 'arg-handler' parameter from
handlers. Remove second seed to 'args-fold*'.
* tests/guix-lint.sh: Add test.
Fixes <http://bugs.gnu.org/19677>.
Reported by Mark H Weaver <mhw@netris.org>.
* guix/hash.scm: Use (guix gcrypt).
(sha256, open-sha256-md, md-write, md-close): Use 'libgcrypt-func'
instead of 'dynamic-func'.
Before that it would check all the URIs of each package.
* guix/scripts/lint.scm (validate-uri): Really return #f on failure and
#t otherwise.
(check-source): Replace 'for-each' with 'any'.
Fixes <http://bugs.gnu.org/19630>.
Reported by Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>.
* guix/derivations.scm (&derivation-error,
&derivation-missing-output-error): New error conditions.
(derivation->output-path): Raise a '&derivation-missing-output-error'
if OUTPUT is not an output of DRV.
* guix/ui.scm (call-with-error-handling): Add case for
'derivation-missing-output-error?'.
(show-what-to-build): Check whether (derivation-outputs drv) is
empty.
* tests/packages.scm ("reference to non-existent output"): Add test.
* guix/ui.scm (report-error): Export.
* guix/scripts/system.scm (read-operating-system): Report syntax errors
using standard GNU format. Report other errors using 'display-error'.
Reported by Andreas Enge <andreas@enge.fr>.
* guix/scripts/package.scm (with-null-error-port): New macro.
(search-path-environment-variables): Wrap 'search-path-as-list' call
in 'with-null-error-port'.
* guix/records.scm (define-record-type*)[make-syntactic-constructor]:
Turn THUNKED and DEFAULTS into keyword arguments.
Adjust caller accordingly. Declare 'thunked' and 'defaults' local
variables.
Fixes <http://bugs.gnu.org/19610>.
Reported by Mark H Weaver <mhw@netris.org>.
* guix/nar.scm (restore-one-item): Use 'read-latin1-string' to read the
signature.
* guix/serialization.scm (read-latin1-string): Use 'get-bytevector-n'
instead of 'get-string-n'. Use 'list->string' etc. to convert the
bytevector to a string.
* doc/guix.texi (The Store Monad): Document '%state-monad' and related
procedures. Describe '%store-monad' as an alias for '%state-monad'.
* guix/monads.scm: Update commentary.
* guix/store.scm (define-alias): New macro.
(%store-monad, store-return, store-bind): Define as aliases of the
corresponding %STATE-MONAD part.
(store-lift, text-file, interned-file): Return STORE as a second
value.
(run-with-store): Use 'run-with-state'.
* guix/packages.scm (set-guile-for-build, package-file): Return STORE as
a second value.
* guix/monads.scm: Remove part of the module commentary.
* guix/packages.scm (origin->derivation): Take body from
'package-source-derivation', and change it to monadic style. Expect
METHOD to a monadic procedure.
(package-source-derivation): Define in terms of 'origin->derivation'.
* guix/download.scm (url-fetch): Remove 'store' argument. Remove
'guile-for-build' variable. Turn into a monadic procedure.
* guix/git-download.scm (git-fetch): Likewise.
* guix/svn-download.scm (svn-fetch): Likewise.
* tests/builders.scm (url-fetch*): New procedure.
Change tests to call 'url-fetch*' instead of 'url-fetch'.
* tests/packages.scm ("package-source-derivation, snippet"): Remove
'store' parameter of 'fetch' and change it to use 'interned-file'
instead of 'add-to-store'.
* gnu/packages/bootstrap.scm (bootstrap-origin)[boot]: Remove 'store'
parameter.
Reported by Mark H Weaver <mhw@netris.org>
* guix/build/glib-or-gtk-build-system.scm (generate-icon-cache): Add check for
existence of icons directory.