Commit Graph

594 Commits

Author SHA1 Message Date
Ludovic Courtès
dedb17ad01 profiles: Store search paths in manifests.
Discussed in <http://bugs.gnu.org/20255>.

* guix/packages.scm (sexp->search-path-specification): New variable.
* guix/profiles.scm (<manifest-entry>)[search-paths]: New field.
  (package->manifest-entry): Initialize it.
  (manifest->gexp): Match it.  Wrap #$deps in (propagated-inputs ...).
  Emit (search-paths ...).  Increment version.
  (find-package): New procedure.
  (sexp->manifest)[infer-search-paths]: New procedure.
  Use it to initialize the 'search-paths' field for versions 0 and 1.
  Add case for version 2.
* guix/scripts/package.scm (search-path-environment-variables)[manifest-entry->package]:
  Remove.
  Use 'manifest-entry-search-paths' instead of 'manifest-entry->package'
  plus 'package-native-search-paths'.
* tests/profiles.scm ("profile-manifest, search-paths"): New test.
2015-05-02 23:57:11 +02:00
Andreas Enge
4ac0d6444d Merge branch 'master' into core-updates. 2015-04-26 20:08:49 +02:00
Ludovic Courtès
cd91504df2 gremlin: Add support for the expansion of $ORIGIN in RUNPATH.
* guix/build/gremlin.scm (expand-variable, expand-origin): New
  procedures.
  (validate-needed-in-runpath): Map 'expand-origin' to the RUNPATH field
  of DYNINFO.
* tests/gremlin.scm ("expand-origin"): New test.
2015-04-23 18:52:40 +02:00
Mark H Weaver
5cfc17cb7f tests: Select appropriate bootstrap guile version for current system.
* tests/packages.scm ("package-source-derivation, snippet"): Select appropriate
  guile-2.0.x.tar.xz tarball based on the value of (%current-system).
2015-04-22 17:25:28 -04:00
Ludovic Courtès
5763ad9266 guix package: -A and -s take supported systems into account.
* guix/scripts/package.scm (guix-package)[process-query]
  <list-available>: Restrict results to packages matching
  'supported-package?".
* guix/ui.scm (package->recutils): Print "systems:".
* tests/guix-package.sh: Add tests.
* doc/guix.texi (Invoking guix package): Adjust description of
  '--list-available' accordingly.
2015-04-19 23:34:53 +02:00
Ludovic Courtès
bbceb0ef8a packages: Add 'supported-package?'.
* guix/packages.scm (supported-package?): New procedure.
* tests/packages.scm ("supported-package?"): New test.
* build-aux/hydra/gnu-system.scm (package->job): Use it instead of
  'package-transitive-supported-systems'.
2015-04-19 23:34:53 +02:00
Mark H Weaver
933204e5b1 Merge branch 'master' into core-updates
Conflicts:
	gnu-system.am
	gnu/packages/gstreamer.scm
2015-04-17 09:54:11 -04:00
Ludovic Courtès
aa46a028c4 profiles: Generalize "hooks" for 'profile-derivation'.
* guix/profiles.scm (info-dir-file): Remove (null? (manifest-entries
  manifest)) test.
  (ca-certificate-bundle): Likewise.
  (ghc-package-cache-file): Turn 'if' into 'and', and remove second
  arm.
  (%default-profile-hooks): New variable.
  (profile-derivation): Remove #:info-dir?, #:ghc-package-cache?, and
  #:ca-certificate-bundle?.  Add #:hooks.  Iterate over HOOKS.  Adjust
  'inputs' accordingly.
* guix/scripts/package.scm (guix-package): Adjust 'profile-derivation'
  call accordingly.
* tests/packages.scm ("--search-paths with pattern"): Likewise.
* tests/profiles.scm ("profile-derivation",
  "profile-derivation, inputs"): Likewise.
2015-04-15 22:44:51 +02:00
Ludovic Courtès
002c57c6f7 lint: Add a 'derivation' checker.
* guix/scripts/lint.scm (check-derivation): New procedure.
  (%checkers): Add 'derivation' checker.
* tests/lint.scm ("derivation: invalid arguments"): New test.
2015-04-13 00:02:59 +02:00
Ludovic Courtès
9bf3ced06c packages: 'package-transitive-supported-systems' accounts for implicit inputs.
Reported by Federico Beffa.

* guix/packages.scm (package-transitive-supported-systems): Use
  bag-direct-inputs + package->bag rather than package-direct-inputs.
* tests/packages.scm ("package-transitive-supported-systems"): Add
  explicit 'build-system' field to each 'dummy-package' form.
  ("package-transitive-supported-systems, implicit inputs"): New test.
2015-04-11 13:06:23 +02:00
Ludovic Courtès
b210b35d61 lint: Report patches that cannot be found.
* guix/scripts/lint.scm (check-patch-file-names): Wrap body in 'guard'.
* tests/lint.scm ("patches: not found"): New test.
2015-04-10 10:27:46 +02:00
Ludovic Courtès
56b1b74c90 lint: Rename 'check-patches' to 'check-patch-file-names'.
* guix/scripts/lint.scm (check-patches): Rename to...
  (check-patch-file-names): ... this.  Rename 'filename' to 'file'.
  (%checkers): Adjust accordingly.
* tests/lint.scm ("patches: file names"): Likewise.
2015-04-10 10:11:59 +02:00
Ludovic Courtès
ee5408576d Merge branch 'master' into core-updates 2015-04-09 21:10:46 +02:00
Federico Beffa
042bc828fc profiles: Generate GHC's package database cache.
* guix/profiles.scm (ghc-package-cache-file): New procedure.
  (profile-derivation): Add 'ghc-package-cache?' keyword argument.  If true
  (the default), add the result of 'ghc-package-cache-file' to 'inputs'.
* guix/scripts/package.scm (guix-package)[process-actions]: Pass
  #:ghc-package-cache? to 'profile-generation'.
* tests/packages.scm ("--search-paths with pattern"): Likewise.
* tests/profiles.scm ("profile-derivation"): Likewise.
2015-04-08 17:31:12 +02:00
Federico Beffa
b29455cfe7 import: Add hackage importer.
* guix/import/hackage.scm: New file.
* tests/hackage.scm: New file.
2015-04-08 17:31:11 +02:00
Ludovic Courtès
0b131612d5 tests: Skip 'guix-package-net.sh' when prerequisites aren't met.
* tests/guix-package-net.sh: Reinstate networking and shebang test that
  inadvertently vanished in commit 57b8623.
2015-04-08 10:20:59 +02:00
宋文武
cf3e3e374c Merge branch 'master' into core-updates 2015-04-08 16:04:37 +08:00
Ludovic Courtès
57b8623754 tests: Move 'guix package' tests that require networking to a separate file.
* tests/guix-package.sh (shebang_not_too_long): Remove.
  Move everything below "if [networking + shebang_not_too_long]" to...
* tests/guix-package-net.sh: ... here.  New file.
* Makefile.am (SH_TESTS): Add it.
2015-04-06 21:52:40 +02:00
Ludovic Courtès
d26eb84d14 guix package: Never remove the current generation and warn about it.
Fixes <http://bugs.gnu.org/19978>.
Reported by taylanbayirli@gmail.com (Taylan Ulrich Bayırlı/Kammer).

* guix/scripts/package.scm (delete-matching-generations): Warn when
  CURRENT is in NUMBERS, and always remove it before calling
  'delete-generations'.
* tests/guix-package.sh: Add --switch-generation=2 invocation before
  --delete-generations=3 invocation.
  Add --delete-generations=1.. test case.
