summaryrefslogtreecommitdiff
path: root/guix/gexp.scm
AgeCommit message (Collapse)Author
2015-05-01derivations: Add #:leaked-env-vars parameter.Ludovic Courtès
Suggested by Joshua Randall <jcrandall@alum.mit.edu> in <http://bugs.gnu.org/20402>. * guix/derivations.scm (derivation): Add #:leaked-env-vars parameter. [user+system-env-vars]: Honor it. * guix/gexp.scm (gexp->derivation): Add #:leaked-env-vars and pass it to 'raw-derivation'. * doc/guix.texi (Derivations, G-Expressions): Adjust accordingly.
2015-04-20gexp: Add printers for <gexp-input> and <gexp-output>.Ludovic Courtès
* guix/gexp.scm (write-gexp-input, write-gexp-output): New procedures. (<gexp-input>, <gexp-output>): Use them as printers.
2015-03-29gexp: Slightly simplify 'lower-inputs'.Ludovic Courtès
* guix/gexp.scm (lower-inputs): Simplify first case by removing the 'input' binding.
2015-03-29gexp: Add 'local-file'.Ludovic Courtès
* 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.
2015-03-22gexp: Fix handling of nativeness in nested gexps.Ludovic Courtès
* 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.
2015-03-22gexp: Ignore nested gexps in macro expansion.Ludovic Courtès
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'.
2015-03-22gexp: Allow <gexp-input> objects in #:allowed-references.Ludovic Courtès
* guix/gexp.scm (lower-references): Add <gexp-input> case. * tests/gexp.scm ("gexp->derivation #:allowed-references, specific output"): New test.
2015-03-22gexp: Add identity compiler for derivations.Ludovic Courtès
* guix/gexp.scm (derivation-compiler): New procedure. (lower-inputs): Remove 'derivation?' case. (gexp-inputs)[add-reference-inputs]: Likewise. (gexp->sexp)[reference->sexp]: Likewise.
2015-03-17gexp: Move the package and origin compilers to (guix packages).Ludovic Courtès
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.
2015-03-17gexp: Separate "compilers" for origins and packages from the core.Ludovic Courtès
* 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.
2015-03-17gexp: Remove special meaning of forms (PACKAGE OUTPUT) in ungexp.Ludovic Courtès
* 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.
2015-03-17gexp: Export 'gexp-input' constructor.Ludovic Courtès
* 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.
2015-03-17gexp: Add <gexp-input>.Ludovic Courtès
* 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'.
2015-03-17gexp: Rename <output-ref> to <gexp-output>.Ludovic Courtès
* guix/gexp.scm (<output-ref>): Rename to... (<gexp-output>): ... this. Adjust constructor/accessor names and users accordingly.
2015-03-02gexp: Make sure 'gexp-outputs' removes duplicate outputs.Ludovic Courtès
Fixes a regression introduced in f9efe56. * guix/gexp.scm (gexp-outputs): Add call to 'delete-duplicates'. * tests/gexp.scm ("output list, combined gexps, duplicate output"): New test.
2015-02-27gexp: Aggregate outputs of compound gexps.Ludovic Courtès
* guix/gexp.scm (gexp-outputs)[add-reference-output]: Recurse into lists. * tests/gexp.scm ("output list + ungexp-splicing list, combined gexps"): New test.
2015-02-13gexp: Add #:graft? parameter to 'gexp->derivation'.Ludovic Courtès
* guix/gexp.scm (gexp->derivation): Add #:graft? parameter and honor it. * tests/gexp.scm ("gexp->derivation vs. grafts"): New test. * doc/guix.texi (G-Expressions): Update 'gexp->derivation' documentation.
2015-02-13gexp: Implement 'imported-modules' & co. using 'gexp->derivation'.Ludovic Courtès
* guix/derivations.scm (imported-files): Keep private. (%imported-modules, %compiled-modules, build-expression->derivation): Mark as deprecated. (imported-modules, compiled-modules): Remove. * guix/gexp.scm (%mkdir-p-definition): New variable. (imported-files, search-path*, imported-modules, compiled-modules): New procedures. * tests/derivations.scm ("imported-files"): Remove. * tests/gexp.scm ("imported-files", "gexp->derivation #:modules"): New tests.
2015-02-11gexp: Add #:allowed-references parameter to 'gexp->derivation'.Ludovic Courtès
* guix/gexp.scm (lower-references): New procedure. (gexp->derivation): Add #:allowed-references and honor it. * tests/gexp.scm ("gexp->derivation #:allowed-references", "gexp->derivation #:allowed-references, disallowed"): New tests. * doc/guix.texi (G-Expressions): Update 'gexp->derivation' doc.
2015-01-14monads: Move '%store-monad' and related procedures where they belong.Ludovic Courtès
This turns (guix monads) into a generic module for monads, and moves the store monad and related monadic procedures in their corresponding module. * guix/monads.scm (store-return, store-bind, %store-monad, store-lift, text-file, interned-file, package-file, package->derivation, package->cross-derivation, origin->derivation, imported-modules, compiled, modules, built-derivations, run-with-store): Move to... * guix/store.scm (store-return, store-bind, %store-monad, store-lift, text-file, interned-file): ... here. (%guile-for-build): New variable. (run-with-store): Moved from monads.scm. Remove default value for #:guile-for-build. * guix/packages.scm (default-guile): Export. (set-guile-for-build): New procedure. (package-file, package->derivation, package->cross-derivation, origin->derivation): Moved from monads.scm. * guix/derivations.scm (%guile-for-build): Remove. (imported-modules): Rename to... (%imported-modules): ... this. (compiled-modules): Rename to... (%compiled-modules): ... this. (built-derivations, imported-modules, compiled-modules): New procedures. * gnu/services/avahi.scm, gnu/services/base.scm, gnu/services/dbus.scm, gnu/services/dmd.scm, gnu/services/networking.scm, gnu/services/ssh.scm, gnu/services/xorg.scm, gnu/system/install.scm, gnu/system/linux-initrd.scm, gnu/system/shadow.scm, guix/download.scm, guix/gexp.scm, guix/git-download.scm, guix/profiles.scm, guix/svn-download.scm, tests/monads.scm: Adjust imports accordingly. * guix/monad-repl.scm (default-guile-derivation): New procedure. (store-monad-language, run-in-store): Use it. * build-aux/hydra/gnu-system.scm (qemu-jobs): Add explicit 'set-guile-for-build' call. * guix/scripts/archive.scm (derivation-from-expression): Likewise. * guix/scripts/build.scm (options/resolve-packages): Likewise. * guix/scripts/environment.scm (guix-environment): Likewise. * guix/scripts/system.scm (guix-system): Likewise. * doc/guix.texi (The Store Monad): Adjust module names accordingly.
2015-01-12monads: Rewrite 'text-file*' using gexps.Ludovic Courtès
* guix/monads.scm (text-file*): Move to... * guix/gexp.scm (text-file*): ... here. Rewrite using gexps. * tests/monads.scm ("text-file*"): Move to... * tests/gexp.scm ("text-file*"): ... here.
2014-11-09gexp: Add #:module-path parameter to 'gexp->derivation'.Ludovic Courtès
* 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.
2014-09-08gexp: 'gexp->script' returns a script that can easily be compiled.Ludovic Courtès
* guix/gexp.scm (gexp->script): Produce an 'eval-when' form around assignments of %load-path and %load-compiled-path.
2014-09-06gexp: Allow use of high-level objects in #:references-graphs.Ludovic Courtès
* 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'.
2014-08-28gnu: Split (gnu packages base), adding (gnu packages commencement).Ludovic Courtès
* gnu/packages/base.scm (gnu-make-boot0, diffutils-boot0, findutils-boot0, %boot0-inputs, nix-system->gnu-triplet, boot-triplet, binutils-boot0, gcc-boot0, perl-boot0, linux-libre-headers-boot0, texinfo-boot0, %boot1-inputs, glibc-final-with-bootstrap-bash, cross-gcc-wrapper, static-bash-for-glibc, glibc-final, gcc-boot0-wrapped, %boot2-inputs, binutils-final, libstdc++, gcc-final, ld-wrapper-boot3, %boot3-inputs, bash-final, %boot4-inputs, guile-final, gnu-make-final, ld-wrapper, coreutils-final, grep-final, %boot5-inputs, %final-inputs, canonical-package, gcc-toolchain, gcc-toolchain-4.8, gcc-toolchain-4.9): Move to... * gnu/packages/commencement.scm: ... here. New file. * gnu-system.am (GNU_SYSTEM_MODULES): Add it. * build-aux/check-final-inputs-self-contained.scm: Adjust accordingly. * gnu/packages/cross-base.scm: Likewise. * gnu/packages/make-bootstrap.scm: Likewise. * guix/build-system/cmake.scm (cmake-build): Likewise. * guix/build-system/gnu.scm (standard-packages, gnu-build, gnu-cross-build): Likewise. * guix/build-system/perl.scm (perl-build): Likewise. * guix/build-system/python.scm (python-build): Likewise. * guix/build-system/trivial.scm (guile-for-build): Likewise. * guix/download.scm (url-fetch): Likewise. * guix/gexp.scm (default-guile): Likewise. * guix/git-download.scm (git-fetch): Likewise. * guix/monads.scm (run-with-store): Likewise. * guix/packages.scm (default-guile): Likewise. * guix/scripts/package.scm (guix-package): Likewise. * guix/scripts/refresh.scm: Likewise. * guix/svn-download.scm (svn-fetch): Likewise. * tests/builders.scm (%bootstrap-inputs, %bootstrap-search-paths): Likewise. * tests/packages.scm ("GNU Make, bootstrap"): Likewise. * tests/guix-package.sh: Likewise. * gnu/services/base.scm: Use 'canonical-package' instead of xxx-final. * gnu/services/xorg.scm: Likewise. * gnu/system/vm.scm: Likewise. * guix/scripts/pull.scm (guix-pull): Likewise.
2014-08-18gexp: Add 'ungexp-native' and 'ungexp-native-splicing'.Ludovic Courtès
* 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.
2014-08-17gexp: Add #:target parameter to 'gexp->derivation'.Ludovic Courtès
* 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.
2014-07-17gexp: Gracefully handle printing of gexps with spliced references.Ludovic Courtès
* guix/gexp.scm (write-gexp): Wrap 'write' call in 'false-if-exception'. * tests/gexp.scm ("printer", "printer vs. ungexp-splicing"): New tests.
2014-07-16gexp: Build 'gexp->file' derivations locally.Ludovic Courtès
* guix/gexp.scm (gexp->file): Add #:local-build? argument.
2014-07-12gexp: Resolve the default system at '>>=' time.Ludovic Courtès
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.
2014-06-04tests: Skip tests that would hit the shebang length limitation.Ludovic Courtès
* 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.
2014-05-01monads, gexp: Remove unintended dependency on (gnu packages …).Ludovic Courtès
* guix/gexp.scm (gexp->derivation, gexp->script): Use 'default-guile' instead of an explicit reference to 'guile-final'. (default-guile): New procedure. * guix/monads.scm (run-with-store)[default-guile]: New procedure. Use it.
2014-05-01gexp: Add support for 'origin?' objects in 'ungexp' forms.Ludovic Courtès
* guix/gexp.scm (lower-inputs, gexp-inputs, gexp->sexp, canonicalize-reference): Add 'origin?' case. * guix/monads.scm (origin->derivation): New procedure. * tests/gexp.scm ("one input origin"): New test.
2014-04-30gexp: Add pretty printer.Ludovic Courtès
* guix/gexp.scm (write-gexp): New procedure. <top level>: Add call to 'set-record-type-printer!'.
2014-04-29gexp: Remove leftover parameter.Ludovic Courtès
* guix/gexp.scm (gexp->sexp): Remove #:outputs parameter. Adjust callers accordingly.
2014-04-28monads: Hide 'derivation-expression' and 'lower-inputs'.Ludovic Courtès
* guix/monads.scm: Unexport 'lower-inputs' and 'derivation-expression'. (text-file*): Add comment about the switch to 'gexp->derivation'. (lower-inputs): Add comment about its doom. (derivation-expression): Likewise. * guix/gexp.scm (lower-inputs*): Rename to... (lower-inputs): ... this. Update callers. * tests/monads.scm (derivation-expression): New procedure. * doc/guix.texi (The Store Monad): Use 'gexp->derivation' instead of 'derivation-expression'. Remove documentation of 'derivation-expression'. * guix/ui.scm (read/eval): Use THE-ROOT-MODULE so that macros are properly expanded. * tests/guix-build.sh: Use 'gexp->derivation' instead of 'derivation-expression'.monads: Hide 'derivation-expression' and 'lower-inputs'.
2014-04-28Add (guix gexp).Ludovic Courtès
* guix/gexp.scm: New file. * tests/gexp.scm: New file. * Makefile.am (MODULES): Add guix/gexp.scm. (SCM_TESTS): Add tests/gexp.scm. * doc/guix.texi (Derivations): Add #:inputs in 'derivation' example. Mark 'build-expression->derivation' as deprecated, refer to "G-Expressions". Remove paragraph about code strata. (G-Expressions): New node.