Commit Graph

107 Commits

Author SHA1 Message Date
Ludovic Courtès ca71942445
Switch to Guile-Gcrypt.
This removes (guix hash) and (guix pk-crypto), which now live as part of
Guile-Gcrypt (version 0.1.0.)

* guix/gcrypt.scm, guix/hash.scm, guix/pk-crypto.scm,
tests/hash.scm, tests/pk-crypto.scm: Remove.
* configure.ac: Test for Guile-Gcrypt.  Remove LIBGCRYPT and
LIBGCRYPT_LIBDIR assignments.
* m4/guix.m4 (GUIX_ASSERT_LIBGCRYPT_USABLE): Remove.
* README: Add Guile-Gcrypt to the dependencies; move libgcrypt as
"required unless --disable-daemon".
* doc/guix.texi (Requirements): Likewise.
* gnu/packages/bash.scm, guix/derivations.scm, guix/docker.scm,
guix/git.scm, guix/http-client.scm, guix/import/cpan.scm,
guix/import/cran.scm, guix/import/crate.scm, guix/import/elpa.scm,
guix/import/gnu.scm, guix/import/hackage.scm,
guix/import/texlive.scm, guix/import/utils.scm, guix/nar.scm,
guix/pki.scm, guix/scripts/archive.scm,
guix/scripts/authenticate.scm, guix/scripts/download.scm,
guix/scripts/hash.scm, guix/scripts/pack.scm,
guix/scripts/publish.scm, guix/scripts/refresh.scm,
guix/scripts/substitute.scm, guix/store.scm,
guix/store/deduplication.scm, guix/tests.scm, tests/base32.scm,
tests/builders.scm, tests/challenge.scm, tests/cpan.scm,
tests/crate.scm, tests/derivations.scm, tests/gem.scm,
tests/nar.scm, tests/opam.scm, tests/pki.scm,
tests/publish.scm, tests/pypi.scm, tests/store-deduplication.scm,
tests/store.scm, tests/substitute.scm: Adjust imports.
* gnu/system/vm.scm: Likewise.
(guile-sqlite3&co): Rename to...
(gcrypt-sqlite3&co): ... this.  Add GUILE-GCRYPT.
(expression->derivation-in-linux-vm)[config]: Remove.
(iso9660-image)[config]: Remove.
(qemu-image)[config]: Remove.
(system-docker-image)[config]: Remove.
* guix/scripts/pack.scm: Adjust imports.
(guile-sqlite3&co): Rename to...
(gcrypt-sqlite3&co): ... this.  Add GUILE-GCRYPT.
(self-contained-tarball)[build]: Call 'make-config.scm' without
 #:libgcrypt argument.
(squashfs-image)[libgcrypt]: Remove.
[build]: Call 'make-config.scm' without #:libgcrypt.
(docker-image)[config, json]: Remove.
[build]: Add GUILE-GCRYPT to the extensions  Remove (guix config) from
the imported modules.
* guix/self.scm (specification->package): Remove "libgcrypt", add
"guile-gcrypt".
(compiled-guix): Remove #:libgcrypt.
[guile-gcrypt]: New variable.
[dependencies]: Add it.
[*core-modules*]: Remove #:libgcrypt from 'make-config.scm' call.
Add #:extensions.
[*config*]: Remove #:libgcrypt from 'make-config.scm' call.
(%dependency-variables): Remove %libgcrypt.
(make-config.scm): Remove #:libgcrypt.
* build-aux/build-self.scm (guile-gcrypt): New variable.
(make-config.scm): Remove #:libgcrypt.
(build-program)[fake-gcrypt-hash]: New variable.
Add (gcrypt hash) to the imported modules.  Adjust load path
assignments.
* gnu/packages/package-management.scm (guix)[propagated-inputs]: Add
GUILE-GCRYPT.
[arguments]: In 'wrap-program' phase, add GUILE-GCRYPT to the search
path.
2018-09-04 17:25:11 +02:00
Ludovic Courtès 9d6fae65f3
derivations: Adjust tests for Stow environments.
Fixes <https://bugs.gnu.org/30250>.
Reported by Jorge <jorge+list@disroot.org>.