2015-04-06 21:27:32 +02:00
Ludovic Courtès
381ac93b5e tests: Deal with 'mount-points' not returning "/".
Fixes <http://bugs.gnu.org/20261>.
Reported by Mark H Weaver <mhw@netris.org>.

* tests/syscalls.scm ("mount-points"): Check for a few other likely
  mount points in addition to "/".
2015-04-06 21:27:16 +02:00
David Thompson
aff8ce7c74 scripts: Add 'publish' command.
* guix/scripts/publish.scm: New file.
* po/guix/POTFILES.in: Add it.
* tests/publish.scm: New file.
* Makefile.am (MODULES): Add script module.
  (SCM_TESTS): Add test module.
* doc/guix.texi ("Invoking guix publish"): New node.
2015-04-04 14:16:43 -04:00
David Thompson
533d1768f4 store: Add query-path-info operation.
* guix/store.scm (<path-info>): New record type.
  (read-path-info): New procedure.
  (read-arg): Add 'path-info' syntax.
  (query-path-info): New variable.
* tests/store.scm ("query-path-info"): New test.
2015-04-04 13:50:52 -04:00
Ludovic Courtès
023dd28a30 Merge branch 'master' into core-updates 2015-03-31 22:41:54 +02:00
Ludovic Courtès
15aa2c3842 Add (guix build gremlin).
* guix/build/gremlin.scm, tests/gremlin.scm: New files.
* Makefile.am (MODULES): Add guix/build/gremlin.scm.
  (SCM_TESTS): Add tests/gremlin.scm.
2015-03-31 22:23:57 +02:00
Ludovic Courtès
4e7b6b4838 tests: Fix module name for 'lint'.
* tests/lint.scm: Change module name to 'test-lint'.
2015-03-31 22:23:57 +02:00
Ludovic Courtès
d9ae938f2c gexp: Add 'local-file'.
* guix/gexp.scm (<local-file>): New record type.
  (local-file): New procedure.
  (local-file-compiler): New compiler.
  (gexp->sexp) <struct? thing>: Handle the case where 'lower' returns a
  file name.
  (text-file*): Update docstring.local-file doc
* tests/gexp.scm ("one local file", "gexp->derivation, local-file"): New
  tests.
* doc/guix.texi (G-Expressions): Mention local files early.  Document
  'local-file'.  Update 'text-file*' documentation.
2015-03-29 22:23:33 +02:00
Taylan Ulrich Bayırlı/Kammer
122c87ead0 Fix remaining references to "substitute-binary".
* nix/nix-daemon/guix-daemon.cc (main): Change substitute-binary to
  substitute.
* po/guix/POTFILES.in: Likewise.
* tests/guix-daemon.sh: Likewise.
* tests/guix-system.sh: Likewise.
2015-03-26 23:54:59 +01:00
Ludovic Courtès
25d5b708a6 Merge branch 'master' into core-updates 2015-03-25 10:52:52 +01:00
Ludovic Courtès
614c218842 substitute: Rename cache directory from "substitute-binary" to "substitute".
* guix/scripts/substitute.scm (%narinfo-cache-directory): Change
  "substitute-binary" to "substitute".
* tests/store.scm ("substitute query"): Likewise.
* tests/substitute.scm (call-with-narinfo): Likewise.
2015-03-25 10:46:22 +01:00
Ludovic Courtès
2c74fde00e Rename 'guix substitute-binary' to 'guix substitute'.
* guix/scripts/substitute-binary.scm: Rename to...
* guix/scripts/substitute.scm: ... this.  Adjust module name, entry
  point, comments, and help string accordingly.
* nix/scripts/substitute-binary.in: Rename to...
* nix/scripts/substitute.in: ... this.
* pre-inst-env.in (NIX_SUBSTITUTERS): Adjust accordingly.
* tests/substitute-binary.scm: Rename to...
* tests/substitute.scm: ... this.  Adjust references to (guix scripts
  substitute) accordingly.
* guix/ui.scm (show-guix-help)[internal?]: Change "substitute-binary" to
  "substitute".
* Makefile.am (MODULES, SCM_TESTS): Adjust to file renames.
* daemon.am (nodist_pkglibexec_SCRIPTS): Likewise.
* config-daemon.ac: Likewise.
* guix/tests.scm (call-with-derivation-narinfo): Adjust comments and
  docstring.
2015-03-25 10:46:22 +01: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
1123759b45 gexp: Fix handling of nativeness in nested gexps.
* guix/gexp.scm (gexp-inputs): Remove 'references' parameter; add
  #:native? and honor it.
  [add-reference-inputs]: Distinguish between native gexp inputs, and
  non-native gexp inputs.  Honor 'native?' field of list inputs.
* tests/gexp.scm ("ungexp + ungexp-native, nested"): New test.
2015-03-22 23:18:33 +01:00
Ludovic Courtès
accb682c50 gexp: Allow <gexp-input> objects in #:allowed-references.
* guix/gexp.scm (lower-references): Add <gexp-input> case.
* tests/gexp.scm ("gexp->derivation #:allowed-references, specific
  output"): New test.
2015-03-22 23:18:30 +01:00
Ludovic Courtès
cf87cc894d packages: Rewrite 'patch-and-repack' using gexps.
* guix/packages.scm (patch-and-repack): Remove 'store' parameter and
  change default value of #:inputs to (%standard-patch-inputs).
  [lookup-input, instantiate-patch]: New procedures.
  [patch-inputs]: Remove.
  [builder]: Rename to...
  [build]: ... this.  Use gexps instead of sexps.
  (patch-and-repack*): Remove.
  (origin->derivation): Use 'patch-and-repack' instead of
  'patch-and-repack*'.
* tests/packages.scm ("package-source-derivation,
  snippet")[source](snippet): Remove references to '%build-inputs' and
  '%outputs'.
2015-03-18 19:07:36 +01:00
Ludovic Courtès
a482cfdcae gexp: Remove special meaning of forms (PACKAGE OUTPUT) in ungexp.
* guix/gexp.scm (gexp-inputs)[add-reference-inputs]: Remove clause for
  inputs of the form (PACKAGE OUTPUT).
  (gexp->sexp)[reference->sexp]: Likewise.
* tests/gexp.scm ("input list splicing"): Change 'list' to 'gexp-input'
  for glibc:debug.
  ("text-file*"): Likewise for %bootstrap-guile:out.
  ("input list splicing + gexp-input + ungexp-native-splicing"): Remove,
  now redundant.
2015-03-17 22:25:54 +01:00
Ludovic Courtès
0dbea56bbf gexp: Export 'gexp-input' constructor.
* guix/gexp.scm (<gexp-input>)[gexp-input]: Rename to...
  [%gexp-input]: ... this.  Adjust callers accordingly.
  (gexp-input): New procedure.
  (gexp-inputs)[add-reference-inputs]: When the input is a list, check
  whether each item is already 'gexp-input?' and to not rewrap those.
  (gexp-outputs)[add-reference-output]: Likewise.
  (gexp->sexp): Likewise.
* tests/gexp.scm ("input list splicing + gexp-input +
  ungexp-native-splicing"): New test.
2015-03-17 22:25:54 +01:00
Ludovic Courtès
e39d146107 gexp: Add <gexp-input>.
* guix/gexp.scm (<gexp-input>): New record type.
  (gexp-inputs)[add-reference-inputs]: Adjust clauses to expect
  <gexp-input> objects.
  (gexp-outputs)[add-reference-output]: Likewise.
  (gexp->sexp)[reference->sexp]: Likewise.
  (canonicalize-reference): Remove.
  (gexp)[escape->ref]: Use 'gexp-input' for all the references.
  Remove use of 'canonicalize-reference'.
2015-03-17 22:25:54 +01:00
Ludovic Courtès
1f9760339e tests: Add an indirection for white-box testing.
* tests/gexp.scm (gexp-inputs, gexp-native-inputs, gexp-outputs,
  gexp->sexp): Make an indirection, to facilitate live testing with
  Geiser.
2015-03-17 22:25:54 +01:00
Ludovic Courtès
116244df95 services: Statically report duplicate dmd service identifiers.
Reported by 白い熊 @相撲道 <guix-devel_gnu.org@sumou.com>
at <http://lists.gnu.org/archive/html/guix-devel/2015-03/msg00264.html>.

* gnu/services/dmd.scm (assert-no-duplicates): New procedure.
  (dmd-configuration-file): Use it.
* po/guix/POTFILES.in: Add gnu/services/dmd.scm.
* tests/guix-system.sh (errorfile): Add test.
2015-03-09 23:51:43 +01:00
Ludovic Courtès
950d2ea414 lint: Add tests for the 'source' checker.
* guix/scripts/lint.scm (check-source): Export.
* tests/lint.scm (%null-sha256): New procedure.
  ("source: 200", "source: 404"): New tests.
2015-03-05 22:17:36 +01:00
Ludovic Courtès
754e5be2d5 tests: Fix import.
* tests/lint.scm: Use 'url-fetch' from (guix download), not (guix build
  download), although this was actually harmless here.
2015-03-05 22:17:36 +01:00
Ludovic Courtès
ce72c78074 store: Attempt to decode build logs as UTF-8.
* guix/serialization.scm (read-maybe-utf8-string): New procedure.
* guix/store.scm (process-stderr): Use it for the build log and errors.
* tests/store.scm ("current-build-output-port, UTF-8",
  "current-build-output-port, UTF-8 + garbage"): New tests.
2015-03-05 22:17:36 +01:00
Ludovic Courtès
6d0b9d03ce tests: Remove dependency on 'glibc-utf8-locales' for profile tests.
This fixes a regression introduced in commit 536c3ee.

* guix/profiles.scm (ca-certificate-bundle): When MANIFEST is empty,
  make a trivial derivation.
* guix/scripts/package.scm (guix-package)[process-actions]: Pass
  #:ca-certificate-bundle? to 'profile-generation'.
* tests/packages.scm ("--search-paths with pattern"): Likewise.
* tests/profiles.scm ("profile-derivation"): Likewise.
2015-03-04 17:23:27 +01:00
Ludovic Courtès
7e75a6739b gexp: Make sure 'gexp-outputs' removes duplicate outputs.
Fixes a regression introduced in f9efe56.

* guix/gexp.scm (gexp-outputs): Add call to 'delete-duplicates'.
* tests/gexp.scm ("output list, combined gexps, duplicate output"): New
  test.
2015-03-02 16:26:13 +01:00
Ludovic Courtès
f9efe568c3 gexp: Aggregate outputs of compound gexps.
* guix/gexp.scm (gexp-outputs)[add-reference-output]: Recurse into
  lists.
* tests/gexp.scm ("output list + ungexp-splicing list, combined gexps"):
  New test.
2015-02-27 22:05:40 +01:00
Ludovic Courtès
4b23c4664e gexp: Add tests for 'gexp-outputs'.
* tests/gexp.scm (gexp-outputs): New procedure.
  ("output list", "output list, combined gexps"): New tests.
2015-02-27 22:03:20 +01:00
Ludovic Courtès
cf6ce3e6ef ui: Honor --no-* options passed via $GUIX_BUILD_OPTIONS.
Reported by Alex Kost <alezost@gmail.com>
at <http://lists.gnu.org/archive/html/guix-devel/2015-02/msg00702.html>.

* guix/ui.scm (parse-command-line)[parse-options-from]: Add 'seeds'
  parameter.
  Thread the result of the first 'parse-options-from' call to the
  second.
2015-02-26 00:04:36 +01:00
Ludovic Courtès
b3f213893b ui: Factorize command-line + env. var. option parsing.
* guix/ui.scm (%default-argument-handler, parse-command-line): New
  procedures.
  (environment-build-options): Make private.
* guix/scripts/archive.scm (guix-archive)[parse-options,
  parse-options-from]: Remove.  Use 'parse-command-line' instead.
* guix/scripts/build.scm (guix-build): Likewise.
* guix/scripts/environment.scm (guix-environment): Likewise.
* guix/scripts/package.scm (guix-package): Likewise.
* guix/scripts/system.scm (guix-system): Likewise.
* tests/ui.scm (with-environment-variable): New macro.
  ("parse-command-line"): New test.
2015-02-26 00:04:36 +01:00
Ludovic Courtès
b69c5c2ced tests: Skip tests that would fail due to the shebang length.
Reported by Daniel Kochmański <dkochmanski@hellsgate.pl>.
Fixes <http://bugs.gnu.org/19888>.

* guix/tests.scm (shebang-too-long?): New procedure.
* tests/builders.scm ("gnu-build"): Conditionalize on
  not (shebang-too-long?).
* tests/packages.scm ("GNU Make, bootstrap"): Likewise.
* tests/guix-package.sh (shebang_not_too_long): New function.
  Use it to determine whether to build 'gnu-make-boot0'.
2015-02-24 00:01:34 +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
Eric Bavier
cc9b70d3ea import: cpan: Update tests for dependency handling.
* tests/cpan.scm (test-json): Remove core module dependencies.
  [cpan->guix-package]: Add mock url handling for module api.
  Adjust expected native-inputs and license.
2015-02-20 16:05:15 -06:00
Ludovic Courtès
ce45eb4c38 gexp: Add #:graft? parameter to 'gexp->derivation'.
* guix/gexp.scm (gexp->derivation): Add #:graft? parameter and honor it.
* tests/gexp.scm ("gexp->derivation vs. grafts"): New test.
* doc/guix.texi (G-Expressions): Update 'gexp->derivation'
  documentation.
2015-02-13 23:19:49 +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
c8351d9a40 gexp: Add #:allowed-references parameter to 'gexp->derivation'.
* guix/gexp.scm (lower-references): New procedure.
  (gexp->derivation): Add #:allowed-references and honor it.
* tests/gexp.scm ("gexp->derivation #:allowed-references",
  "gexp->derivation #:allowed-references, disallowed"): New tests.
* doc/guix.texi (G-Expressions): Update 'gexp->derivation' doc.
2015-02-11 22:10:14 +01:00
Ludovic Courtès
3bea13bb1f profiles: Report "pseudo-upgrades" as upgrades, not downgrades.
Reported by Andreas Enge <andreas@enge.fr>
at <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19764#19>.

* guix/profiles.scm (manifest-transaction-effects): Use 'version>=?'
  instead of 'version>?'.
* tests/profiles.scm ("manifest-transaction-effects and
  pseudo-upgrades"): New test.
2015-02-09 18:18:41 +01:00
Ludovic Courtès
46b23e1a43 profiles: Distinguish downgrades from upgrades.
Fixes <http://bugs.gnu.org/19764>.

* guix/profiles.scm (manifest-transaction-effects): Return downgraded
  packages as a fourth value.
* guix/ui.scm (show-manifest-transaction): Adjust accordingly.
* tests/profiles.scm ("manifest-transaction-effects and downgrades"):
  New test.
2015-02-08 19:00:39 +01:00
Ludovic Courtès
77ee4a96f4 ui: Simplify 'show-manifest-transaction' test.
* tests/ui.scm ("show-manifest-transaction"): Remove useless call to
  'manifest-transaction-effects'.
2015-02-08 19:00:39 +01:00
Ludovic Courtès
46b8aadbd6 serialization: Check for EOF and incomplete input conditions.
Fixes <http://bugs.gnu.org/19756>.
Reported by <sleep_walker@suse.cz>.

* guix/serialization.scm (currently-restored-file): New variable.
  (get-bytevector-n*): New procedure.
  (read-int, read-long-long, read-string, read-latin1-string,
  read-contents): Use it instead of 'get-bytevector-n'.
  (restore-file): Parameterize 'currently-restored-file' and set it.
* tests/nar.scm ("restore-file with incomplete input"): New test.
2015-02-07 23:16:55 +01:00
Ludovic Courtès
862abf8fcd tests: Disable grafts when comparing derivations.
Fixes a regression introduced with the grafting of Patch in 3f11f01.

* tests/packages.scm ("reference to non-existent output"): Wrap in
  'parameterize'.
2015-02-06 18:04:19 +01:00
Ludovic Courtès
c9323a4c69 guix package: Make custom profiles actual indirect roots.
Before that, any profile generation built when '-p' is used would
effectively become a permanent GC root because the symlink in
/var/guix/gcroots/auto would point directly to /gnu/store/...-profile.

* guix/scripts/package.scm (maybe-register-gc-root): Rename to...
  (register-gc-root): ... this.  Remove conditional, and replace call to
  'canonicalize-path' with (string-append (getcwd) "/" ...).
  (guix-package): Call 'register-gc-root' only if PROFILE is different
  from %CURRENT-PROFILE.
* tests/guix-package.sh: Add test case.
2015-02-06 17:56:22 +01:00
Ludovic Courtès
bd98ad1fbc tests: Skip 'guix-register' when the socket name length is exceeded.
* tests/guix-register.sh: Before running 'guix-daemon', check whether
  the socket name length exceeds the system limitation.
2015-02-02 12:46:36 +01:00
Ludovic Courtès
5f1f10c59d tests: Don't dump the list of dead items in the test log.
* tests/store.scm ("dead-paths"): Wrap result in '->bool'.
2015-02-02 12:46:36 +01:00
Ludovic Courtès
abac874b22 store: Add 'build-things'.
* guix/store.scm (operation-id): Rename 'build-derivations' to
  'build-things', as per Nix commit 1aba0bf0.
  (build-derivations): Rename to...
  (build-things): ... this.  Keep 'build-derivations' as an alias.
  (build): New procedure.
* tests/store.scm ("build-things with output path",
  "substitute + build-things with output path"): New tests.
2015-02-02 12:46:36 +01:00
Ludovic Courtès
e6c8839c18 tests: Add 'with-derivation-substitute' and use it.
* guix/tests.scm (%substitute-directory): New variable.
  (call-with-derivation-narinfo): Use it.
  (call-with-derivation-substitute): New procedure.
  (with-derivation-substitute): New macro.
* tests/store.scm ("substitute"): Use 'with-derivation-substitute'.
  ("substitute, corrupt output hash"): Likewise.
2015-02-02 12:46:35 +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
2d53df66de tests: Use 'with-store' as appropriate.
* tests/store.scm ("no substitutes", "substitute query",
  "substitute", "substitute, corrupt output hash",
  "substitute --fallback"): Use 'with-store' instead of
  'open-connection'.
2015-02-02 12:46:35 +01:00
Ludovic Courtès
8fbf530260 lint: Fix argument parsing when several packages are specified.
* guix/scripts/lint.scm (%options) <--checkers>: Remove 'arg-handler'
  parameter, and return a single value.
  (guix-lint)[parse-options]: Remove 'arg-handler' parameter from
  handlers.  Remove second seed to 'args-fold*'.
* tests/guix-lint.sh: Add test.
2015-01-28 14:00:58 +01:00
Ludovic Courtès
f304c9c237 derivations: Raise an error for references to non-existent outputs.
Fixes <http://bugs.gnu.org/19630>.
Reported by Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>.

* guix/derivations.scm (&derivation-error,
  &derivation-missing-output-error): New error conditions.
  (derivation->output-path): Raise a '&derivation-missing-output-error'
  if OUTPUT is not an output of DRV.
* guix/ui.scm (call-with-error-handling): Add case for
  'derivation-missing-output-error?'.
  (show-what-to-build): Check whether (derivation-outputs drv) is
  empty.
* tests/packages.scm ("reference to non-existent output"): Add test.
2015-01-24 22:57:49 +01:00
Ludovic Courtès
dbab5150f8 gnu: 'search-patch' raises an error when a patch is not found.
* gnu/packages.scm (search-patch): Raise an error condition when
  'search-path' returns #f.
* tests/packages.scm ("patch not found yields a run-time error"): New
  test.
2015-01-20 10:17:24 +01:00
Ludovic Courtès
310b32a2a6 records: Add support for delayed fields.
* guix/records.scm (make-syntactic-constructor): Add #:delayed
  parameter.
  [delayed-field?]: New procedure.
  [wrap-field-value]: Use it.
  (define-record-type*)[delayed-field?, wrapped-field?]: New procedures.
  [thunked-field-accessor-name]: Rename to...
  [wrapped-field-accessor-name]: ... this.
  [field-spec->srfi-9]: Change 'thunked' to 'wrapped'.
  [delayed-field-accessor-definition]: New procedure.
  Compute delayed-field accessors and emit them.  Pass #:delayed to
  'make-syntactic-constructor'.
* tests/records.scm ("define-record-type* & delayed",
  "define-record-type* & delayed & default",
  "define-record-type* & delayed & inherited"): New tests.
2015-01-19 23:30:42 +01:00
Ludovic Courtès
d35c5e29b6 tests: Adjust syscall tests for 2.6ish Linux.
* tests/syscalls.scm ("set-network-interface-flags",
  "set-network-interface-address"): Accept EACCES as a valid result.
2015-01-19 15:44:12 +01:00
Ludovic Courtès
81a97734e0 monads: Add the state monad.
* guix/monads.scm (state-return, state-bind, run-with-state,
  current-state, set-current-state, state-push, state-pop): New
  procedures.
  (%state-monad): New variable.
* tests/monads.scm (%monads): Add %STATE-MONAD.
  (%monad-run): Add 'run-with-state'.
  (values->list): New macro.
  ("set-current-state", "state-push etc."): New tests.
2015-01-17 23:45:48 +01:00
Ludovic Courtès
5b3d863f00 store: Add #:recursive? parameter to 'export-paths'.
* guix/store.scm (export-paths): Add #:recursive? parameter and honor
  it.
* tests/store.scm ("export/import incomplete", "export/import
  recursive"): New tests.
2015-01-17 15:59:00 +01:00
Ludovic Courtès
57b7e1a62d Merge branch 'core-updates'
Conflicts:
	gnu/packages/bootstrap.scm
2015-01-16 13:27:03 +01:00
Ludovic Courtès
f220a83848 packages: Convert source derivations to monadic style.
* guix/packages.scm (origin->derivation): Take body from
  'package-source-derivation', and change it to monadic style.  Expect
  METHOD to a monadic procedure.
  (package-source-derivation): Define in terms of 'origin->derivation'.
* guix/download.scm (url-fetch): Remove 'store' argument.  Remove
  'guile-for-build' variable.  Turn into a monadic procedure.
* guix/git-download.scm (git-fetch): Likewise.
* guix/svn-download.scm (svn-fetch): Likewise.
* tests/builders.scm (url-fetch*): New procedure.
  Change tests to call 'url-fetch*' instead of 'url-fetch'.
* tests/packages.scm ("package-source-derivation, snippet"): Remove
  'store' parameter of 'fetch' and change it to use 'interned-file'
  instead of 'add-to-store'.
* gnu/packages/bootstrap.scm (bootstrap-origin)[boot]: Remove 'store'
  parameter.
2015-01-14 14:42:10 +01:00
Ludovic Courtès
023d9892c0 store: Add 'store-lower'.
* guix/store.scm (store-lower): New procedure.
* tests/store.scm ("store-lower"): New test.
2015-01-14 14:25:58 +01:00
Ludovic Courtès
e87f0591f3 monads: Move '%store-monad' and related procedures where they belong.
This turns (guix monads) into a generic module for monads, and moves the
store monad and related monadic procedures in their corresponding
module.

* guix/monads.scm (store-return, store-bind, %store-monad, store-lift,
  text-file, interned-file, package-file, package->derivation,
  package->cross-derivation, origin->derivation, imported-modules,
  compiled, modules, built-derivations, run-with-store): Move to...
* guix/store.scm (store-return, store-bind, %store-monad, store-lift,
  text-file, interned-file): ... here.
  (%guile-for-build): New variable.
  (run-with-store): Moved from monads.scm.  Remove default value for
  #:guile-for-build.
* guix/packages.scm (default-guile): Export.
  (set-guile-for-build): New procedure.
  (package-file, package->derivation, package->cross-derivation,
  origin->derivation): Moved from monads.scm.
* guix/derivations.scm (%guile-for-build): Remove.
  (imported-modules): Rename to...
  (%imported-modules): ... this.
  (compiled-modules): Rename to...
  (%compiled-modules): ... this.
  (built-derivations, imported-modules, compiled-modules): New
  procedures.
* gnu/services/avahi.scm, gnu/services/base.scm, gnu/services/dbus.scm,
  gnu/services/dmd.scm, gnu/services/networking.scm,
  gnu/services/ssh.scm, gnu/services/xorg.scm, gnu/system/install.scm,
  gnu/system/linux-initrd.scm, gnu/system/shadow.scm, guix/download.scm,
  guix/gexp.scm, guix/git-download.scm, guix/profiles.scm,
  guix/svn-download.scm, tests/monads.scm: Adjust imports accordingly.
* guix/monad-repl.scm (default-guile-derivation): New procedure.
  (store-monad-language, run-in-store): Use it.
* build-aux/hydra/gnu-system.scm (qemu-jobs): Add explicit
  'set-guile-for-build' call.
* guix/scripts/archive.scm (derivation-from-expression): Likewise.
* guix/scripts/build.scm (options/resolve-packages): Likewise.
* guix/scripts/environment.scm (guix-environment): Likewise.
* guix/scripts/system.scm (guix-system): Likewise.
* doc/guix.texi (The Store Monad): Adjust module names accordingly.
2015-01-14 13:34:52 +01:00
Mark H Weaver
a813710a5f Merge branch 'master' into core-updates 2015-01-13 12:14:08 -05:00
Ludovic Courtès
4655005e24 tests: Properly synchronize threads in the 'home-page' lint tests.
* tests/lint.scm (%http-server-lock, %http-server-ready): New
  variables.
  (http-open): New procedure.
  (stub-http-server): Use it.
  (call-with-http-server): Wrap body in 'with-mutex'.  Call
  'wait-condition-variable' after 'make-thread'.
2015-01-13 11:09:05 +01:00
Ludovic Courtès
abebac4601 monads: Remove 'derivation-expression'.
* guix/monads.scm (lower-inputs, derivation-expression): Remove.
* tests/monads.scm (derivation-expression, "mlet* +
  derivation-expression"): Remove.
2015-01-12 23:33:08 +01:00
Ludovic Courtès
462a3fa36c monads: Rewrite 'text-file*' using gexps.
* guix/monads.scm (text-file*): Move to...
* guix/gexp.scm (text-file*): ... here.  Rewrite using gexps.
* tests/monads.scm ("text-file*"): Move to...
* tests/gexp.scm ("text-file*"): ... here.
2015-01-12 23:33:08 +01:00
Ludovic Courtès
d326767e64 Add (guix sets).
* guix/sets.scm, tests/sets.scm: New files.sets
* Makefile.am (MODULES, SCM_TESTS): Add them.
2015-01-11 23:50:01 +01:00
Mark H Weaver
7744885731 Merge branch 'master' into core-updates 2015-01-11 09:38:49 -05: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
Eric Bavier
d45dc6da5c import: Add CPAN importer.
* guix/import/cpan.scm, guix/scripts/import/cpan.scm, tests/cpan.scm:
  New files.
* Makefile.am (MODULE)[HAVE_GUILE_JSON]: Add them.
* guix/scripts/import.scm (importers): Add cpan.
* doc/guix.texi (Requirements): Mention `guix import cpan` as a user
  of guile-json.
  (Invoking guix import): Document new `guix import cpan` command.
2015-01-09 10:38:26 -06:00
Eric Bavier
694b317c2d tests: import: Factorize utility function.
* tests/pypi.scm (mock): Move this...
* guix/tests.scm: to here.
2015-01-09 10:38:25 -06:00
Eric Bavier
1ff2619bc1 import: Factorize utility functions.
* guix/import/pypi.scm (hash-table->alist, flatten, assoc-ref*,
  url-fetch, json-fetch): Pull procedures from here into...
* guix/import/utils.scm: Here and...
* guix/import/json.scm: Here.  New file.
* Makefile.am (MODULE)[HAVE_GUILE_JSON]: Add it.
* guix/import/gnu.scm (file-sha256): Move from here to...
* guix/hash.scm: Here.
* tests/pypi.scm (pypi->guix-package): Update mock module reference.
2015-01-09 10:33:24 -06:00
Ludovic Courtès
05f0607bfc tests: Add missing copyright line.
* tests/lint.scm: Add missing copyright line for commit 907c98ac and
  others.
2015-01-07 22:33:21 +01:00
Mark H Weaver
23800e4736 Merge branch 'master' into core-updates 2015-01-06 12:57:15 -05:00
Ludovic Courtès
ee06af5b4b gnu: Search for patches under $GUIX_PACKAGE_PATH.
Fixes <http://bugs.gnu.org/19364>.
Reported by Tomáš Čech <sleep_walker@suse.cz>
and Mark H Weaver <mhw@netris.org>.

* gnu/packages.scm (%patch-path): Move after definition of
  %package-module-path'.  Append "/gnu/packages/patches" only to
  %DISTRO-ROOT-DIRECTORY.
* tests/guix-package.sh: Add 'emacs-foo-bar-patched' test.
2015-01-03 23:49:42 +01:00
Ludovic Courtès
cf81a23639 guix package: Follow symlinks for pattern search paths.
* guix/scripts/package.scm (search-path-environment-variables): Add
  local 'files' variable.
* tests/packages.scm ("--search-paths with pattern"): New test.
2015-01-03 19:46:07 +01:00
Mark H Weaver
8cbb67e045 Merge branch 'master' into core-updates 2014-12-30 12:23:32 -05:00
Ludovic Courtès
4fbf4ca552 tests: Make the 'lint' tests slightly more concise.
* tests/lint.scm (with-warnings): New macro.
  Replace all uses of 'call-with-warnings' with the corresponding
  'with-warnings' form.
2014-12-29 21:19:13 +01:00
Ludovic Courtès
8b385969cf tests: Factorize the 'dummy-package' macro.
* guix/tests.scm (dummy-package): New macro.
* tests/lint.scm (dummy-package): Remove.
* tests/packages.scm (dummy-package): Remove.
2014-12-29 21:18:12 +01:00
Ludovic Courtès
907c98acbb lint: Add tests for the 'home-page' checker.
Suggested by Cyril Roelandt <tipecaml@gmail.com>.

* tests/lint.scm (%http-server-port, %http-server-socket, %local-url,
  stub-http-server): New variables.
  (http-write, call-with-http-server): New procedures.
  (with-http-server): New macro.
  ("home-page: wrong home-page", "home-page: invalid URI", "home-page:
  host not found", "home-page: Connection refused", "home-page: 200",
  "home-page: 404"): New tests.
* guix/scripts/lint.scm (check-home-page): Export.
2014-12-29 21:17:36 +01:00
Ludovic Courtès
af07095516 packages: Add 'file-type' field to 'search-path-specification'.
Fixes <http://bugs.gnu.org/18033>.

* guix/packages.scm (<search-path-specification>): Rename 'directories'
  field to 'files'.  Add 'file-type'.
  (search-path-specification->sexp): Honor 'file-type'.
* gnu/packages/autotools.scm, gnu/packages/bootstrap.scm,
  gnu/packages/cross-base.scm, gnu/packages/games.scm,
  gnu/packages/gcc.scm, gnu/packages/glib.scm,
  gnu/packages/guile.scm, gnu/packages/man.scm,
  gnu/packages/perl.scm, gnu/packages/pkg-config.scm,
  gnu/packages/python.scm, gnu/packages/ruby.scm,
  gnu/packages/xfce.scm: Change 'directories' to 'files'.
* tests/packages.scm ("search paths"): Change 'directories' field to
  'files'.
* guix/scripts/environment.scm (for-each-search-path): Likewise.
2014-12-27 23:22:49 +01:00
Ludovic Courtès
c9bf64d6d7 syscalls: Add more procedures for network interfaces.
* guix/build/syscalls.scm (sizeof*, type-size, write-type, write-types,
  read-type, read-types, define-c-struct): New macros.
  (SIOCSIFFLAGS, SIOCGIFADDR, SIOCSIFADDR): New variables.
  (sockaddr-in, sockaddr-in6): New C structs.
  (write-socket-address!, read-socket-address,
  set-network-interface-flags, set-network-interface-address,
  network-interface-address, configure-network-interface): New
  procedures.
2014-12-19 17:15:53 +01:00
Ludovic Courtès
ebf5ad46db tests: Use 'test-assertm' for profiles.
* tests/profiles.scm (test-assertm): New macro.
  ("profile-derivation"): Use it instead of 'test-assert' +
  'run-with-store'.
2014-12-15 23:01:56 +01:00
nebuli
847391fe62 guix: scripts: Parse $GUIX_BUILD_OPTIONS separately.
Appending to "raw" args broke optional parameters in 'guix package -I'
and 'guix package -A', and possibly other places.  Therefore, switch to
parsing each set of options on its own and append resulting alists
together afterwards.

* guix/scripts/archive.scm (parse-options-from): Rename from
  (parse-options) and add explicit argument.  New form of (parse-options)
  using its old algorithm via -from function.
* guix/scripts/build.scm: Ditto.
* guix/scripts/environment.scm: Ditto.
* guix/scripts/package.scm: Ditto.
* guix/scripts/system.scm: Ditto.
* tests/guix-package.sh: Add test.
* doc/guix.texi (Invoking guix build): Make it clear that the options
  are parsed independently.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2014-12-06 16:03:49 +01:00
nebuli
16eb115ef4 guix: scripts: Add GUIX_BUILD_OPTIONS environment handling.
* doc/guix.texi (Invoking guix build): Mention 'GUIX_BUILD_OPTIONS'.
* guix/scripts/archive.scm: (append args (environment-build-options)).
* guix/scripts/build.scm: Ditto.
* guix/scripts/environment.scm: Ditto.
* guix/scripts/package.scm: Ditto.
* guix/scripts/system.scm: Ditto.
* guix/ui.scm (environment-build-options): New function.
* guix/utils.scm (arguments-from-environment-variable): New function.
* tests/guix-build.sh: Add tests.
* test-env.in: Unset GUIX_BUILD_OPTIONS.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2014-11-30 18:54:07 +01:00
Ludovic Courtès
ccea821bef syscalls: Add 'mount-points'.
* guix/build/syscalls.scm (mount-points): New procedure.
* tests/syscalls.scm ("mount-points"): New test.
2014-11-10 22:42:14 +01:00
Ludovic Courtès
15a6d433ff lint: Allow synopses that start with an abbreviation.
* guix/scripts/lint.scm (starts-with-abbreviation?): New procedure.
  (check-synopsis-style)[check-start-with-package-name]: Use it.
* tests/lint.scm ("synopsis: start with abbreviation"): New test.
2014-11-07 17:52:11 +01:00
Ludovic Courtès
17854ef91d lint: Improve check for synopses starting with package name.
* guix/scripts/lint.scm (package-name-regexp): New procedure.
  (check-synopsis-style)[check-start-with-package-name]: Use it instead
  of 'string-prefix-ci?'.
* tests/lint.scm ("synopsis: start with package name prefix"): New test.
2014-11-07 17:52:11 +01:00
Ludovic Courtès
b1e666835e lint: Simplify no-warnings tests.
* tests/lint.scm ("description: may start with a digit"): Replace
  (not (string-contains exp str)) with (string-null? exp).
  ("description: may start with lower-case package name"): Likewise.
  ("description: end-of-sentence detection with abbreviations"):
  Likewise.
  ("synopsis: may start with a digit"): Likewise.
  ("synopsis: ends with 'etc.'"): Likewise.
2014-11-07 17:52:11 +01:00
Ludovic Courtès
c8af8572bf tests: Avoid Bash extension in 'tests/guix-lint.sh'.
* tests/guix-lint.sh: Remove redundant and non-portable 'export'.
2014-11-06 18:00:51 +01:00
Ludovic Courtès
834ea02ad8 tests: When a store item is to be deleted, make it statistically unique.
Fixes <http://bugs.gnu.org/18935>.
Reported by Mark H Weaver <mhw@netris.org>.

Previously, if tests/nar.scm ran concurrently with tests/gexp.scm, the
store item "foo" containing the string "Hello, world!" could be
deleted (via 'delete-paths') from the tests/nar.scm daemon while the
tests/gexp.scm daemon would still consider it live.

* tests/nar.scm ("restore-file-set (missing signature)"):
  Use (random-text) rather than "Hello, world!", to avoid concurrent
  deletion of store item "foo" used in tests/gexp.scm.
2014-11-04 21:13:28 +01:00
Ludovic Courtès
000c59b671 store: Invalidate caches once GC has run.
* guix/store.scm (run-gc): Add calls to 'hash-clear!'.
* tests/store.scm ("add-text-to-store vs. delete-paths",
  "add-to-store vs. delete-paths"): New tests.
2014-11-04 21:13:28 +01:00
Ludovic Courtès
c37a74bd3e packages: 'package-transitive-supported-systems' accounts for indirect deps.
Reported by Andreas Enge <andreas@enge.fr>.

* guix/packages.scm (first-value): New macro.
  (package-transitive-supported-systems): Rewrite to traverse all the
  DAG rooted at PACKAGE.
* tests/packages.scm ("package-transitive-supported-systems"): Add 'd'
  and 'e', and test them.
2014-11-03 21:26:48 +01:00
Ludovic Courtès
05962f2958 packages: Implement grafts.
Thanks to Mark H. Weaver <mhw@netris.org> for insightful discussions
and suggestions.

* guix/packages.scm (<package>)[graft]: New field.
  (patch-and-repack): Invoke 'package-derivation' with #:graft? #f.
  (package-source-derivation): Likewise.  Do not use (%guile-for-build)
  in call to 'patch-and-repack', and we could end up using a grafted
  Guile.
  (expand-input): Likewise, also for 'package-cross-derivation' call.
  (package->bag): Add #:graft? parameter.  Honor it.  Use 'strip-append'
  instead of 'package-full-name'.
  (input-graft, input-cross-graft, bag-grafts, package-grafts): New
  procedures.
  (package-derivation, package-cross-derivation): Add #:graft? parameter
  and honor it.
* gnu/packages/bootstrap.scm (package-with-bootstrap-guile): Add
  recursive call on 'graft'.
* guix/build-system/gnu.scm (package-with-explicit-inputs,
  package-with-extra-configure-variable, static-package): Likewise.
  (gnu-build): Use the ungrafted Guile to avoid full rebuilds.
  (gnu-cross-build): Likewise.
* guix/build-system/cmake.scm (cmake-build): Likewise.
* guix/build-system/glib-or-gtk.scm (glib-or-gtk-build): Likewise.
* guix/build-system/perl.scm (perl-build): Likewise.
* guix/build-system/python.scm (python-build): Likewise.
* guix/build-system/ruby.scm (ruby-build): Likewise.
* guix/build-system/trivial.scm (guile-for-build): Likewise.
* tests/packages.scm ("package-derivation, direct graft",
  "package-cross-derivation, direct graft", "package-grafts,
  indirect grafts", "package-grafts, indirect grafts, cross",
  "package-grafts, indirect grafts, propagated inputs",
  "package-derivation, indirect grafts"): New tests.
  ("bag->derivation", "bag->derivation, cross-compilation"): Wrap in
  'parameterize'.
* doc/guix.texi (Security Updates): New node.
  (Invoking guix build): Document --no-graft.
2014-11-02 21:22:12 +01:00
Ludovic Courtès
50373bab7a packages: Add 'package->bag' test for propagated inputs.
* tests/packages.scm ("package->bag, propagated inputs"): New test.
2014-11-02 21:22:12 +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
Eric Bavier
791e0126ae build: Adjust lint tests for latest rules.
* tests/guix-lint.sh (dummy)[description]: Add failing case.
  [doc]: Adjust.
2014-10-28 09:28:40 -05:00
Eric Bavier
3c42965b1e guix: lint: Make exception for package name starting description.
* guix/scripts/lint.scm (check-description-style): Exception for
  upper-case rule if the description starts with the package name.
* tests/lint.scm: Test it.
2014-10-26 13:03:53 -05:00
Eric Bavier
903581f971 guix: lint: Allow digits at start of synopsis or description.
* guix/scripts/lint.scm (start-with-capital-letter?): Rename too...
  (properly-starts-sentence?): Rewrite with regex and add digits.
  (check-description-style, check-synopsis-style): Use it.
* tests/lint.scm: Add tests.
2014-10-26 13:03:53 -05:00
Eric Bavier
334c43e354 guix: lint: Check for empty synopses and descriptions.
* guix/scripts/lint.scm (check-description-style,
  check-synopsis-style): New emptiness checks.
* tests/lint.scm: Test them.
2014-10-26 13:03:53 -05:00
Eric Bavier
574e847b8e guix: lint: Check for proper end-of-sentence space.
* guix/scripts/lint.scm (start-with-capital-letter?): Handle empty
  strings.
  (check-description-style): New check for end-of-sentence space.
* tests/lint.scm: Test it.
2014-10-26 13:03:53 -05:00
Ludovic Courtès
7c3c0374de packages: Add 'package-transitive-supported-systems'.
* guix/packages.scm (package-transitive-supported-systems): New procedure.
* tests/packages.scm ("package-transitive-supported-systems"): New test.
* build-aux/hydra/gnu-system.scm (package->job): Use it.
2014-10-17 23:23:21 +02: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
Cyril Roelandt
dd7c013d4b guix lint: add the --checkers option.
* guix/scripts/lint.scm: add the "--checkers" option.
* doc/guix.texi (Invoking guix lint): Document it.
* tests/guix-lint.sh: New file
* Makefile.am (SCM_TESTS): Add it.
2014-10-16 00:50:27 +02:00
Alex Kost
b3bb82f154 guix package: Add '--switch-generation' option.
* guix/scripts/package.scm (switch-to-generation): New procedure.
  (switch-to-previous-generation): Use it.
  (guix-package): Adjust for '--switch-generation' option.
* tests/guix-package.sh: Test it.
* doc/guix.texi (Invoking guix package): Document it.
2014-10-12 08:45:38 +04:00
Ludovic Courtès
2793c0fb26 syscalls: Accept ENOENT in the 'swapoff' test.
Fixes <http://bugs.gnu.org/18690>.
Reported by Philip Woods <elzairthesorcerer@gmail.com>.

* tests/syscalls.scm ("swapoff, EINVAL/EPERM"): Rename to...
  ("swapoff, ENOENT/EINVAL/EPERM"): ... this.  Add ENOENT to the list of
  possible return values.
2014-10-12 00:14:09 +02:00
Ludovic Courtès
e25234e34b build: Make sure tests/guix-package.sh doesn't leave anything behind it.
Fixes a regression introduced in commit 300868ba.

* tests/guix-package.sh: Move 'module_dir' definition to the top, and
  "rm -rf" it from the top-most 'trap'.  Remove second use of 'trap'.
2014-10-10 14:08:59 +02:00
Alex Kost
5d7a8584f5 ui: Move 'show-manifest-transaction' from (guix profiles).
* guix/profiles.scm: Do not use (guix ui) module.
  (right-arrow, manifest-show-transaction): Move and rename to...
* guix/ui.scm (right-arrow, show-manifest-transaction): ... here.
* tests/profiles.scm ("manifest-show-transaction"): Move to...
* tests/ui.scm ("show-manifest-transaction"): ... here.
  (guile-1.8.8, guile-2.0.9): New variables.
* emacs/guix-main.scm (process-package-actions): Rename
  'manifest-show-transaction' to 'show-manifest-transaction'.
* guix/scripts/package.scm (guix-package): Likewise.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2014-10-10 00:06:35 +02:00
Ludovic Courtès
0363991a25 Break module cycle involving (guix store) and (guix ui).
Before, there was a cycle along the lines of:

  (guix store) -> (guix nar) -> (guix ui) -> (guix store)

This caused problems, as discussed at:

  http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00109.html

This patch removes cycles in the (guix ...) modules.

* guix/nar.scm (&nar-error, &nar-read-error, dump, write-contents,
  read-contents, %archive-version-1, write-file, restore-file): Move to...
* guix/serialization.scm: ... here.
* guix/store.scm: Remove dependency on (guix nar).
* guix/scripts/hash.scm, guix/scripts/offload.scm,
  guix/scripts/substitute-binary.scm, tests/nar.scm, tests/store.scm,
  tests/substitute-binary.scm: Adjust accordingly.
2014-10-09 23:51:19 +02:00
Ludovic Courtès
4938b0eead substitute-binary: Ignore $GUIX_BINARY_SUBSTITUTE_URL.
* guix/scripts/substitute-binary.scm (%cache-url): Ignore the
  'GUIX_BINARY_SUBSTITUTE_URL' environment variable.
* test-env.in: Invoke 'guix-daemon' with '--substitute-urls'.
* tests/substitute-binary.scm: Set '%cache-url' to the value of
  'GUIX_BINARY_SUBSTITUTE_URL'.
2014-10-09 23:51:19 +02:00
Ludovic Courtès
405a9d4ec9 monads: Add 'mbegin'.
* guix/monads.scm (mbegin): New macro.
* tests/monads.scm ("mbegin"): New test.
* doc/guix.texi (The Store Monad): Document it.
2014-10-08 23:35:20 +02:00
Ludovic Courtès
2e1bafb034 packages: Gracefully print packages whose 'location' is #f.
* guix/packages.scm (<package> printer): Check whether LOC is #f.
* tests/packages.scm ("printer with location", "printer without
  location"): New tests.
2014-10-08 23:06:19 +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
Cyril Roelandt
3c762a13bf guix lint: make sure synopses do not start with the package name.
* guix/scripts/lint.scm (check-start-with-package-name): New method.
* tests/lint.scm ("synopsis: start with package name"): New test.
2014-10-08 03:08:20 +02:00
Cyril Roelandt
a00ffdaa17 guix lint: Make sure a synopsis cannot start with a lower-case article.
* guix/scripts/lint.scm (check-start-article): use "string-ci=?" instead of
  "string=?".
* tests/lint.scm ("synopsis: starts with 'a'",
  "synopsis: starts with 'an'"): New tests.
2014-10-08 03:08:19 +02:00
Cyril Roelandt
8202a51313 guix lint: check whether descriptions and synopses start with an upper-case letter.
* guix/scripts/lint.scm (check-description-style,
  check-synopsis-start-upper-case): New methods.
* tests/lint.scm ("description: does not start with an upper-case letter",
  "synopsis: does not start with an upper-case letter"): New tests.
2014-10-08 03:08:19 +02:00
Cyril Roelandt
5622953de1 guix lint: Make sure synopses are not too long.
* guix/scripts/lint.scm (check-synopsis-length): New procedure.
* tests/lint.scm ("synopsis: too long"): New test.
2014-10-08 03:08:19 +02:00
Ludovic Courtès
d3d337d2d8 build-system: Bags record their system and target.
* guix/build-system.scm (<bag>)[system, target]: New fields.
  (make-bag): Add #:system parameter and pass it to LOWER.
* gnu/packages/bootstrap.scm (make-raw-bag): Initialize 'system' field.
* guix/build-system/cmake.scm (lower): Likewise.
* guix/build-system/perl.scm (lower): Likewise.
* guix/build-system/python.scm (lower): Likewise.
* guix/build-system/ruby.scm (lower): Likewise.
* guix/build-system/trivial.scm (lower): Likewise.
* guix/build-system/gnu.scm (lower): Initialize 'system' and 'target'
  fields.
* guix/packages.scm (bag->derivation, bag->cross-derivation): New
  procedures.
  (package-derivation, package-cross-derivation): Use 'bag->derivation'.
* tests/packages.scm ("search paths"): Initialize 'system' and 'target'
  fields.
  ("package->bag", "package->bag, cross-compilation", "bag->derivation",
  "bag->derivation, cross-compilation"): New tests.
2014-10-05 21:58:42 +02:00
Ludovic Courtès
b4469d8c12 gnu: cross-base: Use the right dynamic linker name.
* gnu/packages/cross-base.scm (cross-gcc-arguments): Parametrize
  %CURRENT-TARGET-SYSTEM.
* tests/monads.scm ("package-file + package->cross-derivation"): Replace
  "foo64-gnu" with "mips64el-linux-gnu".
2014-10-05 21:58:42 +02:00
Ludovic Courtès
0d5a559f0f 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.
2014-10-05 21:58:42 +02:00
Ludovic Courtès
5e1103821a utils: Add 'strip-keyword-arguments'.
* guix/utils.scm (strip-keyword-arguments): New procedure.
* tests/utils.scm ("strip-keyword-arguments"): New test.
2014-10-05 21:57:19 +02:00
Ludovic Courtès
4a44d7bbc6 ui: Recognize the same size units as Coreutils.
* guix/ui.scm (size->number): Add a bunch of large units.  Recognize
  one-letter unit names.  Change "KB" to "kB".
* tests/ui.scm ("size->number, 1T"): New test.
* doc/guix.texi (Invoking guix gc): Add cross-reference to "Block size"
  in the Coreutils manual.
  (Invoking guix system): Likewise.
2014-10-03 18:03:09 +02:00
Ludovic Courtès
882383a9aa download: Allow raw file names or file:// URLs.
* guix/download.scm (url-fetch): When URL is a string, if it's not a URI
  or if it's a URI with 'file' or #f scheme, use 'add-to-store'.
* tests/builders.scm ("url-fetch, file", "url-fetch, file URI"): New
  tests.
2014-10-03 18:03:09 +02:00
David Thompson
1b3e968512 import: Add PyPI importer.
* guix/snix.scm: Delete.
* guix/import/snix.scm: New file.
* guix/import/pypi.scm: New file.
* guix/import/utils.scm: New file.
* guix/scripts/import/nix.scm: New file.
* guix/scripts/import/pypi.scm: New file.
* tests/pypi.scm: New file.
* tests/snix.scm: Import (guix import snix) module.
* guix/scripts/import.scm (%default-options, %options): Delete.
  (%standard-import-options, importers): New variables.
  (show-help): List importers.
  (guix-import): Factor out Nix-specific logic.  Delegate to correct importer
  based upon first argument.
* configure.ac (HAVE_GUILE_JSON): New conditional.
* Makefile.am (MODULES): Add new files and remove 'guix/snix.scm'.
  (SCM_TESTS): Add 'tests/pypi.scm' if guile-json is installed.
2014-09-29 19:30:28 -04:00
Ludovic Courtès
8689901f95 Introduce the 'GUIX_PACKAGE_PATH' environment variable.
* gnu/packages.scm (%package-module-path): Honor $GUIX_PACKAGE_PATH.
* test-env.in: Unset 'GUIX_PACKAGE_PATH'.
* tests/guix-package.sh: Test it.
* doc/guix.texi (Package Modules): Document it.
2014-09-24 14:06:09 +02:00
Ludovic Courtès
300868ba57 guix build: Add -L/--load-path as a common option.
* guix/scripts/build.scm (show-build-options-help): Document -L.
  (%standard-build-options): Add -L/--load-path.
* tests/guix-package.sh: Test it.
2014-09-24 14:06:09 +02:00
Ludovic Courtès
f07aa672fd Merge branch 'core-updates' 2014-09-22 23:06:33 +02:00
Ludovic Courtès
715fc9d44d syscalls: Add 'swapon' and 'swapoff'.
* guix/build/syscalls.scm (swapon, swapoff): New procedures.
* tests/syscalls.scm ("swapon, ENOENT/EPERM", "swapoff, EINVAL/EPERM"):
  New tests.
2014-09-18 20:19:56 +02:00
Ludovic Courtès
4d54785c69 syscalls: Add 'all-network-interfaces'.
* guix/build/syscalls.scm (network-interfaces): Update docstring.
  (%interface-line): New variable.
  (all-network-interfaces): New procedure.
* tests/syscalls.scm ("all-network-interfaces"): New test.
  ("network-interfaces"): Change to make sure the result is a subset
  of (all-network-interfaces).
2014-09-14 23:49:02 +02:00
Ludovic Courtès
973eea3478 syscalls: Add 'network-interface-flags'.
* guix/build/syscalls.scm (SIOCGIFFLAGS, IFF_UP, IFF_BROADCAST,
  IFF_LOOPBACK, IF_NAMESIZE): New variables.
  (network-interface-flags, loopback-network-interface?): New
  procedures.
* tests/syscalls.scm ("network-interface-flags",
  "loopback-network-interface?"): New tests.
2014-09-14 23:49:02 +02:00
Ludovic Courtès
7585016f53 syscalls: Add 'network-interfaces'.
* guix/build/syscalls.scm (SIOCGIFCONF, ifconf-struct,
  ifreq-struct-size): New variables.
  (%ioctl, bytevector->string-list, network-interfaces): New
  procedures.
* tests/syscalls.scm ("network-interfaces"): New test.
2014-09-14 23:49:02 +02:00