Commit Graph

90 Commits

Author SHA1 Message Date
Ludovic Courtès 97d3998e7a tests: Adjust to not rely on /bin/sh.
* tests/derivations.scm (%bash): New variable.
  Replace occurrences of "/bin/sh" by %BASH.
* tests/union.scm ("union-build"): Delete duplicates from
  %BOOTSTRAP-INPUTS.
2013-01-02 01:04:37 +01:00
Ludovic Courtès 1e9824513c Merge branch 'nix-integration'
Conflicts:
	tests/guix-package.sh
2012-12-13 22:14:25 +01:00
Ludovic Courtès ad1ebab379 tests: Skip network-dependent tests when the network is unreachable.
* tests/builders.scm (network-reachable?): New variable.
  ("url-fetch", "gnu-build"): Skip unless NETWORK-REACHABLE?.
* tests/derivations.scm (%coreutils): Check for network access.
  ("build-expression->derivation with one input"): Skip when %COREUTILS
  is #f.
* tests/guix-package.sh: Skip installation of GNU Make when the network
  is unreachable.
* tests/packages.scm ("GNU Make, bootstrap"): Likewise.
* tests/union.scm ("union-build"): Likewise.
2012-12-13 22:06:45 +01:00
Ludovic Courtès fdb50f8d8a tests: base32: Work around `system*' bug.
* tests/base32.scm (%nix-hash): When `getenv' returns the empty string,
  ignore it.
  (%have-nix-hash?): New variable.  Update `test-skip' clause to use it.
2012-12-13 00:23:20 +01:00
Ludovic Courtès 7a6548cbae tests: Remove `t-profile' files on exit.
* tests/guix-package.sh: Use a trap on EXIT to remove profile-related
  files.  Reported by Andreas Enge <andreas@enge.fr>.
2012-12-12 00:10:32 +01:00
Ludovic Courtès 1c67d639d5 guix-package: Gracefully handle multiple installs of the same path.
* guix-package.in (guix-package)[process-actions]: Compute PACKAGES such
  that packages listed in INSTALL* are first removed from the remainder
  of the list.  When PROF is equal to the previous profile's store path,
  do nothing.  Reported by Andreas Enge <andreas@enge.fr>.
* tests/guix-package.sh: Test the behavior of installing the same store
  path twice.  When removing a package, omit its version number.
2012-12-12 00:01:17 +01:00
Ludovic Courtès 4d152bf1d9 Merge branch 'master' into nix-integration
Conflicts:
	guix/store.scm
2012-12-09 23:54:37 +01:00
Ludovic Courtès 3259877d35 store: Add GC-related operations.
* guix/store.scm (gc-action): New enumerate type.
  (read-long-long, read-string-list, write-store-path,
  write-store-path-list, read-store-path-list): New procedures.
  (write-arg): Add support for `store-path' and `store-path-list'.
  (read-arg): Add support for `store-path-list'.
  (define-operation): Add support for multiple-value returns.
  (run-gc, live-paths, dead-paths, collect-garbage, delete-paths): New
  procedures.
  (%long-long-max): New macro.
* tests/store.scm: New file.
* Makefile.am (TESTS): Add it.
2012-12-09 23:52:59 +01:00
Ludovic Courtès 29833b26eb build: Update skip count in `tests/derivations.scm'.
* tests/derivations.scm: When %STORE if #f, skip 11 tests.
2012-12-06 00:07:17 +01:00
Ludovic Courtès 69cfce50db build: Run all the tests against the just-built daemon.
* test-env.in: New file.
* configure.ac: Add it to `AC_CONFIG_FILES' and `commands-exec'.
* config-daemon.ac: Set and substitute `GUIX_TEST_ROOT'.
* Makefile.am (SCM_LOG_COMPILER, SH_LOG_COMPILER): Use it in lieu of
  `pre-inst-env'.
* daemon.am (test_root): Remove
  (AM_TESTS_ENVIRONMENT): Remove `TEST_ROOT'.
  (clean-local): Use $(GUIX_TEST_ROOT); make files writable before
  removing them.guix_test_root
* tests/guix-daemon.sh: Remove `NIX_' variable settings; don't launch
  `guix-daemon'.
2012-12-06 00:07:08 +01:00
Ludovic Courtès b980f0f9fd tests: Remove hard-coded /nix/store.
* tests/utils.scm ("store-path-package-name"): Use (%store-prefix)
  instead of a hard-coded "/nix/store".
2012-12-05 22:42:11 +01:00
Ludovic Courtès f5c82e15e0 daemon: Add `list-runtime-roots' script.
* nix/scripts/list-runtime-roots.in: New file.
* config-daemon.ac: Add `AC_CONFIG_FILES' invocation for it.
* daemon.am (nodist_pkglibexec_SCRIPTS): New variable.
  (AM_TESTS_ENVIRONMENT): Define `top_builddir'.
* tests/guix-daemon.sh: Export `NIX_ROOT_FINDER'.
* nix/sync-with-upstream: Substitute the path to the root finder in
  libstore/gc.cc.
2012-12-05 16:29:28 +01:00
Ludovic Courtès d23077dc5c daemon: Add test.
* daemon.am (test_root, AM_TESTS_ENVIRONMENT): New variables.
  (clean-local): New target.
* tests/guix-daemon.sh: New file.
2012-12-04 23:51:48 +01:00
Ludovic Courtès 860a6f1ae0 derivations: Fix erroneous call to `add-to-store' for local files as input.
* guix/derivations.scm (derivation)[inputs]: Fix typo in call to
  `add-to-store'.
* tests/derivations.scm ("derivation with local file as input"): New test.
* tests/packages.scm ("trivial with local file as input"): New test.
2012-12-04 23:46:50 +01:00
Ludovic Courtès 5075e28305 guix-package: Extract version strings when installing a direct store path.
* guix-package.in (guix-package)[process-actions]: Extract the version
  string from store paths.
* tests/guix-package.sh: Adjust accordingly.
2012-11-19 23:53:32 +01:00
Ludovic Courtès 64fc89b6ec guix-package: Add `--list-available'.
* guix-package.in (show-help, %options): Add `--list-available'.
  (guix-package)[process-query]: Add support for `--list-available'.
* doc/guix.texi (Invoking guix-package): Document it.
* tests/guix-package.sh: Add test.

* guix/ui.scm (location->string): New procedure.
* guix/utils.scm: Export <location>.
2012-11-19 23:04:38 +01:00
Ludovic Courtès ba326ce41b distro: Add `fold-packages'.
* distro.scm (fold-packages): New procedure.
  (find-packages-by-name): Use it instead of hand-written traversal;
  remove `package?' checks from `right-package?'.
* tests/packages.scm ("fold-packages"): New test.
2012-11-19 23:04:38 +01:00
Ludovic Courtès 733b4130d7 guix-package: Add `--list-installed'.
* guix-package.in (show-help, %options): Add `--list-installed'.
  (guix-package): Move main body to...
  [process-actions]: ... here.  New internal procedure.
  [process-query]: New procedure.
* tests/guix-package.sh: Add tests for `--list-installed'.
* doc/guix.texi (Invoking guix-package): Document it.
2012-11-19 23:04:35 +01:00
Ludovic Courtès ec4d308a9e guix-download: Use code from (guix build download).
* guix-download.in (http-fetch, ftp-fetch): Remove.
  (fetch-and-store): Replace `uri' parameter with `name', for the output
  file name.  Redirect the output of `fetch' to the error port.
  (guix-download): Call `url-fetch' for all URI schemes except `file'.
  Handle PATH equal to #f.
* guix/download.scm: Export `%mirrors'.
* tests/guix-download.sh: Change erroneous URL, because URLs at
  example.com are all valid redirections.
2012-11-13 23:04:21 +01:00
Ludovic Courtès 352ec143de guix-download: Add support for file:// URIs.
* guix-download.in (fetch-and-store): New procedure.
  (guix-download): Use it to compute PATH.  Call `add-to-store' when
  a `file' URI scheme is used.
* Makefile.am (AM_TESTS_ENVIRONMENT): New variable.
* tests/guix-download.sh: Add test.
2012-11-13 22:58:43 +01:00
Ludovic Courtès ecdb81e159 guix-download: Gracefully handle invalid URIs.
* guix-download.in (guix-download): Error out when `string->uri'
  returns #f.  Use `leave' when the scheme is unknown.
* tests/guix-download.sh: Add tests.
2012-11-13 22:15:59 +01:00
Ludovic Courtès 92b8d1ea8b tests: Make sure to use the bootstrap Guile.
* tests/builders.scm ("url-fetch", "gnu-build"): Pass `url-fetch'
  #:guile %BOOTSTRAP-GUILE.
2012-11-13 00:40:29 +01:00
Ludovic Courtès 1dfb715df0 tests: Remove extraneous test.
* tests/derivations.scm ("build-expression->derivation for fixed-output
  derivation"): Remove test.  It is redundant with that in builders.scm,
  and doesn't work out of the box with the statically-linked
  %BOOTSTRAP-GUILE.
2012-11-13 00:34:56 +01:00
Ludovic Courtès 87f5d36630 Remove (guix http) and (guix ftp).
* guix/ftp.scm, guix/http.scm, guix/build/ftp.scm, guix/build/http.scm:
  Remove.
* Makefile.am (MODULES): Likewise.
* tests/builders.scm, distro/packages/base.scm,
  distro/packages/bash.scm, distro/packages/bdw-gc.scm,
  distro/packages/compression.scm, distro/packages/gawk.scm,
  distro/packages/gnupg.scm, distro/packages/gperf.scm,
  distro/packages/guile.scm, distro/packages/libffi.scm,
  distro/packages/libsigsegv.scm, distro/packages/libtool.scm,
  distro/packages/libunistring.scm, distro/packages/lout.scm,
  distro/packages/m4.scm, distro/packages/multiprecision.scm,
  distro/packages/ncurses.scm, distro/packages/perl.scm,
  distro/packages/pkg-config.scm, distro/packages/pth.scm,
  distro/packages/readline.scm, distro/packages/recutils.scm: Use
  `url-fetch' instead of `http-fetch' and `ftp-fetch'.
* distro/packages/bootstrap.scm: Likewise
  (bootstrap-origin): Remove references to `http-fetch' and
  `ftp-fetch'.
* guix.scm (%public-modules): Remove `http' and `ftp'; add `download'.
2012-11-13 00:23:39 +01:00
Ludovic Courtès 62cab99c32 Add (guix download) and (guix build download).
* guix/download.scm, guix/build/download.scm: New files.
* Makefile.am (MODULES): Add them.
* tests/builders.scm ("url-fetch"): New test.
* distro/packages/bootstrap.scm (bootstrap-origin): Support
  `url-fetch'.
* guix/snix.scm (snix-derivation->guix-package): Use `url-fetch' instead
  of `http-fetch'.
2012-11-12 23:35:04 +01:00
Ludovic Courtès ddc29a782e Move base32 code to (guix base32).
* guix/utils.scm (bytevector-quintet-ref, bytevector-quintet-ref-right,
  bytevector-quintet-length, bytevector-quintet-fold,
  bytevector-quintet-fold-right, make-bytevector->base32-string,
  %nix-base32-chars, %rfc4648-base32-chars, bytevector->base32-string,
  bytevector->nix-base32-string, bytevector-quintet-set!,
  bytevector-quintet-set-right!, base32-string-unfold,
  base32-string-unfold-right, make-base32-string->bytevector,
  base32-string->bytevector, nix-base32-string->bytevector): Move to...
* guix/base32.scm: ... here.  New file.

* tests/utils.scm (%nix-hash, "bytevector->base32-string",
  "base32-string->bytevector", "nix-base32-string->bytevector", "sha256
  & bytevector->base32-string"): Move to...
* tests/base32.scm: ... here.  New file

* guix-download.in, guix/derivations.scm, guix/packages.scm,
  guix/snix.scm, tests/builders.scm, tests/derivations.scm: Adjust
  accordingly.
* guix.scm (%public-modules): Add `base32'.
2012-11-11 22:33:28 +01:00
Ludovic Courtès 9e782349fe tests: Choose a less expensive test for packages.
* tests/packages.scm (%bootstrap-inputs): Remove.
  ("GNU Hello"): Rename to...
  ("GNU Make, bootstrap"): ... this.  Build GNU-MAKE-BOOT0 instead of
  HELLO.
2012-11-09 23:59:11 +01:00
Ludovic Courtès 7bdd1f0e3c derivations: build-expression->derivation: Builder only refers to sources.
* guix/derivations.scm (build-expression->derivation)[source-path]: New
  procedure.
  [builder]: Pass only sources as references.  This fixes a bug whereby
  changing a fixed-output drv referred to by a builder would cause the
  builder's hash to change, thereby leading to a full rebuild.
* tests/derivations.scm ("build-expression->derivation with a
  fixed-output input"): New test.
2012-11-09 00:07:10 +01:00
Ludovic Courtès 813986ac09 derivations: Add tests relative to fixed-output derivations.
* tests/derivations.scm ("fixed-output derivation"): Add comment that
  the reference to BUILDER is optional.
  ("fixed-output derivation: output paths are equal",
  "derivation with a fixed-output input",
  "build-expression->derivation: same fixed-output path"): New tests.
2012-11-08 23:55:12 +01:00
Ludovic Courtès 37d19403e7 guix-download: Error out when the HTTP response code is not 200.
* guix-download.in (http-fetch): Leave with an error message when
  RESPONSE's code is not 200.

* tests/guix-download.sh: New file.
* Makefile.am (TESTS): Add it.
2012-11-08 00:13:25 +01:00
Ludovic Courtès 912209ee61 guix-build: Error out when `-S' used for source-less package.
* guix-build.in (derivations-from-package-expressions): Leave with an
  error message when SOURCE? is #t and P has no source.

* tests/guix-build.sh: Add test.
2012-11-07 23:44:38 +01:00
Ludovic Courtès 9518856b9b guix-package: Fix handling of the PACKAGE:OUTPUT syntax.
* guix-package.in (guix-package)[find-package]: Return the correct NAME
  and SUB-DRV when NAME contains #\:.

* tests/guix-package.sh (profile): Add test.
2012-11-07 19:14:22 +01:00
Ludovic Courtès 18633d4f35 distro: Move bootstrap packages to (distro packages bootstrap).
* distro/packages/base.scm (glibc-dynamic-linker, %bootstrap-guile,
  bootstrap-origin, package-from-tarball, %bootstrap-base-url,
  %bootstrap-coreutils&co, %bootstrap-binutils, %bootstrap-glibc,
  %bootstrap-gcc, %bootstrap-inputs, package-with-bootstrap-guile): Move
  to ...
* distro/packages/bootstrap.scm: ... here.  New file.
* Makefile.am (MODULES): Add it.
* tests/builders.scm: Use (distro packages bootstrap).
  (%bootstrap-guile): Remove.
* tests/packages.scm: Likewise.
* tests/union.scm: Likewise, and remove @@ to access %bootstrap-inputs.
* tests/derivations.scm: Use (distro packages bootstrap) and remove @@
  to access %bootstrap-coreutils&co.
* HACKING (When the platform is supported by Nixpkgs): Update
  accordingly.
2012-11-04 22:04:41 +01:00
Ludovic Courtès 10226c05b1 Add (guix snix) and the `guix-import' command.
* guix/snix.scm, tests/snix.scm, guix-import.in: New files.
* configure.ac: Output `guix-import' and make it executable.
* Makefile.am (bin_SCRIPTS): Add `guix-import'.
  (MODULES): Add `guix/snix.scm'.
  (TESTS): Add `tests/snix.scm'.
2012-11-04 19:38:31 +01:00
Ludovic Courtès d45122f537 packages: `description' → `synopsis', `long-description' → `description'.
* guix/packages.scm (<package>): Rename `description' to `synopsis', and
  `long-description' to `description'.
* tests/packages.scm, distro/packages/base.scm,
  distro/packages/databases.scm, distro/packages/guile.scm,
  distro/packages/typesetting.scm:  Update accordingly.
* po/Makevars (XGETTEXT_OPTIONS): Update `--keyword' flags accordingly.
2012-11-04 13:48:35 +01:00
Ludovic Courtès 9b48fb88ca utils: Add `package-name->name+version'.
* guix/utils.scm (package-name->name+version): New procedure.
* guix-package.in (guix-package)[find-package]: Use it.
* tests/utils.scm ("package-name->name+version"): New test.
2012-11-04 01:29:18 +01:00
Ludovic Courtès 81dbd783bd tests: Run without substitutes.
* tests/builders.scm, tests/derivations.scm, tests/packages.scm: Set
  #:use-substitutes? #f for %STORE.
2012-11-02 22:38:52 +01:00
Ludovic Courtès 0afdc48532 Add a preliminary `guix-package' command-line tool.
* guix-package.in, tests/guix-package.sh: New files.
* configure.ac: Output `guix-package'.
* Makefile.am (TESTS): Add `tests/guix-package.sh'.
  (bin_SCRIPTS): Add `guix-package'.
2012-11-01 01:46:15 +01:00
Ludovic Courtès e3d741065e store: Add `store-path-package-name'.
* guix/store.scm (store-path-package-name): New procedure.
* tests/utils.scm ("store-path-package-name"): New test.
2012-11-01 01:39:23 +01:00
Ludovic Courtès 97298ffae9 build: Add unit test for the `guix-build' command.
* tests/guix-build.sh: New file.
* Makefile.am (TESTS): Add it.
  (LOG_COMPILER): Rename to...
  (SCM_LOG_COMPILER): ... this.  Move flags to...
  (AM_SCM_LOG_FLAGS): ... this.
  (TEST_EXTENSIONS, SH_LOG_COMPILER, AM_SH_LOG_FLAGS): New variables.
2012-11-01 00:52:46 +01:00
Ludovic Courtès c8c88afaa1 Add (guix build union).
* guix/build/union.scm, tests/union.scm: New files.
* Makefile.am (MODULES): Add `guix/build/union.scm'.
  (TESTS): Add `tests/union.scm'.
2012-10-29 22:39:46 +01:00
Ludovic Courtès 8f3ecbd715 tests: Use our own bootstrap tools.
* tests/builders.scm (%bootstrap-inputs): Use %BOOT0-INPUTS from the distro.
* tests/packages.scm (%bootstrap-inputs): Likewise.
* tests/derivations.scm (%coreutils): Alias for %BOOTSTRAP-COREUTILS&CO.
2012-10-28 01:58:39 +02:00
Ludovic Courtès b272c47433 derivations: Pass the derivation of guile-for-build to `imported-files' & co.
* guix/derivations.scm (%guile-for-build): Initialize to #f.
  (imported-files, imported-modules, compiled-modules): Add `guile'
  keyword parameter.  Pass it down to `build-expression->derivation'.
  (build-expression->derivation)[guile-drv]: New variable.  Pass it as
  the #:guile parameter for `imported-modules' and `compiled-modules'.

* tests/derivations.scm: Set %GUILE-FOR-BUILD to the derivation of
  %BOOTSTRAP-GUILE.
2012-10-25 18:03:48 +02:00
Ludovic Courtès 82058eff59 store: Add `query-path-hash'.
* guix/store.scm (write-arg, read-arg): Add `base16' literal and
  corresponding rule.
  (query-path-hash): New operation.

* tests/derivations.scm ("fixed-output derivation"): Check whether
  `query-path-hash' returns a bytevector.
2012-10-24 23:52:15 +02:00
Ludovic Courtès d90248844b derivations: Compile the #:modules passed to `build-expression->derivation'.
* guix/derivations.scm (imported-files)[parent-dirs]: Move to...
  (parent-directories): ... here.  New procedure.
  (compiled-modules): New procedure.
  (build-expression->derivation): Use it.

* tests/derivations.scm ("build-expression->derivation with modules"):
  New test.
2012-10-24 00:09:25 +02:00
Ludovic Courtès 592ef6c88f packages: Add support for system-dependent inputs.
* guix/packages.scm (package-derivation)[intern]: New procedure.  Pass
  #t as the `recursive?' argument, instead of #f.
  [expand-input]: New procedure, with code formerly in the body.
  Support inputs where the input is a procedure returning a file name or
  an <origin>.
  Use `expand-input' in the body.

* tests/packages.scm ("trivial with system-dependent input"): New test.
2012-10-21 17:52:16 +02:00
Ludovic Courtès 91133c2d71 utils: Add `fold-port-matches' and `remove-store-references'.
* guix/build/utils.scm (fold-port-matches, remove-store-references): New
  procedures.

* tests/build-utils.scm ("fold-port-matches", "fold-port-matches,
  trickier", "fold-port-matches, with unmatched chars"): New tests.
2012-10-16 23:01:01 +02:00
Ludovic Courtès 14da91e2f0 tests: Use bootstrap and Nixpkgs inputs to be less costly.
* tests/builders.scm (%bootstrap-inputs, %bootstrap-guile): New
  variables.
  ("gnu-build"): Use them, by setting `#:implicit-inputs? #f' and `#:guile'.

* tests/packages.scm (%bootstrap-inputs, %bootstrap-guile): New
  variables.
  ("trivial"): Pass `#:guile %bootstrap-guile'.
  ("GNU Hello"): Use `package-with-explicit-inputs' to use
  %BOOTSTRAP-GUILE and %BOOTSTRAP-INPUTS.
2012-10-07 22:24:59 +02:00
Ludovic Courtès 1f455fdca6 distro: Rename (distro ...) to (distro packages ...).
* distro/base.scm, distro/ld-wrapper.scm: Move to `distro/packages'.
  Adjust LD-WRAPPER-BOOT3 input file name accordingly.
* Makefile.am (MODULES): Adjust accordingly.
* distro.scm (%distro-module-directory): Change to "/distro/packages".
* guix/build-system/gnu.scm (standard-inputs): Change module name
  to (distro packages base).
* tests/packages.scm (test-packages): Likewise.
2012-09-26 22:00:58 +02:00
Ludovic Courtès be13fbfa83 Add (guix build-system trivial).
* guix/build-system/trivial.scm: New file.
* Makefile.am (MODULES): Add it.
* tests/packages.scm ("trivial"): New test.

* guix/packages.scm (package-derivation): Allow SOURCE to be #f.
2012-09-10 22:47:10 +02:00