Previously things returned by 'program-file', such as %MODPROBE-WRAPPER
in (gnu services), would refer to 'guile-final'. This would introduce
'guile-final' in the system closure, which is otherwise absent. By
referring to 'guile-2.2' we remove that extra Guile.
* guix/gexp.scm (default-guile): Refer to GUILE-2.2 instead of
GUILE-FINAL.
This avoids repeated deprecation messages, particularly while running
'guix system build' or similar.
* guix/gexp.scm (gexp->derivation): Add #:deprecation-warnings. Pass it
to 'compiled-modules'.
(compiled-modules): Add #:deprecation-warnings and honor it.
* doc/guix.texi (G-Expressions): Update 'gexp->derivation'
documentation.
* guix/packages.scm (patch-and-repack): Pass #:deprecation-warnings #t.
Reported by Ricardo Wurmus.
* guix/gexp.scm (local-file): Define using 'syntax-case' instead of
'syntax-rules'. Explicitly handle the zero-argument case and the
use-as-an-identifier case.
Previously, (gexp-native-inputs #~#$@(list #~#+foo)) would return '().
This is a followup to 5b14a7902c.
* guix/gexp.scm (gexp-inputs)[add-reference-inputs]: In the list case,
remove 'if' around 'fold-right'. In 'map' lambda, always inherit N?.
* tests/gexp.scm ("gexp list splicing + ungexp-splicing"): New test.
* guix/gexp.scm (imported-files)[file-pair]: Add case for pairs where
the cdr is not a string.
(imported-modules): Support '=>' syntax in MODULES.
* tests/gexp.scm ("imported-files with file-like objects")
("gexp->derivation & with-imported-module & computed module"): New tests.
* doc/guix.texi (G-Expressions): Document '=>' syntax for
'with-imported-modules'.
* guix/gexp.scm (gexp)[substitute-ungexp]: Wrap body in 'with-syntax'
and pass EXP as the last argument to 'syntax-error'.
[substitute-ungexp-splicing]: Pass EXP as the last argument to
'syntax-error'.
Previously, 'gexp-native-inputs' would not return the native inputs of
nested gexps. For example, this:
(gexp-native-inputs #~(foo #$#~(bar #+coreutils)))
would return '().
* guix/gexp.scm (gexp-inputs)[add-reference-inputs]: In the
non-recursive cases, check whether N? and NATIVE? are the same, and act
accordingly.
[native-input?]: Remove.
Fold over all of (gexp-references exp).
* tests/gexp.scm ("ungexp + ungexp-native, nested, special mixture"):
New test.
* tests/gexp.scm ("input list splicing + ungexp-native-splicing"): Pass
#:native? #t to 'gexp-input'.
* guix/gexp.scm (<file-append>): New record type.
(file-append): New procedure.
(file-append-compiler): New gexp compiler.
* tests/gexp.scm ("file-append", "file-append, output")
("file-append, nested", "gexp->file + file-append"): New tests.
* doc/guix.texi (G-Expressions): Use it in 'nscd' and 'list-files'
examples. Document 'file-append'.
* guix/gexp.scm (<gexp-compiler>)[expand]: New field.
(default-expander, lookup-expander): New procedures.
(define-gexp-compiler): Add second pattern to allow for the definition
of both a compiler and an expander.
(gexp->sexp)[reference->sexp]: Call 'lookup-expander' and use its
result.
* guix/gexp.scm (<gexp>)[modules]: New field.
(gexp-modules): New procedure.
(gexp->derivation): Use it and append the result to %MODULES.
Update docstring to mark #:modules as deprecated.
(current-imported-modules, with-imported-modules): New macros.
(gexp): Pass CURRENT-IMPORTED-MODULES as second argument to 'gexp'.
(gexp->script): Use and honor 'gexp-modules'; define '%modules'.
* tests/gexp.scm ("gexp->derivation & with-imported-modules")
("gexp->derivation & nested with-imported-modules")
("gexp-modules & ungexp", "gexp-modules & ungexp-splicing"):
New tests.
("program-file"): Use 'with-imported-modules'. Remove #:modules
argument to 'program-file'.
* doc/guix.texi (G-Expressions): Document 'with-imported-modules'.
Mark #:modules of 'gexp->derivation' as deprecated.
* emacs/guix-devel.el: Add syntax for 'with-imported-modules'.
(guix-devel-keywords): Add it.
* .dir-locals.el: Likewise.
The distinction between native inputs and "normal" inputs can already be
determined by looking at the 'native?' field of <gexp-input>. The extra
'natives' field of <gexp> added complexity for no good reason.
* guix/gexp.scm (<gexp>)[natives]: Remove.
(write-gexp): Remove use of 'gexp-native-references'.
(gexp-inputs)[native-input?]: New procedure.
Use it.
(gexp->sexp)[reference->sexp]: Honor N? for input lists.
Remove use of 'gexp-native-references'.
(gexp)[collect-native-escapes]: Remove.
Simplify.
Suggested by Jookia.
* guix/derivations.scm (&file-search-error): New error condition.
(search-path*): Raise it when 'search-path' returns #f.
* guix/gexp.scm (search-path*): Remove.
* guix/ui.scm (call-with-error-handling): Add case for
'file-search-error?'.
* tests/derivations.scm ("build-expression->derivation and invalid
module name"): New test.
* guix/gexp.scm (<scheme-file>): New record type.
(scheme-file, scheme-file-compiler): New procedures.
* tests/gexp.scm ("scheme-file"): New test.
* doc/guix.texi (G-Expressions): Document 'scheme-file'.
* guix/gexp.scm (<program-file>): New record type.
(program-file, program-file-compiler): New procedures.
* tests/gexp.scm ("program-file"): New test.
* doc/guix.texi (G-Expressions): Document it.
* guix/gexp.scm (%mkdir-p-definition): Remove.
(%utils-module): New variable.
(imported-files, compiled-modules): Have gexp load %UTILS-MODULE
instead of using %MKDIR-P-DEFINITION.
* guix/gexp.scm (lower-object): New procedure.
(lower-inputs, lower-references, gexp->sexp): Use it.
* tests/gexp.scm ("lower-object"): New test.
* doc/guix.texi (G-Expressions): Document it.
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.
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.