Mirror of GNU Guix
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

414 lines
18 KiB

derivations: 'derivation' and related procedures return a single value. * guix/derivations.scm (derivation->output-path, derivation->output-paths): New procedures. (derivation-path->output-path): Use 'derivation->output-path'. (derivation-path->output-paths): Use 'derivation->output-paths'. (derivation): Accept 'derivation?' objects as inputs. Return a single value. (build-derivations): New procedure. (compiled-modules): Use 'derivation->output-paths'. (build-expression->derivation)[source-path]: Add case for when the input matches 'derivation?'. [prologue]: Accept 'derivation?' objects in INPUTS. [mod-dir, go-dir]: Use 'derivation->output-path'. * guix/download.scm (url-fetch): Adjust to the single-value return. * guix/packages.scm (package-output): Use 'derivation->output-path'. * guix/scripts/build.scm (guix-build): When the argument is 'derivation-path?', pass it through 'read-derivation'. Use 'derivation-file-name' to print out the .drv file names, and to register them. Use 'derivation->output-path' instead of 'derivation-path->output-path'. * guix/scripts/package.scm (roll-back): Adjust to the single-value return. (guix-package): Use 'derivation->output-path'. * guix/ui.scm (show-what-to-build): Adjust to deal with 'derivation?' objects instead of .drv file names. * gnu/system/grub.scm (grub-configuration-file): Use 'derivation->output-path' instead of 'derivation-path->output-path'. * gnu/system/vm.scm (qemu-image, system-qemu-image): Likewise. * tests/builders.scm, tests/derivations.scm, tests/packages.scm, tests/store.scm, tests/union.scm: Adjust to the new calling convention. * doc/guix.texi (Defining Packages, The Store, Derivations): Adjust accordingly.
8 years ago
derivations: 'derivation' and related procedures return a single value. * guix/derivations.scm (derivation->output-path, derivation->output-paths): New procedures. (derivation-path->output-path): Use 'derivation->output-path'. (derivation-path->output-paths): Use 'derivation->output-paths'. (derivation): Accept 'derivation?' objects as inputs. Return a single value. (build-derivations): New procedure. (compiled-modules): Use 'derivation->output-paths'. (build-expression->derivation)[source-path]: Add case for when the input matches 'derivation?'. [prologue]: Accept 'derivation?' objects in INPUTS. [mod-dir, go-dir]: Use 'derivation->output-path'. * guix/download.scm (url-fetch): Adjust to the single-value return. * guix/packages.scm (package-output): Use 'derivation->output-path'. * guix/scripts/build.scm (guix-build): When the argument is 'derivation-path?', pass it through 'read-derivation'. Use 'derivation-file-name' to print out the .drv file names, and to register them. Use 'derivation->output-path' instead of 'derivation-path->output-path'. * guix/scripts/package.scm (roll-back): Adjust to the single-value return. (guix-package): Use 'derivation->output-path'. * guix/ui.scm (show-what-to-build): Adjust to deal with 'derivation?' objects instead of .drv file names. * gnu/system/grub.scm (grub-configuration-file): Use 'derivation->output-path' instead of 'derivation-path->output-path'. * gnu/system/vm.scm (qemu-image, system-qemu-image): Likewise. * tests/builders.scm, tests/derivations.scm, tests/packages.scm, tests/store.scm, tests/union.scm: Adjust to the new calling convention. * doc/guix.texi (Defining Packages, The Store, Derivations): Adjust accordingly.
8 years ago
derivations: 'derivation' and related procedures return a single value. * guix/derivations.scm (derivation->output-path, derivation->output-paths): New procedures. (derivation-path->output-path): Use 'derivation->output-path'. (derivation-path->output-paths): Use 'derivation->output-paths'. (derivation): Accept 'derivation?' objects as inputs. Return a single value. (build-derivations): New procedure. (compiled-modules): Use 'derivation->output-paths'. (build-expression->derivation)[source-path]: Add case for when the input matches 'derivation?'. [prologue]: Accept 'derivation?' objects in INPUTS. [mod-dir, go-dir]: Use 'derivation->output-path'. * guix/download.scm (url-fetch): Adjust to the single-value return. * guix/packages.scm (package-output): Use 'derivation->output-path'. * guix/scripts/build.scm (guix-build): When the argument is 'derivation-path?', pass it through 'read-derivation'. Use 'derivation-file-name' to print out the .drv file names, and to register them. Use 'derivation->output-path' instead of 'derivation-path->output-path'. * guix/scripts/package.scm (roll-back): Adjust to the single-value return. (guix-package): Use 'derivation->output-path'. * guix/ui.scm (show-what-to-build): Adjust to deal with 'derivation?' objects instead of .drv file names. * gnu/system/grub.scm (grub-configuration-file): Use 'derivation->output-path' instead of 'derivation-path->output-path'. * gnu/system/vm.scm (qemu-image, system-qemu-image): Likewise. * tests/builders.scm, tests/derivations.scm, tests/packages.scm, tests/store.scm, tests/union.scm: Adjust to the new calling convention. * doc/guix.texi (Defining Packages, The Store, Derivations): Adjust accordingly.
8 years ago
derivations: 'derivation' and related procedures return a single value. * guix/derivations.scm (derivation->output-path, derivation->output-paths): New procedures. (derivation-path->output-path): Use 'derivation->output-path'. (derivation-path->output-paths): Use 'derivation->output-paths'. (derivation): Accept 'derivation?' objects as inputs. Return a single value. (build-derivations): New procedure. (compiled-modules): Use 'derivation->output-paths'. (build-expression->derivation)[source-path]: Add case for when the input matches 'derivation?'. [prologue]: Accept 'derivation?' objects in INPUTS. [mod-dir, go-dir]: Use 'derivation->output-path'. * guix/download.scm (url-fetch): Adjust to the single-value return. * guix/packages.scm (package-output): Use 'derivation->output-path'. * guix/scripts/build.scm (guix-build): When the argument is 'derivation-path?', pass it through 'read-derivation'. Use 'derivation-file-name' to print out the .drv file names, and to register them. Use 'derivation->output-path' instead of 'derivation-path->output-path'. * guix/scripts/package.scm (roll-back): Adjust to the single-value return. (guix-package): Use 'derivation->output-path'. * guix/ui.scm (show-what-to-build): Adjust to deal with 'derivation?' objects instead of .drv file names. * gnu/system/grub.scm (grub-configuration-file): Use 'derivation->output-path' instead of 'derivation-path->output-path'. * gnu/system/vm.scm (qemu-image, system-qemu-image): Likewise. * tests/builders.scm, tests/derivations.scm, tests/packages.scm, tests/store.scm, tests/union.scm: Adjust to the new calling convention. * doc/guix.texi (Defining Packages, The Store, Derivations): Adjust accordingly.
8 years ago
derivations: 'derivation' and related procedures return a single value. * guix/derivations.scm (derivation->output-path, derivation->output-paths): New procedures. (derivation-path->output-path): Use 'derivation->output-path'. (derivation-path->output-paths): Use 'derivation->output-paths'. (derivation): Accept 'derivation?' objects as inputs. Return a single value. (build-derivations): New procedure. (compiled-modules): Use 'derivation->output-paths'. (build-expression->derivation)[source-path]: Add case for when the input matches 'derivation?'. [prologue]: Accept 'derivation?' objects in INPUTS. [mod-dir, go-dir]: Use 'derivation->output-path'. * guix/download.scm (url-fetch): Adjust to the single-value return. * guix/packages.scm (package-output): Use 'derivation->output-path'. * guix/scripts/build.scm (guix-build): When the argument is 'derivation-path?', pass it through 'read-derivation'. Use 'derivation-file-name' to print out the .drv file names, and to register them. Use 'derivation->output-path' instead of 'derivation-path->output-path'. * guix/scripts/package.scm (roll-back): Adjust to the single-value return. (guix-package): Use 'derivation->output-path'. * guix/ui.scm (show-what-to-build): Adjust to deal with 'derivation?' objects instead of .drv file names. * gnu/system/grub.scm (grub-configuration-file): Use 'derivation->output-path' instead of 'derivation-path->output-path'. * gnu/system/vm.scm (qemu-image, system-qemu-image): Likewise. * tests/builders.scm, tests/derivations.scm, tests/packages.scm, tests/store.scm, tests/union.scm: Adjust to the new calling convention. * doc/guix.texi (Defining Packages, The Store, Derivations): Adjust accordingly.
8 years ago
build-system: Introduce "bags" as an intermediate representation. * 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.
7 years ago
build-system: Introduce "bags" as an intermediate representation. * 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.
7 years ago
build-system: Introduce "bags" as an intermediate representation. * 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.
7 years ago
derivations: 'derivation' and related procedures return a single value. * guix/derivations.scm (derivation->output-path, derivation->output-paths): New procedures. (derivation-path->output-path): Use 'derivation->output-path'. (derivation-path->output-paths): Use 'derivation->output-paths'. (derivation): Accept 'derivation?' objects as inputs. Return a single value. (build-derivations): New procedure. (compiled-modules): Use 'derivation->output-paths'. (build-expression->derivation)[source-path]: Add case for when the input matches 'derivation?'. [prologue]: Accept 'derivation?' objects in INPUTS. [mod-dir, go-dir]: Use 'derivation->output-path'. * guix/download.scm (url-fetch): Adjust to the single-value return. * guix/packages.scm (package-output): Use 'derivation->output-path'. * guix/scripts/build.scm (guix-build): When the argument is 'derivation-path?', pass it through 'read-derivation'. Use 'derivation-file-name' to print out the .drv file names, and to register them. Use 'derivation->output-path' instead of 'derivation-path->output-path'. * guix/scripts/package.scm (roll-back): Adjust to the single-value return. (guix-package): Use 'derivation->output-path'. * guix/ui.scm (show-what-to-build): Adjust to deal with 'derivation?' objects instead of .drv file names. * gnu/system/grub.scm (grub-configuration-file): Use 'derivation->output-path' instead of 'derivation-path->output-path'. * gnu/system/vm.scm (qemu-image, system-qemu-image): Likewise. * tests/builders.scm, tests/derivations.scm, tests/packages.scm, tests/store.scm, tests/union.scm: Adjust to the new calling convention. * doc/guix.texi (Defining Packages, The Store, Derivations): Adjust accordingly.
8 years ago
derivations: 'derivation' and related procedures return a single value. * guix/derivations.scm (derivation->output-path, derivation->output-paths): New procedures. (derivation-path->output-path): Use 'derivation->output-path'. (derivation-path->output-paths): Use 'derivation->output-paths'. (derivation): Accept 'derivation?' objects as inputs. Return a single value. (build-derivations): New procedure. (compiled-modules): Use 'derivation->output-paths'. (build-expression->derivation)[source-path]: Add case for when the input matches 'derivation?'. [prologue]: Accept 'derivation?' objects in INPUTS. [mod-dir, go-dir]: Use 'derivation->output-path'. * guix/download.scm (url-fetch): Adjust to the single-value return. * guix/packages.scm (package-output): Use 'derivation->output-path'. * guix/scripts/build.scm (guix-build): When the argument is 'derivation-path?', pass it through 'read-derivation'. Use 'derivation-file-name' to print out the .drv file names, and to register them. Use 'derivation->output-path' instead of 'derivation-path->output-path'. * guix/scripts/package.scm (roll-back): Adjust to the single-value return. (guix-package): Use 'derivation->output-path'. * guix/ui.scm (show-what-to-build): Adjust to deal with 'derivation?' objects instead of .drv file names. * gnu/system/grub.scm (grub-configuration-file): Use 'derivation->output-path' instead of 'derivation-path->output-path'. * gnu/system/vm.scm (qemu-image, system-qemu-image): Likewise. * tests/builders.scm, tests/derivations.scm, tests/packages.scm, tests/store.scm, tests/union.scm: Adjust to the new calling convention. * doc/guix.texi (Defining Packages, The Store, Derivations): Adjust accordingly.
8 years ago
build-system: Introduce "bags" as an intermediate representation. * 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.
7 years ago
gnu: Split (gnu packages base), adding (gnu packages commencement). * 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.
8 years ago
derivations: 'derivation' and related procedures return a single value. * guix/derivations.scm (derivation->output-path, derivation->output-paths): New procedures. (derivation-path->output-path): Use 'derivation->output-path'. (derivation-path->output-paths): Use 'derivation->output-paths'. (derivation): Accept 'derivation?' objects as inputs. Return a single value. (build-derivations): New procedure. (compiled-modules): Use 'derivation->output-paths'. (build-expression->derivation)[source-path]: Add case for when the input matches 'derivation?'. [prologue]: Accept 'derivation?' objects in INPUTS. [mod-dir, go-dir]: Use 'derivation->output-path'. * guix/download.scm (url-fetch): Adjust to the single-value return. * guix/packages.scm (package-output): Use 'derivation->output-path'. * guix/scripts/build.scm (guix-build): When the argument is 'derivation-path?', pass it through 'read-derivation'. Use 'derivation-file-name' to print out the .drv file names, and to register them. Use 'derivation->output-path' instead of 'derivation-path->output-path'. * guix/scripts/package.scm (roll-back): Adjust to the single-value return. (guix-package): Use 'derivation->output-path'. * guix/ui.scm (show-what-to-build): Adjust to deal with 'derivation?' objects instead of .drv file names. * gnu/system/grub.scm (grub-configuration-file): Use 'derivation->output-path' instead of 'derivation-path->output-path'. * gnu/system/vm.scm (qemu-image, system-qemu-image): Likewise. * tests/builders.scm, tests/derivations.scm, tests/packages.scm, tests/store.scm, tests/union.scm: Adjust to the new calling convention. * doc/guix.texi (Defining Packages, The Store, Derivations): Adjust accordingly.
8 years ago
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org>
  3. ;;;
  4. ;;; This file is part of GNU Guix.
  5. ;;;
  6. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  7. ;;; under the terms of the GNU General Public License as published by
  8. ;;; the Free Software Foundation; either version 3 of the License, or (at
  9. ;;; your option) any later version.
  10. ;;;
  11. ;;; GNU Guix is distributed in the hope that it will be useful, but
  12. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. ;;; GNU General Public License for more details.
  15. ;;;
  16. ;;; You should have received a copy of the GNU General Public License
  17. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  18. (define-module (test-packages)
  19. #:use-module (guix tests)
  20. #:use-module (guix store)
  21. #:use-module (guix utils)
  22. #:use-module (guix hash)
  23. #:use-module (guix derivations)
  24. #:use-module (guix packages)
  25. #:use-module (guix build-system)
  26. #:use-module (guix build-system trivial)
  27. #:use-module (guix build-system gnu)
  28. #:use-module (gnu packages)
  29. #:use-module (gnu packages base)
  30. #:use-module (gnu packages bootstrap)
  31. #:use-module (srfi srfi-11)
  32. #:use-module (srfi srfi-26)
  33. #:use-module (srfi srfi-34)
  34. #:use-module (srfi srfi-64)
  35. #:use-module (rnrs io ports)
  36. #:use-module (ice-9 match))
  37. ;; Test the high-level packaging layer.
  38. (define %store
  39. (open-connection-for-tests))
  40. (test-begin "packages")
  41. (define-syntax-rule (dummy-package name* extra-fields ...)
  42. (package (name name*) (version "0") (source #f)
  43. (build-system gnu-build-system)
  44. (synopsis #f) (description #f)
  45. (home-page #f) (license #f)
  46. extra-fields ...))
  47. (test-assert "package-field-location"
  48. (let ()
  49. (define (goto port line column)
  50. (unless (and (= (port-column port) (- column 1))
  51. (= (port-line port) (- line 1)))
  52. (unless (eof-object? (get-char port))
  53. (goto port line column))))
  54. (define read-at
  55. (match-lambda
  56. (($ <location> file line column)
  57. (call-with-input-file (search-path %load-path file)
  58. (lambda (port)
  59. (goto port line column)
  60. (read port))))))
  61. ;; Until Guile 2.0.6 included, source properties were added only to pairs.
  62. ;; Thus, check against both VALUE and (FIELD VALUE).
  63. (and (member (read-at (package-field-location %bootstrap-guile 'name))
  64. (let ((name (package-name %bootstrap-guile)))
  65. (list name `(name ,name))))
  66. (member (read-at (package-field-location %bootstrap-guile 'version))
  67. (let ((version (package-version %bootstrap-guile)))
  68. (list version `(version ,version))))
  69. (not (package-field-location %bootstrap-guile 'does-not-exist)))))
  70. ;; Make sure we don't change the file name to an absolute file name.
  71. (test-equal "package-field-location, relative file name"
  72. (location-file (package-location %bootstrap-guile))
  73. (with-fluids ((%file-port-name-canonicalization 'absolute))
  74. (location-file (package-field-location %bootstrap-guile 'version))))
  75. (test-assert "package-transitive-inputs"
  76. (let* ((a (dummy-package "a"))
  77. (b (dummy-package "b"
  78. (propagated-inputs `(("a" ,a)))))
  79. (c (dummy-package "c"
  80. (inputs `(("a" ,a)))))
  81. (d (dummy-package "d"
  82. (propagated-inputs `(("x" "something.drv")))))
  83. (e (dummy-package "e"
  84. (inputs `(("b" ,b) ("c" ,c) ("d" ,d))))))
  85. (and (null? (package-transitive-inputs a))
  86. (equal? `(("a" ,a)) (package-transitive-inputs b))
  87. (equal? `(("a" ,a)) (package-transitive-inputs c))
  88. (equal? (package-propagated-inputs d)
  89. (package-transitive-inputs d))
  90. (equal? `(("b" ,b) ("b/a" ,a) ("c" ,c)
  91. ("d" ,d) ("d/x" "something.drv"))
  92. (pk 'x (package-transitive-inputs e))))))
  93. (test-skip (if (not %store) 8 0))
  94. (test-assert "package-source-derivation, file"
  95. (let* ((file (search-path %load-path "guix.scm"))
  96. (package (package (inherit (dummy-package "p"))
  97. (source file)))
  98. (source (package-source-derivation %store
  99. (package-source package))))
  100. (and (store-path? source)
  101. (valid-path? %store source)
  102. (equal? (call-with-input-file source get-bytevector-all)
  103. (call-with-input-file file get-bytevector-all)))))
  104. (test-assert "package-source-derivation, store path"
  105. (let* ((file (add-to-store %store "guix.scm" #t "sha256"
  106. (search-path %load-path "guix.scm")))
  107. (package (package (inherit (dummy-package "p"))
  108. (source file)))
  109. (source (package-source-derivation %store
  110. (package-source package))))
  111. (string=? file source)))
  112. (test-assert "package-source-derivation, indirect store path"
  113. (let* ((dir (add-to-store %store "guix-build" #t "sha256"
  114. (dirname (search-path %load-path
  115. "guix/build/utils.scm"))))
  116. (package (package (inherit (dummy-package "p"))
  117. (source (string-append dir "/utils.scm"))))
  118. (source (package-source-derivation %store
  119. (package-source package))))
  120. (and (direct-store-path? source)
  121. (string-suffix? "utils.scm" source))))
  122. (unless (false-if-exception (getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV))
  123. (test-skip 1))
  124. (test-equal "package-source-derivation, snippet"
  125. "OK"
  126. (let* ((file (search-bootstrap-binary "guile-2.0.9.tar.xz"
  127. (%current-system)))
  128. (sha256 (call-with-input-file file port-sha256))
  129. (fetch (lambda* (store url hash-algo hash
  130. #:optional name #:key system)
  131. (pk 'fetch url hash-algo hash name system)
  132. (add-to-store store (basename url) #f "sha256" url)))
  133. (source (bootstrap-origin
  134. (origin
  135. (method fetch)
  136. (uri file)
  137. (sha256 sha256)
  138. (patch-inputs
  139. `(("tar" ,%bootstrap-coreutils&co)
  140. ("xz" ,%bootstrap-coreutils&co)
  141. ("patch" ,%bootstrap-coreutils&co)))
  142. (patch-guile %bootstrap-guile)
  143. (modules '((guix build utils)))
  144. (imported-modules modules)
  145. (snippet '(begin
  146. ;; We end up in 'bin', because it's the first
  147. ;; directory, alphabetically. Not a very good
  148. ;; example but hey.
  149. (chmod "." #o777)
  150. (symlink "guile" "guile-rocks")
  151. (copy-recursively "../share/guile/2.0/scripts"
  152. "scripts")
  153. ;; These variables must exist.
  154. (pk %build-inputs %outputs))))))
  155. (package (package (inherit (dummy-package "with-snippet"))
  156. (source source)
  157. (build-system trivial-build-system)
  158. (inputs
  159. `(("tar" ,(search-bootstrap-binary "tar"
  160. (%current-system)))
  161. ("xz" ,(search-bootstrap-binary "xz"
  162. (%current-system)))))
  163. (arguments
  164. `(#:guile ,%bootstrap-guile
  165. #:builder
  166. (let ((tar (assoc-ref %build-inputs "tar"))
  167. (xz (assoc-ref %build-inputs "xz"))
  168. (source (assoc-ref %build-inputs "source")))
  169. (and (zero? (system* tar "xvf" source
  170. "--use-compress-program" xz))
  171. (string=? "guile" (readlink "bin/guile-rocks"))
  172. (file-exists? "bin/scripts/compile.scm")
  173. (let ((out (assoc-ref %outputs "out")))
  174. (call-with-output-file out
  175. (lambda (p)
  176. (display "OK" p))))))))))
  177. (drv (package-derivation %store package))
  178. (out (derivation->output-path drv)))
  179. (and (build-derivations %store (list (pk 'snippet-drv drv)))
  180. (call-with-input-file out get-string-all))))
  181. (test-assert "return value"
  182. (let ((drv (package-derivation %store (dummy-package "p"))))
  183. (and (derivation? drv)
  184. (file-exists? (derivation-file-name drv)))))
  185. (test-assert "package-output"
  186. (let* ((package (dummy-package "p"))
  187. (drv (package-derivation %store package)))
  188. (and (derivation? drv)
  189. (string=? (derivation->output-path drv)
  190. (package-output %store package "out")))))
  191. (test-assert "trivial"
  192. (let* ((p (package (inherit (dummy-package "trivial"))
  193. (build-system trivial-build-system)
  194. (source #f)
  195. (arguments
  196. `(#:guile ,%bootstrap-guile
  197. #:builder
  198. (begin
  199. (mkdir %output)
  200. (call-with-output-file (string-append %output "/test")
  201. (lambda (p)
  202. (display '(hello guix) p))))))))
  203. (d (package-derivation %store p)))
  204. (and (build-derivations %store (list d))
  205. (let ((p (pk 'drv d (derivation->output-path d))))
  206. (equal? '(hello guix)
  207. (call-with-input-file (string-append p "/test") read))))))
  208. (test-assert "trivial with local file as input"
  209. (let* ((i (search-path %load-path "ice-9/boot-9.scm"))
  210. (p (package (inherit (dummy-package "trivial-with-input-file"))
  211. (build-system trivial-build-system)
  212. (source #f)
  213. (arguments
  214. `(#:guile ,%bootstrap-guile
  215. #:builder (copy-file (assoc-ref %build-inputs "input")
  216. %output)))
  217. (inputs `(("input" ,i)))))
  218. (d (package-derivation %store p)))
  219. (and (build-derivations %store (list d))
  220. (let ((p (pk 'drv d (derivation->output-path d))))
  221. (equal? (call-with-input-file p get-bytevector-all)
  222. (call-with-input-file i get-bytevector-all))))))
  223. (test-assert "trivial with source"
  224. (let* ((i (search-path %load-path "ice-9/boot-9.scm"))
  225. (p (package (inherit (dummy-package "trivial-with-source"))
  226. (build-system trivial-build-system)
  227. (source i)
  228. (arguments
  229. `(#:guile ,%bootstrap-guile
  230. #:builder (copy-file (assoc-ref %build-inputs "source")
  231. %output)))))
  232. (d (package-derivation %store p)))
  233. (and (build-derivations %store (list d))
  234. (let ((p (derivation->output-path d)))
  235. (equal? (call-with-input-file p get-bytevector-all)
  236. (call-with-input-file i get-bytevector-all))))))
  237. (test-assert "trivial with system-dependent input"
  238. (let* ((p (package (inherit (dummy-package "trivial-system-dependent-input"))
  239. (build-system trivial-build-system)
  240. (source #f)
  241. (arguments
  242. `(#:guile ,%bootstrap-guile
  243. #:builder
  244. (let ((out (assoc-ref %outputs "out"))
  245. (bash (assoc-ref %build-inputs "bash")))
  246. (zero? (system* bash "-c"
  247. (format #f "echo hello > ~a" out))))))
  248. (inputs `(("bash" ,(search-bootstrap-binary "bash"
  249. (%current-system)))))))
  250. (d (package-derivation %store p)))
  251. (and (build-derivations %store (list d))
  252. (let ((p (pk 'drv d (derivation->output-path d))))
  253. (eq? 'hello (call-with-input-file p read))))))
  254. (test-assert "search paths"
  255. (let* ((p (make-prompt-tag "return-search-paths"))
  256. (s (build-system
  257. (name 'raw)
  258. (description "Raw build system with direct store access")
  259. (lower (lambda* (name #:key source inputs system target
  260. #:allow-other-keys)
  261. (bag
  262. (name name)
  263. (system system) (target target)
  264. (build-inputs inputs)
  265. (build
  266. (lambda* (store name inputs
  267. #:key outputs system search-paths)
  268. search-paths)))))))
  269. (x (list (search-path-specification
  270. (variable "GUILE_LOAD_PATH")
  271. (directories '("share/guile/site/2.0")))
  272. (search-path-specification
  273. (variable "GUILE_LOAD_COMPILED_PATH")
  274. (directories '("share/guile/site/2.0")))))
  275. (a (package (inherit (dummy-package "guile"))
  276. (build-system s)
  277. (native-search-paths x)))
  278. (b (package (inherit (dummy-package "guile-foo"))
  279. (build-system s)
  280. (inputs `(("guile" ,a)))))
  281. (c (package (inherit (dummy-package "guile-bar"))
  282. (build-system s)
  283. (inputs `(("guile" ,a)
  284. ("guile-foo" ,b))))))
  285. (let-syntax ((collect (syntax-rules ()
  286. ((_ body ...)
  287. (call-with-prompt p
  288. (lambda ()
  289. body ...)
  290. (lambda (k search-paths)
  291. search-paths))))))
  292. (and (null? (collect (package-derivation %store a)))
  293. (equal? x (collect (package-derivation %store b)))
  294. (equal? x (collect (package-derivation %store c)))))))
  295. (test-assert "package-cross-derivation"
  296. (let ((drv (package-cross-derivation %store (dummy-package "p")
  297. "mips64el-linux-gnu")))
  298. (and (derivation? drv)
  299. (file-exists? (derivation-file-name drv)))))
  300. (test-assert "package-cross-derivation, trivial-build-system"
  301. (let ((p (package (inherit (dummy-package "p"))
  302. (build-system trivial-build-system)
  303. (arguments '(#:builder (exit 1))))))
  304. (let ((drv (package-cross-derivation %store p "mips64el-linux-gnu")))
  305. (derivation? drv))))
  306. (test-assert "package-cross-derivation, no cross builder"
  307. (let* ((b (build-system (inherit trivial-build-system)
  308. (lower (const #f))))
  309. (p (package (inherit (dummy-package "p"))
  310. (build-system b))))
  311. (guard (c ((package-cross-build-system-error? c)
  312. (eq? (package-error-package c) p)))
  313. (package-cross-derivation %store p "mips64el-linux-gnu")
  314. #f)))
  315. (test-equal "package->bag"
  316. `("foo86-hurd" #f (,(package-source gnu-make))
  317. (,(canonical-package glibc)) (,(canonical-package coreutils)))
  318. (let ((bag (package->bag gnu-make "foo86-hurd")))
  319. (list (bag-system bag) (bag-target bag)
  320. (assoc-ref (bag-build-inputs bag) "source")
  321. (assoc-ref (bag-build-inputs bag) "libc")
  322. (assoc-ref (bag-build-inputs bag) "coreutils"))))
  323. (test-equal "package->bag, cross-compilation"
  324. `(,(%current-system) "foo86-hurd"
  325. (,(package-source gnu-make))
  326. (,(canonical-package glibc)) (,(canonical-package coreutils)))
  327. (let ((bag (package->bag gnu-make (%current-system) "foo86-hurd")))
  328. (list (bag-system bag) (bag-target bag)
  329. (assoc-ref (bag-build-inputs bag) "source")
  330. (assoc-ref (bag-build-inputs bag) "libc")
  331. (assoc-ref (bag-build-inputs bag) "coreutils"))))
  332. (test-assert "bag->derivation"
  333. (let ((bag (package->bag gnu-make))
  334. (drv (package-derivation %store gnu-make)))
  335. (parameterize ((%current-system "foox86-hurd")) ;should have no effect
  336. (equal? drv (bag->derivation %store bag)))))
  337. (test-assert "bag->derivation, cross-compilation"
  338. (let ((bag (package->bag gnu-make (%current-system) "mips64el-linux-gnu"))
  339. (drv (package-cross-derivation %store gnu-make "mips64el-linux-gnu")))
  340. (parameterize ((%current-system "foox86-hurd") ;should have no effect
  341. (%current-target-system "foo64-linux-gnu"))
  342. (equal? drv (bag->derivation %store bag)))))
  343. (unless (false-if-exception (getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV))
  344. (test-skip 1))
  345. (test-assert "GNU Make, bootstrap"
  346. ;; GNU Make is the first program built during bootstrap; we choose it
  347. ;; here so that the test doesn't last for too long.
  348. (let ((gnu-make (@@ (gnu packages commencement) gnu-make-boot0)))
  349. (and (package? gnu-make)
  350. (or (location? (package-location gnu-make))
  351. (not (package-location gnu-make)))
  352. (let* ((drv (package-derivation %store gnu-make))
  353. (out (derivation->output-path drv)))
  354. (and (build-derivations %store (list drv))
  355. (file-exists? (string-append out "/bin/make")))))))
  356. (test-eq "fold-packages" hello
  357. (fold-packages (lambda (p r)
  358. (if (string=? (package-name p) "hello")
  359. p
  360. r))
  361. #f))
  362. (test-assert "find-packages-by-name"
  363. (match (find-packages-by-name "hello")
  364. (((? (cut eq? hello <>))) #t)
  365. (wrong (pk 'find-packages-by-name wrong #f))))
  366. (test-assert "find-packages-by-name with version"
  367. (match (find-packages-by-name "hello" (package-version hello))
  368. (((? (cut eq? hello <>))) #t)
  369. (wrong (pk 'find-packages-by-name wrong #f))))
  370. (test-end "packages")
  371. (exit (= (test-runner-fail-count (test-runner-current)) 0))
  372. ;;; Local Variables:
  373. ;;; eval: (put 'dummy-package 'scheme-indent-function 1)
  374. ;;; End: