summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2013-07-10records: `recutils->alist' recognizes lines starting with a `+'.Ludovic Courtès
* guix/records.scm (%recutils-plus-rx): New variable. (recutils->alist): Use it to read + lines. * tests/records.scm ("recutils->alist with + lines"): New test.
2013-07-10records: `alist->record' supports multiple-field occurrences.Ludovic Courtès
* guix/records.scm (alist->record): Add `multiple-value-keys' parameter. Update docstring, and honor it. * tests/records.scm ("alist->record"): New record.
2013-07-10records: `recutils->alist' recognizes comments.Ludovic Courtès
* guix/records.scm (%recutils-comment-rx): New variable. (recutils->alist): Match comments. * tests/records.scm ("recutils->alist"): Add comments.
2013-07-10records: Add `recutils->alist' for public consumption.Ludovic Courtès
* guix/records.scm (%recutils-field-rx): New variable. (recutils->alist): New procedure, formerly known as `fields->alist'. * guix/scripts/substitute-binary.scm (fields->alist): Use it. * tests/records.scm ("recutils->alist"): New test.
2013-07-10tests: Fix guix-package.sh in the presence of multiple-output `make'.Ludovic Courtès
* tests/guix-package.sh: For $boot_make_drv, take only the "out" output. Reported by Nikita Karetnikov <nikita@karetnikov.org>.
2013-07-08tests: Adjust `package-field-location' test for Guile <= 2.0.6.Ludovic Courtès
* tests/packages.scm ("package-field-location"): Check the result of `read-at' against both VALUE and (FIELD VALUE). Reported by Matthew Lien - 練喆明" <bluet@bluet.org>.
2013-07-02hash: Add `open-sha256-port'.Ludovic Courtès
* guix/hash.scm (GCRY_MD_SHA256): New macro. (sha256): Use it. (open-sha256-md, md-write, md-read, md-close, open-sha256-port, port-sha256): New procedures. * tests/hash.scm: New file. * Makefile.am (SCM_TESTS): Add it.
2013-07-01Move `sha256' to (guix hash).Ludovic Courtès
* guix/utils.scm (sha256): Move to... * guix/hash.scm: ... here. New file. * Makefile.am (MODULES): Add it. * guix/derivations.scm, guix/scripts/download.scm, guix/scripts/hash.scm, guix/scripts/refresh.scm, tests/base32.scm, tests/derivations.scm, tests/store.scm: Use (guix hash).
2013-06-13store: Add `requisites'.Ludovic Courtès
* guix/store.scm (fold-path, requisites): New procedures. * tests/store.scm ("requisites"): New test.
2013-05-29store: Test the `fallback?' store option.Ludovic Courtès
* guix/store.scm (set-build-options): Rename #:try-fallback? to #:fallback?. * tests/store.scm ("substitute --fallback"): New test.
2013-05-27packages: Raise an error condition a cross builder is needed but unavailable.Ludovic Courtès
* guix/packages.scm (&package-cross-build-system-error): New condition type. (package-cross-derivation): Raise &package-cross-build-system-error when the build system doesn't support cross builds. * guix/ui.scm (call-with-error-handling): Add package-cross-build-system-error? case. * tests/packages.scm ("package-cross-derivation, no cross builder"): New test.
2013-05-24build-system/trivial: Implement the cross-build protocol.Ludovic Courtès
* guix/build-system/trivial.scm (guile-for-build): New procedure. (trivial-build): Use it. (trivial-cross-build): New procedure. (trivial-build-system): Use it.
2013-05-24build: Add `--target' option.Ludovic Courtès
* guix/scripts/build.scm (derivations-from-package-expressions): Add `package-derivation' parameter. (show-help, %options): Add `--target'. (guix-build): Use `package-cross-derivation' when `--target' is passed. * tests/guix-build.sh: Add dry-run test with `--target'. * doc/guix.texi (Invoking guix build): Document `--target'.
2013-05-24packages: Implement `package-cross-derivation'.Ludovic Courtès
* guix/packages.scm (package-transitive-target-inputs, package-transitive-native-inputs): New procedures. (package-derivation): Parametrize `%current-target-system'. (package-cross-derivation): Implement. * guix/utils.scm (%current-target-system): New variable. * tests/packages.scm ("package-cross-derivation"): New test. * doc/guix.texi (Defining Packages): Document `package-cross-derivation'.
2013-05-20Add `--max-silent-time' to `guix build' and `guix package'.Ludovic Courtès
* guix/scripts/build.scm (%default-options): Add default `max-silent-time' value. (show-help, %options): Add `--max-silent-time'. (guix-build): Pass `max-silent-time' to `set-build-options'. * guix/scripts/package.scm (%default-options): Add default `max-silent-time' value. (show-help, %options): Add `--max-silent-time'. (guix-package): Pass `max-silent-time' to `set-build-options'. * guix/ui.scm (string->number*): New procedure. * tests/derivations.scm ("build-expression->derivation and max-silent-time"): New test. * doc/guix.texi (Invoking guix package, Invoking guix build): Document `--max-silent-time'.
2013-05-15substitute-binary: Pass `filtered-port' an unbuffered port.Ludovic Courtès
This fixes a bug whereby `read-response' would read more than just the response, with the extra data going into the port's buffer; the "bzip2 -dc" process spawned by `filtered-port' would not see the those buffered data, which are definitely lost, and would bail out with "bzip2: (stdin) is not a bzip2 file." * guix/utils.scm (filtered-port): Document that INPUT must be unbuffered. * guix/web.scm (http-fetch): Add `buffered?' parameter. Call `open-socket-for-uri' explicitly, and call `setvbuf' when BUFFERED? is false. Pass the port to `http-get'. Close it upon 301/302. * guix/scripts/substitute-binary.scm (fetch): Add `buffered?' parameter. Pass it to `http-fetch'; honor it for `file' URIs. (guix-substitute-binary): Call `fetch' with #:buffered? #f for port RAW. * tests/utils.scm ("filtered-port, file"): Open FILE as unbuffered.
2013-05-12Move record utilities to (guix records).Ludovic Courtès
* guix/utils.scm (define-record-type*): Move to... * guix/records.scm: ... here. New file. * guix/build-system.scm, guix/packages.scm: Use it. * guix/gnu-maintenance.scm: Likewise. (official-gnu-packages)[alist->record]: Remove. * guix/scripts/substitute-binary.scm: Likewise. (alist->record, object->fields): Remove. * tests/utils.scm ("define-record-type*", "define-record-type* with letrec* behavior", "define-record-type* & inherit", "define-record-type* & inherit & letrec* behavior", "define-record-type* & thunked", "define-record-type* & thunked & default", "define-record-type* & thunked & inherited"): Move to... * tests/records.scm: ... here. New file.
2013-05-11tests: Fix out-of-source builds.Ludovic Courtès
* tests/nar.scm (%test-dir): Compute relative to `pre-inst-env', which is in $top_builddir.
2013-05-11tests: Add `guix hash' test.Ludovic Courtès
* guix/scripts/hash.scm (guix-hash)[eof->null]: New procedure. Use it to convert the EOF object to the empty bytevector. * tests/guix-hash.sh: New file. * Makefile.am (SH_TESTS): Add it.
2013-05-10package: Store the output path of packages installed with `-e'.Ludovic Courtès
* guix/scripts/package.scm (guix-package)[process-actions](package->tuple): Put the output path in the tuple, not the derivation path. * tests/guix-package.sh: Add test.
2013-04-30Merge branch 'core-updates'Ludovic Courtès
2013-04-29substitute-binary: Support decompression from non-file ports.Ludovic Courtès
* guix/scripts/substitute-binary.scm (filtered-port): Move to utils.scm. (decompressed-port): Upon "none", return '() as the second value. (guix-substitute-binary): Expect `decompressed-port' to return a list of PIDs as its second value. * guix/utils.scm (filtered-port): New procedure. Add case for when INPUT is not `file-port?'. * tests/utils.scm ("filtered-port, file", "filtered-port, non-file"): New tests.
2013-04-28guix package: Add `--search-paths' & co.Ludovic Courtès
* guix/scripts/package.scm (search-path-environment-variables, display-search-paths): New procedures. (show-help, %options): Add `--search-paths'. (guix-package)[process-actions]: Call `display-search-paths' once the profile is ready. [process-query]: Honor `search-paths'.
2013-04-28utils: Add `string-tokenize*'.Ludovic Courtès
* guix/utils.scm (string-tokenize*): New procedure. * tests/utils.scm ("string-tokenize*"): New test.
2013-04-26Merge branch 'master' into core-updatesLudovic Courtès
Conflicts: Makefile.am gnu/packages/autotools.scm gnu/packages/guile.scm gnu/packages/python.scm gnu/packages/shishi.scm guix/gnu-maintenance.scm guix/scripts/build.scm guix/scripts/gc.scm guix/scripts/package.scm guix/scripts/substitute-binary.scm guix/ui.scm nix/nix-daemon/guix-daemon.cc test-env.in tests/nar.scm tests/store.scm
2013-04-25packages: Use `read' and source properties for `package-field-location'.Ludovic Courtès
* guix/packages.scm (package-field-location): Rewrite using `read' and source properties. Change to return #f upon failure. * tests/packages.scm ("package-field-location"): Check for #f upon failure. * build-aux/sync-synopses.scm: Adjust accordingly.
2013-04-22packages: Add `package-field-location'.Ludovic Courtès
* guix/packages.scm (package-field-location): New procedure. * build-aux/sync-synopses.scm: Use it instead of `package-location'. * tests/packages.scm ("package-field-location"): New test.
2013-04-18tests: Use a new synopsis of GNU Hello.Nikita Karetnikov
* tests/guix-package.sh: Use a new synopsis of GNU Hello, which was added in f50d2669e3e624365221cc81918ba55fdce94107.
2013-04-17scripts: Report what will be substituted.Ludovic Courtès
* guix/derivations.scm (derivation-input-output-paths): New procedure. (derivation-prerequisites-to-build): New `use-substitutes?' keyword argument. Change two return the list of substitutable paths as a second argument. * guix/ui.scm (show-what-to-build): Turn `dry-run?' into a keyword argument. New `use-substitutes?' keyword argument. Use `fold2' and adjust to use both return values of `derivation-prerequisites-to-build'. Display what will/would be downloaded. * guix/scripts/build.scm (guix-build): Adjust accordingly. * guix/scripts/package.scm (guix-package): Likewise. * tests/derivations.scm ("derivation-prerequisites-to-build and substitutes"): New test.
2013-04-15substitute-binary: Add a local cache.Ludovic Courtès
* guix/scripts/substitute-binary.scm (%narinfo-cache-directory, %narinfo-ttl, %narinfo-negative-ttl): New variables. (with-atomic-file-output, object->fields, read-narinfo, write-narinfo, narinfo->string, string->narinfo, lookup-narinfo): New procedures. (fetch-narinfo): Adjust to use `read-narinfo'. (guix-substitute-binary): Ensure the existence of %NARINFO-CACHE-DIRECTORY. Use `lookup-narinfo' instead of `fetch-narinfo'.
2013-04-14utils: Add `fold2'.Ludovic Courtès
* gnu/packages.scm (fold2): Remove. * guix/utils.scm (fold2): New procedure. Generalization of the above to one and two lists. * tests/utils.scm ("fold2, 1 list", "fold2, 2 lists"): New tests.
2013-04-12substitute-binary: Implement `--substitute'.Ludovic Courtès
This allows build outputs to be transparently downloaded from http://hydra.gnu.org, for example. * config-daemon.ac: Check for `gzip', `bzip2', and `xz'. * guix/config.scm.in (%gzip, %bzip2, %xz): New variable. * guix/scripts/substitute-binary.scm (fetch): Return SIZE as a second value. (<narinfo>): Change `url' to `uri'. (make-narinfo): Rename to... (narinfo-maker): ... this. Handle relative URLs. (fetch-narinfo): Adjust accordingly. (filtered-port, decompressed-port): New procedures. (guix-substitute-binary): Implement the `--substitute' case. * tests/store.scm ("substitute query"): Use (%store-prefix) instead of (getenv "NIX_STORE_DIR"). ("substitute"): New test.
2013-04-12nar: Add support for symlinks.Ludovic Courtès
* guix/nar.scm (write-file): Add case for type `symlink'. (restore-file): Likewise. * tests/nar.scm (random-file-size, make-file-tree, delete-file-tree, with-file-tree, file-tree-equal?, make-random-bytevector, populate-file): New procedures. (%test-dir): New variable. ("write-file + restore-file"): Use `%test-dir' and `file-tree-equal?'. ("write-file + restore-file with symlinks"): New test.
2013-04-12nar: Implement restoration from Nar.Ludovic Courtès
* guix/nar.scm (&nar-error, &nar-read-error): New condition types. (dump): New procedure. (write-contents)[dump]: Remove. Use the one above instead. (read-contents, write-file, restore-file): New procedures. (%archive-version-1): New variable.
2013-04-12Add preliminary binary substituter.Ludovic Courtès
* guix/scripts/substitute-binary.scm: New file. * Makefile.am (MODULES): Add it. * nix/scripts/substitute-binary.in: New file. * config-daemon.ac: Produce nix/scripts/substitute-binary. * daemon.am (nodist_pkglibexec_SCRIPTS): Add nix/scripts/substitute-binary. * guix/store.scm (substitutable-path-info): Use the `query-substitutable-path-infos' RPC. * nix/nix-daemon/guix-daemon.cc (main): Honor `NIX_SUBSTITUTERS'. * pre-inst-env.in: Set `NIX_SUBSTITUTERS'. * test-env.in: Leave `NIX_SUBSTITUTERS' unchanged. Set `GUIX_BINARY_SUBSTITUTE_URL, and create $NIX_STATE_DIR/substituter-data. Run `guix-daemon' within `./pre-inst-env'. * tests/store.scm ("substitute query"): New test.
2013-04-12store: Add `store-path-hash-part'.Ludovic Courtès
* guix/store.scm (store-path-hash-part): New procedure. * tests/store.scm ("store-path-hash-part", "store-path-hash-part #f"): New tests.
2013-04-12tests: Remove temporary directory created by nar.scm.Ludovic Courtès
* tests/nar.scm ("write-file + restore-file with symlinks"): Add (rm-rf output).
2013-04-12substitute-binary: Implement `--substitute'.Ludovic Courtès
This allows build outputs to be transparently downloaded from http://hydra.gnu.org, for example. * config-daemon.ac: Check for `gzip', `bzip2', and `xz'. * guix/config.scm.in (%gzip, %bzip2, %xz): New variable. * guix/scripts/substitute-binary.scm (fetch): Return SIZE as a second value. (<narinfo>): Change `url' to `uri'. (make-narinfo): Rename to... (narinfo-maker): ... this. Handle relative URLs. (fetch-narinfo): Adjust accordingly. (filtered-port, decompressed-port): New procedures. (guix-substitute-binary): Implement the `--substitute' case. * tests/store.scm ("substitute query"): Use (%store-prefix) instead of (getenv "NIX_STORE_DIR"). ("substitute"): New test.
2013-04-12nar: Add support for symlinks.Ludovic Courtès
* guix/nar.scm (write-file): Add case for type `symlink'. (restore-file): Likewise. * tests/nar.scm (random-file-size, make-file-tree, delete-file-tree, with-file-tree, file-tree-equal?, make-random-bytevector, populate-file): New procedures. (%test-dir): New variable. ("write-file + restore-file"): Use `%test-dir' and `file-tree-equal?'. ("write-file + restore-file with symlinks"): New test.
2013-04-11tests: Adjust `gnu-build' test to search path mechanism.Ludovic Courtès
Fixes a regression introduced in a18eda2. Reported by Nikita Karetnikov <nikita@karetnikov.org>. * tests/builders.scm (%bootstrap-search-paths): New variable. ("gnu-build"): Pass #:search-paths.
2013-04-08nar: Implement restoration from Nar.Ludovic Courtès
* guix/nar.scm (&nar-error, &nar-read-error): New condition types. (dump): New procedure. (write-contents)[dump]: Remove. Use the one above instead. (read-contents, write-file, restore-file): New procedures. (%archive-version-1): New variable.
2013-04-03Add preliminary binary substituter.Ludovic Courtès
* guix/scripts/substitute-binary.scm: New file. * Makefile.am (MODULES): Add it. * nix/scripts/substitute-binary.in: New file. * config-daemon.ac: Produce nix/scripts/substitute-binary. * daemon.am (nodist_pkglibexec_SCRIPTS): Add nix/scripts/substitute-binary. * guix/store.scm (substitutable-path-info): Use the `query-substitutable-path-infos' RPC. * nix/nix-daemon/guix-daemon.cc (main): Honor `NIX_SUBSTITUTERS'. * pre-inst-env.in: Set `NIX_SUBSTITUTERS'. * test-env.in: Leave `NIX_SUBSTITUTERS' unchanged. Set `GUIX_BINARY_SUBSTITUTE_URL, and create $NIX_STATE_DIR/substituter-data. Run `guix-daemon' within `./pre-inst-env'. * tests/store.scm ("substitute query"): New test.
2013-04-01store: Add `store-path-hash-part'.Ludovic Courtès
* guix/store.scm (store-path-hash-part): New procedure. * tests/store.scm ("store-path-hash-part", "store-path-hash-part #f"): New tests.
2013-03-30packages: Add `native-search-paths' field and honor it.Ludovic Courtès
* guix/packages.scm (<search-path-specification>): New record type. (search-path-specification->sexp): New procedure. (<package>)[native-search-paths]: New field. (package-derivation): Accumulate the search paths, and pass them as #:search-paths toe BUILDER. * guix/build-system/gnu.scm (gnu-build): Add #:search-paths. Compute `implicit-search-paths'. Pass #:search-paths in BUILDER. * guix/build-system/perl.scm (perl-build): Add #:search-paths, pass it to BUILDER with the search paths of PERL. * guix/build-system/cmake.scm (cmake-build): Add #:search-paths, pass it to BUILDER. * guix/build-system/trivial.scm (trivial-build): Add #:search-paths, ignore it. * guix/build/gnu-build-system.scm (set-paths): Add #:search-paths. Remove explicit settings of CPATH, LIBRARY_PATH, and PKG_CONFIG_PATH. Instead, walk SEARCH-PATHS and call `set-path-environment-variable' for them. * guix/build/perl-build-system.scm (perl-build): Remove PERL5LIB setting. * tests/packages.scm ("search paths"): New test. * gnu/packages/bootstrap.scm (%bootstrap-guile)[raw]: Add #:search-paths. (%bootstrap-gcc): Add `native-search-paths' field. * gnu/packages/perl.scm (perl): Likewise. * gnu/packages/pkg-config.scm (pkg-config): Likewise. * gnu/packages/glib.scm (intltool): Remove `arguments'. * gnu/packages/avahi.scm (avahi): Remove #:phases.
2013-03-07packages: Remove the default value for `license'.Ludovic Courtès
* guix/packages.scm (<package>): Remove the default value for `license'. * gnu/packages/bootstrap.scm (package-from-tarball, %bootstrap-glibc, %bootstrap-gcc): Initialize `license'. * tests/packages.scm (dummy-package): Likewise.
2013-03-01guix package: Add `--install-from-expression'.Ludovic Courtès
* guix/scripts/package.scm (read/eval-package-expression): New procedure. (show-help): Add `-e'. (%options): Likewise. (guix-package)[process-actions]: Handle ('install . p) pairs, where P is a package. * tests/guix-package.sh: Add `boot_make_drv'. Use `-i $boot_make_drv' once, and then use `-e $boot_make'. * doc/guix.texi (Invoking guix package): Document `-e'.
2013-02-27guix gc: Add `--references' and `--referrers'.Ludovic Courtès
* guix/scripts/gc.scm (show-help): Update. (%options): Add `--references' and `--referrers'. (guix-gc)[symlink-target, store-directory]: New procedures. Handle the `list-references' and `list-referrers' actions. * tests/guix-gc.sh: Add tests for `--references'. * doc/guix.texi (Invoking guix gc): Document `--references' and `--referrers'.
2013-02-27store: Add queries for references & co.Ludovic Courtès
* guix/store.scm (operation-id)[query-valid-derivers]: New value. (references, referrers, valid-derivers, query-derivation-outputs): New procedures. * tests/store.scm ("references", "derivers"): New tests.
2013-02-16Replace individual scripts with master 'guix' script.Mark H Weaver
* scripts/guix.in: New script. * Makefile.am (bin_SCRIPTS): Add 'scripts/guix'. Remove 'guix-build', 'guix-download', 'guix-import', 'guix-package', and 'guix-gc'. (MODULES): Add 'guix/scripts/build.scm', 'guix/scripts/download.scm', 'guix/scripts/import.scm', 'guix/scripts/package.scm', and 'guix/scripts/gc.scm'. * configure.ac (AC_CONFIG_FILES): Add 'scripts/guix'. Remove 'guix-build', 'guix-download', 'guix-import', 'guix-package', and 'guix-gc'. * guix-build.in, guix-download.in, guix-gc.in, guix-import.in, guix-package.in: Remove shell script boilerplate. Move to guix-COMMAND.in to guix/scripts/COMMAND.scm. Rename module from (guix-COMMAND) to (guix scripts COMMAND). Change "guix-COMMAND" to "guix COMMAND" in usage help string. * pre-inst-env.in: Add "@abs_top_builddir@/scripts" to the front of $PATH. Export $GUIX_UNINSTALLED. * tests/guix-build.sh, tests/guix-daemon.sh, tests/guix-download.sh, tests/guix-gc.sh, tests/guix-package.sh: Use "guix COMMAND" instead of "guix-COMMAND". * doc/guix.texi: Replace all occurrences of "guix-COMMAND" with "guix COMMAND". * po/POTFILES.in: Update.
2013-02-16packages: Add `package-output'.Ludovic Courtès
* guix/packages.scm (package-output): New procedure. * tests/packages.scm ("package-output"): New test.