* tests/derivations.scm ("add-to-store, flat")
("add-to-store, recursive"): Call 'readlink*'.
2018-01-30 22:24:06 +01:00
Ludovic Courtès 6ea10db973
tests: Support multiple HTTP server instances.
* guix/tests/http.scm (%http-server-socket): Turn into...
(open-http-server-socket): ... this procedure.
(http-server-can-listen?): New procedure.
(http-write, %http-server-lock, %http-server-ready)
(http-open, stub-http-server): Move to 'call-with-http-server' body.
(call-with-http-server): Add #:headers parameter.
(with-http-server): Add an additional pattern with headers.
* tests/derivations.scm: Use (http-server-can-listen?) instead
of (force %http-server-socket).
* tests/lint.scm: Likewise.
2017-10-12 23:47:48 +02:00
Ludovic Courtès 2dc98729af
derivations: 'derivation-prerequisites-to-build' returns <substitutable>.
* guix/derivations.scm (derivation-prerequisites-to-build): Rename
 #:substitutable? to #:substitutable-info.
[derivation-substitutable?]: Rename to...
[derivation-substitutable-info]: ... this.  Return a list of <substitutable>.
Second return value is now a list of <substitutable> instead of a list
of strings.
* guix/ui.scm (show-what-to-build)[substitutable?]: Rename to...
[substitutable-info]: ... this.
Adjust to new 'derivation-prerequisites-to-build' return value type.
* tests/derivations.scm ("derivation-prerequisites-to-build and
substitutes"): Adjust.
("derivation-prerequisites-to-build and substitutes, local build"):
Likewise.
2017-06-02 18:47:06 +02:00
Ludovic Courtès ef51ac21ee
derivations: 'substitution-oracle' returns a <substitutable>.
* guix/derivations.scm (substitution-oracle): Use
'substitution-path-info' instead of 'substitution-paths'.  Turn SUBST
into a vhash from path to <substitutable>.  Change the returned
procedure to provide a <substitutable> instead of a Boolean.
* tests/derivations.scm ("substitution-oracle and #:substitute? #f"):
Mock 'substitutable-path-info' instead of 'substitutable-paths'.
2017-06-02 18:47:06 +02:00
Ludovic Courtès 8a8e2d2ed5
derivations: Adjust builder encoding test.
This is a followup to 9231ef12f2.

* tests/derivations.scm ("build-expression->derivation and builder
encoding"): Set '%default-port-encoding' to "UTF-8".
2017-04-22 14:07:46 +02:00
Ludovic Courtès 9231ef12f2
derivations: Restore UTF-8 encoding of build scripts.
Reported by Mark H Weaver <mhw@netris.org>
at <https://lists.gnu.org/archive/html/guix-devel/2017-04/msg00457.html>.

* guix/derivations.scm (build-expression->derivation): Use a string
output port for the expression.  This reverts part of
2dce88d5bb.
* tests/derivations.scm ("build-expression->derivation and builder
encoding"): New test.
2017-04-21 22:45:29 +02:00
Ludovic Courtès bdb59b331b
derivations: Do not fetch narinfos for non-substitutable items.
This avoids connections to substitute servers for derivations that are
not substitutable anyway, such as profiles.

Reported by Andy Wingo.

* guix/derivations.scm (substitution-oracle): Skip derivations that do
not pass 'substitutable-derivation?'.
* tests/derivations.scm ("substitution-oracle and #:substitute? #f"):
New test.
2017-03-28 10:00:05 +02:00
Ludovic Courtès 9b5364a3af
daemon: Allow check builds of 'builtin:download' derivations.
Fixes <http://bugs.gnu.org/25089>.
Reported by Leo Famulari <leo@famulari.name>.

* nix/libstore/build.cc (DerivationGoal::runChild): In the 'isBuiltin'
case, check whether DRV's output is in 'redirectedOutputs', and pass an
'output' argument to the built-in builder.
(DerivationGoal::addHashRewrite): Add 'printMsg' call.
* nix/libstore/builtins.hh (derivationBuilder): Add 'output' parameter.
* nix/libstore/builtins.cc (builtinDownload): Likewise.
Add OUTPUT to ARGV.
* guix/scripts/perform-download.scm (perform-download): Add 'output'
parameter.
(guix-perform-download): Adjust 'match' clauses accordingly.
* tests/derivations.scm ("'download' built-in builder, check mode"): New
test.
2017-01-11 17:06:31 +01:00
Ludovic Courtès f9aefa2d5f
daemon: Add 'built-in-builders' RPC.
* nix/libstore/builtins.cc (builtinBuilderNames): New function.
* nix/libstore/builtins.hh (builtinBuilderNames): New declaration.
* nix/libstore/worker-protocol.hh (PROTOCOL_VERSION): Bump to 0x160.
(WorkerOp)[wopBuiltinBuilders]: New value.
* nix/nix-daemon/nix-daemon.cc (performOp): Handle it.
* guix/store.scm (operation-id)[built-in-builders]: New value.
* guix/store.scm (read-arg): Add 'string-list'.
(built-in-builders): New procedure.
* tests/derivations.scm ("built-in-builders"): New test.
2016-11-16 18:19:54 +01:00
Ludovic Courtès 94d92c7796
daemon: Add "builtin:download" derivation builder.
This ensures that 1) the derivation doesn't change when Guix changes;
2) the derivation closure doesn't contain Guix and its dependencies; 3)
we don't have to rely on ugly chroot hacks.

Adapted from Nix commit 0a2bee307b20411f5b0dda0c662b1f9bb9e0e131.

* nix/libstore/build.cc (DerivationGoal::runChild): Add special case for
'isBuiltin(drv)'.  Disable chroot when 'isBuiltin(drv)'.
* nix/libstore/builtins.cc, nix/libstore/builtins.hh,
nix/scripts/download.in, guix/scripts/perform-download.scm: New files.
* guix/ui.scm (show-guix-help)[internal?]: Add 'perform-download'.
* nix/local.mk (libstore_a_SOURCES): Add builtins.cc.
(libstore_headers): Add builtins.hh.
(nodist_pkglibexec_SCRIPTS): Add 'scripts/download'.
* config-daemon.ac: Emit 'scripts/download'.
* Makefile.am (MODULES): Add 'guix/scripts/perform-download.scm'.
* tests/derivations.scm ("unknown built-in builder")
("'download' built-in builder")
("'download' built-in builder, invalid hash")
("'download' built-in builder, not found")
("'download' built-in builder, not fixed-output"): New tests.

Co-authored-by: Eelco Dolstra <eelco.dolstra@logicblox.com>
2016-11-16 18:19:47 +01:00
Ludovic Courtès 97507ebedc
derivations: 'derivation' sorts items in the resulting object.
* guix/derivations.scm (derivation-input<?): New procedure.
(write-derivation)[coalesce-duplicate-inputs]: Remove.
Remove calls to 'sort'.
(coalesce-duplicate-inputs): New procedure.
(derivation-hash): Sort INPUTS and use 'coalesce-duplicate-inputs'.
(derivation)[input->derivation-input]
[coalesce-duplicate-inputs]: New procedures.
Sort OUTPUTS, INPUTS, and ENV-VARS.
* tests/derivations.scm ("read-derivation vs. derivation"): New test.
2016-05-21 01:35:14 +02:00
Mathieu Lirzin a9edb211e7 build: Add a Guile custom test driver using SRFI-64.
Before that '.log' files for scheme tests were fragmented and not
included in test-suite.log.  This unifies the semantics of SRFI-64 API
with Automake test suite.

* build-aux/test-driver.scm: New file.
* Makefile.am (SCM_LOG_DRIVER, AM_SCM_LOG_DRIVER_FLAGS): New variables.
(SCM_LOG_COMPILER, AM_SCM_LOG_FLAGS): Delete variables.
(AM_TESTS_ENVIRONMENT): Set GUILE_AUTO_COMPILE to 0.
* test-env.in: Silence guix-daemon.
* doc/guix.texi (Running the Test Suite): Describe how to display the
detailed results.  Bug reports require only 'test-suite.log' file.
* tests/base32.scm, tests/build-utils.scm, tests/builders.scm,
tests/challenge.scm, tests/cpan.scm, tests/cpio.scm, tests/cran.scm,
tests/cve.scm, tests/derivations.scm, tests/elpa.scm,
tests/file-systems.scm, tests/gem.scm, tests/gexp.scm,
tests/gnu-maintenance.scm, tests/grafts.scm, tests/graph.scm,
tests/gremlin.scm, tests/hackage.scm, tests/hash.scm,
tests/import-utils.scm, tests/lint.scm, tests/monads.scm, tests/nar.scm,
tests/packages.scm, tests/pk-crypto.scm, tests/pki.scm,
tests/profiles.scm, tests/publish.scm, tests/pypi.scm,
tests/records.scm, tests/scripts-build.scm, tests/scripts.scm,
tests/services.scm, tests/sets.scm, tests/size.scm, tests/snix.scm,
tests/store.scm, tests/substitute.scm, tests/syscalls.scm,
tests/system.scm, tests/ui.scm, tests/union.scm, tests/upstream.scm,
tests/utils.scm: Don't exit at the end of test groups.
* tests/containers.scm: Likewise.  Use 'test-skip' instead of exiting
with error code 77.
2016-04-03 14:19:09 +02:00
Ludovic Courtès d26e19671e derivations: Raise an error when a module file is not found.
Suggested by Jookia.

* guix/derivations.scm (&file-search-error): New error condition.
(search-path*): Raise it when 'search-path' returns #f.
* guix/gexp.scm (search-path*): Remove.
* guix/ui.scm (call-with-error-handling): Add case for
'file-search-error?'.
* tests/derivations.scm ("build-expression->derivation and invalid
module name"): New test.
2016-03-23 00:23:12 +01:00
Ludovic Courtès 35b5ca7869 derivations: Add #:disallowed-references.
* guix/derivations.scm (derivation): Add #:disallowed-references.
[user+system-env-vars]: Honor it.
(build-expression->derivation): Likewise.
* tests/derivations.scm ("derivation #:disallowed-references, ok")
("derivation #:disallowed-references, not ok"): New tests.
* doc/guix.texi (Derivations): Adjust accordingly.
2016-03-20 22:45:35 +01:00
Ludovic Courtès ef8de9852e tests: Disable grafting by default for most tests.
This allows tests to run as expected even in the presence of
replacements among the bootstrap packages, such as Perl (commit
d8173f21f7).

* tests/cpan.scm: Add (%graft? #f).
* tests/derivations.scm: Likewise.
* tests/graph.scm: Likewise.
* tests/monads.scm: Likewise.
* tests/profiles.scm: Likewise.
* tests/gexp.scm: Likewise.
("gexp->derivation vs. grafts"): Explicitly reenable grafting before,
and disable it after, using 'set-grafting'.
2016-03-06 23:16:35 +01:00
Ludovic Courtès 7adf9b8469 derivations: Move grafts to (guix grafts).
* guix/derivations.scm (<graft>, graft-derivation, %graft?)
(set-grafting): Move to...
* guix/grafts.scm: ... here.  New file.
* guix/gexp.scm, guix/packages.scm, tests/packages.scm,
guix/scripts/build.scm: Use it.
* Makefile.am (MODULES): Add it.
(SCM_TESTS): Add tests/grafts.scm.
* tests/derivations.scm ("graft-derivation"): Move to...
* tests/grafts.scm: ... here.  New file.
2016-02-22 22:11:37 +01:00
Ludovic Courtès 0e510971c3 derivations: Add test in keep-going mode.
* tests/derivations.scm ("derivation fails but keep going"): New test.
2016-01-19 21:59:58 +01:00
Ludovic Courtès 44ad33843a derivations: Add test for #:leaked-env-vars.
* tests/derivations.scm ("derivation #:leaked-env-vars"): New test.
2016-01-18 17:41:16 +01:00
Ludovic Courtès 58c08df054 derivations: Determine what's built in 'check' mode.
* guix/derivations.scm (substitution-oracle): Add #:mode parameter and
honor it.
(derivation-prerequisites-to-build): Likewise.
[derivation-built?]: Take it into account.
* guix/ui.scm (show-what-to-build): Add #:mode parameter.  Pass it to
'substitute-oracle' and 'derivations-prerequisites-to-build'.
* tests/derivations.scm ("derivation-prerequisites-to-build in 'check'
mode"): New test.
2015-12-09 14:29:41 +01:00
Ludovic Courtès f073e52382 utils: Remove Nixpkgs helpers.
* guix/config.scm.in (%nixpkgs): Remove.
* guix/utils.scm (%nixpkgs-directory, nixpkgs-derivation,
  nixpkgs-derivation*): Remove.
* test-env.in: Export 'NIXPKGS'.
* tests/derivations.scm (%coreutils): Remove use of
  'nixpkgs-derivation'.
* tests/snix.scm (%nixpkgs-directory): New variable.
  Adjust users accordingly.
2015-10-06 23:51:04 +02:00
Ludovic Courtès cfc5d39888 tests: Fix typos.
* tests/derivations.scm ("substitutable-derivation?",
  "derivation-prerequisites-to-build and substitutes, local build"): Fix
  harmless typos.
2015-09-05 22:11:03 +02:00
Ludovic Courtès 24f5aaaf24 substitute: Honor "substitute-urls" option passed by "untrusted" clients.
* guix/scripts/substitute.scm (or*): New macro.
  (%cache-url): Honor "untrusted-substitute-urls".
* guix/tests.scm (%test-substitute-urls): New variable.
  (open-connection-for-tests): Use it.
* tests/derivations.scm ("derivation-prerequisites-to-build and substitutes",
  "derivation-prerequisites-to-build and substitutes, non-substitutable
  build", "derivation-prerequisites-to-build and substitutes, local build"):
  Pass it to 'set-build-options'.
* tests/guix-daemon.sh: Likewise.
* tests/store.scm ("substitute query, alternating URLs"): New test.
  ("substitute query", "substitute", "substitute + build-things with output
  path", "substitute, corrupt output hash", "substitute --fallback"): Pass
  #:substitute-urls to 'set-build-options'.
2015-07-13 18:29:01 +02:00
Ludovic Courtès 4a6aeb670f derivations: Add #:substitutable?, distinguished from #:local-build?.
Fixes <http://bugs.gnu.org/18747>.

* guix/derivations.scm (substitutable-derivation?): Rewrite to check for
  "allowSubstitutes".
  (derivation): Add #:substitutable? parameter.
  [user+system-env-vars]: Honor it.
  (build-expression->derivation): Add #:substitutable? and honor it.
* guix/gexp.scm (gexp->derivation): Likewise.
* tests/derivations.scm ("derivation-prerequisites-to-build and substitutes,
  non-substitutable build"): Use #:substitutable? instead of #:local-build?.
  ("substitutable-derivation?", "derivation-prerequisites-to-build and
  substitutes, local build"): New tests.
* guix/download.scm (url-fetch): Adjust comment.
* guix/git-download.scm (git-fetch): Likewise.
* guix/build-system/gnu.scm (gnu-build, gnu-cross-build): Use #:substitutable?
  instead of #:local-build?.
* doc/guix.texi (Derivations, G-Expressions): Adjust accordingly.
2015-07-03 00:30:55 +02:00
Ludovic Courtès 49c0a8d6b6 tests: Make sure %BOOTSTRAP-GUILE is available when we need it.
* tests/derivations.scm ("derivation-prerequisites and
  valid-derivation-input?"): Renamed from "derivation-prerequisites and
  derivation-input-is-valid?".  Build %BOOTSTRAP-GUILE.  This fixes a
  regression introduced in cdb5b07 when running the whole test suite.
2015-05-27 09:36:43 +02:00
Ludovic Courtès 3681db5d2c derivations: Add a 'cut?' parameter to 'derivation-prerequisites'.
* guix/derivations.scm (valid-derivation-input?): New procedure.
  (derivation-prerequisites): Add 'cut?' parameter and honor it.
* tests/derivations.scm ("derivation-prerequisites and
  derivation-input-is-valid?"): New test.
2015-03-25 10:46:22 +01:00
Ludovic Courtès 12d720fd1a tests: Factorize the network reachability test.
* guix/tests.scm (network-reachable?): New procedure.
* tests/builders.scm (network-reachable?): Remove.
  Replace references to it with calls to the new 'network-reachable?'
  procedure.
* tests/derivations.scm (%coreutils): Use 'network-reachable?' instead
  of 'getaddrinfo'.
* tests/packages.scm: Likewise.
* tests/union.scm: Likewise.
2015-02-24 00:01:34 +01:00
Ludovic Courtès aa72d9afdf gexp: Implement 'imported-modules' & co. using 'gexp->derivation'.
* 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-13 17:28:19 +01:00
Ludovic Courtès 6eebbab562 tests: Further factorize substitute mocks.
* guix/tests.scm (derivation-narinfo): Turn 'nar' into a keyword
  parameter.  Add #:sha256 parameter, and honor it.
  (call-with-derivation-narinfo): Add #:sha256 and pass it to
  'derivation-narinfo'.
  (with-derivation-narinfo): Extend with support for (sha256 => value).
* tests/store.scm ("substitute query"): Use 'with-derivation-narinfo'.
  ("substitute"): Likewise.
  ("substitute, corrupt output hash"): Likewise.
  ("substitute --fallback"): Likewise.
* tests/derivations.scm: Remove Emacs local variable.
2015-02-02 12:46:35 +01:00
Ludovic Courtès e9651e39b3 derivations: Add 'substitution-oracle' and use it.
This makes 'guix environment PACKAGE' significantly faster when
substitutes are enabled.  Before that, it would lead to many invocations
of 'guix substitute-binary', one per 'derivation-prerequisites-to-build'
call.  Now, all these are replaced by a single invocation.

* guix/derivations.scm (derivation-output-paths, substitution-oracle):
  New procedures.
  (derivation-prerequisites-to-build): Replace #:use-substitutes? with
  #:substitutable?.  Remove the local 'derivation-output-paths' and
  'substitutable?'.
* guix/ui.scm (show-what-to-build): Add 'substitutable?'.  Pass it to
  'derivation-prerequisites-to-build'.
  [built-or-substitutable?]: Use it instead of 'has-substitutes?'.
* tests/derivations.scm ("derivation-prerequisites-to-build and
  substitutes"): Use #:substitutable? instead of #:use-substitutes?.
2015-01-10 00:39:59 +01:00
Ludovic Courtès 0b6af195fe derivations: Add 'derivation-output-names'.
* guix/derivations.scm (derivation-output-names): New procedure.
  (derivation-prerequisites-to-build): Use it for #:outputs.
  (map-derivation): Likewise.
* tests/derivations.scm ("derivation-output-names"): New test.
2015-01-09 23:36:24 +01:00
Ludovic Courtès e786293e76 derivations: Add 'derivation-name'.
* guix/derivations.scm (derivation-name): New procedure.
* tests/derivations.scm ("derivation-name"): New test.
2014-11-02 21:22:12 +01:00
Ludovic Courtès d2d0514b58 derivations: Fix 'derivation-prerequisites-to-build' when #:local-build?.
* guix/derivations.scm (derivation-prerequisites-to-build)[derivation-substitutable?]:
  Call 'substitutable-derivation?'.
  <body>: When 'substitutable-derivation?' returns #f, add DRV to BUILD.
2014-10-29 00:31:23 +01:00
Ludovic Courtès e6740741d1 tests: Move some of the narinfo test tools to (guix tests).
* guix/tests.scm (derivation-narinfo, call-with-derivation-narinfo): New
  procedures.
  (with-derivation-narinfo): New macro.
* tests/derivations.scm ("derivation-prerequisites-to-build and
  substitutes"): Use them.
2014-10-29 00:31:23 +01:00
Ludovic Courtès fc93e30919 derivations: Add 'offloadable-derivation?' and 'substitutable-derivation?'.
* guix/derivations.scm (offloadable-derivation?,
  substitutable-derivation?): New procedures.
* tests/derivations.scm ("offloadable-derivation?"): New test.
2014-10-29 00:31:23 +01:00
Ludovic Courtès 969df97487 derivations: Introduce 'graft' record type.
* guix/derivations.scm (<graft>): New record type.
  (graft-derivation): Rename 'replacements' to 'grafts', and expect it
  to be a list of <graft> records.  Adjust accordingly.
* tests/derivations.scm ("graft-derivation"): Use 'graft' instead of
  pairs in argument to 'graft-derivation'.
2014-10-17 23:23:20 +02:00
Ludovic Courtès fb59e275dd derivations: Add 'graft-derivation'.
* guix/derivations.scm (graft-derivation): New procedure.
* guix/build/graft.scm: New file.
* Makefile.am (MODULES): Add it.
* tests/derivations.scm ("graft-derivation"): New test.
2014-10-08 12:01:49 +02:00
Ludovic Courtès 44d43c7a85 daemon: Really enable automatic deduplication by default.
* nix/nix-daemon/guix-daemon.cc (main): Set 'autoStoreOptimise' to
  true.  Add 'printMsg' call.
* tests/derivations.scm ("identical files are deduplicated"): New test.
2014-08-31 14:44:34 +02:00
Ludovic Courtès c1bc358f29 Factorize test suite support in (guix tests).
* guix/tests.scm: New file.
* Makefile.am (noinst_DATA): New variable.
  (GOBJECTS): Add guix/tests.go.
* tests/builders.scm (%store): Use 'open-connection-for-tests'
  from (guix tests).
* tests/derivations.scm: Likewise.
* tests/monads.scm: Likewise.
* tests/packages.scm: Likewise.
* tests/profiles.scm: Likewise.
* tests/union.scm: Likewise.
* tests/gexp.scm: Likewise.
  (guile-for-build): Remove.  Use (%guile-for-build) instead.
* tests/nar.scm (make-random-bytevector, %seed, random-text): Remove.
  (populate-file): Change 'make-random-bytevector' to 'random-bytevector'.
  Use (guix tests).
* tests/store.scm (%seed, random-text): Remove.
  Use (guix tests).
2014-08-23 22:33:04 +02:00
Ludovic Courtès b53be755e4 derivations: Add #:allowed-references 'derivation' parameter.
* guix/derivations.scm (derivation): Add #:allowed-references
  parameter.
  [user+system-env-vars]: Honor it.
* tests/derivations.scm ("derivation #:allowed-references, ok",
  "derivation #:allowed-references, not allowed",
  "derivation #:allowed-references, self allowed",
  "derivation #:allowed-references, self not allowed"): New tests.
* doc/guix.texi (Derivations): Document #:allowed-references.
2014-06-01 23:32:26 +02:00
Ludovic Courtès 99e17dc927 derivations: Fix 'fixed-output-derivation?'.
Reported by Nikita Karetnikov <nikita@karetnikov.org>.

* guix/derivations.scm (fixed-output-derivation?): Fix pattern.
* tests/derivations.scm ("fixed-output-derivation?"): Add test.
2014-04-13 00:42:07 +02:00
Ludovic Courtès 1950bf56d0 tests: Make sure substitutes are usable when we need them.
* tests/derivations.scm ("derivation-prerequisites-to-build and
  substitutes"): Add call to 'set-build-options'.
2014-03-22 22:57:10 +01:00
Ludovic Courtès 6c20d1d0c3 store: Add #:timeout build option.
* guix/serialization.scm (write-string-pairs): New procedure.
* guix/store.scm (write-arg): Add 'string-pairs' case.
  (set-build-options): Add 'timeout' keyword parameter.  Honor it.
* tests/derivations.scm ("build-expression->derivation and timeout"):
  New test.
2014-03-09 23:01:18 +01:00
Ludovic Courtès 36bbbbd150 derivations: Add support for recursive fixed-output derivations.
* guix/derivations.scm (<derivation-output>): Add 'recursive?' field.
  Adjust 'make-derivation-output' callers.
  (%read-derivation) <fixed-output>: When HASH-ALGO starts with 'r:',
  set the 'recursive?' field and drop 'r:' from the hash algo name.
  (write-derivation)[write-output]: Write the algo as 'r:HASH-ALGO' when
  the RECURSIVE? field is set.
  (derivation-hash) <fixed-output>: Prepend "r:" when RECURSIVE? is set.
  (fixed-output-path): New procedure.
  (derivation): Add #:recursive? parameter.  Use 'fixed-output-path' to
  compute the output file name of a fixed output derivation.
  (build-expression->derivation): Add #:recursive? parameter.  Pass it
  to 'derivation'.
* tests/derivations.scm ("fixed-output derivation, recursive",
  "build-expression->derivation produces recursive fixed-output",
  "build-expression->derivation uses recursive fixed-output"): New
  tests.
* doc/guix.texi (Derivations): Document #:recursive? for 'derivation'.
  Add #:recursive? for 'build-expression->derivation'.
2014-02-21 23:49:52 +01:00
Ludovic Courtès dd1a5a152c derivations: Use more keyword parameters for 'build-expression->derivation'.
* guix/derivations.scm (build-expression->derivation): Turn 'system' and
  'inputs' into keyword parameters.
  Adjust callers accordingly.
* gnu/system/linux.scm, gnu/system/vm.scm, guix/build-system/cmake.scm,
  guix/build-system/gnu.scm, guix/build-system/perl.scm,
  guix/build-system/python.scm, guix/build-system/trivial.scm,
  guix/download.scm, guix/packages.scm, guix/profiles.scm,
  guix/scripts/pull.scm, tests/derivations.scm, tests/guix-build.sh,
  tests/monads.scm, tests/store.scm, tests/union.scm: Adjust users of
  'build-expression->derivation' and 'derivation-expression'
  accordingly.
* doc/guix.texi (Derivations): Adjust 'build-expression->derivation'
  documentation accordingly.
  (The Store Monad): Likewise for 'derivation-expression'.
2013-12-04 16:07:53 +01:00
Ludovic Courtès a716e36de9 derivations: Allow 'map-derivations' to replace sources.
* guix/derivations.scm (map-derivation)[input->output-paths]: Allow
  non-derivation inputs.
  Allow replacements to be store files.  Replace in SOURCES too.
* tests/derivations.scm ("map-derivation, sources"): New test.
2013-11-13 11:22:07 +01:00
Ludovic Courtès e387ab7c10 derivations: Add 'map-derivation'.
* guix/derivations.scm (map-derivation): New procedure.
* tests/derivations.scm ("map-derivation"): New test.
2013-11-13 00:29:05 +01:00
Ludovic Courtès 01e82af55f tests: Fix max-silent-time test.
* tests/derivations.scm ("build-expression->derivation and
  max-silent-time"): Use STORE instead of %STORE.  Change BUILDER to
  succeed by default.  Return #f when no exception is raised.
2013-11-04 23:41:33 +01:00
Ludovic Courtès bde2d9cf8d tests: Add the builder as an input to raw derivations.
* tests/derivations.scm ("build derivation with 1 source",
  "derivation with local file as input",
  "derivation with a fixed-output input",
  "multiple-output derivation",
  "multiple-output derivation, non-alphabetic order",
  "user of multiple-output derivation"): Add %BASH as an input, needed
  in chroot builds.
2013-11-04 23:06:13 +01:00
Ludovic Courtès d0dc4907d6 derivations: 'derivation-path->output-path' honors the 'output' parameter.
* guix/derivations.scm (derivation-path->output-path): Pass OUTPUT.
* tests/derivations.scm ("multiple-output derivation,
  derivation-path->output-path"): New test.
2013-10-30 22:09:32 +01:00