Commit Graph

1630 Commits (eb097f36b1c3e7a25f1ce212670e8a19788fd195)

Author SHA1 Message Date
Mark H Weaver 2e9511dfbd packages: patch-and-repack: Build tarballs deterministically.
* guix/packages.scm (patch-and-repack)[build]: When invoking 'tar' to repack
  the archive, pass "--mtime=@0", "--owner=root:0", and "--group=root:0".
2015-07-14 19:41:20 -04:00
Mark H Weaver 3c7d023d64 build-system/gnu: Pass --build=<triplet> to configure by default.
* guix/build-system/gnu.scm (gnu-build, gnu-cross-build): Accept #:build
  keyword argument.  Pass it to 'gnu-build' on the build side.
* guix/build/gnu-build-system.scm (configure): Accept #:build keyword
  argument.  Unless it is false, pass --build to configure.
2015-07-13 18:54:40 -04:00
Ludovic Courtès ef8f910fce substitute: Improve functional decomposition.
* guix/scripts/substitute.scm (display-narinfo-data,
  process-query, process-substitution): New procedures.  Code moved from...
  (guix-substitute): ... here.  Use them.
2015-07-13 18:29:01 +02:00
Ludovic Courtès f8a8e0fe16 guix build: Add '--substitute-urls' client option.
* guix/scripts/build.scm (%standard-build-options,
  show-build-options-help): Add --substitute-urls=URLS.
  (set-build-options-from-command-line): Honor it.
* guix/store.scm (%default-substitute-urls): Make public.
* doc/guix.texi (Substitutes): Add xref to the client --substitute-urls
  option.
  (Invoking guix build): Document it.
  (Invoking guix-daemon): Add 'daemon-substitute-urls' anchor.
2015-07-13 18:29:01 +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 895d1eda54 substitute: Store cached narinfo in cache-specific sub-directories.
This ensures that switching between different substitute servers doesn't lead
to a polluted narinfo cache.

* guix/scripts/substitute.scm (narinfo-cache-file): Add 'cache-url'
  parameter.  Add the base32 of CACHE-URL as a sub-directory under
  %NARINFO-CACHE-DIRECTORY.  Update callers.
  (cached-narinfo): Likewise.  Call 'mkdir-p' on the dirname of the cache
  file.  Update callers.
  (remove-expired-cached-narinfos): Add 'directory' parameter and use it
  instead of %NARINFO-CACHE-DIRECTORY.
  (narinfo-cache-directories): New procedure.
  (maybe-remove-expired-cached-narinfo): Call 'remove-expired-cached-narinfos'
  for each item returned by 'narinfo-cache-directories'.
2015-07-13 18:29:01 +02:00
Ludovic Courtès 074efd63a8 substitute: Pass the cache URL instead of <cache> objects.
* guix/scripts/substitute.scm (<cache>): Rename to...
  (<cache-info>): ... this.
  (open-cache): Rename to...
  (download-cache-info): ... this.  Return a <cache-info> or #f.
  (open-cache*): Remove.
  (cache-narinfo!): Take a URL instead of a <cache> as the first parameter.
  (fetch-narinfos): Likewise.  Call 'download-cache-info'.  Remove use of
  'force'.
  (guix-substitute): Replace calls to 'open-cache*' with %CACHE-URL.
2015-07-13 18:29:01 +02:00
Ludovic Courtès e4e099feca substitute: Remove unneeded conditionals.
* guix/scripts/substitute.scm (guix-substitute): Remove unneeded (if cache
  ...) forms since CACHE is always true (it's a promise.)
2015-07-13 18:29:01 +02:00
Alex Kost 663d0733c8 guix lint: Remove duplicated module lines.
* guix/scripts/lint.scm (guix): Remove duplicated lines for using
  'srfi-34' and 'srfi-35' modules.  These lines were introduced twice by
  commits b210b35 and 002c57c.
2015-07-13 10:20:34 +03:00
Ludovic Courtès 161094c8e2 packages: Rewrite 'transitive-inputs' to be linear and remove duplicates.
There were two issues:

  1. Use of 'delete-duplicates', which is quadratic, was a serious problem for
     closures with lots of propagated inputs, such as that of the 'hydra'
     package (several minutes for 'guix build hydra -n'!).

  2. The 'delete-duplicates' call essentially had no effect since duplicate
     inputs typically had a different label and were thus kept.  For
     instance, (bag-transitive-inputs (package->bag inkscape)) would return
     216 items whereas (delete-duplicates (map cdr THAT)) contains only 67
     items.

     The new implementation returns 67 items in this case.  For 'hydra', we're
     down from 42211 items to 361, and roughly 13s for 'guix build hydra'.

* guix/packages.scm (transitive-inputs): Rewrite as a breadth-first
  traversal.  Remove duplicate propagated inputs.
* tests/packages.scm ("package-transitive-inputs", "package->bag, propagated
  inputs"): Adjust to use simple labels for propagated inputs, without "/".
  ("package-transitive-inputs, no duplicates"): New test.
2015-07-12 01:27:00 +02:00
Ludovic Courtès b19649a132 offload: Add 'ssh-options' field to <build-machine>.
* guix/scripts/offload.scm (<build-machine>)[ssh-options]: New field.
  (remote-pipe): Use it.
  (send-files): Likewise.
2015-07-09 11:59:26 +02:00
Federico Beffa d8b6fcdeda import: cabal: Make token recognition case-insensitive.
* guix/import/cabal.scm (make-rx-matcher): Add optional parameter FLAG.
  (is-property, is-flag, is-src-repo, is-exec, is-test-suite, is-benchmark,
  is-lib, is-else, is-if): Make test case-insensitive.
2015-07-08 10:53:05 +02:00
Federico Beffa e9137a5310 build: Add 'emacs-build-system'.
* Makefile.am (MODULES): Add 'guix/build-system/emacs.scm' and
  'guix/build/emacs-build-system.scm'.
* guix/build-system/emacs.scm: New file.
* guix/build/emacs-build-system.scm: New file.
* doc/guix.texi (Build Systems): Document it.
2015-07-08 10:53:05 +02:00
Federico Beffa 1d44b4e544 build: emacs-utils: Add 'emacs-byte-compile-directory'.
* guix/build/emacs-utils.scm (emacs-byte-compile-directory): New procedure.
2015-07-08 10:53:05 +02:00
Federico Beffa 7f74a931dd import: Add 'elpa' importer.
* guix/import/elpa.scm: New file.
* guix/scripts/import.scm: Add "elpa" to 'importers'.
* guix/scripts/import/elpa.scm: New file.
* Makefile.am (MODULES): Add 'guix/import/elpa.scm' and
  'guix/scripts/import/elpa.scm'.
  (SCM_TESTS): Add 'tests/elpa.scm'.
* doc/guix.texi (Invoking guix import): Document it.
* tests/elpa.scm: New file.
* po/guix/POTFILES.in: Add 'guix/scripts/import/elpa.scm'.
2015-07-08 10:53:05 +02:00
David Thompson 9110c2e942 gnu: system: Move <file-system-mapping> into (gnu system file-systems).
* gnu/system/vm.scm (<file-system-mapping>, %store-mapping): Move from here...
* gnu/system/file-systems.scm: ...to here.
* guix/scripts/system.scm: Import (gnu system file-systems).
2015-07-07 21:20:59 -04:00
David Thompson df3ce5c123 build: syscalls: Add pivot-root.
* guix/build/syscalls.scm (pivot-root): New procedure.
* tests/syscalls.scm ("pivot-root"): New test.
2015-07-07 21:16:25 -04:00
David Thompson 43ace6ea76 build: syscalls: Add setns.
* guix/build/syscalls.scm (setns): New procedure.
* tests/syscalls.scm ("setns"): New test.

squash: setns
2015-07-07 20:55:09 -04:00
David Thompson 8950ed11c6 build: syscalls: Add clone.
* guix/build/syscalls.scm (clone): New procedure.
  (CLONE_NEWNS, CLONE_NEWUTS, CLONE_NEWIPC, CLONE_NEWUSER, CLONE_NEWPID,
  CLONE_NEWNET): New variables.
* tests/syscalls.scm ("clone"): New test.
2015-07-07 20:35:08 -04:00
David Thompson db6e5e2b2c utils: Add call-with-temporary-directory.
* guix/utils.scm (call-with-temporary-directory): New procedure.
2015-07-07 18:47:25 -04:00
David Thompson b4abdeb63b build: syscalls: Add mkdtemp!
* guix/build/syscalls.scm (mkdtemp!): New procedure.
* tests/syscalls.scm ("mkdtemp!"): New test.
2015-07-07 18:46:44 -04:00
David Thompson b16d138a0a build: syscalls: Add unmount flags.
* guix/build/syscalls.scm (MNT_FORCE, MNT_DETACH, MNT_EXPIRE)
  (UMOUNT_NOFOLLOW): New variables.
2015-07-07 18:38:41 -04:00
David Thompson 577c02eb40 build: syscalls: Add additional mount flags.
* guix/build/syscalls.scm (MS_NOSUID, MS_NODEV, MS_NOEXEC, MS_STRICTATIME):
  New variables.
2015-07-07 18:38:41 -04:00
Ludovic Courtès a8afb9aed3 store: 'run-with-store' initializes %CURRENT-TARGET-SYSTEM to #f.
* guix/store.scm (run-with-store): Set %CURRENT-TARGET-SYSTEM to #f.
* tests/gexp.scm ("gexp->derivation vs. %current-target-system"): New test.
2015-07-08 00:06:45 +02:00
pjotrp 76ae915ec8 build: ruby: Run 'rake gem' when gemspec is missing.
* guix/build/ruby-build-system.scm (build): Run 'rake gem' when there is no
  gemspec in the source tree.

Co-Authored-By: David Thompson <davet@gnu.org>
2015-07-07 08:54:29 -04:00
Andy Patterson 075d99f195 substitute: Avoid infinite loop when updating the substitute list.
Reported
at <http://lists.gnu.org/archive/html/guix-devel/2015-07/msg00119.html>.

* guix/scripts/substitute.scm (http-multiple-get): When RESP has "Connection:
  close", consume HEAD anyway; always call PROC to read from BODY.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2015-07-07 01:04:02 +02:00
Andreas Enge 9884d7ec8e download: Reference tls instead of renamed gnutls module.
* guix/download.scm (gnutls-package): Use new module name tls instead
  of gnutls.
2015-07-05 19:11:04 +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
Cyril Roelandt d2cef629fd scripts: environment: Return the exit status of the command.
* guix/scripts/environment.scm (guix-environment): Return the exit
  status of the command.
2015-07-02 21:47:24 +02:00
Ludovic Courtès 28de8d258b environment: Define 'GUIX_ENVIRONMENT'.
* guix/scripts/environment.scm (create-environment): Define 'GUIX_ENVIRONMENT'.
* doc/guix.texi (Invoking guix environment): Document it.
* gnu/system/shadow.scm (default-skeletons): Adjust 'PS1' depending on whether
  'GUIX_ENVIRONMENT' is defined.
2015-07-01 23:29:49 +02:00
Ludovic Courtès d70389c423 environment: Improve error reporting for '-l'.
This fixes two problems:

  1. Load errors would print an ugly backtrace.
  2. When FILE was an absolute name, 'load' was passed an incorrect file
     name.

* guix/scripts/environment.scm (options/resolve-packages): Use 'load*' instead
  of 'load'.
2015-07-01 23:29:49 +02:00
Ludovic Courtès 417c39f132 environment: For --ad-hoc, allow users to specify an output.
* guix/scripts/environment.scm (package+propagated-inputs): Add 'output'
  parameter.  Use it in return value.
  (options/resolve-packages): Use 'append-map' instead of 'map'.  For 'load'
  and 'expression', return all the outputs of the resulting package.  For
  'package', use 'specification->package+output' instead of
  'specification->package'.
  (guix-environment): Adjust uses of PACKAGES accordingly.
* doc/guix.texi (Invoking guix environment): Document it.
* tests/guix-environment.sh: Add test for --ad-hoc guile-bootstrap:out.
2015-07-01 23:29:49 +02:00
Ludovic Courtès ce367ef3a9 environment: Add --system.
* guix/scripts/environment.scm (show-help, %options): Add -s/--system.
  (%default-options): Add 'system' pair.
  (guix-environment): Pass 'system' value from OPTS to 'lower-inputs'.
* doc/guix.texi (Invoking guix environment): Document it.
2015-07-01 23:29:49 +02:00
Ludovic Courtès 6b6298ae39 environment: Add only the specified outputs of the dependencies.
Before that, 'guix environment guile' (for instance) would define environment
variables that would refer to the "include" output of Bash, the "debug" output
of libgc, etc., even though these are not listed as inputs in the recipe of
'guile'.

* guix/gexp.scm (lower-inputs): Export.
* guix/scripts/environment.scm (evaluate-input-search-paths): Remove
  'derivations' parameter; add 'search-paths'.  Expect 'inputs' to be
  a list of tuples.  Adjust callers.
  (create-environment): Remove 'derivations' parameter; add 'search-paths'.
  (show-search-paths): Likewise.
  (package+propagated-inputs): New procedure.
  (packages->transitive-inputs, packages+propagated-inputs): Remove.
  (build-inputs): Expect INPUTS to be a list of derivation tuples.
  (guix-environment): Compute INPUTS using 'package+propagated-inputs',
  'package->bag', and 'bag-transitive-inputs'.  Move 'run-with-store' higher.
* tests/guix-environment.sh: Add test with FINDUTILS-BOOT0.
2015-07-01 23:29:49 +02:00
Cyril Roelandt ff986890ec import: pypi: Detect inputs.
* guix/import/pypi.scm (python->package-name, maybe-inputs, compute-inputs,
  guess-requirements): New procedures.
* guix/import/pypi.scm (guix-hash-url): Now takes a filename instead of an
  URL as input.
* guix/import/pypi.scm (make-pypi-sexp): Now tries to generate the inputs
  automagically.
* tests/pypi.scm: Update the test.
2015-06-24 22:47:59 +02:00
Ludovic Courtès eae5b3fff5 linux-initrd: Produce cpio archives with zeroed timestamps, etc.
* guix/cpio.scm (file->cpio-header*): New procedure.
* gnu/build/linux-initrd.scm (write-cpio-archive): Add #:file->header argument
  to 'cpio:write-cpio-archive'.
2015-06-24 18:05:03 +02:00
Ludovic Courtès 7a18c3cc10 Add (guix cpio).
* guix/cpio.scm, tests/cpio.scm: New files.
* Makefile.am (MODULES): Add guix/cpio.scm.
  (SCM_TESTS): Add tests/cpio.scm.
2015-06-24 18:05:03 +02:00
Ludovic Courtès 8de3df72bc tests: Move 'file=?' to (guix tests).
* tests/nar.scm (file-tree-equal?)[file=?]: Move to...
* guix/tests.scm (file=?): ... here.  New procedure.
2015-06-24 18:05:03 +02:00
Mark H Weaver e5c35d9a7b licenses: Add the SGI Free Software License B, version 2.0.
* guix/licenses.scm (sgifreeb2.0): New variable.
2015-06-23 01:04:53 -04:00
Ludovic Courtès a8f996c605 size: Add '--map-file' option.
* guix/scripts/size.scm (profile->page-map): New procedures.
  (show-help, %options):  Add --map-file.
  (guix-size): Honor it.
* doc/guix.texi (Invoking guix size): Document it.
* doc/images/coreutils-size-map.png: New file.
* doc.am (dist_infoimage_DATA): Add it.
2015-06-21 23:39:12 +02:00
Ludovic Courtès a8aa84af39 size: Remove unused variables.
* guix/scripts/size.scm (ensure-store-item): Remove #:dry-run? parameter.
  (%options): Remove 'dry-run?' variable.
2015-06-21 23:39:11 +02:00
Mark H Weaver bf76d98789 Merge branch 'master' into core-updates 2015-06-21 14:30:22 -04:00
Ludovic Courtès 7833db1f30 gexp: 'local-file' canonicalizes its file argument.
Reported by Alex Kost <alezost@gmail.com>
at <http://lists.gnu.org/archive/html/guix-devel/2015-06/msg00235.html>.

* guix/gexp.scm (local-file): Add call to 'canonicalize-path'.
* tests/gexp.scm ("one local file, symlink"): New test.
2015-06-19 10:23:29 +02:00
Ludovic Courtès 69792b285c store: Memoize 'add-to-store' based on the result of 'lstat', not 'stat'.
* guix/store.scm (add-to-store): Change 'stat' call to 'lstat'.  Clarify
  docstring.
2015-06-19 10:23:29 +02:00
Ludovic Courtès 020f3e4156 gexp: 'local-file' now defaults to non-recursive.
Reported by Alex Kost <alezost@gmail.com>
at <http://lists.gnu.org/archive/html/guix-devel/2015-06/msg00235.html>.

* guix/gexp.scm (local-file): Change #:recursive? to default to #f.
* tests/gexp.scm ("one local file", "gexp->derivation, local-file"): Adjust
  calls to 'add-to-store' and 'interned-file' accordingly.
2015-06-19 10:23:28 +02:00
Mark H Weaver 2abf678682 Merge branch 'master' into core-updates 2015-06-18 01:32:37 -04:00
Ludovic Courtès fcc58db68b Add 'guix size'.
* guix/scripts/size.scm: New file.
* Makefile.am (MODULES): Add it.
  (SCM_TESTS): Add tests/size.scm.
* doc.am (SUBCOMMANDS): Add 'size'.
* po/guix/POTFILES.in: Add guix/scripts/size.scm.
* tests/size.scm: New file.
* doc/guix.texi (Packages with Multiple Outputs): Add xref to "Invoking guix
  size".
  (Invoking guix size): New node.
  (Invoking guix gc): Add index for "closure" and xref to the above.
* doc/contributing.texi (Submitting Patches): Use @enumerate for the check
  list.  Add item about 'guix size'.
2015-06-18 00:36:09 +02:00
Ludovic Courtès 39bee8a293 Add 'guix edit'.
* guix/scripts/edit.scm: New file.
* Makefile.am (MODULES): Add it.
* doc.am (SUBCOMMANDS): Add 'edit'.
* doc/guix.texi (Defining Packages): Add xref to "Invoking guix edit".
  (Invoking guix edit): New node.
* po/guix/POTFILES.in: Add it.
2015-06-18 00:25:49 +02:00
Ludovic Courtès 84189ebc66 Move 'specification->package+output' to (gnu packages).
* guix/scripts/package.scm (specification->package+output): Move to...
* gnu/packages.scm (specification->package+output): ... here
* guix/scripts/archive.scm (guix): Adjust accordingly.
2015-06-18 00:25:48 +02:00
Mark H Weaver 2c04921634 offload: Fix sorting bug in 'choose-build-machine'.
* guix/scripts/offload.scm (choose-build-machine)[undecorate]: Return the
  boolean result of pred instead of the best machine+slot.
2015-06-17 15:33:08 -04:00
Ludovic Courtès 55d1f529e1 gnu-maintenance: Use 'home-page' as an additional hint of "GNUness".
Reported by Rastus_Vernon on IRC.
Fixes 'gnu-package?' for GNUcash.

* guix/gnu-maintenance.scm (gnu-package?)[gnu-home-page?]: New procedure.  Use
  it to determine whether PACKAGE is GNU.
2015-06-16 10:31:12 +02:00
Mark H Weaver bcf2971f6e Merge branch 'master' into core-updates
Conflicts:
	gnu/packages/commencement.scm
	gnu/packages/xml.scm
2015-06-14 08:49:42 -04:00
Eric Bavier 6508ce55e9 build-system/haskell: install config for any package that creates it.
A Cabal package is allowed to declare an "empty" library, in an
otherwise executable-only package, for the purpose of allowing Cabal
to use it as a dependency for other packages.  See e.g. hspec-discover.

* guix/build/haskell-build-system.scm (register): Unconditionally call
  setup script with "register", and install any config file generated.
2015-06-11 18:55:49 -05:00
Eric Bavier b4b1fe9d2f profiles: Process ghc conf files only once.
A package may be listed in the manifest inputs multiple times.  Avoid
copying ghc *.conf files twice by deleting duplicates.

* guix/profiles.scm (ghc-package-cache-file)[conf-files]: Delete
  duplicate manifest inputs before copying conf files.
2015-06-11 18:55:48 -05:00
Eric Bavier 84de458ba8 profiles: Search for ghc conf files only if package db exists.
This avoids having 'find-files' report warnings about searching in
non-existent directories.

* guix/profiles.scm (ghc-package-cache-file)[conf-files]: Only search
  for *.conf files if the search directory exists.
2015-06-11 18:55:48 -05:00
Ludovic Courtès ad7c1a2cde records: Remove unnecessary 'begin'.
* guix/records.scm (define-record-type*): Remove unnecessary 'begin'.
2015-06-11 23:33:32 +02:00
Ludovic Courtès 79477def6b tests: Write the random seed to the error port.
* guix/tests.scm (random-seed): New procedure.
  (%seed): Use it, and write the random seed to the error port.
2015-06-11 23:33:32 +02:00
Ludovic Courtès 0004c5904c packages: Make 'location' field innate.
* guix/packages.scm (<package>)[location]: Add 'innate' property.
* guix/build-system/gnu.scm (static-package): Remove 'loc' parameter and
  'location' field.
* gnu/packages/autotools.scm (autoconf-wrapper): Remove 'location' field.
* gnu/packages/commencement.scm (gnu-make-boot0, diffutils-boot0, gcc-final):
  Likewise.
* gnu/packages/cross-base.scm (cross): Likewise.
* gnu/packages/emacs.scm (emacs-no-x, emacs-no-x-toolkit): Likewise.
* gnu/packages/make-bootstrap.scm (tarball-package): Likewise.
* gnu/packages/maths.scm (petsc-complex): Likewise.
2015-06-11 23:33:32 +02:00
Ludovic Courtès 8a16d064fa records: Add support for 'innate' fields.
* guix/records.scm (make-syntactic-constructor): Add #:innate parameter.
  [record-inheritance]: Honor it.
  [innate-field?]: New procedure.
  (define-record-type*)[innate-field?]: New procedure.
  Pass #:innate to 'make-syntactic-constructor'.
* tests/records.scm ("define-record-type* & inherit & innate",
  "define-record-type* & thunked & innate"): New tests.
2015-06-11 23:33:32 +02:00
Ludovic Courtès 792798f486 records: "options" → "properties".
* guix/records.scm (define-record-type*): Change "options" to "properties".
2015-06-11 23:33:32 +02:00
Ludovic Courtès faef3b6a96 records: Factorize field property predicates.
* guix/records.scm (define-field-property-predicate): New macro.
  (define-record-type*)[thunked-field?, delayed-field?]: Use it.
2015-06-11 23:33:32 +02:00
Ludovic Courtès b9c8647337 records: Separate default-value handling.
* guix/records.scm (make-syntactic-constructor)[default-values]: New
  variable.
  [field-default-value]: New procedure.
  Use them.
2015-06-11 23:33:32 +02:00
Ludovic Courtès 39fc041a7d records: Replace 'eval-when' with a proper 'define-syntax'.
* guix/records.scm (make-syntactic-constructor): Remove enclosing
  'eval-when'.  Turn into a 'syntax-rules' macro.
2015-06-11 23:33:32 +02:00
Ludovic Courtès a43b55f1a6 guix build: Allow directories to be passed to --with-source.
* guix/scripts/build.scm (package-with-source)[tarball-base-name]: Gracefully
  handle file names that lack an extension.
  Pass #:recursive? #t to 'download-to-store'.
* guix/download.scm (download-to-store): Add #:recursive? parameter and pass
  it to 'add-to-store'.
* doc/guix.texi (Invoking guix build): Add an example of --with-source with a
  directory.
2015-06-11 11:19:12 +02:00
Ludovic Courtès c2590362ad environment: Connect to the store after the command line has been parsed.
* guix/scripts/environment.scm (guix-environment): Call 'parse-command-line'
  outside of 'with-store'.  This allows things like --help to run even if the
  daemon is not running.
2015-06-11 11:09:12 +02:00
Mark H Weaver 1492801655 Merge branch 'master' into core-updates 2015-06-10 17:50:27 -04:00
Ludovic Courtès 78acff7c11 guix system: init: Overwrite the items in the target store.
Fixes <http://bugs.gnu.org/20722>.
Reported by Eric Bavier <ericbavier@openmailbox.org>.

* guix/scripts/system.scm (copy-item): Check whether DEST exists and remove it
  if it does.
2015-06-10 10:31:47 +02:00
Ludovic Courtès 7522a0160b ui: Replace the global 'symlink' binding.
* guix/ui.scm (symlink): Set! the global symlink.
2015-06-10 10:25:16 +02:00
Federico Beffa a415474873 import: hackage: Refactor parsing code and add new options.
* guix/import/cabal.scm: New file.
* guix/import/hackage.scm: Update to use the new Cabal parsing module.
* tests/hackage.scm: Update tests.
* guix/scripts/import/hackage.scm: Add new '--cabal-environment' and '--stdin'
  options.
* doc/guix.texi: ... and document them.
* Makefile.am (MODULES): Add 'guix/import/cabal.scm',
  'guix/import/hackage.scm' and 'guix/scripts/import/hackage.scm'.
  (SCM_TESTS): Add 'tests/hackage.scm'.
2015-06-09 09:48:38 +02:00
Ludovic Courtès 751630c9c3 monads: Allow n-ary '>>=' expressions.
Suggested by Federico Beffa <beffa@fbengineering.ch>.

* guix/monads.scm (bind-syntax): New macro.
  (with-monad): Use it instead of 'identifier-syntax'.
* tests/monads.scm (">>= with more than two arguments"): New test.
* doc/guix.texi (The Store Monad): Explain that there can be several MPROC.
  Add an example.
2015-06-08 23:00:49 +02:00
Alex Kost 2a4e2e4b01 guix: Clean up --help messages.
* guix/scripts/import.scm (show-help): Add newline before a list of
  importers.
* guix/scripts/lint.scm (show-help): Split a long description line.
* guix/scripts/package.scm (show-help): Improve docstrings for --install
  and --remove options.
* guix/scripts/system.scm (show-help): Format actions the same way as
  guix commands and importers are formatted.
2015-06-08 11:46:05 +03:00
Ludovic Courtès 7770aafc75 guix gc: Add '--verify'.
* guix/scripts/gc.scm (show-help, %options): Add --verify.
  (guix-gc): Handle it.
* doc/guix.texi (Invoking guix gc): Document --verify, and move --optimize
  description right below it.
2015-06-06 19:05:56 +02:00
Ludovic Courtès c63d94035f store: Add 'verify-store' RPC.
* guix/store.scm (operation-id): Add 'verify-store'.
  (verify-store): New procedure.
  (set-build-options): Adjust comment.
* tests/store.scm ("verify-store", "verify-store + check-contents"): New
  tests.
2015-06-06 19:05:25 +02:00
Alex Kost d2aa12250e guix package: Fix typo in --help message.
* guix/scripts/package.scm (show-help): Align '--show' option properly.
2015-06-06 18:32:03 +03:00
Mark H Weaver c058f4eca2 licenses: Add the Open Publication License 1.0.
* guix/licenses.scm (opl1.0+): New variable.
2015-06-05 00:58:53 -04:00
Ludovic Courtès 558e8b11d7 gexp: Add 'plain-file'.
* guix/gexp.scm (<plain-file>): New type.
  (plain-file, plain-file-compiler): New procedures.
* tests/gexp.scm ("one plain file"): New test.
* doc/guix.texi (G-Expressions): Document 'plain-file'.
2015-06-03 11:47:36 +02:00
Ludovic Courtès 74d441abee gexp: Export <local-file> accessors.
* guix/gexp.scm (local-file-file, local-file-name, local-file-recursive?):
  Export.
2015-06-03 11:47:36 +02:00
Ludovic Courtès d7bc3470b7 gnu-maintenance: latest-release: Honor releases that are not in subdirs.
Reported by Mark H Weaver.

* guix/gnu-maintenance.scm (latest-release): Add 'result' parameter to
  'loop'.  When entering a sub-directory, use the current directory's latest
  release as 'result'.  This fixes the code for 'gnu-pw-mgr' and 'sharutils'.
2015-06-02 21:55:30 +02:00
Ludovic Courtès 2b5115f8ba lint: source: Warn only when all the URIs are unreachable.
* guix/scripts/lint.scm (call-with-accumulated-warnings): New procedure.
  (with-accumulated-warnings): New macro.
  (check-source): Add 'try-uris' and use it.  Emit warnings only upon
  failure.
2015-05-31 23:25:46 +02:00
Ludovic Courtès 91a0b9cc0b lint: 'validate-uri' really returns #f on failure.
* guix/scripts/lint.scm (validate-uri): Always return #f on failure.
2015-05-31 23:13:09 +02:00
Ludovic Courtès 1a706ff5cf base32: Use a custom error condition instead of 'misc-error'.
Suggested by Christopher Allan Webber <cwebber@dustycloud.org>.

* guix/base32.scm (&invalid-base32-character): New error condition.
  (make-base32-string->bytevector): Use it instead of 'error'.
* tests/base32.scm ("&invalid-base32-character"): New test.
2015-05-31 22:39:48 +02:00
Ludovic Courtès 23185ceadc ui: Do not call 'display-error' for SRFI-34 exceptions.
* guix/ui.scm (report-load-error, warn-about-load-error, read/eval): Add
  clause for SRFI-34 exceptions.
2015-05-31 22:39:48 +02:00
Alex Kost 307153c1ef emacs: Report about "search paths" after operation.
* guix/scripts/package.scm: Export 'display-search-paths'.
* emacs/guix-main.scm (process-package-actions): Use it.
2015-05-29 20:54:54 +03:00
David Thompson a54bd6d72d guix environment: Add --ad-hoc option.
* guix/scripts/environment.scm (%options): Add "ad-hoc" option.
  (show-help): Display help for "--ad-hoc".
  (packages+propagated-inputs): New procedure.
  (guix-environment): Create ad hoc environment when asked.
* doc/guix.texi ("invoking guix environment"): Document it.
2015-05-28 20:52:52 -04:00
Ludovic Courtès 1ba4796d13 profiles: Deal with non-directory items in share/icons.
Reported by Mark H Weaver <mhw@netris.org>.

* guix/profiles.scm (gtk-icon-themes)[build]: Check whether DIR is a directory
  before calling 'ensure-writable-directory'.
2015-05-28 14:41:15 +02:00
Ludovic Courtès 6a669bda51 profiles: Export 'ensure-writable-directory' and use it.
* guix/build/profiles.scm (ensure-writable-directory): Export.
* guix/profiles.scm (gtk-icon-themes)[build]: Remove '@@' form and use (guix
  build profiles).
2015-05-27 22:36:52 +02:00
Ludovic Courtès 102f7101b9 profiles: Don't assume all the inputs are of a package are packages.
Reported by Ricardo Wurmus.

* guix/profiles.scm (gtk-icon-themes)[entry-lookup-gtk+](find-among-packages):
  Rename to...
  (find-among-inputs): ... this.  Check whether INPUT is a package before
  calling 'package-name'.  Fixes a regression introduced in b04af0e.
2015-05-27 22:31:56 +02:00
宋文武 eeae0b3c6c profiles: Use 'derivation?' to filter hooks.
Fixes a regression introduced in 07eaecfa.

* guix/profiles.scm (profile-derivation): Use 'derivation?' instead of
  'gexp?' to filter hooks.
2015-05-27 21:03:21 +08:00
宋文武 b04af0ec67 profiles: Add gtk-icon-themes hook.
* guix/profiles.scm (gtk-icon-themes): New function.
  (%default-profile-hooks): Add it.
2015-05-27 20:58:27 +08:00
Ludovic Courtès b734996f9c monads: 'foldm', 'mapm', and 'anym' now take a list of regular values.
* guix/monads.scm (foldm, mapm, anym): Change to take a list of regular
  values as is customary.
* tests/monads.scm ("mapm", "anym"): Adjust accordingly.
2015-05-27 09:44:43 +02:00
Ludovic Courtès 07eaecfae1 profiles: Hooks always return a monadic value.
Suggested by 宋文武 <iyzsong@gmail.com>.

* guix/profiles.scm (ghc-package-cache-file): Return a monadic #f, not just
  #f, when MANIFEST contains no GHC package.
  (profile-derivation): Do not filter based on the return value of HOOK;
  instead filter based on the value of items in EXTRAS.
2015-05-26 23:38:27 +02:00
Ludovic Courtès 41766807d0 ui: Improve error reporting for 'read/eval'.
The effect is visible on commands like:

  guix build -e '(+ 2 "foo")'
  guix build -e '()'

* guix/ui.scm (read/eval): Change handler to properly report syntax errors and
  use 'display-error' for other errors.
2015-05-26 22:38:17 +02:00
Cyrill Schenkel cdb5b075d5 gc: ignore trailing slash or subdirectories for `guix gc -d'
Fixes <http://bugs.gnu.org/19757>.

* guix/scripts/gc.scm (guix-gc): Convert paths to direct store paths.
* guix/store.scm (direct-store-path): Get rid of subdirectories in store path.
* tests/guix-gc.sh: New tests.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2015-05-26 22:26:01 +02:00
Ludovic Courtès db030303b8 guix system: Add '--on-error'.
* guix/ui.scm (load*): Add #:on-error parameter.
  [tag, error-string]: New variables.
  Wrap 'load' call in 'call-with-prompt'.  Pass TAG to 'make-stack'.  Honor
  ON-ERROR after 'report-load-error' call.
  (report-load-error): Change to not exit on error.  Make private.
* guix/scripts/system.scm (show-help, %options): Add --on-error.
  (guix-system): Use 'load*' and pass it #:on-error.
2015-05-25 22:52:41 +02:00
Ludovic Courtès 5f1087c481 guix package: --manifest DTRT when combined with --dry-run.
* guix/scripts/package.scm (guix-package)[process-actions]: Process 'manifest
  action regardless of whether 'dry-run? is set.  Adjust the message
  accordingly.
* tests/guix-package.sh: Add error-reporting test.
2015-05-25 21:34:23 +02:00
Ludovic Courtès 2abcc97fd1 ui: Auto-compile user code, and improve error reporting.
Reported by Christian Grothoff.

* guix/ui.scm (load*): Add 'frame-with-source'.  Set
  %load-should-auto-compile.  Change error handle to just (exit 1).  Add
  pre-unwind handler to capture the stack and call 'report-load-error'.
  (report-load-error): Add optional 'frame' parameter and pass it to
  'display-error'.
* tests/guix-system.sh: Add "unbound variable" test.
2015-05-25 21:34:23 +02:00
Ludovic Courtès 6ec1f4caa3 ui: Make 'symlink' replacement more future-proof.
* guix/ui.scm (symlink): Change next-to-last 'throw' argument to explicitly
  ignore ARGS; change last argument to (list errno).
2015-05-24 17:29:14 +02:00
Ludovic Courtès 9b14107f2d ui: Add 'copy-file' replacement with better error reporting.
* guix/ui.scm (copy-file): New procedure.
2015-05-24 17:27:36 +02:00
Ludovic Courtès f245b03deb guix system: init: Copy the closure of 'grub.cfg', not that of the system.
Fixes <http://bugs.gnu.org/20591>.
Reported by Daniel Pimentel <d4n1@openmailbox.org>.

* guix/scripts/system.scm (install): Copy the closure of GRUB.CFG rather than
  that of OS-DIR.
2015-05-24 17:20:24 +02:00
Ludovic Courtès 328639e48f guix system: Always add zero previous entries in grub.cfg for 'init'.
* guix/scripts/system.scm (grub.cfg): Remove.
  (perform-action): Call 'operating-system-grub.cfg' with the empty list as
  the 2nd argument when ACTION is 'init.
2015-05-24 17:15:16 +02:00