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.
* guix/build/glib-or-gtk-build-system.scm (data-directories): Rename
'schemas-directories' to 'data-directories' and add support for XDG theming
data.
* guix/build/glib-or-gtk-build-system.scm (gio-module-directories): New
function.
* guix/build/glib-or-gtk-build-system.scm (wrap-all-programs): Update names to
reflect that we are dealing with more types of data and not only with
schemas. Add handling of GIO modules.
* guix/build-system/glib-or-gtk.scm (lower): Import the 'bin' output of GLib
instead of 'out'. This was an error since we need the program
'glib-compile-schemas'. Update the description.
This yields a 46% improvement in 'derivation-prerequisites' invocations
on the Emacs derivation.
* guix/derivations.scm (derivation-prerequisites): Add 'input-set'
variable, and use it in iterations.
This makes 'guix environment PACKAGE' significantly faster when
substitutes are enabled. Before that, it would lead to many invocations
of 'guix substitute-binary', one per 'derivation-prerequisites-to-build'
call. Now, all these are replaced by a single invocation.
* guix/derivations.scm (derivation-output-paths, substitution-oracle):
New procedures.
(derivation-prerequisites-to-build): Replace #:use-substitutes? with
#:substitutable?. Remove the local 'derivation-output-paths' and
'substitutable?'.
* guix/ui.scm (show-what-to-build): Add 'substitutable?'. Pass it to
'derivation-prerequisites-to-build'.
[built-or-substitutable?]: Use it instead of 'has-substitutes?'.
* tests/derivations.scm ("derivation-prerequisites-to-build and
substitutes"): Use #:substitutable? instead of #:use-substitutes?.
* guix/derivations.scm (derivation-output-names): New procedure.
(derivation-prerequisites-to-build): Use it for #:outputs.
(map-derivation): Likewise.
* tests/derivations.scm ("derivation-output-names"): New test.
* guix/build/utils.scm (patch-/usr/bin/file): New procedure.
* guix/build/gnu-build-system.scm (patch-usr-bin-file): Rewrite using
it. Patch all the files returned by 'find-files' that are executable.
* gnu/packages/gawk.scm (gawk)[arguments]: Remove use of 'substitute*'
for 'extension/configure'.
* guix/scripts/substitute-binary.scm (narinfo-signature->canonical-sexp):
Change "~a" to "~s" in error message.
(%signature-line-rx): Remove.
(narinfo-sha256): Use 'string-contains' instead of 'regexp-exec', and
'string-take' instead of 'match:substring'.
* guix/records.scm (%recutils-field-rx, %recutils-comment-rx,
%recutils-plus-rx): Remove.
(%recutils-field-charset): New variable.
(recutils->alist): Adjust to use tests (string-ref line 0) instead of
regexps.
Based on preliminary work by John Darrington <john@darrington.wattle.id.au>.
* gnu/packages/cross-base.scm (xgcc-armhf): New variable.
* gnu/packages/gcc.scm (gcc-configure-flags-for-triplet): Add armhf case.
(gcc-4.7)[pre-configure]: Add gcc/config/*/linux-eabi.h to the list
of files in which to patch GLIBC_DYNAMIC_LINKER.
* gnu/packages/bootstrap.scm (glibc-dynamic-linker): Add armhf case.
* guix/utils.scm (gnu-triplet->nix-system, nix-system->gnu-triplet):
Add armhf cases.
Fixes <http://bugs.gnu.org/18895>.
* guix/build/gnu-build-system.scm (patch-shebangs): Add #:inputs
parameter. Remove 'bindirs'. Add 'bin-directories',
'output-bindirs', and 'input-bindirs'. Use them instead of (getenv
"PATH") to as the argument to 'patch-shebang'.
* guix/scripts/package.scm (search-path-environment-variables): Add
local 'files' variable.
* tests/packages.scm ("--search-paths with pattern"): New test.
This is a followup to 856ae5e. See <http://hydra.gnu.org/build/180506>
for an example of build failure.
* guix/build/gnu-build-system.scm (strip): Add #:archive-strip-flags
parameter. Use it when (ar-file? path).
* guix/build-system/gnu.scm (gnu-build): Add #:archive-strip-flags
parameter and pass it down.
* gnu/packages/commencement.scm (gcc-boot0)[arguments]: Add
#:strip-flags.
* gnu/packages/base.scm (glibc)[arguments]: Likewise.
* guix/scripts/lint.scm (run-checkers): Check
whether (current-error-port) is a tty, and print the package being
checked and the checker currently running when it is.
This will handle the new 'file-type' and 'file-pattern' fields correctly.
* guix/scripts/package.scm (search-path-environment-variables)[search-path-definition]:
Rewrite in terms of 'search-path-as-list'.
This saves 19% on the 'bin' directory of Coreutils, and certainly
helpful for things like Git's 'libexec' directory.
* guix/build-system/gnu.scm (gnu-build): Change default value for
#:strip-flags to '("--strip-all").
* guix/build/gnu-build-system.scm (strip): Ditto.
* gnu/packages/linux.scm (linux-libre)[arguments]: Add #:strip-flags.
Partly fixes <http://bugs.gnu.org/18033>.
* guix/build/utils.scm (search-path-as-list): Rename 'sub-directories'
parameter to 'files'. Add #:type parameter and honor it.
(set-path-environment-variable): Likewise. Pass #:type to
'search-path-as-list'.
* guix/packages.scm (search-path-specification->sexp): Add 'directory as
the last item of the tuple.
* guix/build/gnu-build-system.scm (set-paths): Add 'type' to search-path
pattern. Pass #:type to 'set-path-environment-variable'.
Reported by Federico Beffa <beffa@ieee.org>
and Eric Bavier <ericbavier@gmail.com>.
* guix/build-system/python.scm (package-with-explicit-python): Do
nothing when P's build system is not PYTHON-BUILD-SYSTEM.
Fixes a bug whereby removing the next-to-last item in a profile would
lead to an obscure error, as shown at
<http://lists.gnu.org/archive/html/guix-devel/2014-12/msg00292.html>.
Reported by Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>.
* guix/profiles.scm (profile-derivation)[inputs]: Use (list info-dir
"out") instead of just INFO-DIR.
Suggested by Mark H Weaver <mhw@netris.org>
in <http://bugs.gnu.org/19138>.
* guix/build/utils.scm (wrap-program): Change wrapper to use "exec -a
PROG" instead of just "exec".
Fixes <http://bugs.gnu.org/19321>.
Reported by Mark H Weaver <mhw@netris.org>.
* guix/build-system/glib-or-gtk.scm (glib-or-gtk-build): Change default
value of #:glib-or-gtk-wrap-excluded-outputs to ''().
This would not work when /boot is a separate partition, as reported by
Nikita Karetnikov <nikita@karetnikov.org> in <http://bugs.gnu.org/19220>.
This fixes a regression introduced in 39d1f82.
* gnu/build/install.scm (install-grub): Copy GRUB.CFG instead of
symlinking it, as was the case before 39d1f82.
* gnu/build/vm.scm (register-grub.cfg-root): Add 'grub.cfg' parameter.
Make it a permanent GC root instead of an indirect GC root.
(initialize-hard-disk): Adjust accordingly.
* guix/scripts/system.scm (install-grub*): Replace use of
'add-indirect-root' by the addition of a permanent GC root in
%GC-ROOTS-DIRECTORY.
Fixes <http://bugs.gnu.org/19279>.
Fixes a regression introduced in cc7fa59.
Reported by Tomas Cech <tcech@suse.cz>.
* guix/scripts/system.scm (install): Fix order of arguments to 'lift'
and 'lift2'.
Appending to "raw" args broke optional parameters in 'guix package -I'
and 'guix package -A', and possibly other places. Therefore, switch to
parsing each set of options on its own and append resulting alists
together afterwards.
* guix/scripts/archive.scm (parse-options-from): Rename from
(parse-options) and add explicit argument. New form of (parse-options)
using its old algorithm via -from function.
* guix/scripts/build.scm: Ditto.
* guix/scripts/environment.scm: Ditto.
* guix/scripts/package.scm: Ditto.
* guix/scripts/system.scm: Ditto.
* tests/guix-package.sh: Add test.
* doc/guix.texi (Invoking guix build): Make it clear that the options
are parsed independently.
Co-authored-by: Ludovic Courtès <ludo@gnu.org>
Fixes <http://bugs.gnu.org/19160>.
* guix/scripts/system.scm (install-grub*): Make /boot/grub/grub.cfg an
indirect GC root.
* gnu/build/install.scm (install-grub): Make TARGET a symlink.
* gnu/build/vm.scm (register-grub.cfg-root): New procedure.
(initialize-hard-disk): Use it.
* guix/build/glib-or-gtk-build-system.scm (wrap-all-programs): Add
#:glib-or-gtk-wrap-excluded-outputs parameter and honor it.
* guix/build-system/glib-or-gtk.scm (glib-or-gtk-build): Add
#:glib-or-gtk-wrap-excluded-outputs parameter and pass it in BUILDER.
* doc/guix.texi (Build Systems): Mention it.
* guix/build/glib-or-gtk-build-system.scm (wrap-all-programs): Move body
to 'handle-output' inner procedure, and parametrize it by output name
and directory. Call it for each element of OUTPUTS.
(compile-glib-schemas): Likewise.
* guix/build/glib-or-gtk-build-system.scm (wrap-all-programs): Use
'for-each' instead of 'map' in for-effect contexts. Use 'cut' instead
of 'lambda' when appropriate.
Reported by Andreas Enge <andreas@enge.fr>.
* guix/gnu-maintenance.scm (sans-extension): Add case for ".zip".
(%tarball-rx): Extend to handle .zip extension.
* guix/scripts/substitute-binary.scm (fetch): Change "unresponsive" to
"somewhat slow". I'm being told that the former is often
misunderstood as "broken".
* guix/build/utils.scm (substitute): Clarify first sentence of
docstring and add warning to the docstring about using '$' to match
an end of line.
(substitute*): Add warning to the docstring about using '$' to match
an end of line.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* guix/build/gnu-build-system.scm (strip): Check whether 'file-exists?'
before calling 'elf-file?' and 'ar-file?'. This should fix build
failures in the presence of dangling symlinks, as in
<http://hydra.gnu.org/build/167521/nixlog/1/raw>.
This avoids uncaught exceptions when the 'strip' phase would call these
procedures on symlinks to directories, such as 'lib/terminfo' in
ncurses (see <http://hydra.gnu.org/build/167310/nixlog/1/tail-reload>.)
* guix/build/utils.scm (file-header-match): Catch 'system-error', and
return #f upon EISDIR.
Fixes <http://bugs.gnu.org/18534>.
* guix/scripts/pull.scm (with-environment-variable, with-PATH): New
macros.
(temporary-directory, first-directory, interned-then-deleted): New
procedures.
(unpack): Rewrite to do the unpacking in the current process rather
than as a separate derivation.
(%self-build-file): New variable.
(build-from-source): New procedure.
(build-and-install): Use it.
* guix/build/pull.scm (build-guix): Rename 'tarball' argument to
'source'. Remove #:tar and #:gzip parameters, as well as 'tar'
invocation. Remove 'scandir' invocation. Wrap body in
'with-directory-excursion'.
* build-aux/build-self.scm: New file.
* Makefile.am (EXTRA_DIST): Add it.
* guix/gexp.scm (gexp->derivation): Add #:module-path parameter, and
pass it to 'imported-modules' and 'compiled-modules'.
* doc/guix.texi (G-Expressions): Adjust accordingly.
* gnu/system/vm.scm (system-qemu-image/shared-store): Add
#:disk-image-size and #:full-boot? parameters and honor them. Pass
'#:copy-inputs? full-boot?', and change #:inputs argument.
* guix/scripts/system.scm (system-derivation-for-action): Pass
#:disk-image-size to 'system-qemu-image/shared-store'.
* doc/guix.texi (Invoking guix system): Mention use of '--image-size' in
conjunction with '--full-boot'.
* guix/scripts/lint.scm (starts-with-abbreviation?): New procedure.
(check-synopsis-style)[check-start-with-package-name]: Use it.
* tests/lint.scm ("synopsis: start with abbreviation"): New test.
* guix/scripts/lint.scm (package-name-regexp): New procedure.
(check-synopsis-style)[check-start-with-package-name]: Use it instead
of 'string-prefix-ci?'.
* tests/lint.scm ("synopsis: start with package name prefix"): New test.
* guix/store.scm (run-gc): Add calls to 'hash-clear!'.
* tests/store.scm ("add-text-to-store vs. delete-paths",
"add-to-store vs. delete-paths"): New tests.
Reported by Andreas Enge <andreas@enge.fr>.
* guix/packages.scm (first-value): New macro.
(package-transitive-supported-systems): Rewrite to traverse all the
DAG rooted at PACKAGE.
* tests/packages.scm ("package-transitive-supported-systems"): Add 'd'
and 'e', and test them.
Thanks to Mark H. Weaver <mhw@netris.org> for insightful discussions
and suggestions.
* guix/packages.scm (<package>)[graft]: New field.
(patch-and-repack): Invoke 'package-derivation' with #:graft? #f.
(package-source-derivation): Likewise. Do not use (%guile-for-build)
in call to 'patch-and-repack', and we could end up using a grafted
Guile.
(expand-input): Likewise, also for 'package-cross-derivation' call.
(package->bag): Add #:graft? parameter. Honor it. Use 'strip-append'
instead of 'package-full-name'.
(input-graft, input-cross-graft, bag-grafts, package-grafts): New
procedures.
(package-derivation, package-cross-derivation): Add #:graft? parameter
and honor it.
* gnu/packages/bootstrap.scm (package-with-bootstrap-guile): Add
recursive call on 'graft'.
* guix/build-system/gnu.scm (package-with-explicit-inputs,
package-with-extra-configure-variable, static-package): Likewise.
(gnu-build): Use the ungrafted Guile to avoid full rebuilds.
(gnu-cross-build): Likewise.
* guix/build-system/cmake.scm (cmake-build): Likewise.
* guix/build-system/glib-or-gtk.scm (glib-or-gtk-build): Likewise.
* guix/build-system/perl.scm (perl-build): Likewise.
* guix/build-system/python.scm (python-build): Likewise.
* guix/build-system/ruby.scm (ruby-build): Likewise.
* guix/build-system/trivial.scm (guile-for-build): Likewise.
* tests/packages.scm ("package-derivation, direct graft",
"package-cross-derivation, direct graft", "package-grafts,
indirect grafts", "package-grafts, indirect grafts, cross",
"package-grafts, indirect grafts, propagated inputs",
"package-derivation, indirect grafts"): New tests.
("bag->derivation", "bag->derivation, cross-compilation"): Wrap in
'parameterize'.
* doc/guix.texi (Security Updates): New node.
(Invoking guix build): Document --no-graft.
* guix/scripts/environment.scm (show-help): Align --pure and
--search-paths with other long options; add 'newline' call before
'show-bug-report-information' call.
* guix/tests.scm (derivation-narinfo, call-with-derivation-narinfo): New
procedures.
(with-derivation-narinfo): New macro.
* tests/derivations.scm ("derivation-prerequisites-to-build and
substitutes"): Use them.
* guix/scripts/lint.scm (check-description-style): Exception for
upper-case rule if the description starts with the package name.
* tests/lint.scm: Test it.
* guix/scripts/lint.scm (start-with-capital-letter?): Rename too...
(properly-starts-sentence?): Rewrite with regex and add digits.
(check-description-style, check-synopsis-style): Use it.
* tests/lint.scm: Add tests.
* guix/scripts/lint.scm (start-with-capital-letter?): Handle empty
strings.
(check-description-style): New check for end-of-sentence space.
* tests/lint.scm: Test it.
The procedure version-prefix truncates a version string to a certain
number of components. version-major+minor is a special case of this,
which extracts the "major.minor" part of the string. Previously this
was handled by an expression common to several packages.
* guix/utils.scm (version-prefix, version-major+minor): New procedures
* gnu/packages/backup.scm (duplicity): Use version-major+minor.
* gnu/packages/cmake.scm (cmake): Likewise.
* gnu/packages/gnome.scm (libbonobo, libbonoboui): Likewise.
* gnu/packages/gnutls.scm (gnutls): Likewise.
* gnu/packages/mail.scm (gmime): Likewise.
* gnu/packages/mpd.scm (mpd): Likewise.
* gnu/packages/mpi.scm (openmpi): Likewise.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Fixes downloads from https://alioth.debian.org.
Reported by John Darrington <jmd@gnu.org>.
* guix/build/download.scm (http-fetch)[headers]: Add 'Accept'.
* guix/packages.scm (package-transitive-supported-systems): New procedure.
* tests/packages.scm ("package-transitive-supported-systems"): New test.
* build-aux/hydra/gnu-system.scm (package->job): Use it.
* guix/derivations.scm (<graft>): New record type.
(graft-derivation): Rename 'replacements' to 'grafts', and expect it
to be a list of <graft> records. Adjust accordingly.
* tests/derivations.scm ("graft-derivation"): Use 'graft' instead of
pairs in argument to 'graft-derivation'.
See <https://bugs.gnu.org/18747> for the original report.
* guix/download.scm (url-fetch): Comment out #:local-build? argument.
* guix/git-download.scm (git-fetch): Likewise.
* guix/svn-download.scm (svn-fetch): Likewise.
This reduces run time of (package-derivation s emacs) by ~1.5%.
* guix/utils.scm (bytevector->base16-string): Traverse BV from the end
so as to use 'string-concatenate' instead of
'string-concatenate-reverse'.
This reduces run time of (package-derivation s emacs) by ~5%.
* guix/derivations.scm (search-path*): New procedure.
(imported-modules): Use it instead of 'search-path'.
This reduces run time of (package-derivation s emacs) by ~10%.
* guix/derivations.scm (derivation-path->base16-hash): New procedure.
(derivation-hash): Use it.
* guix/scripts/package.scm (switch-to-generation): New procedure.
(switch-to-previous-generation): Use it.
(guix-package): Adjust for '--switch-generation' option.
* tests/guix-package.sh: Test it.
* doc/guix.texi (Invoking guix package): Document it.
* guix/scripts/substitute-binary.scm (%cache-url): Ignore the
'GUIX_BINARY_SUBSTITUTE_URL' environment variable.
* test-env.in: Invoke 'guix-daemon' with '--substitute-urls'.
* tests/substitute-binary.scm: Set '%cache-url' to the value of
'GUIX_BINARY_SUBSTITUTE_URL'.
* guix/packages.scm (<package> printer): Check whether LOC is #f.
* tests/packages.scm ("printer with location", "printer without
location"): New tests.
* guix/derivations.scm (graft-derivation): New procedure.
* guix/build/graft.scm: New file.
* Makefile.am (MODULES): Add it.
* tests/derivations.scm ("graft-derivation"): New test.
* guix/scripts/lint.scm (check-start-article): use "string-ci=?" instead of
"string=?".
* tests/lint.scm ("synopsis: starts with 'a'",
"synopsis: starts with 'an'"): New tests.
* guix/scripts/lint.scm (check-description-style,
check-synopsis-start-upper-case): New methods.
* tests/lint.scm ("description: does not start with an upper-case letter",
"synopsis: does not start with an upper-case letter"): New tests.
* guix/build-system.scm (<build-system>)[build, cross-build]: Remove.
[lower]: New field.
(<bag>): New record type.
(make-bag): New procedure.
* guix/packages.scm (bag-transitive-inputs, bag-transitive-build-inputs,
bag-transitive-host-inputs, bag-transitive-target-inputs,
package->bag): New procedures.
(package-derivation): Use it; use the bag, apply its build procedure,
etc.
(package-cross-derivation): Likewise.
* gnu/packages/bootstrap.scm (raw-build, make-raw-bag): New procedure.
(%bootstrap-guile): Use them.
* guix/build-system/trivial.scm (lower): New procedure.
(trivial-build, trivial-cross-build): Remove 'source' parameter. Pass
INPUTS as is.
(trivial-build-system): Adjust accordingly.
* guix/build-system/gnu.scm (%store, inputs-search-paths,
standard-search-paths, expand-inputs, standard-inputs): Remove.
(gnu-lower): New procedure.
(gnu-build): Remove 'source' and #:implicit-inputs? parameters.
Remove 'implicit-inputs' and 'implicit-search-paths' variables. Get
the source from INPUT-DRVS.
(gnu-cross-build): Likewise.
(standard-cross-packages): Remove call to 'standard-packages'.
(standard-cross-inputs, standard-cross-search-paths): Remove.
(gnu-build-system): Remove 'build' and 'cross-build'; add 'lower'.
* guix/build-system/cmake.scm (lower): New procedure.
(cmake-build): Remove 'source' and #:cmake parameters. Use INPUTS and
SEARCH-PATHS as is. Get the source from INPUTS.
* guix/build-system/perl.scm: Likewise.
* guix/build-system/python.scm: Likewise.
* guix/build-system/ruby.scm: Likewise.
* gnu/packages/cross-base.scm (cross-gcc): Change "cross-linux-headers"
to "linux-headers".
(cross-libc)[xlinux-headers]: Pass #:implicit-cross-inputs? #f.
Likewise. In 'propagated-inputs', change "cross-linux-headers" to
"linux-headers".
* guix/git-download.scm (git-fetch): Use 'standard-packages' instead of
'standard-inputs'.
* tests/builders.scm ("gnu-build-system"): Remove use of
'build-system-builder'.
("gnu-build"): Remove 'source' and #:implicit-inputs? arguments to
'gnu-build'.
* tests/packages.scm ("search paths"): Adjust to new build system API.
("package-cross-derivation, no cross builder"): Likewise.
* doc/guix.texi (Build Systems): Add paragraph on bags.
* guix/build-system/gnu.scm (gnu-build, gnu-cross-build): Remove comment
about case where GUILE is a derivation path.
* guix/build-system/cmake.scm (cmake-build): Remove case where GUILE is
a derivation path.
* guix/build-system/perl.scm (perl-build): Likewise.
* guix/build-system/python.scm (python-build): Likewise.
* guix/build-system/ruby.scm (ruby-build): Likewise.
* guix/build-system/trivial.scm (guile-for-build): Likewise.
* guix/build-system/cmake.scm (cmake-build): Add #:build-type. Pass it
in BUILDER.
* guix/build/cmake-build-system.scm (configure): Add #:build-type
parameter and honor it.
* doc/guix.texi (Build Systems): Document #:configure-flags and
#:build-type for CMake.
* guix/ui.scm (size->number): Add a bunch of large units. Recognize
one-letter unit names. Change "KB" to "kB".
* tests/ui.scm ("size->number, 1T"): New test.
* doc/guix.texi (Invoking guix gc): Add cross-reference to "Block size"
in the Coreutils manual.
(Invoking guix system): Likewise.
* guix/download.scm (url-fetch): When URL is a string, if it's not a URI
or if it's a URI with 'file' or #f scheme, use 'add-to-store'.
* tests/builders.scm ("url-fetch, file", "url-fetch, file URI"): New
tests.
Reported by Alex Sassmannshausen <alex.sassmannshausen@gmail.com>.
* guix/scripts/pull.scm (unpack): Add Guile-JSON to %load-path and
%load-compiled-path.
* guix/snix.scm: Delete.
* guix/import/snix.scm: New file.
* guix/import/pypi.scm: New file.
* guix/import/utils.scm: New file.
* guix/scripts/import/nix.scm: New file.
* guix/scripts/import/pypi.scm: New file.
* tests/pypi.scm: New file.
* tests/snix.scm: Import (guix import snix) module.
* guix/scripts/import.scm (%default-options, %options): Delete.
(%standard-import-options, importers): New variables.
(show-help): List importers.
(guix-import): Factor out Nix-specific logic. Delegate to correct importer
based upon first argument.
* configure.ac (HAVE_GUILE_JSON): New conditional.
* Makefile.am (MODULES): Add new files and remove 'guix/snix.scm'.
(SCM_TESTS): Add 'tests/pypi.scm' if guile-json is installed.
Co-authored-by: David Thompson <davet@gnu.org>
* gnu/packages/ruby.scm: New file.
* gnu-system.am (GNU_SYSTEM_MODULES): Add it.
* guix/licenses.scm (ruby): New variable.
* guix/packages.scm (patch-and-repack)[patch-inputs]: Use 'add-to-store'
only if the PATCH is a file name, and 'package-source-derivation' if
PATCH is an origin.
Fixes <http://bugs.gnu.org/18526>.
Reported by Mark H. Weaver.
* guix/build/download.scm (tls-wrap): Add 'server' parameter. Call
'set-session-server-name!' when (gnutls) defines it.
(open-connection-for-uri): Adjust 'tls-wrap' call accordingly.
* guix/scripts/offload.scm (machine-less-loaded?, machine-faster?):
Remove.
(machine-power-factor): New procedure.
(machine-less-loaded-or-faster?): Use it.
* guix/scripts/pull.scm (unpack): Remove 'store' parameter. Rewrite
using 'gexp->derivation'.
(what-to-build, indirect-root-added, build-and-install): New
procedures.
(guix-pull): Use it.
* guix/build/syscalls.scm (network-interfaces): Update docstring.
(%interface-line): New variable.
(all-network-interfaces): New procedure.
* tests/syscalls.scm ("all-network-interfaces"): New test.
("network-interfaces"): Change to make sure the result is a subset
of (all-network-interfaces).
Previously 'guix pull' would just fail with "No such file or directory"
if ~/.config didn't already exist.
* guix/ui.scm (config-directory): Use 'mkdir-p' instead of 'mkdir'.
Change the 'catch' handler to expect errors different from EEXIST.
* guix/build/utils.scm (wrap-program): Multiple invocations of
wrap-program for the same file create successive wrappers. Adjust
docstring.
* tests/build-utils.scm: Test new wrap-program behavior.
(%store): New variable.
* gnu/build/activation.scm (activate-current-system): Honor
$GUIX_NEW_SYSTEM by default.
* guix/scripts/system.scm (switch-to-system): Set $GUIX_NEW_SYSTEM
before loading SCRIPT.
Reported by Andreas Enge <andreas@enge.fr>.
* guix/profiles.scm (right-arrow): Use 'set-port-conversion-strategy!'
instead of '%default-port-conversion-strategy'. The latter is only
available in Guile 2.0.5.
* guix/gexp.scm (lower-reference-graphs): New procedure.
(gexp->derivation)[graphs-file-names]: New procedure.
Use 'lower-reference-graphs', and augment #:inputs argument as a
function of #:references-graphs.
* doc/guix.texi (G-Expressions): Adjust 'gexp->derivation' documentation
accordingly.
* tests/gexp.scm ("gexp->derivation, store copy"): Remove reference to
TWO in BUILD-DRV. Use TWO directly in #:references-graphs argument.
("gexp->derivation #:references-graphs"): New test.
* gnu/system/vm.scm (qemu-image): Remove variable 'graph'; use INPUTS as
the #:references-graphs argument to
'expression->derivation-in-linux-vm'.
* guix/build/pull.scm (report-build-progress): New procedure.
(p-for-each): Add #:progress parameter.
[loop]: Keep track of the number of completed processes. Tail-call
PROGRESS at each loop iteration.
(build-guix): Add #:debug-port parameter. Use it for verbose
messages. Change 'tar' flags to 'xf'. Around 'compile-file' call,
bind CURRENT-WARNING-PORT to DEBUG-PORT.
* guix/scripts/pull.scm (unpack): Add #:verbose? parameter.
[builder]: Pass #:debug-port to 'build-guix'.
(guix-pull): Leave CURRENT-BUILD-OUTPUT-PORT unchanged. Pass
#:verbose? to 'unpack'.
This allows editors to parse warnings correctly.
* guix/scripts/lint.scm (emit-warning): Use 'format' instead of
'warning', to avoid the "guix lint: " prefix in messages.
* tests/lint.scm (call-with-warnings): Indent.
* guix/profiles.scm (manifest-show-transaction)[package-strings,
upgrade-strings]: Show version number in separate column. Show OUTPUT
in first column, and only when it's different from "out".
* guix/profiles.scm (manifest-lookup): New procedure.
(manifest-installed?): Use it.
(manifest-transaction-effects): Return a pair of entries for upgrades.
(right-arrow): New procedure.
(manifest-show-transaction)[upgrade-string, →]: New variables.
Report upgrades using 'upgrade-string'.
* tests/profiles.scm ("manifest-show-transaction"): New test.
("manifest-transaction-effects"): Match UPGRADE against a pair.
Before that, 'guix package --search-paths' would not work if, say,
'foo-0.2' is installed but the distro provides 'foo-0.3'.
* guix/scripts/package.scm (search-path-environment-variables)[manifest-entry->package]:
Handle the case where 'find-best-packages-by-name' returns '().
* guix/profiles.scm (manifest-transaction-effects): New procedure.
(manifest-show-transaction): Use it instead of locally computing it.
* tests/profiles.scm (glibc): New variable.
("manifest-transaction-effects"): New test.
Fixes <http://bugs.gnu.org/18115>.
Reported by Mark H Weaver <mhw@netris.org>.
* guix/scripts/offload.scm (register-gc-root)[script]: Wrap 'symlink'
call in "catch 'system-error", and ignore EEXIST errors.
Fixes <http://bugs.gnu.org/18070>.
Reported by Andreas Enge <andreas@enge.fr>.
* guix/scripts/offload.scm (remote-pipe): Augment docstring.
(machine-load): Return +inf.0 instead of 1 if MACHINE does not respond
or responds badly.
* guix/build-system/perl.scm (perl-build): Add support for variables
parallel-build? and parallel-tests?.
* guix/build-system/gnu.scm (gnu-build): Add a line break for clarity.
* guix/git-download.scm (git-package): New procedure.
(git-fetch): Use it. Remove 'git-for-build'.
Use a gexp and 'gexp->derivation'.
* guix/download.scm (gnutls-package): Fix docstring.
Fixes <http://bugs.gnu.org/18305>.
Reported by Brandon Invergo <brandon@gnu.org>.
* guix/profiles.scm (manifest-inputs, info-dir-file): New procedures.
(profile-derivation): Use them. Add #:info-dir? parameter and honor
it.
* guix/scripts/package.scm (guix-package): Call 'profile-derivation'
with #:info-dir? #f when the 'bootstrap? option is set.
* tests/profiles.scm ("profile-derivation"): Pass #:info-dir? #f.
* guix/profiles.scm (<manifest-transaction>): New record-type.
(manifest-perform-transaction): New procedure.
(manifest-show-transaction): New procedure.
* tests/profiles.scm ("manifest-perform-transaction"): New test.
Co-authored-by: Ludovic Courtès <ludo@gnu.org>
* guix/gexp.scm (<gexp>)[natives]: New field.
(write-gexp): Use both 'gexp-references' and
'gexp-native-references'.
(gexp->derivation): Use both 'gexp-inputs' and 'gexp-native-inputs',
and append them.
(gexp-inputs): Add 'references' parameter and honor it.
(gexp-native-inputs): New procedure.
(gexp->sexp)[reference->sexp]: Add 'native?' parameter and honor it.
Use it, and use 'gexp-native-references'.
(gexp)[collect-native-escapes]: New procedure.
[escape->ref]: Handle 'ungexp-native' and 'ungexp-native-splicing'.
[substitute-ungexp, substitute-ungexp-splicing]: New procedures.
[substitute-references]: Use them, and handle 'ungexp-native' and
'ungexp-native-splicing'.
Adjust generated 'make-gexp' call to provide both normal references
and native references.
[read-ungexp]: Support 'ungexp-native' and
'ungexp-native-splicing'.
Add reader extension for #+.
* tests/gexp.scm (gexp-native-inputs): New procedure.
(gexp->sexp*): Add 'target' parameter.
("ungexp + ungexp-native",
"input list + ungexp-native",
"input list splicing + ungexp-native-splicing",
"gexp->derivation, ungexp-native",
"gexp->derivation, ungexp + ungexp-native"): New tests.
("sugar"): Add tests for #+ and #+@.
* doc/guix.texi (G-Expressions): Document 'ungexp-native' et al.
* guix/gexp.scm (lower-inputs): Add #:system and #:target. Use
'package->cross-derivation' when TARGET is true. Honor SYSTEM.
(gexp->derivation): Add #:target argument. Pass SYSTEM and TARGET to
'lower-inputs' and 'gexp->sexp'.
(gexp->sexp): Add #:system and #:target. Pass them in recursive call
and to 'package-file'.
* tests/gexp.scm (gexp->sexp*): Add 'system' and 'target' parameters.
("gexp->derivation, cross-compilation"): New test.
* guix/monads.scm (package-file): Add #:target keyword parameter and
honor it.
(package->cross-derivation): New procedure.
* tests/monads.scm ("package-file + package->cross-derivation"): New test.
* doc/guix.texi (The Store Monad): Update 'package-file' documentation.
Add 'package->cross-derivation'.
Fixes <http://bugs.gnu.org/17468>.
* guix/ui.scm (fill-paragraph): Two spaces after period and no spaces before newline.
* tests/ui.scm: New test case.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Suggested by Alex Kost <alezost@gmail.com>.
* guix/scripts/package.scm (options->installable)[package->manifest-entry]:
Move to (guix profiles).
[package->manifest-entry*]: New procedure.
Use it.
* guix/profiles.scm (package->manifest-entry): New procedure.
* tests/profiles.scm (guile-for-build): New variable.
Call '%guile-for-build'.
("profile-derivation"): New test.
* guix/profiles.scm (<manifest-entry>)[path]: Rename to...
[item]: ... this. Update users.
(manifest->sexp): Rename to...
(manifest->gexp): ... this. Return a gexp.
(lower-input): Remove.
(profile-derivation): Remove 'store' parameter, and turn into a
monadic procedure.
[inputs]: New variable.
[builder]: Turn into a gexp.
Replace call to 'build-expression->derivation' with call to
'gexp->derivation'.
* guix/scripts/package.scm (link-to-empty-profile): Adjust call to
'profile-derivation', and wrap it in 'run-with-store'.
(show-what-to-remove/install): Rename 'path' to 'item'. Check whether
ITEM is a package, and return its output path if it is.
(input->name+path): Remove.
(options->installable): Set 'item' to P.
(guix-package): Adjust call to 'profile-derivation'.
* tests/profiles.scm (guile-2.0.9): Change 'path' to 'item'.
* guix/profiles.scm (manifest=?): Remove.
* guix/scripts/package.scm (readlink*): New procedure.
(guix-package)[process-actions]: Use 'readlink*' and compare the
profile to be built, PROF, with PROFILE to determine whether there's
nothing to be done.
Suggested by Mark H. Weaver.
* gnu/system/shadow.scm (<user-group>)[system?]: New field.
(%base-groups): Introduce 'system-group' macro, and use it.
* gnu/system.scm (user-group->gexp): Pass the 'system?' field.
* guix/build/activation.scm (add-group): Add #:system? and honor it.
(activate-users+groups): Handle the 'system?' field.
* gnu/system/file-systems.scm (%tty-gid): Choose an ID below 1000.
* doc/guix.texi (User Accounts): Document the 'system?' field.
Partly fixes <http://bugs.gnu.org/18082>.
Reported by Mark H Weaver <mhw@netris.org>.
* guix/scripts/system.scm (save-environment-excursion): New macro.
(switch-to-system): Wrap 'primitive-load' call in it.
Partly fixes <http://bugs.gnu.org/18082>.
Reported by Mark H Weaver <mhw@netris.org>.
* guix/scripts/system.scm (perform-action) <reconfigure>: Pass the
output file name of GRUB.CFG to 'install-grub'.
* guix/build/linux-initrd.scm (MS_NOSUID, MS_NODEV, MS_NOEXEC): New
variables.
(mount-flags->bit-mask): New procedure.
(mount-file-system)[flags->bit-mask]: Remove.
Use 'mount-flags->bit-mask' instead.
In /etc/mtab, use the empty string when OPTIONS is false.
* gnu/services/base.scm (file-system-service): Add #:flags parameter and
honor it.
* gnu/system.scm (other-file-system-services): Pass FLAGS to
'file-system-service'.
Fixes <http://bugs.gnu.org/18049>.
Reported by Marek Benc <merkur32@gmail.com>.
* guix/scripts/system.scm (copy-closure): Pass #:state-directory to
'register-path'.
* nix/guix-register/guix-register.cc (GUIX_OPT_STATE_DIRECTORY): New
macro.
(parse_opt): Honor it.
* tests/guix-register.sh: Add test with '--state-directory'.
* guix/store.scm (register-path): Add #:state-directory parameter.
* guix/records.scm (define-record-type*)[record-inheritance]: Check for
unexpected field names.
* tests/records.scm ("define-record-type* with let* behavior"): Return
#t, not *unspecified*.
("define-record-type* & inherit & extra initializers"): New test.
* guix/scripts/system.scm (references*, topologically-sorted*,
show-what-to-build*): New procedures.
(copy-closure): Turn into a monadic procedure.
(install): Likewise, and adjust parameter list.
(switch-to-system): Likewise.
(system-derivation-for-action, grub.cfg, maybe-build, perform-action):
New procedures.
(guix-system): Use them.
Partly fixes <http://bugs.gnu.org/18002>.
Reported by David Thompson <dthompson2@worcester.edu>.
* guix/gexp.scm (gexp->derivation): Change #:system to default #f.
Use (%current-system) from within the 'mlet*'.
* tests/gexp.scm ("gexp->derivation, default system"): New test.
* guix/monads.scm (mapm): Don't reverse LST, so that items are processed
from left to right. Bind the result of 'foldm' and reverse it.
* tests/monads.scm ("sequence"): Change 'frob' so it performs its side
effect within an 'mlet' body. Adjust call accordingly.
Fixes <http://bugs.gnu.org/17946>.
Notoriously, cron jobs may set LOGNAME only and not USER. See
e.g. crontab(5) under Debian 7 (wheezy).
* guix/scripts/package.scm (%profile-directory)
(guix-package): Also try LOGNAME if USER is unset.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Fixes <http://bugs.gnu.org/17939>.
Reported by Taylan Ulrich Bayirli/Kammer <taylanbayirli@gmail.com>.
* guix/scripts/package.scm (canonicalize-profile): New procedure.
(%options): Use it for --profile.
* tests/guix-package.sh: Add test.
* guix/build/linux-initrd.scm (canonicalize-device-spec): When label
resolution fails, call 'error' instead of 'format' + 'start-repl'.
(boot-system): Wrap most of body in 'call-with-error-handling'.
Remove 'catch' around 'primitive-load' call.
Reported by David Thompson <dthompson2@worcester.edu>.
* guix/build/linux-initrd.scm (read-ext2-superblock): Add
'superblock-size' variable. Read with 'get-bytevector-n!' instead of
'getbytevector-n', and make sure we read exactly SUPERBLOCK-SIZE
bytes.
* guix/git-download.scm (<git-reference>)[recursive?]: New field.
(git-fetch): Add 'inputs' variable. Add it to the #:inputs argument
of 'build-expression->derivation'. Augment builder with call to
'set-path-environment-variable', and pass #:recursive? to
'git-fetch'.
* guix/build/git.scm (git-fetch): Add #:recursive? parameter. Pass
--recursive when RECURSIVE? is true, and delete all the '.git' files.
* gnu/system/shadow.scm (<user-account>)[system?]: New field.
* gnu/system.scm (user-account->gexp): Add it.
* guix/build/activation.scm (add-user): Add #:system? parameter and
honor it.
(activate-users+groups): Handle the 'system?' part of user tuples.
Pass it to 'add-user'. Don't create PROFILE-DIR when SYSTEM? is
true.
* gnu/services/dbus.scm (dbus-service): Add 'system?' field for
"messagebus" account.
* gnu/services/base.scm (guix-build-accounts): Likewise.
* gnu/services/avahi.scm (avahi-service): Likewise.
This is a followup to e2fcc23. The /etc/group file would be cleared
when booting.
* guix/build/activation.scm (activate-users+groups)[touch]: Rewrite so
it does not wipe out FILE's contents.
* guix/scripts/system.scm (read-operating-system) <catch handler>: Add
case for 'syntax-error'. Correct message for default case.
* guix/scripts/offload.scm (build-machines) <catch handler>: Add case
for 'syntax-error'.
* tests/guix-system.sh: New file.
* Makefile.am (SH_TESTS): Add it.
Fixes a regression introduced in 56b8210 ("guix build: Allow gexps to be
passed to '-e'.")
* guix/ui.scm (%guix-user-module): Wrap in 'delay'.
(read/eval): Adjust accordingly.
* guix/ui.scm (%guix-user-module): New variable.
(read/eval): Pass it as the second argument to 'eval'.
* guix/scripts/build.scm (options/resolve-packages): Add case for
'gexp?'.
* tests/guix-build.sh: Add tests.
* doc/guix.texi (Invoking guix build): Document '-e gexp'.
guxi build: Allow gexps to be passed to '-e'.
* guix/ui.scm (%guix-user-module): New variable.
(read/eval): Pass it as the second argument to 'eval'.
* guix/scripts/build.scm (options/resolve-packages): Add case for
'gexp?'.
* tests/guix-build.sh: Add tests.
* doc/guix.texi (Invoking guix build): Document '-e gexp'.
This makes 'guix package' et al. slightly less verbose, by not emitting
"@ substituter-started" lines and similar.
* guix/scripts/build.scm (set-build-options-from-command-line): Pass
#:print-build-trace.
(%default-options): Add 'print-build-trace?'.
* guix/derivations.scm (build-expression->derivation): Add
#:allowed-references and pass it to 'derivation.
* doc/guix.texi (Derivations): Adjust accordingly.
This partly reverts commit 185f669 ("services: Make sure the store's
group is the build group.")
* gnu/services/base.scm (guix-service)[activate]: Remove 'chown' call.
Add 'id' field to 'user-group' form.
* guix/build/install.scm (directives): Set the store's GID to 30000.
Before that the effect would be to re-create groups at each boot, and
thus remove any members of the groups.
* guix/build/activation.scm (activate-users+groups): Call 'add-group'
only when (getgrname name) fails.
* gnu/services/base.scm (guix-service)[activate]: New variable. Add
'chown' call for (%store-prefix). Set the 'activate' field to
ACTIVATE.
* guix/build/install.scm (directives): Add comment about STORE's group.
* tests/gexp.scm (shebang): New variable.
Skip "gexp->script" when SHEBANG is longer than 127 chars.
* guix/gexp.scm (gexp->script): Add comment on the issue.
* gnu/system/file-systems.scm (<file-system>)[title]: New field.
* gnu/services/base.scm (file-system-service): Add #:title parameter.
In 'start' gexp, use 'canonicalize-device-spec' and honor TITLE.
* gnu/system.scm (other-file-system-services,
operating-system-root-file-system, operating-system-initrd-file):
Adjust accordingly.
* gnu/system/linux-initrd.scm (file-system->spec): Likewise.
* gnu/system/vm.scm (system-disk-image): Add 'title' field for the root
file system.
* guix/build/linux-initrd.scm (mount-file-system): Expect the second
element of SPEC to be the title.
(boot-system)[root-mount-point?, root-fs-type]: Likewise.
* gnu/services/dmd.scm (dmd-configuration-file): Select
'canonicalize-device-spec'.
* guix/build/linux-initrd.scm (canonicalize-device-spec): Add #:title
parameter. When resolving a label, wait a little and try several
times before bailing out.
* guix/build/linux-initrd.scm (make-disk-device-nodes): New procedure.
(make-essential-device-nodes): Use it. Make more devices nodes for
SCSI disks and CD-ROM devices.
* guix/build/vm.scm (format-partition): Add #:label parameter, and honor
it.
(initialize-hard-disk): Add #:file-system-label parameter, and pass it
to 'format-partition'.
* gnu/system/vm.scm (qemu-image): Add #:file-system-label parameter and
pass it to 'initialize-hard-disk'.
* guix/store.scm (open-connection): Remove misleading 'setsockopt' call,
erroneously introduced in df1fab58. This would actually shrink the
receive buffer from 124 KiB to 12 KiB, though it had little impact on
performance.
* gnu/system.scm (operating-system-activation-script): New procedure,
containing most of the former 'operating-system-boot-script'.
(operating-system-boot-script): Call it, and 'primitive-load' its
result.
* guix/build/activation.scm (%booted-system): Remove.
(activate-current-system): Remove #:boot? parameter and related code.
* guix/build/vm.scm (load-in-linux-vm): When MAKE-DISK-IMAGE?, use
'-drive ...,if=virtio' for better performance.
* gnu/system/vm.scm (qemu-image): Use /dev/vda instead of /dev/sda.
* guix/build/install.scm (install-grub): Call 'error' if 'system*'
returns non-zero.
* guix/build/vm.scm (initialize-partition-table): Make 'partition-size'
a positional parameter. Call 'error' when 'system*' returns
non-zero'.
(format-partition, initialize-root-partition): New procedures.
(initialize-hard-disk): Use them.
This allows progress reports emitted by 'substitute-binary' to be
correctly displayed.
* guix/store.scm (%newlines): New variable.
(process-stderr) <%stderr-next>: Flush (current-build-output-port)
when S contains one of %NEWLINES.
* guix/build/linux-initrd.scm (boot-system): Add pre-unwind handler in
'catch' form around 'primitive-load', and call 'format' and
'display-backtrace' from there.
* guix/ui.scm (show-what-to-build)[built-or-substitutable?]: New
procedure. Check whether OUT is #f.
Use it.
* tests/ui.scm ("show-what-to-build, zero outputs"): New test.
* gnu/system.scm (etc-directory): Change default value of #:profile.
Change contents of SHELLS. Use /run/current-system/profile/{s,}bin in
BASHRC.
(operating-system-boot-script)[%modules]: Add (guix build
linux-initrd). Add call to 'activate-current-system' in gexp.
(operating-system-initrd-file, operating-system-grub.cfg): New
procedures.
(operating-system-derivation): Don't build grub.cfg here and remove it
from the file union.
* gnu/system/vm.scm (qemu-image): Remove #:populate.
(operating-system-build-gid, operating-system-default-contents):
Remove.
(system-qemu-image): Remove call to
'operating-system-default-contents'. Use 'operating-system-grub.cfg'
to get grub.cfg. Add GRUB.CFG to #:inputs.
(system-qemu-image/shared-store): Likewise, but don't add GRUB.CFG to
#:inputs.
(system-qemu-image/shared-store-script): Pass --system kernel option.
* guix/build/activation.scm (%booted-system, %current-system): New
variables.
(boot-time-system, activate-current-system): New procedures.
* guix/build/install.scm (evaluate-populate-directive): Add case
for ('directory name uid gid mode).
(directives, populate-root-file-system): New procedures.
* guix/build/vm.scm (initialize-hard-disk): Replace calls to
'evaluate-populate-directive' by a call to
'populate-root-file-system'.
* gnu/services/dmd.scm (dmd-configuration-file): Use
/run/current-system/profile/bin.
* gnu/services/xorg.scm (slim-service): Likewise.