* guix/derivations.scm (derivation-hash): Add comment as to why we keep
the plain `sha256' call.
* guix/scripts/download.scm (guix-download): Use `port-sha256' instead
of (compose sha256 get-bytevector-all).
* guix/scripts/refresh.scm (update-package): Likewise.
* guix/hash.scm (GCRY_MD_SHA256): New macro.
(sha256): Use it.
(open-sha256-md, md-write, md-read, md-close, open-sha256-port,
port-sha256): New procedures.
* tests/hash.scm: New file.
* Makefile.am (SCM_TESTS): Add it.
Reported by Nikita Karetnikov and Cyril Roelandt.
* guix/ui.scm (show-what-to-build): Call `substitutable-path-info'
only when USE-SUBSTITUTES? is true.
* guix/web.scm (open-socket-for-uri): New procedure.
(http-fetch): Add `port' keyword parameter; use it.
* guix/scripts/substitute-binary.scm (%random-state): New variable.
(with-timeout): Wait a little before retrying.
(fetch): Use `open-socket-for-uri', and keep a copy of the socket in
variable `port'. Close PORT upon timeout.
* guix/build-system/trivial.scm (trivial-cross-build): Don't bind
`%target' here since this causes problem when BUILDER
contains (use-modules ...) clauses, and can be achieved differently
anyway.
* guix/build/utils.scm (set-path-environment-variable): When VALUE is
the empty string, call `unsetenv' instead of `setenv'.
* gnu/packages/guile.scm (guile-2.0)[arguments]: Remove `unsetenv'
trick.
* guix/scripts/substitute-binary.scm (decompressed-port): Improve docstring.
(progress-report-port): New procedure.
(guix-substitute-binary)["--substitute"]: Use it to report progress.
* guix/build/download.scm: Export `progress-proc' and `uri-abbreviation'.
* guix/gnu-maintenance.scm (download-tarball): Add a 'key-download'
keyword argument and pass it to 'gnupg-verify*'. Make
'archive-type' a keyword argument.
(package-update): Add a 'key-download' keyword argument. Pass
'archive-type' and 'key-download' keyword arguments to
'download-tarball'.
* guix/gnupg.scm: Import (ice-9 i18n) and (guix ui).
(gnupg-verify*): Add a 'key-download' keyword argument and adjust
'gnupg-verify*' to use it. Make 'server' a keyword argument.
* guix/scripts/refresh.scm (show-help, %options): Add and document
'--key-download'.
(update-package): Add a 'key-download' keyword argument and pass it
to 'package-update'.
(guix-refresh): Pass 'key-download' to 'update-package'. Limit
lines to a maximum of 79 characters.
* guix/build-system/gnu.scm (static-package): Call `package-arguments'
from within the `arguments' field, so it see the
right (%current-target-system).
* guix/ui.scm (define-diagnostic): Use `free-identifier=?' to compare
the user's input with `_' and `N-". This should fix builds with Guile 2.1.
Reported by Cojocaru Alexandru <xojoc@gmx.com>.
This fixes a circular dependency introduced in commit acc26ff ("gnu: Add
pytz.").
* guix/build-system/python.scm (default-python): New procedure.
(python-build): Use it.
Suggested by Andreas Enge <andreas@enge.fr>.
* guix/scripts/substitute-binary.scm (with-networking): New macro.
(guix-substitute-binary): Wrap the body in `with-networking'.
* guix/packages.scm (&package-cross-build-system-error): New condition type.
(package-cross-derivation): Raise &package-cross-build-system-error
when the build system doesn't support cross builds.
* guix/ui.scm (call-with-error-handling): Add
package-cross-build-system-error? case.
* tests/packages.scm ("package-cross-derivation, no cross builder"): New test.
* guix/build-system/trivial.scm (guile-for-build): New procedure.
(trivial-build): Use it.
(trivial-cross-build): New procedure.
(trivial-build-system): Use it.
* guix/scripts/package.scm (guix-package)[ensure-default-profile]: Check
whether S is true before checking its owner. Fixes the case where we
built %PROFILE-DIRECTORY just above.
* guix/build-system/gnu.scm (inputs-search-paths): New procedure.
(standard-search-paths): Use it.
(expand-inputs): New procedure.
(standard-inputs): Use it.
(standard-cross-packages, standard-cross-inputs,
standard-cross-search-paths, gnu-cross-build): New procedures.
(gnu-build-system): Set `cross-build' field to `gnu-cross-build'.
* gnu/packages/cross-base.scm: Export `cross-gcc', `cross-binutils', and
`cross-libc'.
* guix/build/gnu-cross-build.scm: New file.
* Makefile.am (MODULES): Add it.
* guix/packages.scm (expand-input): New procedure, moved out of...
(package-derivation): ... here. Adjust accordingly.
(package-cross-derivation): Add `cross-system' and `system'
parameters.
* guix/scripts/package.scm (guix-package)[ensure-default-profile]: Check
the owner of %PROFILE-DIRECTORY. Report an error when the owner is
not the current user. Add `rtfm' procedure.
* doc/guix.texi (Invoking guix package): Mention the ownership test.
This fixes a bug whereby `read-response' would read more than just the
response, with the extra data going into the port's buffer; the
"bzip2 -dc" process spawned by `filtered-port' would not see the those
buffered data, which are definitely lost, and would bail out with
"bzip2: (stdin) is not a bzip2 file."
* guix/utils.scm (filtered-port): Document that INPUT must be
unbuffered.
* guix/web.scm (http-fetch): Add `buffered?' parameter. Call
`open-socket-for-uri' explicitly, and call `setvbuf' when BUFFERED? is
false. Pass the port to `http-get'. Close it upon 301/302.
* guix/scripts/substitute-binary.scm (fetch): Add `buffered?'
parameter. Pass it to `http-fetch'; honor it for `file' URIs.
(guix-substitute-binary): Call `fetch' with #:buffered? #f for port RAW.
* tests/utils.scm ("filtered-port, file"): Open FILE as unbuffered.
* guix/scripts/substitute-binary.scm (%regexp-exec-mutex): New variable.
(string->uri): New procedure.
(fields->alist): Wrap `regexp-exec' call in `with-mutex'.
* guix/ftp-client.scm (ftp-open): Let exceptions through.
* guix/scripts/package.scm (waiting): Wrap EXP in a `dynamic-wind', so
the line is always cleared.
* guix/scripts/hash.scm (guix-hash)[eof->null]: New procedure.
Use it to convert the EOF object to the empty bytevector.
* tests/guix-hash.sh: New file.
* Makefile.am (SH_TESTS): Add it.
* guix/scripts/refresh.scm (%options): Add `--key-server' and `--gpg'.
(show-help): Update accordingly.
(update-package): New procedure, formerly in `guix-refresh'.
(guix-refresh): Use it. Parameterize `%openpgp-key-server' and
`%gpg-command'.
* guix/gnupg.scm (%gpg-command): Turn into a SRFI-39 parameter.
(%openpgp-key-server): Likewise. Default to pgp.mit.edu, as
keys.gnupg.net is unreliable.
Update users.
* guix/ui.scm (show-guix-usage): Mention `guix --help'.
Suggested by Mark H. Weaver.
(run-guix-command): Invoke it when a command is not found.
(guix-main): Adjust accordingly.
* guix/scripts/package.scm (guix-package)[process-actions](package->tuple):
Put the output path in the tuple, not the derivation path.
* tests/guix-package.sh: Add test.
Before this, something like "guix package -i glibc" could fail because
glibc lists linux-libre-headers as a propagated input (which would be
added as a dependency in the manifest) but the linux-libre-headers
output could be unavailable, leading to an error like this:
path `/nix/store/4v2bk8sx5cm166gks3fi3q7d9zchibnk-linux-libre-headers-3.3.8' is not valid
This patch adds such dependencies as inputs of the profile derivation.
* guix/scripts/package.scm (profile-derivation): Accept package objects
in the `deps' field of an element of PACKAGES. Convert them to their
output path for BUILDER, and add them to the inputs of the
`build-expression->derivation' call.
(input->name+path): When INPUT doesn't contain a package object,
return it as is.
(guix-package)[process-actions](canonicalize-deps): Expect DEPS to
contain package objects, and leave them as is.
* guix/scripts/refresh.scm (guix-refresh): When updating a source file,
gracefully handle the case where TARBALL is #f.
Reported by Nikita Karetnikov <nikita@karetnikov.org>.
* guix/ui.scm (run-guix-command): Can `resolve-interface' errors and
report them with `leave'. Parameterize `program-name' from here.
(guix-main): Remove parameterization of `program-name'.
This would manifest when downloading a large file such as the Bazaar
tarball, leading to an "Error in the pull function" GnuTLS exception.
* guix/build/download.scm (add-weak-reference): New procedure.
(tls-wrap): Add (add-weak-reference record port).
* guix/scripts/package.scm (search-path-environment-variables): Prefer
%USER-ENVIRONMENT-DIRECTORY when it points to PROFILE.
(display-search-paths): Use 3 spaces for indentation.
* guix/build/rpath.scm: New file.
* Makefile.am (MODULES): Add it.
* gnu/packages/python.scm (python): Use it; remove local copy of
the *rpath* procedures.
* gnu/packages/samba.scm (samba): Likewise.
* guix/scripts/package.scm (guix-package)[find-package]: Add optional
parameter `output'. Use it.
[process-actions]: When computing UPGRADE, pass OUTPUT to
`find-package'.
* guix/build/utils.scm (wrap-program): Fix computation of PROG-REAL and
PROG-TMP when PROG is an absolute file name. Add "$@" in the
generated script, and quote PROG-REAL.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* guix/scripts/substitute-binary.scm (filtered-port): Move to utils.scm.
(decompressed-port): Upon "none", return '() as the second value.
(guix-substitute-binary): Expect `decompressed-port' to return a list
of PIDs as its second value.
* guix/utils.scm (filtered-port): New procedure. Add case for when
INPUT is not `file-port?'.
* tests/utils.scm ("filtered-port, file", "filtered-port, non-file"):
New tests.
* guix/gnu-maintenance.scm (latest-release): Filter out directories
whose name does not contain digits early in the process. This fixes
(latest-release "gnupg").
* guix/scripts/refresh.scm (%options): Add `--select'.
(show-help): Likewise. Augment initial help text.
(guix-refresh)[core-package?]: New procedure.
Use it when selecting packages.
This should fix `substitute-binary --query' on Guile 2.0.5.
* guix/web.scm: New file.
* Makefile.am (MODULES): Add it.
* po/POTFILES.in: Add it.
* guix/gnu-maintenance.scm (http-fetch): Remove.
(%package-list-url): Turn into a URI.
(official-gnu-packages): Add #:text? #t to `http-fetch' call.
* guix/scripts/substitute-binary.scm (fetch): Remove `http' case, and
use `http-fetch' instead.
* guix/gnu-maintenance.scm (tarball-regexp, sans-extension,
release-file): New procedures.
(%alpha-tarball-rx): New variable.
(releases): Use them instead of local copies.
(latest-release): Rewrite to not do a recursive search of all
versions and instead jump directly to the latest.
* guix/packages.scm (package-field-location): Rewrite using `read' and
source properties. Change to return #f upon failure.
* tests/packages.scm ("package-field-location"): Check for #f upon failure.
* build-aux/sync-synopses.scm: Adjust accordingly.
* guix/packages.scm (package-field-location): New procedure.
* build-aux/sync-synopses.scm: Use it instead of `package-location'.
* tests/packages.scm ("package-field-location"): New test.
* guix/ui.scm (define-diagnostic, warning, report-error, leave): Move
definitions before any use. Reported by Nikita Karetnikov.
(install-locale): Move back close to `initialize-guix'.
* guix/scripts/hash.scm: New file.
* Makefile.am (MODULES): Add it.
* po/POTFILES.in: Add it.
* doc/guix.texi (Invoking guix hash): New node.
(Defining Packages): Add a cross-reference to the 'Invoking guix
hash' node.
* guix/ui.scm (define-diagnostic): New macro, which is based on the
previous version of 'warning'.
(warning, leave): Redefine using 'define-diagnostic'.
(report-error): New macro.
(install-locale): Use 'warning' instead of 'format'.
(call-with-error-handling): Adjust 'leave'.
* gnu/packages.scm (package-files): Use 'warning' instead of 'format'.
* guix/gnu-maintenance.scm (http-fetch): Use 'warning' and 'leave'.
* guix/scripts/build.scm (derivations-from-package-expressions, guix-build):
Adjust 'leave'.
* guix/scripts/download.scm (guix-download): Adjust 'leave'.
* guix/scripts/gc.scm (size->number, %options): Adjust 'leave'.
* guix/scripts/package.scm (roll-back, guix-package): Adjust 'leave'.
* po/POTFILES.in: Add 'guix/gnu-maintenance.scm'.
* guix/derivations.scm (derivation-input-output-paths): New procedure.
(derivation-prerequisites-to-build): New `use-substitutes?' keyword
argument. Change two return the list of substitutable paths as a
second argument.
* guix/ui.scm (show-what-to-build): Turn `dry-run?' into a keyword
argument. New `use-substitutes?' keyword argument. Use `fold2' and
adjust to use both return values of
`derivation-prerequisites-to-build'. Display what will/would be
downloaded.
* guix/scripts/build.scm (guix-build): Adjust accordingly.
* guix/scripts/package.scm (guix-package): Likewise.
* tests/derivations.scm ("derivation-prerequisites-to-build and
substitutes"): New test.
* guix/scripts/packages.scm (guix-package) [process-actions]: When upgrading,
use "" when REGEXP is #f.
* doc/guix.texi: update the documentation accordingly.
Reported by Andreas Enge <andreas@enge.fr>.
* guix/build-system/gnu.scm (standard-search-paths): New procedure.
(gnu-build): Use it.
* guix/build-system/perl.scm (perl-build):
Append (standard-search-paths) to the search paths of PERL.
* guix/build-system/cmake.scm (cmake-build):
Append (standard-search-paths) to SEARCH-PATHS.
* guix/scripts/substitute-binary.scm (lookup-narinfo): Force CACHE when
passing it to `fetch-narinfo'.
(guix-substitute-binary): Delay calls to `open-cache'.
* guix/scripts/substitute-binary.scm (%narinfo-cache-directory,
%narinfo-ttl, %narinfo-negative-ttl): New variables.
(with-atomic-file-output, object->fields, read-narinfo,
write-narinfo, narinfo->string, string->narinfo, lookup-narinfo): New
procedures.
(fetch-narinfo): Adjust to use `read-narinfo'.
(guix-substitute-binary): Ensure the existence of
%NARINFO-CACHE-DIRECTORY. Use `lookup-narinfo' instead of
`fetch-narinfo'.
* gnu/packages.scm (fold2): Remove.
* guix/utils.scm (fold2): New procedure. Generalization of the above to
one and two lists.
* tests/utils.scm ("fold2, 1 list", "fold2, 2 lists"): New tests.
* guix/store.scm: Remove unneeded (ice-9 rdelim) import. In Guile 2.0.9
that module exports `read-string', which conflicts with that of (guix
serialization).
* guix/scripts/package.scm (roll-back): Use `format', not `leave' when
indicating "already at the empty profile". Fixes a regression
introduced in a2011be5df. Reported by
Nikita Karetnikov <nikita@karetnikov.org>.
This allows build outputs to be transparently downloaded from
http://hydra.gnu.org, for example.
* config-daemon.ac: Check for `gzip', `bzip2', and `xz'.
* guix/config.scm.in (%gzip, %bzip2, %xz): New variable.
* guix/scripts/substitute-binary.scm (fetch): Return SIZE as a second value.
(<narinfo>): Change `url' to `uri'.
(make-narinfo): Rename to...
(narinfo-maker): ... this. Handle relative URLs.
(fetch-narinfo): Adjust accordingly.
(filtered-port, decompressed-port): New procedures.
(guix-substitute-binary): Implement the `--substitute' case.
* tests/store.scm ("substitute query"): Use (%store-prefix) instead
of (getenv "NIX_STORE_DIR").
("substitute"): New test.
* guix/nar.scm (write-file): Add case for type `symlink'.
(restore-file): Likewise.
* tests/nar.scm (random-file-size, make-file-tree, delete-file-tree,
with-file-tree, file-tree-equal?, make-random-bytevector,
populate-file): New procedures.
(%test-dir): New variable.
("write-file + restore-file"): Use `%test-dir' and `file-tree-equal?'.
("write-file + restore-file with symlinks"): New test.
* guix/ui.scm (program-name, guix-warning-port): New variables.
(warning): New macro.
(guix-main): Parametrize PROGRAM-NAME.
* guix/scripts/build.scm, guix/scripts/download.scm,
guix/scripts/gc.scm, guix/scripts/package.scm: Adjust to use `leave'
and `warning' consistently.
* guix/nar.scm (&nar-error, &nar-read-error): New condition types.
(dump): New procedure.
(write-contents)[dump]: Remove. Use the one above instead.
(read-contents, write-file, restore-file): New procedures.
(%archive-version-1): New variable.
* guix/scripts/substitute-binary.scm (guix-substitute-binary)["--query"]:
Emit blank lines only after the complete list of store paths has been
returned.
* guix/scripts/substitute-binary.scm: New file.
* Makefile.am (MODULES): Add it.
* nix/scripts/substitute-binary.in: New file.
* config-daemon.ac: Produce nix/scripts/substitute-binary.
* daemon.am (nodist_pkglibexec_SCRIPTS): Add
nix/scripts/substitute-binary.
* guix/store.scm (substitutable-path-info): Use the
`query-substitutable-path-infos' RPC.
* nix/nix-daemon/guix-daemon.cc (main): Honor `NIX_SUBSTITUTERS'.
* pre-inst-env.in: Set `NIX_SUBSTITUTERS'.
* test-env.in: Leave `NIX_SUBSTITUTERS' unchanged. Set
`GUIX_BINARY_SUBSTITUTE_URL, and create
$NIX_STATE_DIR/substituter-data.
Run `guix-daemon' within `./pre-inst-env'.
* tests/store.scm ("substitute query"): New test.
* guix/gnu-maintenance.scm (http-fetch): Try #:streaming? #t, or
'http-get*', or 'http-get' as a last resort. Check whether DATA is
#f, a string, or an input port.
* guix/store.scm: Remove unneeded (ice-9 rdelim) import. In Guile 2.0.9
that module exports `read-string', which conflicts with that of (guix
serialization).
* guix/scripts/package.scm (roll-back): Use `format', not `leave' when
indicating "already at the empty profile". Fixes a regression
introduced in a2011be5df. Reported by
Nikita Karetnikov <nikita@karetnikov.org>.
This allows build outputs to be transparently downloaded from
http://hydra.gnu.org, for example.
* config-daemon.ac: Check for `gzip', `bzip2', and `xz'.
* guix/config.scm.in (%gzip, %bzip2, %xz): New variable.
* guix/scripts/substitute-binary.scm (fetch): Return SIZE as a second value.
(<narinfo>): Change `url' to `uri'.
(make-narinfo): Rename to...
(narinfo-maker): ... this. Handle relative URLs.
(fetch-narinfo): Adjust accordingly.
(filtered-port, decompressed-port): New procedures.
(guix-substitute-binary): Implement the `--substitute' case.
* tests/store.scm ("substitute query"): Use (%store-prefix) instead
of (getenv "NIX_STORE_DIR").
("substitute"): New test.
* guix/nar.scm (write-file): Add case for type `symlink'.
(restore-file): Likewise.
* tests/nar.scm (random-file-size, make-file-tree, delete-file-tree,
with-file-tree, file-tree-equal?, make-random-bytevector,
populate-file): New procedures.
(%test-dir): New variable.
("write-file + restore-file"): Use `%test-dir' and `file-tree-equal?'.
("write-file + restore-file with symlinks"): New test.
* guix/ui.scm (program-name, guix-warning-port): New variables.
(warning): New macro.
(guix-main): Parametrize PROGRAM-NAME.
* guix/scripts/build.scm, guix/scripts/download.scm,
guix/scripts/gc.scm, guix/scripts/package.scm: Adjust to use `leave'
and `warning' consistently.
Reported by Andreas Enge <andreas@enge.fr>.
* guix/build-system/gnu.scm (standard-packages): New procedure.
(standard-inputs): Use it instead of resolving things locally.
(gnu-build)[implicit-search-paths]: Map over (standard-packages), not
over STANDARD-INPUTS.
* guix/nar.scm (&nar-error, &nar-read-error): New condition types.
(dump): New procedure.
(write-contents)[dump]: Remove. Use the one above instead.
(read-contents, write-file, restore-file): New procedures.
(%archive-version-1): New variable.
* guix/scripts/substitute-binary.scm (guix-substitute-binary)["--query"]:
Emit blank lines only after the complete list of store paths has been
returned.
* guix/scripts/substitute-binary.scm: New file.
* Makefile.am (MODULES): Add it.
* nix/scripts/substitute-binary.in: New file.
* config-daemon.ac: Produce nix/scripts/substitute-binary.
* daemon.am (nodist_pkglibexec_SCRIPTS): Add
nix/scripts/substitute-binary.
* guix/store.scm (substitutable-path-info): Use the
`query-substitutable-path-infos' RPC.
* nix/nix-daemon/guix-daemon.cc (main): Honor `NIX_SUBSTITUTERS'.
* pre-inst-env.in: Set `NIX_SUBSTITUTERS'.
* test-env.in: Leave `NIX_SUBSTITUTERS' unchanged. Set
`GUIX_BINARY_SUBSTITUTE_URL, and create
$NIX_STATE_DIR/substituter-data.
Run `guix-daemon' within `./pre-inst-env'.
* tests/store.scm ("substitute query"): New test.