summaryrefslogtreecommitdiff
path: root/guix/gexp.scm
AgeCommit message (Collapse)Author
2018-06-01gexp: Add 'with-extensions'.Ludovic Courtès
* guix/gexp.scm (<gexp>)[extensions]: New field. (gexp-attribute): New procedure. (gexp-modules): Write in terms of 'gexp-attribute'. (gexp-extensions): New procedure. (gexp->derivation): Add #:effective-version. [extension-flags]: New procedure. Honor extensions of EXP. (current-imported-extensions): New syntax parameter. (with-extensions): New macro. (gexp): Honor CURRENT-IMPORTED-EXTENSIONS. (compiled-modules): Add #:extensions and honor it. (load-path-expression): Likewise. (gexp->script, gexp->file): Honor extensions. * tests/gexp.scm (%extension-package): New variable. ("gexp-extensions & ungexp") ("gexp-extensions & ungexp-splicing") ("gexp-extensions and literal Scheme object") ("gexp->derivation & with-extensions") ("program-file & with-extensions"): New tests. * doc/guix.texi (G-Expressions): Document 'with-extensions'.
2018-06-01gexp: 'compiled-modules' no longer overrides (guix build utils).Ludovic Courtès
Until now 'compiled-modules' would override (guix build utils) with its own. Thus, when asked to build a different (guix build utils), via #:module-path, it would fail badly because a (guix build utils) module was already loaded and possibly incompatible with the new one. This happened when running 'guix pull --branch=core-updates' from current master: in 'core-updates', (guix build utils) exports 'ignore-error?' but in 'master' it does not. Thus, 'guix pull' would fail with: no binding `invoke-error?' in module (guix build utils) builder for `/gnu/store/…-module-import-compiled.drv' failed with exit code 1 cannot build derivation `/gnu/store/…-compute-guix-derivation.drv': 1 dependencies couldn't be built This patch fixes it. * guix/gexp.scm (compiled-modules)[build-utils-hack?]: New variable. [build]: Load MODULES/build/utils.scm when it exists.
2018-05-17Merge branch 'master' into core-updatesMark H Weaver
2018-05-15gexp: Disable deprecation warnings for 'imported-modules'.Ludovic Courtès
Fixes <https://bugs.gnu.org/31450>. Reported by Martin Castillo <castilma@uni-bremen.de>. * guix/gexp.scm (gexp->derivation): Pass #:deprecation-warnings to 'imported-modules'. (imported-files): Add #:deprecation-warnings and pass #:env-vars to 'gexp->derivation'. (imported-modules): Add #:deprecation-warnings and pass it to 'imported-files'.
2018-04-11Merge branch 'master' into core-updatesMark H Weaver
2018-04-11gexp: 'scheme-file' can splice expressions.Ludovic Courtès
* guix/gexp.scm (<scheme-file>)[splice?]: New field. (scheme-file): Add #:splice? and pass it to '%scheme-file'. (scheme-file-compiler): Pass SPLICE? to 'gexp->file'. (gexp->file): Add #:splice? and honor it. * tests/gexp.scm ("gexp->file + #:splice?"): New test. ("gexp->derivation & with-imported-module & computed module"): Use #:splice? #t.
2018-04-10Merge branch 'master' into core-updatesMark H Weaver
2018-04-08gexp: 'directory-union' has a #:resolve-collision parameter.Ludovic Courtès
* guix/gexp.scm (directory-union): Add #:resolve-collision and honor it.
2018-04-01gexp: 'compiled-modules' prints a line for each module.Ludovic Courtès
* guix/gexp.scm (compiled-modules)[build]: Add 'processed' parameter to 'process-entry' and 'process-directory'. Print a message before each 'compile-file' call.
2018-04-01gexp: compiled-modules: Factorize build code.Ludovic Courtès
* guix/gexp.scm (compiled-modules)[build]: Factorize 'process-entry'.
2018-03-23gexp: 'program-file' has a new #:module-path parameter.Ludovic Courtès
* guix/gexp.scm (<program-file>): Add 'path' field. (program-file): Add #:module-path parameter and honor it. (program-file-compiler): Honor the 'path' field. * tests/gexp.scm ("program-file #:module-path"): New test. * doc/guix.texi (G-Expressions): Update.
2018-03-23gexp: 'gexp->script' and 'gexp->file' have a new #:module-path parameter.Ludovic Courtès
* guix/gexp.scm (load-path-expression): Add 'path' optional parameter. (gexp->script): Add #:module-path and honor it. (gexp->file): Likewise. * tests/gexp.scm ("gexp->script #:module-path"): New test. * doc/guix.texi (G-Expressions): Update accordingly.
2018-03-03services: messaging: Prosody config supports file-like objects.Clément Lassieur
* doc/guix.texi (Messaging Services): Update accordingly. * gnu/services/configuration.scm (serialize-configuration, serialize-maybe-stem, serialize-package): Return strings or string-valued gexps (these procedures were only used for their side-effects). * gnu/services/messaging.scm (serialize-field, serialize-field-list, enclose-quotes, serialize-raw-content, serialize-ssl-configuration, serialize-virtualhost-configuration-list, serialize-int-component-configuration-list, serialize-ext-component-configuration-list, serialize-virtualhost-configuration, serialize-int-component-configuration, serialize-ext-component-configuration, serialize-prosody-configuration): Return strings or string-valued gexps and stop printing. (prosody-activation): Use SERIALIZE-PROSODY-CONFIGURATION's return value with MIXED-TEXT-FILE instead of using its output with PLAIN-FILE. (serialize-non-negative-integer, serialize-non-negative-integer-list): Convert numbers to strings. (file-object?, serialize-file-object, file-object-list?, serialize-file-object-list): New procedures. (ssl-configuration)[capath, cafile], (prosody-configuration)[plugin-paths, groups-file]: Replace FILE-NAME with FILE-OBJECT. * guix/gexp.scm (file-like?): New exported procedure.
2017-12-18gexp: 'computed-file' has a new #:guile parameter.Ludovic Courtès
* guix/gexp.scm (<computed-file>)[guile]: New field. (computed-file): Add #:guile. (computed-file-compiler): Honor 'guile'.
2017-11-29gexp: Default to 'guile-2.2' for 'program-file'.Ludovic Courtès
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.
2017-11-29gexp: 'compiled-modules' disables deprecation warnings by default.Ludovic Courtès
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.
2017-11-21gexp: 'directory-union' has a #:quiet? parameter.Ludovic Courtès
* guix/gexp.scm (directory-union): Add #:quiet? and honor it.
2017-11-21union: Parametrize the symlink procedure .Ludovic Courtès
* guix/gexp.scm (directory-union): Add #:hard-links and honor it. * guix/build/union.scm (union-build): Add #:symlink parameter.
2017-10-22gexp: Add 'directory-union'.Ludovic Courtès
* gnu/services.scm (directory-union): Move to... * guix/gexp.scm (directory-union): ... here. New procedure. * doc/guix.texi (G-Expressions): Document it.
2017-10-22gexp: Add 'file-union'.Ludovic Courtès
* gnu/services.scm (file-union): Move to... * guix/gexp.scm (file-union): ... here. New procedure. * doc/guix.texi (G-Expressions): Document it.
2017-07-20gexp: Slightly improve error reporting for 'local-file'.Ludovic Courtès
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.
2017-07-17gexp: 'ungexp-splicing' properly accounts for nested native inputs.Ludovic Courtès
Previously, (gexp-native-inputs #~#$@(list #~#+foo)) would return '(). This is a followup to 5b14a7902c58d9fb7923f9e16871f549fbe59b6e. * 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.
2017-04-19gexp: 'gexp-modules' accepts plain Scheme objects.Ludovic Courtès
* guix/gexp.scm (gexp-modules): Return '() when not (gexp? GEXP). * tests/gexp.scm ("gexp-modules and literal Scheme object"): New test.
2017-04-04gexp: 'lower-object' raises an exception when passed an invalid object.Ludovic Courtès
* guix/gexp.scm (&gexp-error, &gexp-input-error): New error conditions. (lower-object): Raise &gexp-input-error when 'lookup-compiler' returns #f. * tests/gexp.scm ("lower-object & gexp-input-error?"): New test. * guix/ui.scm (call-with-error-handling): Add case for 'gexp-input-error?'.
2017-03-16gexp: Add '=>' syntax to import computed modules.Ludovic Courtès
* 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'.
2017-03-09gexp: Expose functions to allow creating derivation builders.Roel Janssen
* guix/gexp.scm: Add load-path-expression and gexp-modules to the public interface of the module. See <http://bugs.gnu.org/26023>.
2017-01-01gexp: Support 'ungexp' forms in improper lists.Ludovic Courtès
* guix/gexp.scm (gexp)[collect-escapes, substitute-references]: Replace the (exp0 exp ...) patterns with (exp0 . exp) to match improper lists. Adjust clause bodies accordingly. * tests/gexp.scm ("one input package, dotted list"): New test.
2017-01-01gexp: Properly report substitution errors.Ludovic Courtès
* 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'.
2016-12-19gexp: Slightly simplify 'gexp-inputs'.Ludovic Courtès
* guix/gexp.scm (gexp-inputs)[add-reference-inputs]: Remove unneeded 'if' in the non-native nested gexp case.
2016-12-19gexp: Native inputs of nested gexps are properly accounted for.Ludovic Courtès
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'.
2016-11-19derivations: Add 'raw-derivation'.Ludovic Courtès
* guix/derivations.scm (raw-derivation): New procedure. * guix/download.scm (raw-derivation): Remove. * guix/gexp.scm (raw-derivation): Remove.
2016-09-10gexp: Store compilers in a hash table for O(1) lookup.Ludovic Courtès
* guix/gexp.scm (<gexp-compiler>)[predicate]: Remove. [type]: New field. (%gexp-compilers): Turn into a hash table. (register-compiler!, lookup-compiler, lookup-expander): Adjust accordingly. (define-gexp-compiler): Replace 'predicate' by 'record-type'. (derivation-compiler, local-file-compiler, plain-file-compiler) (computed-file-compiler, program-file-compiler, scheme-file-compiler) (file-append-compiler): Adjust accordingly. * guix/packages.scm (package-compiler, origin-compiler): Likewise.
2016-09-09gexp: Add 'file-append'.Ludovic Courtès
* 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'.
2016-09-09gexp: Compilers can now provide an "expander".Ludovic Courtès
* 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.
2016-09-09gexp: Remove outdated comment.Ludovic Courtès
* guix/gexp.scm (lower-references): Remove outdated "XXX" comment.
2016-07-12gexp: 'program-file' and 'gexp->script' no longer have #:modules.Ludovic Courtès
* guix/gexp.scm (<program-file>)[modules]: Remove. (program-file): Remove #:modules and adjust accordingly. (program-file-compiler): Likewise. (gexp->script): Likewise.
2016-07-12gexp: 'computed-file' no longer has a #:modules parameter.Ludovic Courtès
* guix/gexp.scm (<computed-file>)[modules]: Remove. (computed-file): Remove #:modules. (computed-file-compiler): Likewise. * doc/guix.texi (G-Expressions): Adjust accordingly.
2016-07-12gexp: 'gexp->file' emits code to set '%load-path'.Ludovic Courtès
* guix/gexp.scm (gexp->file): Add #:set-load-path? parameter and honor it. * gnu/system.scm (operating-system-parameters-file): Pass #:set-load-path? #f. * doc/guix.texi (G-Expressions): Adjust accordingly.
2016-07-12gexp: Factorize load-path-setting expression.Ludovic Courtès
* guix/gexp.scm (load-path-expression): New procedure. (gexp->script): Use it.
2016-07-12gexp: Add 'with-imported-modules' macro.Ludovic Courtès
* 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.
2016-07-12gexp: Keep only a single 'references' field.Ludovic Courtès
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.
2016-06-20gexp: Use a relative file name.Ludovic Courtès
This is a followup to cbbbb7be0fbaa11ff75bce92f2d82131ff8db104. * guix/gexp.scm (%utils-module): Use a file name relative to this file instead of using 'search-path'.
2016-06-16gexp: Add #:select? parameter to 'local-file'.Ludovic Courtès
* guix/gexp.scm (<local-file>)[select?]: New field. (true): New procedure. (%local-file): Add #:select? and honor it. (local-file): Likewise. * tests/gexp.scm ("local-file, #:select?"): New test. * doc/guix.texi (G-Expressions): Adjust accordingly.
2016-06-16gexp: Move 'current-source-directory' to (guix utils).Ludovic Courtès
* guix/gexp.scm (extract-directory, current-source-directory): Move to... * guix/utils.scm (extract-directory, current-source-directory): ... here. New procedures.
2016-03-23derivations: Raise an error when a module file is not found.Ludovic Courtès
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.
2016-03-23derivations: Add 'module->source-file-name'.Ludovic Courtès
* guix/derivations.scm (module->source-file-name): New procedure. (%imported-modules): Use it. * guix/gexp.scm (imported-modules): Likewise.
2016-03-20gexp: Add #:disallowed-references.Ludovic Courtès
* guix/gexp.scm (gexp->derivation): Add #:disallowed-references and honor it. * tests/gexp.scm ("gexp->derivation #:disallowed-references, allowed") ("gexp->derivation #:disallowed-references"): New tests. * doc/guix.texi (G-Expressions): Adjust accordingly.
2016-02-22derivations: Move grafts to (guix grafts).Ludovic Courtès
* guix/derivations.scm (<graft>, graft-derivation, %graft?) (set-grafting): Move to... * guix/grafts.scm: ... here. New file. * guix/gexp.scm, guix/packages.scm, tests/packages.scm, guix/scripts/build.scm: Use it. * Makefile.am (MODULES): Add it. (SCM_TESTS): Add tests/grafts.scm. * tests/derivations.scm ("graft-derivation"): Move to... * tests/grafts.scm: ... here. New file.
2015-12-14gexp: 'local-file' resolves relative file names.Ludovic Courtès
* guix/gexp.scm (<local-file>): Rename constructor to '%%local-file'. Add 'absolute' field. (%local-file, extract-directory, absolute-file-name): New procedures. (current-source-directory): New macro. (local-file): Adjust call to '%local-file'. (local-file-absolute-file-name): New procedure. (local-file-compiler): Force the 'absolute' field. * tests/guix-system.sh: Test whether 'local-file' canonicalization works. * doc/guix.texi (G-Expressions): Adjust.
2015-11-25gexp: Build text derivations locally.Ludovic Courtès
* guix/gexp.scm (gexp->file): Pass #:substitutable? #f. (text-file*): Likewise, and #:local-build? #t.