This removes all I/O, which obviously makes things faster.
* guix/scripts/size.scm (file-size, store-item-exists?): Remove.
(query-path-info*): New procedure.
(file-size*): Rename to...
(file-size): ... this; adjust caller. Use 'query-path-info*' instead of
'file-size'.
On systems with a glibc prior to 2.14, the 'setns' function is not available.
Thanks to Eric Bavier for reporting the issue.
* guix/build/syscalls.scm (setns): Wrap with 'false-if-exception'.
Reported by Eric Dvorsak <eric@dvorsak.fr> on #guix.
* guix/scripts/import/elpa.scm (%default-options): Remove redundant
quote which led to an error if --archive option was not specified.
Based on discussions with Rohan Prinja <rohan.prinja@gmail.com>.
* guix/build/syscalls.scm (<interface>): New record type.
(write-interface, values->interface, unfold-interface-list,
network-interfaces, free-ifaddrs): New procedures.
(ifaddrs): New C struct.
(%struct-ifaddrs-type, %sizeof-ifaddrs): New macros.
* tests/syscalls.scm ("network-interfaces returns one or more interfaces",
"network-interfaces returns \"lo\""): New tests.
* guix/build/syscalls.scm (alignof*, align): New macros.
(write-types, read-types): Use 'align' to compute the actual offset to
read/write a value of TYPE0.
* guix/build/syscalls.scm (PF_PACKET, AF_PACKET): New variables.
(read-socket-address): Make 'index' optional. Return (vector FAMILY) when
FAMILY is neither AF_INET nor AF_INET6.
Previously, before replying to a /nar/* request, 'guix publish' would first
build up the whole nar into memory (as a consequence of
<http://bugs.gnu.org/21093>), which obviously doesn't scale.
* guix/scripts/publish.scm (render-nar): Return STORE-PATH instead of a
procedure that calls 'write-file'.
(sans-content-length): New procedure.
(http-write): For 'x-nix-archive', don't call '%http-write'. Instead, call
'write-file' right from here, using BODY as the file name.
* guix/scripts/publish.scm (%http-write): New variable.
(http-write): New procedure.
(concurrent-http-server): New variable.
(run-publish-server): Use it.
* guix/build/syscalls.scm (read-types): Add RETURN and VALUES parameters.
(define-c-struct): Add WRAP-FIELDS parameter and pass it to 'read-types'.
(sockaddr-in, sockaddr-in6): Add first argument that uses
'make-socket-address'.
(read-socket-address): Remove 'match' on the result of 'read-sockaddr-in'
and 'read-sockaddr-in6'.
* gnu/system.scm (<operating-system>)[kernel-arguments]: New field.
(operating-system-grub.cfg): Honor it.
(operating-system-parameters-file): Add 'kernel-arguments' to the parameters
file.
* guix/scripts/system.scm (previous-grub-entries)[system->grub-entry]: Read
the 'kernel-arguments' field of the parameters file, when available.
* gnu/system/vm.scm (system-qemu-image/shared-store-script):
Use (operating-system-kernel-arguments os) in '-append'.
* doc/guix.texi (operating-system Reference): Document it.
* guix/build-system/gnu.scm (gnu-build, gnu-cross-build): Accept #:build
keyword argument. Pass it to 'gnu-build' on the build side.
* guix/build/gnu-build-system.scm (configure): Accept #:build keyword
argument. Unless it is false, pass --build to configure.
* guix/scripts/substitute.scm (display-narinfo-data,
process-query, process-substitution): New procedures. Code moved from...
(guix-substitute): ... here. Use them.
* guix/scripts/substitute.scm (or*): New macro.
(%cache-url): Honor "untrusted-substitute-urls".
* guix/tests.scm (%test-substitute-urls): New variable.
(open-connection-for-tests): Use it.
* tests/derivations.scm ("derivation-prerequisites-to-build and substitutes",
"derivation-prerequisites-to-build and substitutes, non-substitutable
build", "derivation-prerequisites-to-build and substitutes, local build"):
Pass it to 'set-build-options'.
* tests/guix-daemon.sh: Likewise.
* tests/store.scm ("substitute query, alternating URLs"): New test.
("substitute query", "substitute", "substitute + build-things with output
path", "substitute, corrupt output hash", "substitute --fallback"): Pass
#:substitute-urls to 'set-build-options'.
This ensures that switching between different substitute servers doesn't lead
to a polluted narinfo cache.
* guix/scripts/substitute.scm (narinfo-cache-file): Add 'cache-url'
parameter. Add the base32 of CACHE-URL as a sub-directory under
%NARINFO-CACHE-DIRECTORY. Update callers.
(cached-narinfo): Likewise. Call 'mkdir-p' on the dirname of the cache
file. Update callers.
(remove-expired-cached-narinfos): Add 'directory' parameter and use it
instead of %NARINFO-CACHE-DIRECTORY.
(narinfo-cache-directories): New procedure.
(maybe-remove-expired-cached-narinfo): Call 'remove-expired-cached-narinfos'
for each item returned by 'narinfo-cache-directories'.
* guix/scripts/substitute.scm (<cache>): Rename to...
(<cache-info>): ... this.
(open-cache): Rename to...
(download-cache-info): ... this. Return a <cache-info> or #f.
(open-cache*): Remove.
(cache-narinfo!): Take a URL instead of a <cache> as the first parameter.
(fetch-narinfos): Likewise. Call 'download-cache-info'. Remove use of
'force'.
(guix-substitute): Replace calls to 'open-cache*' with %CACHE-URL.
* guix/scripts/lint.scm (guix): Remove duplicated lines for using
'srfi-34' and 'srfi-35' modules. These lines were introduced twice by
commits b210b35 and 002c57c.
There were two issues:
1. Use of 'delete-duplicates', which is quadratic, was a serious problem for
closures with lots of propagated inputs, such as that of the 'hydra'
package (several minutes for 'guix build hydra -n'!).
2. The 'delete-duplicates' call essentially had no effect since duplicate
inputs typically had a different label and were thus kept. For
instance, (bag-transitive-inputs (package->bag inkscape)) would return
216 items whereas (delete-duplicates (map cdr THAT)) contains only 67
items.
The new implementation returns 67 items in this case. For 'hydra', we're
down from 42211 items to 361, and roughly 13s for 'guix build hydra'.
* guix/packages.scm (transitive-inputs): Rewrite as a breadth-first
traversal. Remove duplicate propagated inputs.
* tests/packages.scm ("package-transitive-inputs", "package->bag, propagated
inputs"): Adjust to use simple labels for propagated inputs, without "/".
("package-transitive-inputs, no duplicates"): New test.
Reported
at <http://lists.gnu.org/archive/html/guix-devel/2015-07/msg00119.html>.
* guix/scripts/substitute.scm (http-multiple-get): When RESP has "Connection:
close", consume HEAD anyway; always call PROC to read from BODY.
Co-authored-by: Ludovic Courtès <ludo@gnu.org>
This fixes two problems:
1. Load errors would print an ugly backtrace.
2. When FILE was an absolute name, 'load' was passed an incorrect file
name.
* guix/scripts/environment.scm (options/resolve-packages): Use 'load*' instead
of 'load'.
* guix/scripts/environment.scm (package+propagated-inputs): Add 'output'
parameter. Use it in return value.
(options/resolve-packages): Use 'append-map' instead of 'map'. For 'load'
and 'expression', return all the outputs of the resulting package. For
'package', use 'specification->package+output' instead of
'specification->package'.
(guix-environment): Adjust uses of PACKAGES accordingly.
* doc/guix.texi (Invoking guix environment): Document it.
* tests/guix-environment.sh: Add test for --ad-hoc guile-bootstrap:out.
Before that, 'guix environment guile' (for instance) would define environment
variables that would refer to the "include" output of Bash, the "debug" output
of libgc, etc., even though these are not listed as inputs in the recipe of
'guile'.
* guix/gexp.scm (lower-inputs): Export.
* guix/scripts/environment.scm (evaluate-input-search-paths): Remove
'derivations' parameter; add 'search-paths'. Expect 'inputs' to be
a list of tuples. Adjust callers.
(create-environment): Remove 'derivations' parameter; add 'search-paths'.
(show-search-paths): Likewise.
(package+propagated-inputs): New procedure.
(packages->transitive-inputs, packages+propagated-inputs): Remove.
(build-inputs): Expect INPUTS to be a list of derivation tuples.
(guix-environment): Compute INPUTS using 'package+propagated-inputs',
'package->bag', and 'bag-transitive-inputs'. Move 'run-with-store' higher.
* tests/guix-environment.sh: Add test with FINDUTILS-BOOT0.
* guix/import/pypi.scm (python->package-name, maybe-inputs, compute-inputs,
guess-requirements): New procedures.
* guix/import/pypi.scm (guix-hash-url): Now takes a filename instead of an
URL as input.
* guix/import/pypi.scm (make-pypi-sexp): Now tries to generate the inputs
automagically.
* tests/pypi.scm: Update the test.
Reported by Alex Kost <alezost@gmail.com>
at <http://lists.gnu.org/archive/html/guix-devel/2015-06/msg00235.html>.
* guix/gexp.scm (local-file): Change #:recursive? to default to #f.
* tests/gexp.scm ("one local file", "gexp->derivation, local-file"): Adjust
calls to 'add-to-store' and 'interned-file' accordingly.
* guix/scripts/size.scm: New file.
* Makefile.am (MODULES): Add it.
(SCM_TESTS): Add tests/size.scm.
* doc.am (SUBCOMMANDS): Add 'size'.
* po/guix/POTFILES.in: Add guix/scripts/size.scm.
* tests/size.scm: New file.
* doc/guix.texi (Packages with Multiple Outputs): Add xref to "Invoking guix
size".
(Invoking guix size): New node.
(Invoking guix gc): Add index for "closure" and xref to the above.
* doc/contributing.texi (Submitting Patches): Use @enumerate for the check
list. Add item about 'guix size'.
Reported by Rastus_Vernon on IRC.
Fixes 'gnu-package?' for GNUcash.
* guix/gnu-maintenance.scm (gnu-package?)[gnu-home-page?]: New procedure. Use
it to determine whether PACKAGE is GNU.
A Cabal package is allowed to declare an "empty" library, in an
otherwise executable-only package, for the purpose of allowing Cabal
to use it as a dependency for other packages. See e.g. hspec-discover.
* guix/build/haskell-build-system.scm (register): Unconditionally call
setup script with "register", and install any config file generated.
A package may be listed in the manifest inputs multiple times. Avoid
copying ghc *.conf files twice by deleting duplicates.
* guix/profiles.scm (ghc-package-cache-file)[conf-files]: Delete
duplicate manifest inputs before copying conf files.
This avoids having 'find-files' report warnings about searching in
non-existent directories.
* guix/profiles.scm (ghc-package-cache-file)[conf-files]: Only search
for *.conf files if the search directory exists.
* guix/scripts/build.scm (package-with-source)[tarball-base-name]: Gracefully
handle file names that lack an extension.
Pass #:recursive? #t to 'download-to-store'.
* guix/download.scm (download-to-store): Add #:recursive? parameter and pass
it to 'add-to-store'.
* doc/guix.texi (Invoking guix build): Add an example of --with-source with a
directory.
* guix/scripts/environment.scm (guix-environment): Call 'parse-command-line'
outside of 'with-store'. This allows things like --help to run even if the
daemon is not running.