* guix/scripts/offload.scm (offload): Add 'log-port' keyword parameter.
Handle log display here. Return the result of (close-pipe pipe).
(process-request): Adjust 'offload' call site accordingly. Call
'retrieve-files' only when 'offload' returns zero; exit when 'offload'
returns non-zero.
* nix/nix-daemon/guix-daemon.cc (GUIX_OPT_NO_BUILD_HOOK): New macro.
(options): Add '--no-build-hook'.
(parse_opt): Handle it.
(main)[HAVE_DAEMON_OFFLOAD_HOOK]: Set 'useBuildHook' by default.
Set $NIX_BUILD_HOOK to our offload hook unless otherwise specified.
[!HAVE_DAEMON_OFFLOAD_HOOK]: Clear 'useBuildHook'.
* pre-inst-env.in: Set and export NIX_BUILD_HOOK.
* nix/scripts/offload.in, guix/scripts/offload.scm: New files.
* guix/ui.scm (show-guix-help)[internal?]: Add "offload".
* config-daemon.ac: Call 'GUIX_CHECK_UNBUFFERED_CBIP'.
Instantiate 'nix/scripts/offload'. Set 'BUILD_DAEMON_OFFLOAD'
conditional, and optionally define 'HAVE_DEAMON_OFFLOAD_HOOK' cpp
macro.
* daemon.am (nodist_pkglibexec_SCRIPTS)[BUILD_DAEMON_OFFLOAD]: Add it.
* Makefile.am (MODULES)[BUILD_DAEMON_OFFLOAD]: Add
'guix/scripts/offload.scm'.
(EXTRA_DIST)[!BUILD_DAEMON_OFFLOAD]: Likewise.
* m4/guix.m4 (GUIX_CHECK_UNBUFFERED_CBIP): New macro.
* doc/guix.texi (Setting Up the Daemon): Move most of the body to...
(Build Environment Setup): ... this. New subsection.
(Daemon Offload Setup): New subsection.
* guix/pki.scm (signature-subject, signature-signed-data,
valid-signature?): New procedures.
* guix/scripts/authenticate.scm (guix-authenticate): Adjust to use
them.
* nix-upstream: Update sub-module.
* daemon.am (libutil_a_SOURCES): Add affinity.cc.
(libutil_headers): Add affinity.hh.
(libexec_PROGRAMS, nix_setuid_helper_SOURCES,
nix_setuid_helper_CPPFLAGS, nix_setuid_helper_LDADD): Remove.
* doc/guix.texi (Setting Up the Daemon): Remove paragraph about
'nix-setuid-helper'.
* guix/scripts/substitute-binary.scm (guix-substitute-binary): Exit 0 when
%CACHE-URL has an HTTP scheme and looking up its host fails.
Always print a newline to stdout when starting.
* guix/pki.scm (ensure-acl): Make sure the directory of %ACL-FILE
exists.
* guix/scripts/archive.scm (generate-key-pair): Likewise for
%PUBLIC-KEY-FILE.
* guix/scripts/package.scm (leave-on-EPIPE): New macro.
(guix-package): Use it for 'list-installed', 'list-available', and
'--list-generations'.
* tests/guix-package.sh: Add test.
* guix/scripts/archive.scm (authorize-key): New procedure.
(guix-archive): Call it when OPTS contains 'authorize-key'.
* tests/guix-archive.sh: Add test with invalid public key.
* guix/pki.scm: Export '%acl-file'.
* doc/guix.texi (Invoking guix archive): Make it clear that '--import'
works only with authorized keys. Document '--authorize'.
* guix/scripts/authenticate.scm (signature-sexp): Remove.
(guix-authenticate): Upon '-verify', check whether the signature's
public key passes 'authorized-key?'.
* guix/scripts/authenticate.scm (signature-sexp): New procedure.
(guix-authenticate): Use it to produce the signature. Adjust
verification code accordingly.
* tests/store.scm ("import corrupt path"): Adjust test accordingly.
* guix/pk-crypto.scm: Rename procedures, variables, etc. from
'gcry-sexp' to 'canonical-sexp'. Add comment with references.
* guix/scripts/authenticate.scm, tests/pk-crypto.scm: Adjust
accordingly.
* guix/scripts/package.scm (%options): Adapt option processors to accept and
return a second seed value: 'arg-handler', which handles bare arguments (if
not false). The install, remove, and upgrade option processors return an
arg-handler that repeat the same operation. All other option processors
return #f as the arg-handler. Make the arguments to install and remove
optional. The upgrade option processor deletes (upgrade . #f) from the
alist before adding a new entry.
(guix-package): Procedures passed to 'args-fold*' accept the new seed value
'arg-handler'. The 'operand-proc' uses 'arg-handler' (if not false).
* doc/guix.texi (Invoking guix package): Update docs.
* tests/guix-package.sh: Add test.
* guix/scripts/pull.scm (unpack)[builder](compile-file*): Remove.
(call-with-process, p-for-each): New procedures. Use them to compile
files in parallel.
Reported by Arne Babenhauserheide <arne.babenhauserheide@kit.edu>.
* guix/scripts/pull.scm (unpack)[builder](compile-file*): Change to run
'compile-file' in a child process. This limits memory usage; before
that memory usage was proportional to the number of files to compile.
* guix/scripts/substitute-binary.scm (n-par-map*): New procedure.
(guix-substitute-binary): Use it instead of 'n-par-map'.
Reported by Nikita Karetnikov and Eric Bavier.
* guix/ui.scm (read/eval): New procedure.
(read/eval-package-expression): Use it.
* guix/scripts/build.scm (derivations-from-package-expressions): Rename to...
(derivation-from-expression): ... this. Accept procedures, under the
assumption that they are monadic thunk.
(show-help): Adjust accordingly.
(guix-build): Ditto.
* tests/guix-build.sh: Add test.
* doc/guix.texi (Invoking guix build): Augment description of '-e'.
* guix/scripts/substitute-binary.scm (with-timeout): Update comment to
mention the fix's commit ID.
(fetch): In the 'with-timeout' handler, close PORT only one Guile
versions < 2.0.9.39. Before that, on Guile >= 2.0.9.39, the HTTP
client would end up trying to read from a closed file descriptor.
* guix/scripts/substitute-binary.scm (%lookup-threads): New variable.
(guix-substitute-binary): Use 'n-par-map' instead of 'par-map' for
batch 'lookup-narinfo' calls.
Fixes <http://bugs.gnu.org/15756>.
* guix/profiles.scm (<manifest-pattern>): New record type.
(remove-manifest-entry): Remove.
(entry-predicate, manifest-matching-entries): New procedures.
(manifest-remove): Accept a list of <manifest-pattern>.
(manifest-installed?): Replace 'name' parameter by 'pattern', a
<manifest-pattern>.
* guix/scripts/package.scm (options->removable): Return a list of
<manifest-pattern>.
(guix-package)[process-action]: Use 'manifest-matching-entries' to
compute the list of packages to remove.
* tests/profiles.scm: New file.
* Makefile.am (SCM_TESTS): Add it.
* guix/scripts/package.scm (options->removable): New procedure.
(guix-package)[process-actions]: Use it. Rename 'remove*' to 'remove'
and 'install*' to 'install'.
* guix/ui.scm (package-specification->name+version+output): New
procedure.
* guix/scripts/package.scm (specification->package+output): Use it.
* tests/ui.scm ("package-specification->name+version+output"): New test.
* guix/scripts/package.scm (<manifest-entry>): Add 'inputs' field.
(manifest=?, lower-input): New procedure.
(profile-derivation)[builder]: Add #:log-port argument to
'union-build'.
[ensure-valid-input]: Remove.
Add each entry's inputs to the input list.
(options->installable): Return just the list of entries.
[package->manifest-entry]: Set 'inputs' field.
[canonicalize-deps]: Rename to...
[deduplicate]: ... this. Remove input fiddling.
(guix-package)[process-actions]: Use 'manifest=?' to compare the new
and old manifests. Pass directly PROF-DRV to 'show-what-to-build'.
Pass #:print-build-trace #f to 'set-build-options'.
* guix/scripts/package.scm (%user-environment-directory): Rename to...
(%user-profile-directory): ... this. Update users accordingly.
(profile-derivation): Use the term "profile" instead of "user
environment", and use "profile" as the derivation name.
* guix/scripts/package.scm (<manifest>, <manifest-entry>): New record
types.
(make-manifest, read-manifest, manifest->sexp, sexp->manifest,
read-manifest, write-manifest, remove-manifest-entry, manifest-remove,
manifest-installed?): New procedures.
(profile-derivation): Take a manifest as the second parameter. Use
'manifest->sexp'. Expect <manifest-entry> objects instead of
"tuples". Adjust callers accordingly.
(search-path-environment-variables): Changes 'packages' parameter to
'entries'. Rename 'package-in-manifest->package' to
'manifest-entry->package'; expect <manifest-entry> objects.
(display-search-paths): Rename 'packages' to 'entries'.
(options->installable): Change 'installed' to 'manifest'. Have
'canonicalize-deps' return name/path tuples instead of raw packages.
Rename 'package->tuple' to 'package->manifest-entry'. Use
<manifest-entry> objects instead of tuples.
(guix-package)[process-actions]: Likewise. Rename 'packages' to
'entries'.
[process-query]: Use 'manifest-entries' instead of
'manifest-packages'.
* guix/scripts/package.scm (find-package): Rename to...
(specification->package+output): ... this. Rename 'name' parmameter
to 'spec'. Return a package and output name instead of a tuple.
(options->installable): New procedure
(guix-package)[process-actions]: Use it, and remove corresponding
code.