Commit Graph

589 Commits (8ed2c92eb12b894e03cc634d92d3c78636f44020)

Author SHA1 Message Date
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
Mark H Weaver d5f01e48e0 guix package: Add '--do-not-upgrade' option.
* guix/scripts/package.scm (%options): Add the '--do-not-upgrade' option.
  (show-help): Document it.
  (options->installable): Add 'do-not-upgrade-regexps' variable.
  Use it in 'packages-to-upgrade'.
* doc/guix.texi (Invoking guix package): Document the '--do-not-upgrade'
  option.
2015-04-14 10:44:19 -04: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 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 863af4e121 import: Add hackage importer.
* guix/scripts/import.scm (importers): Add hackage.
* guix/scripts/import/hackage.scm: New file.
* po/guix/POTFILES.in: Add guix/scripts/import.scm.
* doc/guix.texi: Add section on 'hackage' importer.
2015-04-08 17:31:11 +02:00
宋文武 cf3e3e374c Merge branch 'master' into core-updates 2015-04-08 16:04:37 +08:00
Ludovic Courtès 1151f6aeae ui: Add 'report-load-error'.
* guix/scripts/system.scm (read-operating-system): Replace error
  handling code by a call to 'report-load-error'.
* guix/ui.scm (report-load-error): New procedure.
2015-04-07 22:28:36 +02:00
Ludovic Courtès 250bc998ac guix package: Avoid 'exit' calls in 'delete-matching-generations'.
* guix/scripts/package.scm (delete-matching-generations): Remove call to
  'exit' when PATTERN is "0".  Call 'leave' instead of 'exit'
  when (null-list? number).
2015-04-06 21:27:35 +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 65d428d8f4 guix package: Move generation deletion to its own procedure.
* guix/scripts/package.scm (delete-matching-generations): New procedure,
  with code formerly found...
  (guix-package)[process-actions]: ... here.  Use it.
  Remove 'current-generation-number'.
2015-04-06 20:02:29 +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
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 cb043c2b13 substitute-binary: Remove thread-safe 'regexp-exec' wrapper.
* guix/scripts/substitute-binary.scm: Remove 'regexp-exec' setting.
2015-03-23 22:28:49 +01:00
Ludovic Courtès d3a652037e substitute-binary: Pipeline HTTP requests instead of using threads.
* guix/scripts/substitute-binary.scm (fetch-narinfo, %lookup-threads,
  n-par-map*): Remove.
  (narinfo-cache-file, cached-narinfo, cache-narinfo!, narinfo-request,
  http-multiple-get, read-to-eof, fetch-narinfos, lookup-narinfos,
  narinfo-from-file): New procedures.
  (lookup-narinfo): Rewrite in terms of 'lookup-narinfos'.
  (guix-substitute-binary): Use 'lookup-narinfos' instead of
  'lookup-narinfo'.
2015-03-23 22:28:49 +01:00
Ludovic Courtès 0561e9ae16 substitute-binary: Allow callers to specify the size of a narinfo.
* guix/scripts/substitute-binary.scm (read-narinfo): Add #:size
  parameter and honor it.
2015-03-23 22:28:49 +01:00
Ludovic Courtès 051edc95f1 guix package: '-s' sorts packages by name, then by version.
Before that it would sort them by name only, so the order in which two
packages with the same name but a different version would appear was
non-deterministic.

Reported by Tomáš Čech <sleep_walker@gnu.org>.

* guix/scripts/package.scm (find-packages-by-description)[version<?]:
  New variable.
  Change the 2nd argument to 'sort' to use 'string-compare' and resort
  to 'version<?' when P1 and P2 have the same name.
2015-03-20 22:07:28 +01:00
Ludovic Courtès 9eeb3d8c28 guix package: '-s' displays different packages that have the same location.
Before that, 'guix package -s foobarbaz' would display only one package
when several match but they have the same location (which is common when
using 'inherit'.)

The original rationale was given at
<http://lists.gnu.org/archive/html/bug-guix/2013-01/msg00280.html> but
it was arguably misguided because it led to "real" packages being
hidden.

Reported by Tomáš Čech <sleep_walker@gnu.org>.

* guix/scripts/package.scm (find-packages-by-description)[same-location?]:
  Remove.
  Remove call to 'delete-duplicates'.
2015-03-20 22:07:28 +01:00
Ludovic Courtès 661c99a434 lint: Report details about FTP errors.
* guix/scripts/lint.scm (probe-uri) <'ftp>: Pass more information about
  failures alongside 'ftp-response.
  (validate-uri) <ftp-response>: Handle it, and adjust "not reachable"
  message accordingly.
2015-03-19 13:00:21 +01:00
Ludovic Courtès 284fe31394 lint: Change misleading variable name.
* guix/scripts/lint.scm (probe-uri) <'ftp>: Rename 'port' to 'conn'.
2015-03-19 13:00:20 +01:00
Ludovic Courtès f222664058 substitute-binary: Fix recently-introduced regression.
* guix/scripts/substitute-binary.scm (%cache-url): Fix regression
  introduced in 41c45e7.
2015-03-18 22:55:54 +01:00
Ludovic Courtès 41c45e7863 store: Add preliminary support for client-supplied substitute URLs.
* guix/store.scm (set-build-options): Rename #:binary-caches to
  #:substitute-urls.  Actually pass it in 'pairs' under the
  "substitute-urls" key.
* guix/scripts/substitute-binary.scm (%cache-url): Add comment for
  "untrusted-substitute-urls".
2015-03-18 14:43:03 +01:00
David Thompson 5762f3062c scripts: environment: Improve error messages.
* guix/scripts/environment.scm (guix-environment): Wrap procedure body with
  error handling form.
2015-03-16 19:42:54 -04: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 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 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 6e1a7d17f4 guix system: Honor '--no-grub'.
Reported by Alex Kost <alezost@gmail.com>
at <http://lists.gnu.org/archive/html/guix-devel/2015-02/msg00564.html>.

* guix/scripts/system.scm (%options) <no-grub>: Use 'alist-cons' instead
  of 'alist-delete'.
2015-02-24 23:43:03 +01:00
Cyril Roelandt c9815b5deb lint: handle FTP URIs.
* guix/scripts/lint.scm (probe-uri): handle FTP URIs.
2015-02-10 00:24:30 +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 3df5acf332 pull: Always install the ~/.config/guix/latest symlink.
Before that, if two users on the same machine ran 'guix pull', the
second one would have the "Guix already up to date" message and their
~/.config/guix/latest link would be left unchanged---effectively
preventing them from updating.

* guix/scripts/pull.scm (build-and-install): Install the 'latest'
  symlink regardless of whether TO-DO? is true or false.
2015-02-06 17:39:10 +01:00
Ludovic Courtès 353e34a626 offload: Better report failure to create the GC root directory.
Suggested by Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>.

* guix/scripts/offload.scm (register-gc-root)[script]: Replace
  'false-if-exception' with a finer-grain 'system-error handler.
  Provide the name of MACHINE in 'leave' error message.
2015-02-05 23:40:55 +01:00
Ludovic Courtès fc61b641c2 offload: Warn about SSH client issues.
Suggested by Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>.

* guix/scripts/offload.scm (remote-pipe): Remove unneeded 'catch'.
  (machine-load): Check the exit value  upon (close-pipe pipe).  Call
  'warning' when it is non-zero.
2015-02-05 23:40:55 +01:00
David Thompson 4b7ad2e338 guix: environment: Consider all package outputs.
* guix/scripts/environment.scm (for-each-search-path): Iterate over all
  derivation output paths.
  (packages->transitive-inputs): Process inputs that specify an output, too.
2015-02-03 16:11:01 -05: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 3bcfe23cfc substitute-binary: Let the user know when the cache is being updated.
* guix/scripts/substitute-binary.scm (open-cache*): New macro.
  (guix-substitute-binary): Use it instead of (delay (open-cache ...)).
2015-01-26 21:58:12 +01:00
Ludovic Courtès 06aac933e1 guix lint: Make the 'source' checker happy if at least one URI is valid.
Before that it would check all the URIs of each package.

* guix/scripts/lint.scm (validate-uri): Really return #f on failure and
  #t otherwise.
  (check-source): Replace 'for-each' with 'any'.
2015-01-26 00:19:33 +01:00
Cyril Roelandt 17a7b75c0f lint: add 'source' checker.
* guix/scripts/lint.scm (validate-uri?): New procedure.
  (%checkers): Add 'source' checker
2015-01-25 18:34:51 +01:00
Ludovic Courtès 70e629f548 guix system: Improve error messages.
* guix/ui.scm (report-error): Export.
* guix/scripts/system.scm (read-operating-system): Report syntax errors
  using standard GNU format.  Report other errors using 'display-error'.
2015-01-22 22:43:46 +01:00
Ludovic Courtès 1a0965045b guix package: Avoid spurious warnings from 'find-files'.
Reported by Andreas Enge <andreas@enge.fr>.

* guix/scripts/package.scm (with-null-error-port): New macro.
  (search-path-environment-variables): Wrap 'search-path-as-list' call
  in 'with-null-error-port'.
2015-01-20 22:29:17 +01:00
Ludovic Courtès 5660708895 guix archive: Add -r/--recursive.
* guix/scripts/archive.scm (show-help, %options): Add -r/--recursive.
  (export-from-store): Pass #:recursive? to 'export-paths'.
* doc/guix.texi (Invoking guix archive): Add -r in Emacs example.  Add
  example with ~/.guix-profile.  Document -r/--recursive.
2015-01-17 17:05:54 +01:00
Ludovic Courtès 9decb18c0b guix archive: Remove unused -r/--root option.
* guix/scripts/archive.scm (%options): Remove -r/--root.
2015-01-17 16:52:49 +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 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 7744885731 Merge branch 'master' into core-updates 2015-01-11 09:38:49 -05: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
Ludovic Courtès 8234fcf21a substitute-binary: Micro-optimize 'narinfo-sha256'.
* guix/scripts/substitute-binary.scm (narinfo-signature->canonical-sexp):
  Change "~a" to "~s" in error message.
  (%signature-line-rx): Remove.
  (narinfo-sha256): Use 'string-contains' instead of 'regexp-exec', and
  'string-take' instead of 'match:substring'.
2015-01-09 01:10:31 +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 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 c79c6e598a lint: Report on the package being checked.
* guix/scripts/lint.scm (run-checkers): Check
  whether (current-error-port) is a tty, and print the package being
  checked and the checker currently running when it is.
2014-12-28 18:21:53 +01:00
Ludovic Courtès a3bf096945 lint: Add 'home-page' checker.
* guix/build/download.scm (open-connection-for-uri): Export.
* guix/scripts/lint.scm (probe-uri, check-home-page): New procedures.
  (%checkers): Add 'home-page' checker.
2014-12-28 17:57:36 +01:00
Ludovic Courtès cc9a5c1454 guix package: Use 'search-path-as-list' instead of custom code.
This will handle the new 'file-type' and 'file-pattern' fields correctly.

* guix/scripts/package.scm (search-path-environment-variables)[search-path-definition]:
  Rewrite in terms of 'search-path-as-list'.
2014-12-27 23:46:10 +01:00
Ludovic Courtès bd2fc4d813 utils: Export 'search-path-as-list'.
* guix/build/utils.scm (search-path-as-list): Make public.
* guix/scripts/environment.scm (for-each-search-path): Use it.
2014-12-27 23:24:35 +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 5f742c84d4 substitute-binary: Add missing newline in download progress report.
Fixes <http://bugs.gnu.org/19313>.
Reported by rekado <rekado@elephly.net>.

* guix/scripts/substitute-binary.scm (guix-substitute-binary)
  <--substitute>: Add 'newline' call.
2014-12-09 11:24:56 +01:00
Ludovic Courtès 6412e58a68 system: Don't make /boot/grub/grub.cfg a symlink to the store.
This would not work when /boot is a separate partition, as reported by
Nikita Karetnikov <nikita@karetnikov.org> in <http://bugs.gnu.org/19220>.
This fixes a regression introduced in 39d1f82.

* gnu/build/install.scm (install-grub): Copy GRUB.CFG instead of
  symlinking it, as was the case before 39d1f82.
* gnu/build/vm.scm (register-grub.cfg-root): Add 'grub.cfg' parameter.
  Make it a permanent GC root instead of an indirect GC root.
  (initialize-hard-disk): Adjust accordingly.
* guix/scripts/system.scm (install-grub*): Replace use of
  'add-indirect-root' by the addition of a permanent GC root in
  %GC-ROOTS-DIRECTORY.
2014-12-09 11:06:50 +01:00
Ludovic Courtès c9e46f1c39 guix system: Fix typo affecting 'guix system init'.
Fixes <http://bugs.gnu.org/19279>.
Fixes a regression introduced in cc7fa59.
Reported by Tomas Cech <tcech@suse.cz>.

* guix/scripts/system.scm (install): Fix order of arguments to 'lift'
  and 'lift2'.
2014-12-07 00:00:42 +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
Ludovic Courtès 39d1f82b52 system: Make /boot/grub/grub.cfg an indirect GC root.
Fixes <http://bugs.gnu.org/19160>.

* guix/scripts/system.scm (install-grub*): Make /boot/grub/grub.cfg an
  indirect GC root.
* gnu/build/install.scm (install-grub): Make TARGET a symlink.
* gnu/build/vm.scm (register-grub.cfg-root): New procedure.
  (initialize-hard-disk): Use it.
2014-12-04 23:53:16 +01:00
Ludovic Courtès c3e79cde06 guix system: Factorize 'grub-install' error handling, and use more 'mbegin'.
* guix/scripts/system.scm (install-grub*): New procedure.
  (install): Use it, and use 'mwhen?'.
  (perform-action) <reconfigure>: Likewise.
2014-12-04 23:53:16 +01:00
Ludovic Courtès cc7fa5929c guix system: Use 'mbegin' for 'install'.
* guix/scripts/system.scm (install): Use 'mbegin'.  Lift FORMAT and
  POPULATE-ROOT-FILE-SYSTEM, and use the result.
2014-12-02 16:51:43 +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 d616c05529 substitute-binary: Change "unresponsive" to "slow".
* guix/scripts/substitute-binary.scm (fetch): Change "unresponsive" to
  "somewhat slow".  I'm being told that the former is often
  misunderstood as "broken".
2014-11-28 00:10:27 +01:00
Ludovic Courtès f6526eb330 guix build: Add '--max-jobs' option.
Suggested by Deck Pickard <deck.r.pickard@gmail.com>.

* guix/scripts/build.scm (show-build-options-help): Document
  --max-jobs.
  (set-build-options-from-command-line): Pass #:max-build-jobs.
  (%standard-build-options): Add --max-jobs.
* doc/guix.texi (Invoking guix-daemon): Document the meaning of
  '--max-jobs 0'.
  (Invoking guix build): Document --max-jobs, with a reference to
  "Invoking guix-daemon'.
2014-11-25 22:37:44 +01:00
Ludovic Courtès 0276f697b3 guix system: Add '--share' and '--expose' options for 'vm'.
* guix/scripts/system.scm (system-derivation-for-action): Add #:mappings
  parameter.  Pass it to 'system-qemu-image/shared-store-script'.
  (perform-action): Likewise.
  (show-help): Document --share and --expose.
  (specification->file-system-mapping): New procedure.
  (%options): Add --share and --expose.
  (guix-system): Pass #:mapping to 'perform-action'.
* doc/guix.texi (Invoking guix system): Document it.
2014-11-21 00:02:26 +01:00
Ludovic Courtès 8b9019a6a9 lint: Fix typos in checker descriptions.
* guix/scripts/lint.scm (%checkers): "file names" (two words), and
  "synopses" (plural).
2014-11-19 22:52:30 +01:00
Ludovic Courtès db6dcf816f lint: Use localized checker descriptions.
* guix/scripts/lint.scm (list-checkers-and-exit): Wrap
  'lint-checker-description' call in (_ ...).
2014-11-19 22:52:30 +01:00
Ludovic Courtès 836f02bf52 lint: Correctly internationalize warning messages.
* guix/scripts/lint.scm (emit-warning): Remove '_' call for format
  string.
  (check-description-style, check-inputs-should-be-native,
  check-synopsis-style, check-patches, check-gnu-synopsis+description):
  Wrap message in (_ ...).
2014-11-19 22:52:30 +01:00
Ludovic Courtès f4d5bca39e lint: Change checker names to be symbols.
* guix/scripts/lint.scm (%checkers): Change 'name' fields to be
  symbols.
  (%options): Adjust "-c" option handler accordingly.
2014-11-19 22:52:30 +01:00
Ludovic Courtès 37627ffa89 lint: Fold 'sync-descriptions' script as 'gnu-description' lint checker.
* build-aux/sync-descriptions.scm: Remove.  Move payload to...
* guix/scripts/lint.scm: ... here.
  (escape-quotes, official-gnu-packages*,
  check-gnu-synopsis+description): New procedures.
  (%checkers): Add 'gnu-descriptions'.
* Makefile.am (EXTRA_DIST): Remove build-aux/sync-descriptions.scm.
  (sync-descriptions): Use 'guix lint'.
2014-11-19 22:52:28 +01:00
Ludovic Courtès d09e8c7b15 substitute-binary: Be slightly less verbose when downloading.
* guix/scripts/substitute-binary.scm (guix-substitute-binary)<"--substitute">:
  Be slightly less verbose.
2014-11-13 22:17:44 +01:00
Ludovic Courtès 906b1b0986 guix system: Decorate GRUB entries of old generations with date and number.
* guix/scripts/system.scm (seconds->string): New procedure.
  (previous-grub-entries)[system->grub-entry]: Add 'number' and 'time'
  parameters.  Adjust call accordingly.
2014-11-11 22:42:42 +01:00
Ludovic Courtès 7047133f07 import: Add GNU importer.
Suggested by Karl Berry <karl@gnu.org>
and Andreas Enge <andreas@enge.fr>.

* guix/import/gnu.scm, guix/scripts/import/gnu.scm: New files.
* Makefile.am (MODULES): Add them.
* guix/scripts/import.scm (importers): Add "gnu".
* guix/gnu-maintenance.scm (gnu-release-archive-types): New procedure.
  (download-tarball): Export.
2014-11-11 15:31:35 +01:00
Ludovic Courtès f81ac34dd9 pull: Use the build procedure provided by the newly-downloaded Guix.
Fixes <http://bugs.gnu.org/18534>.

* guix/scripts/pull.scm (with-environment-variable, with-PATH): New
  macros.
  (temporary-directory, first-directory, interned-then-deleted): New
  procedures.
  (unpack): Rewrite to do the unpacking in the current process rather
  than as a separate derivation.
  (%self-build-file): New variable.
  (build-from-source): New procedure.
  (build-and-install): Use it.
* guix/build/pull.scm (build-guix): Rename 'tarball' argument to
  'source'.  Remove #:tar and #:gzip parameters, as well as 'tar'
  invocation.  Remove 'scandir' invocation.  Wrap body in
  'with-directory-excursion'.
* build-aux/build-self.scm: New file.
* Makefile.am (EXTRA_DIST): Add it.
2014-11-09 22:33:45 +01:00
Ludovic Courtès 6aa260af12 vm: Fix 'vm --full-boot' to produce a sufficient disk image.
* gnu/system/vm.scm (system-qemu-image/shared-store): Add
  #:disk-image-size and #:full-boot? parameters and honor them.  Pass
  '#:copy-inputs? full-boot?', and change #:inputs argument.
* guix/scripts/system.scm (system-derivation-for-action): Pass
  #:disk-image-size to 'system-qemu-image/shared-store'.
* doc/guix.texi (Invoking guix system): Mention use of '--image-size' in
  conjunction with '--full-boot'.
2014-11-08 15:10:42 +01:00
Ludovic Courtès ab11f0bed4 vm: Support 'guix system vm --full-boot'.
* gnu/system/vm.scm (system-qemu-image/shared-store-script): Add
  #:full-boot? parameter and honor it.
* guix/scripts/system.scm (system-derivation-for-action): Likewise.
  (perform-action): Likewise.
  (show-help): Document '--full-boot'.
  (%options): Add '--full-boot'.
  (guix-system): Add #:full-boot? argument in call to 'perform-action'.
* doc/guix.texi (Invoking guix system): Document it.
2014-11-08 01:05:35 +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 105c260f00 lint: Skip starting-article test for the synopses of GNU packages.
* guix/scripts/lint.scm (check-synopsis-style)[check-start-article]:
  Change to (const #t) when PACKAGE matches 'gnu-package?'.
2014-11-07 17:52:11 +01:00
Ludovic Courtès 431e5f5a3e lint: Tolerate sentences that start with a parenthesis or a quote.
* guix/scripts/lint.scm (properly-starts-sentence?): Add (, ", and ' as
  valid beginnings.
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 84934f40d1 import: pypi: Gracefully handle wrong argument counts.
* guix/scripts/import/pypi.scm (guix-import-pypi): Use 'leave' to handle
  cases where ARGS has zero or two or more elements.
2014-11-05 18:04:16 +01:00
Ludovic Courtès 467a3c93db import: pypi: Gracefully handle non-existent packages.
Fixes <http://bugs.gnu.org/18831>.
Reported by Ian Denhardt <ian@zenhack.net>.

* guix/import/pypi.scm (url-fetch, json-fetch, pypi-fetch): Augment
  docstring to mention #f on failure.
  (pypi->guix-package): Likewise, and actually return #f on failure.
* guix/scripts/import/pypi.scm (guix-import-pypi): Call 'leave' when
  'pypi->guix-package' returns #f.
2014-11-05 17:56:39 +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 b9113adf45 environment: Improve '--help' output.
* guix/scripts/environment.scm (show-help): Align --pure and
  --search-paths with other long options; add 'newline' call before
  'show-bug-report-information' call.
2014-10-30 14:08:03 +01:00
Ludovic Courtès 940a8c57be offload: Remove mutual exclusion on transfers.
Suggested by Mark H. Weaver <mhw@netris.org>
at <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00352.html>.

* guix/scripts/offload.scm (transfer-and-offload): Remove uses of
  'with-machine-lock'.
2014-10-29 00:31:23 +01: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
Eric Bavier c04b82ffce guix: lint: Use if/when consistently.
* guix/scripts/lint.scm (check-synopsis-style): Replace single-branch
  uses of if with when.
  (check-patches): Same
2014-10-26 13:03:53 -05:00
Eric Bavier 86a4126348 guix: lint: Use string-suffix? and string-prefix? where appropriate.
* guix/scripts/lint.scm (check-synopsis): Use string-suffix? and
  string-prefix? in place of string-take and string=?.
2014-10-26 13:03:53 -05:00
Eric Bavier 05b4226ad9 refresh: Add end-of-line to error message.
* guix/scripts/refresh.scm (%options)[select]: Add end-of-line to
  error message.
2014-10-20 17:03:02 -05: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
Alex Kost c0c018f180 profiles: Add condition types for profiles and generations.
Suggested by Ludovic Courtès.

* guix/profiles.scm (&profile-error, &profile-not-found-error,
  &missing-generation-error): New condition types.
* guix/ui.scm (call-with-error-handling): Handle new types.
* guix/scripts/package.scm (roll-back, guix-package): Raise
  '&profile-not-found-error' where needed.
2014-10-12 08:45:37 +04:00
David Thompson 372c4bbcbb scripts: Add 'environment' command.
* guix/scripts/environment.scm: New file.
* Makefile.am (MODULES): Add it.
* doc/guix.texi ("Invoking guix environment"): New node.
2014-10-10 18:14:40 -04: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 9176607ec4 daemon: Add '--substitute-urls' option.
* nix/nix-daemon/guix-daemon.cc (GUIX_OPT_SUBSTITUTE_URLS): New macro.
  (GUIX_OPT_NO_BUILD_HOOK, GUIX_OPT_GC_KEEP_OUTPUTS,
  GUIX_OPT_GC_KEEP_DERIVATIONS): Renumber.
  (options): Add '--substitute-urls'.
  (parse_opt): Honor it.
  (main): Add 'settings.set' call for the default "substitute-urls"
  value.
* guix/scripts/substitute-binary.scm (daemon-options,
  find-daemon-option): New procedures.
  (%cache-url): Define based on the "substitute-urls" daemon option.
* doc/guix.texi (Invoking guix-daemon): Document '--substitute-urls'.
  (Substitutes): Mention it.
2014-10-09 23:51:19 +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
Cyril Roelandt 90d104ba82 guix lint: make sure check-patches retrieves patch names.
* guix/lint (check-patches): Test the output of origin-patches.
2014-10-08 03:08:19 +02:00
Alex Kost b72a312c30 guix package: Export generation procedures.
* guix/scripts/package.scm: Export 'roll-back', 'delete-generation',
  'delete-generations'.
  (link-to-empty-profile, roll-back): Add 'store' argument.
  (delete-generations): New procedure.
  (guix-package): Adjust accordingly.
  [delete-generation]: Move to the top level.  Add 'store' and 'profile'
  arguments.
  [display-and-delete]: Move to 'delete-generation'.
2014-10-05 22:17:48 +04:00
Ludovic Courtès 6d7328b2f1 pull: Add dependency on Guile-JSON.
Reported by Alex Sassmannshausen <alex.sassmannshausen@gmail.com>.

* guix/scripts/pull.scm (unpack): Add Guile-JSON to %load-path and
  %load-compiled-path.
2014-09-30 10:11:45 +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 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
Alex Kost 886cf584db guix package: Use 'profile-generations'.
* guix/scripts/package.scm (guix-package)[process-actions]: Use
  'profile-generations' instead of the equivalent code.
2014-09-22 13:24:52 +04:00
Ludovic Courtès 46025e94cd offload: Use a total order when sorting available machines.
* guix/scripts/offload.scm (machine-less-loaded?, machine-faster?):
  Remove.
  (machine-power-factor): New procedure.
  (machine-less-loaded-or-faster?): Use it.
2014-09-20 12:23:39 +02:00
Ludovic Courtès b1fea30339 offload: Try another machine when the "best" machine is overloaded.
* guix/scripts/offload.scm (choose-build-machine): When BEST is
  overloaded, try the other machines.
2014-09-20 12:10:28 +02:00
Ludovic Courtès cb823dd279 pull: Rewrite using gexps.
* guix/scripts/pull.scm (unpack): Remove 'store' parameter.  Rewrite
  using 'gexp->derivation'.
  (what-to-build, indirect-root-added, build-and-install): New
  procedures.
  (guix-pull): Use it.
2014-09-18 18:45:00 +02:00
Ludovic Courtès 6d49355d8b activation: Honor $GUIX_NEW_SYSTEM for use by 'guix system reconfigure'.
* gnu/build/activation.scm (activate-current-system): Honor
  $GUIX_NEW_SYSTEM by default.
* guix/scripts/system.scm (switch-to-system): Set $GUIX_NEW_SYSTEM
  before loading SCRIPT.
2014-09-12 22:13:52 +02:00
Ludovic Courtès b50c5b7418 pull: Add a compilation progress report.
* guix/build/pull.scm (report-build-progress): New procedure.
  (p-for-each): Add #:progress parameter.
  [loop]: Keep track of the number of completed processes.  Tail-call
  PROGRESS at each loop iteration.
  (build-guix): Add #:debug-port parameter.  Use it for verbose
  messages.  Change 'tar' flags to 'xf'.  Around 'compile-file' call,
  bind CURRENT-WARNING-PORT to DEBUG-PORT.
* guix/scripts/pull.scm (unpack): Add #:verbose? parameter.
  [builder]: Pass #:debug-port to 'build-guix'.
  (guix-pull): Leave CURRENT-BUILD-OUTPUT-PORT unchanged.  Pass
  #:verbose? to 'unpack'.
2014-09-05 23:11:04 +02:00
Ludovic Courtès 548f7a8fa2 Move operating system helpers from (guix build …) to (gnu build …).
* guix/build/activation.scm, guix/build/install.scm,
  guix/build/linux-initrd.scm, guix/build/vm.scm: Move to...
* gnu/build: ... here.
* Makefile.am (MODULES): Remove the above guix/build/ files.
* gnu-system.am (GNU_SYSTEM_MODULES): Add the above gnu/build/ files
  here.
* gnu/services/base.scm, gnu/services/dmd.scm, gnu/system.scm,
  gnu/system/linux-initrd.scm, gnu/system/vm.scm,
  guix/scripts/system.scm: Adjust to the new module names.
2014-09-03 15:43:07 +02:00
Ludovic Courtès b002e9d08e guix lint: Remove "guix lint: " prefix from warnings.
This allows editors to parse warnings correctly.

* guix/scripts/lint.scm (emit-warning): Use 'format' instead of
  'warning', to avoid the "guix lint: " prefix in messages.
* tests/lint.scm (call-with-warnings): Indent.
2014-09-03 15:43:07 +02:00
Cyril Roelandt b4f5e0e87c scripts: add guix lint
* guix/scripts/lint.scm: New file. Defines a 'lint' tool for Guix packages.
* tests/lint.scm: New file.
* Makefile.am (MODULES, SCM_TESTS): Add them.
* po/guix/Makevars: Update appropriately.
* po/guix/POTFILES.in: Update appropriately.
* doc/guix.texi: Document "guix lint".
2014-09-03 02:07:07 +02:00
Cyril Roelandt 5e3b388b51 Move specification->package to gnu/packages.scm.
* guix/scripts/build.scm (specification->package): Move from here...
* gnu/packages.scm: ... to here.
2014-09-03 02:07:07 +02:00
Ludovic Courtès 4720f524fc guix package: Fix search path lookup when an obsolete version is installed.
Before that, 'guix package --search-paths' would not work if, say,
'foo-0.2' is installed but the distro provides 'foo-0.3'.

* guix/scripts/package.scm (search-path-environment-variables)[manifest-entry->package]:
  Handle the case where 'find-best-packages-by-name' returns '().
2014-08-31 22:17:56 +02:00
Ludovic Courtès b9a31d90e9 offload: Ignore EEXIST when registering a .drv as a GC root.
Fixes <http://bugs.gnu.org/18115>.
Reported by Mark H Weaver <mhw@netris.org>.

* guix/scripts/offload.scm (register-gc-root)[script]: Wrap 'symlink'
  call in "catch 'system-error", and ignore EEXIST errors.
2014-08-29 14:53:15 +02:00
Ludovic Courtès b1e48f222b offload: Ignore unreachable machines.
Fixes <http://bugs.gnu.org/18070>.
Reported by Andreas Enge <andreas@enge.fr>.

* guix/scripts/offload.scm (remote-pipe): Augment docstring.
  (machine-load): Return +inf.0 instead of 1 if MACHINE does not respond
  or responds badly.
2014-08-29 14:37:58 +02:00
Ludovic Courtès bdb36958fb gnu: Split (gnu packages base), adding (gnu packages commencement).
* gnu/packages/base.scm (gnu-make-boot0, diffutils-boot0,
  findutils-boot0, %boot0-inputs, nix-system->gnu-triplet, boot-triplet,
  binutils-boot0, gcc-boot0, perl-boot0, linux-libre-headers-boot0,
  texinfo-boot0, %boot1-inputs, glibc-final-with-bootstrap-bash,
  cross-gcc-wrapper, static-bash-for-glibc, glibc-final,
  gcc-boot0-wrapped, %boot2-inputs, binutils-final, libstdc++,
  gcc-final, ld-wrapper-boot3, %boot3-inputs, bash-final, %boot4-inputs,
  guile-final, gnu-make-final, ld-wrapper, coreutils-final, grep-final,
  %boot5-inputs, %final-inputs, canonical-package, gcc-toolchain,
  gcc-toolchain-4.8, gcc-toolchain-4.9): Move to...
* gnu/packages/commencement.scm: ... here.  New file.
* gnu-system.am (GNU_SYSTEM_MODULES): Add it.
* build-aux/check-final-inputs-self-contained.scm: Adjust accordingly.
* gnu/packages/cross-base.scm: Likewise.
* gnu/packages/make-bootstrap.scm: Likewise.
* guix/build-system/cmake.scm (cmake-build): Likewise.
* guix/build-system/gnu.scm (standard-packages, gnu-build,
  gnu-cross-build): Likewise.
* guix/build-system/perl.scm (perl-build): Likewise.
* guix/build-system/python.scm (python-build): Likewise.
* guix/build-system/trivial.scm (guile-for-build): Likewise.
* guix/download.scm (url-fetch): Likewise.
* guix/gexp.scm (default-guile): Likewise.
* guix/git-download.scm (git-fetch): Likewise.
* guix/monads.scm (run-with-store): Likewise.
* guix/packages.scm (default-guile): Likewise.
* guix/scripts/package.scm (guix-package): Likewise.
* guix/scripts/refresh.scm: Likewise.
* guix/svn-download.scm (svn-fetch): Likewise.
* tests/builders.scm (%bootstrap-inputs, %bootstrap-search-paths):
  Likewise.
* tests/packages.scm ("GNU Make, bootstrap"): Likewise.
* tests/guix-package.sh: Likewise.
* gnu/services/base.scm: Use 'canonical-package' instead of xxx-final.
* gnu/services/xorg.scm: Likewise.
* gnu/system/vm.scm: Likewise.
* guix/scripts/pull.scm (guix-pull): Likewise.
2014-08-28 09:21:54 +02:00
Ludovic Courtès 79ee406d51 profiles: Produce a top-level Info 'dir' file.
Fixes <http://bugs.gnu.org/18305>.
Reported by Brandon Invergo <brandon@gnu.org>.

* guix/profiles.scm (manifest-inputs, info-dir-file): New procedures.
  (profile-derivation): Use them.  Add #:info-dir? parameter and honor
  it.
* guix/scripts/package.scm (guix-package): Call 'profile-derivation'
  with #:info-dir? #f when the 'bootstrap? option is set.
* tests/profiles.scm ("profile-derivation"): Pass #:info-dir? #f.
2014-08-23 22:33:03 +02:00
Alex Kost 4ea444198d Move 'check-package-freshness' from 'guix package' to 'packages'.
* guix/scripts/package.scm (%sigint-prompt, call-with-sigint-handler)
  (waiting, ftp-open*, check-package-freshness): Move to...
* gnu/packages.scm: ... here.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2014-08-20 10:55:29 +02:00
Alex Kost 89caec6920 guix package: Use 'manifest-transaction'.
* guix/scripts/package.scm (guix-package)[process-actions]: Use
  'manifest-transaction' instead of the equivalent code.
  (show-what-to-remove/install): Remove.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2014-08-19 22:58:22 +02:00
Ludovic Courtès dfd1d5edf6 guix package: Remove leftover internal procedure.
Reported by Alex Kost <alezost@gmail.com>.

* guix/scripts/package.scm (guix-package)[process-actions]: Remove
  'same-package?'.
2014-08-12 21:51:45 +02:00
Ludovic Courtès f48624fc68 guix package: Use 'manifest-add'.
* guix/scripts/package.scm (guix-package)[process-actions]: Use
  'manifest-add' instead of the equivalent code.
2014-08-12 16:10:32 +02:00
Ludovic Courtès 3d6e65d529 guix package: Remove dead code and unused variables.
Suggested by Alex Kost <alezost@gmail.com>.

* guix/scripts/package.scm (options->installable)[deduplicate]: Remove.
  [packages-to-upgrade]: Remove unused variable 'newest'.
  (roll-back): Remove unused variable 'manifest'.
  (guix-package): Remove unused variables 'guile-missing?', 'verbose?',
  and 'packages'.
2014-08-11 19:03:29 +02:00
Ludovic Courtès 462f5ccade profiles: Add 'package->manifest-entry'.
Suggested by Alex Kost <alezost@gmail.com>.

* guix/scripts/package.scm (options->installable)[package->manifest-entry]:
  Move to (guix profiles).
  [package->manifest-entry*]: New procedure.
  Use it.
* guix/profiles.scm (package->manifest-entry): New procedure.
* tests/profiles.scm (guile-for-build): New variable.
  Call '%guile-for-build'.
  ("profile-derivation"): New test.
2014-07-26 22:57:00 +02:00
Ludovic Courtès 4ca0b4101d profiles: Get rid of the 'inputs' field of 'manifest-entry'.
* guix/profiles.scm (<manifest-entry>)[inputs]: Remove.
  (profile-derivation): Rely on 'item' and 'deps' instead of 'inputs'.
  Adjust 'builder' accordingly.
* guix/scripts/package.scm (options->installable)[package->manifest-entry]:
  Remove 'inputs' field.  Change 'dependencies' field to contain
  packages.
2014-07-26 22:56:59 +02:00
Ludovic Courtès a54c94a40d profiles: Switch to gexps.
* guix/profiles.scm (<manifest-entry>)[path]: Rename to...
  [item]: ... this.  Update users.
  (manifest->sexp): Rename to...
  (manifest->gexp): ... this.  Return a gexp.
  (lower-input): Remove.
  (profile-derivation): Remove 'store' parameter, and turn into a
  monadic procedure.
  [inputs]: New variable.
  [builder]: Turn into a gexp.
  Replace call to 'build-expression->derivation' with call to
  'gexp->derivation'.
* guix/scripts/package.scm (link-to-empty-profile): Adjust call to
  'profile-derivation', and wrap it in 'run-with-store'.
  (show-what-to-remove/install): Rename 'path' to 'item'.  Check whether
  ITEM is a package, and return its output path if it is.
  (input->name+path): Remove.
  (options->installable): Set 'item' to P.
  (guix-package): Adjust call to 'profile-derivation'.
* tests/profiles.scm (guile-2.0.9): Change 'path' to 'item'.
2014-07-26 22:56:59 +02:00
Ludovic Courtès 48704e5b5c profiles: Do away with 'manifest=?'.
* guix/profiles.scm (manifest=?): Remove.
* guix/scripts/package.scm (readlink*): New procedure.
  (guix-package)[process-actions]: Use 'readlink*' and compare the
  profile to be built, PROF, with PROFILE to determine whether there's
  nothing to be done.
2014-07-26 22:56:59 +02:00
Ludovic Courtès 720ee245da guix system: Protect against changes to $PATH when activating the system.
Partly fixes <http://bugs.gnu.org/18082>.
Reported by Mark H Weaver <mhw@netris.org>.

* guix/scripts/system.scm (save-environment-excursion): New macro.
  (switch-to-system): Wrap 'primitive-load' call in it.
2014-07-23 18:20:56 +02:00
Ludovic Courtès b6debdaa22 guix system: Fix type error in 'reconfigure'.
Partly fixes <http://bugs.gnu.org/18082>.
Reported by Mark H Weaver <mhw@netris.org>.

* guix/scripts/system.scm (perform-action) <reconfigure>: Pass the
  output file name of GRUB.CFG to 'install-grub'.
2014-07-23 18:20:56 +02:00
Cyril Roelandt 2aa6efb0b9 guix package: add a "show" option.
* doc/guix.texi: Update the documentation.
* guix/scripts/package.scm: Add a "show" option.
* tests/guix-package.sh: Add a test for the "show" option.
2014-07-21 22:18:03 +02:00
Ludovic Courtès 65ea711189 guix refresh: Use (ice-9 format).
* guix/scripts/refresh.scm: Use (ice-9 format).
2014-07-20 22:39:02 +02:00
Ludovic Courtès 8334cf5b5c guix system: Factorize 'copy-closure'.
* guix/scripts/system.scm (copy-closure): Rename to...
  (copy-item): ... this.
  (copy-closure): New procedure.
  (install): Use it, and remove redundant code.
2014-07-20 22:39:02 +02:00
Eric Bavier 7d193ec348 guix: refresh: Add --list-dependent option.
* guix/packages.scm (package-direct-inputs): New procedure.
* gnu/packages.scm (vhash-refq, package-direct-dependents)
  (package-transitive-dependents, package-covering-dependents): New procedures.
* guix/scripts/refresh.scm (%options, show-help, guix-refresh): Add
  --list-dependent option.
* doc/guix.texi (Invoking guix refresh): Document '--list-dependent' option.
2014-07-20 11:36:09 -05:00
Ludovic Courtès a52127c052 guix system: init: Always use /var/guix as the target state directory.
Fixes <http://bugs.gnu.org/18049>.
Reported by Marek Benc <merkur32@gmail.com>.

* guix/scripts/system.scm (copy-closure): Pass #:state-directory to
  'register-path'.
2014-07-18 20:40:51 +02:00
Eric Bavier 49d91de763 guix: refresh: Correctly identify invalid package names.
* guix/scripts/refresh.scm (guix-refresh): Check for null list
  returned by find-packages-by-name rather than #f.
2014-07-15 00:10:10 -05:00
Ludovic Courtès 3942305eb1 guix system: reconfigure: Always use "/" as GRUB's target file system.
* guix/scripts/system.scm (perform-action) <reconfigure>: Wrap
  'install-grub' call in 'false-if-exception'.  Always use "/" as the
  target.
2014-07-14 16:14:15 +02:00
Ludovic Courtès 314a83ef1e guix system: Fix return value for 'reconfigure'.
* guix/scripts/system.scm (perform-action) <reconfigure>: Add missing
  'return' expression.
2014-07-13 23:44:37 +02:00
Ludovic Courtès 8e42796bdc guix system: Convert to monadic style.
* guix/scripts/system.scm (references*, topologically-sorted*,
  show-what-to-build*): New procedures.
  (copy-closure): Turn into a monadic procedure.
  (install): Likewise, and adjust parameter list.
  (switch-to-system): Likewise.
  (system-derivation-for-action, grub.cfg, maybe-build, perform-action):
  New procedures.
  (guix-system): Use them.
2014-07-13 16:37:11 +02:00
Ludovic Courtès df2ce34385 guix system: Add '--system' option.
* guix/scripts/system.scm (switch-to-system): Add #:system parameter;
  pass it to 'run-with-store'.
  (%options): Add '--system'.
  (guix-system): Pass the 'system' option to 'run-with-store',
  'package-derivation', and 'switch-to-system' calls.
* doc/guix.texi (Invoking guix system): Document '--system' and
  '--image-size'.
2014-07-08 23:42:35 +02:00
Taylan Ulrich Bayirli/Kammer 6879fe235c guix package: Try $LOGNAME in addition to $USER.
Fixes <http://bugs.gnu.org/17946>.

Notoriously, cron jobs may set LOGNAME only and not USER.  See
e.g. crontab(5) under Debian 7 (wheezy).

* guix/scripts/package.scm (%profile-directory)
(guix-package): Also try LOGNAME if USER is unset.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2014-07-05 15:09:43 +02:00
Ludovic Courtès 88371f0d7d guix package: Do the right thing for '-p ~/.guix-profile'.
Fixes <http://bugs.gnu.org/17939>.
Reported by Taylan Ulrich Bayirli/Kammer <taylanbayirli@gmail.com>.

* guix/scripts/package.scm (canonicalize-profile): New procedure.
  (%options): Use it for --profile.
* tests/guix-package.sh: Add test.
2014-07-05 14:56:08 +02:00
Ludovic Courtès f2c403eab6 system: Install /var/guix/profiles/system-1-link on new systems.
* guix/build/install.scm (directives): Add /var/guix/profiles/system.
  (populate-root-file-system): Add 'system' parameter.  Create
  /var/guix/profiles/system-1-link.
* guix/scripts/system.scm (install): Pass OS-DIR to
  'populate-root-file-system'.
* guix/build/vm.scm (initialize-root-partition): Add #:system-directory
  parameter, and pass it to 'populate-root-file-system'.
  (initialize-hard-disk): Add #:system-directory parameter, and pass it
  to 'initialize-root-partition'.
* gnu/system/vm.scm (qemu-image): Add #:os-derivation parameter and pass
  it to 'initialize-hard-disk'.
  (system-disk-image, system-qemu-image,
  system-qemu-image/shared-store): Pass #:os-derivation to 'qemu-image.
2014-06-27 19:06:08 +02:00
Ludovic Courtès b25937e318 guix system: Add 'reconfigure' action.
* guix/scripts/system.scm (%system-profile): New variable.
  (switch-to-system, previous-grub-entries): New procedures.
  (unless-file-not-found): New macro.
  (show-help): Add 'reconfigure'.
  (guix-system): Handle it.
* gnu/system.scm: Export 'operating-system-activation-script'.
* doc/guix.texi (Invoking guix system): Document it.
2014-06-27 00:12:40 +02:00
Ludovic Courtès c1202fb1f9 guix {system,offload}: Improve reporting of syntax errors.
* guix/scripts/system.scm (read-operating-system) <catch handler>: Add
  case for 'syntax-error'.  Correct message for default case.
* guix/scripts/offload.scm (build-machines) <catch handler>: Add case
  for 'syntax-error'.
* tests/guix-system.sh: New file.
* Makefile.am (SH_TESTS): Add it.
2014-06-27 00:12:40 +02:00
Ludovic Courtès cadf6cb4cf guix system: Gracefully handle 'install-grub' errors.
* guix/scripts/system.scm (install): Wrap 'install-grub' call in
  'false-if-exception'.  This is a followup to 641f9a2a.
2014-06-24 22:11:12 +02:00
Ludovic Courtès f513527a8e Merge branch 'core-updates' 2014-06-20 23:44:42 +02:00
Ludovic Courtès 00fe93338d substitute-binary: Warn about uninitialized ACL.
* guix/scripts/substitute-binary.scm (guix-substitute-binary): Call
  'check-acl-initialized'.
  (check-acl-initialized): Don't rely on 'equal?' to compare keys.
  Instead, convert keys to strings.
2014-06-19 23:35:41 +02:00
Ludovic Courtès eef4096c14 guix system: 'init' makes sure the target store directory exists.
* guix/scripts/system.scm (install): Before calling 'copy-closure', make
  sure directory (%store-prefix) under TARGET exists.
2014-06-19 23:35:41 +02:00
Ludovic Courtès 2eea253f4d substitute-binary: Avoid the term "narinfo" in user messages.
* guix/scripts/substitute-binary.scm (assert-valid-narinfo): Change
  message to avoid the term "narinfo".
2014-06-17 00:30:16 +02:00
Ludovic Courtès 56b8210697 guix build: Allow gexps to be passed to '-e'.
* guix/ui.scm (%guix-user-module): New variable.
  (read/eval): Pass it as the second argument to 'eval'.
* guix/scripts/build.scm (options/resolve-packages): Add case for
  'gexp?'.
* tests/guix-build.sh: Add tests.
* doc/guix.texi (Invoking guix build): Document '-e gexp'.
guxi build: Allow gexps to be passed to '-e'.

* guix/ui.scm (%guix-user-module): New variable.
  (read/eval): Pass it as the second argument to 'eval'.
* guix/scripts/build.scm (options/resolve-packages): Add case for
  'gexp?'.
* tests/guix-build.sh: Add tests.
* doc/guix.texi (Invoking guix build): Document '-e gexp'.
2014-06-14 22:55:59 +02:00
Ludovic Courtès ee76417972 Separate package description translations from string translations.
* po/packages/LINGUAS, po/packages/Makevars, po/packages/POTFILES.in:
  New files.
* po/guix/Makevars (DOMAIN): Change to "guix".
  (XGETTEXT_OPTIONS): Remove "--keyword=synopsis --keyword=description".
* po/guix/POTFILES.in: Remove gnu/packages/*.scm.
* configure.ac: Change to gettext 0.18.3.  Produce
  po/packages/Makefile.in.
* Makefile.am (SUBDIRS): Add po/packages.
* guix/ui.scm (%package-text-domain): New variable.
  (P_): New procedure.
  (package->recutils): Use 'P_' instead of '_'.
* guix/scripts/package.scm (find-packages-by-description): Use 'P_'
  instead of 'gettext'.
2014-06-13 17:30:40 +02:00
Ludovic Courtès b6b097ac81 guix build: Only 'guix build' sets #:print-build-trace.
This makes 'guix package' et al. slightly less verbose, by not emitting
"@ substituter-started" lines and similar.

* guix/scripts/build.scm (set-build-options-from-command-line): Pass
  #:print-build-trace.
  (%default-options): Add 'print-build-trace?'.
2014-06-09 18:55:48 +02:00
Ludovic Courtès fb729425dc guix system: Add 'disk-image' action.
* guix/scripts/system.scm (show-help): Add 'disk-image'.
  (guix-system)[parse-options]: Support 'disk-image' action.
  [option-arguments]: Likewise.
  Handle the 'disk-image' action.
* doc/guix.texi (Invoking guix system): Document 'disk-image'.
2014-05-22 23:24:13 +02:00
Ludovic Courtès 79b0d4e104 guix system: Check whether we are installing to /.
* guix/scripts/system.scm (install): Check whether TARGET is / and warn.
2014-05-19 23:52:40 +02:00
Ludovic Courtès c56d19fb11 guix system: Factorize out closure copy.
* guix/scripts/system.scm (copy-closure): New procedure.
  (install): Use it.
2014-05-19 23:52:40 +02:00
Ludovic Courtès c79d54fe41 guix system: 'guix system init' installs GRUB by default.
* guix/scripts/system.scm (install): Add #:grub?, #:grub.cfg, and
  #:device parameters; honor them.
  (show-help): Document '--no-grub'.
  (%options): Add '--no-grub'.
  (%default-options): Add 'install-grub?'.
  (guix-system): Honor 'install-grub?' option from OPTS.  Adjust
  'install' call accordingly.
* doc/guix.texi (Invoking guix system): Document '--no-grub'.
2014-05-19 23:52:39 +02:00
Ludovic Courtès 72b9d60df4 guix system: Add 'init' sub-command.
* guix/scripts/system.scm (install): New procedure.
  (guix-system)[parse-option]: Remove check for extraneous arguments.
  [match-pair, option-arguments]: New procedures.
  Use 'option-arguments'.  Honor 'init'.
  (show-help): Document 'init'.
* doc/guix.texi (Invoking guix system): Document 'init'.
2014-05-18 22:27:23 +02:00
Ludovic Courtès 7889394e05 guix system: Add 'build' action.
* guix/scripts/system.scm (show-help): Document 'build' action.
  (guix-system): Honor 'build' action.
* doc/guix.texi (Invoking guix system): Add 'build' action.
2014-05-16 21:56:00 +02:00
Ludovic Courtès 4cca91832b authenticate: Add compatibility hack for Guile 2.0.5.
* guix/scripts/authenticate.scm (%default-port-conversion-strategy): New
  variable.  Reported by Andreas Enge <andreas@enge.fr>.
2014-05-16 10:22:19 +02:00
Ludovic Courtès 6ef3644e34 pk-crypto: Add pretty-printer to 'gcry-error' exceptions.
* guix/pk-crypto.scm (string->canonical-sexp, sign, generate-key): Pass
  the procedure name as the first argument to 'throw'.
  (gcrypt-error-printer): New procedure.
  <top level>: Add call to 'set-exception-printer!'.
* guix/nar.scm (restore-one-item): Add 'proc' parameter to 'catch'
  handler for 'gcry-error.
* guix/scripts/archive.scm (%options, generate-key-pair, authorize-key):
  Likewise.
* guix/scripts/substitute-binary.scm (narinfo-signature->canonical-sexp):
  Likewise.
2014-04-22 11:41:52 +02:00
Ludovic Courtès 6f69588529 authenticate: Allow signatures with binary data to be written to stdout.
Fixes <http://bugs.gnu.org/17312>.

* guix/scripts/authenticate.scm (guix-authenticate): Add calls to
  'set-port-encoding!' and 'set-port-conversion-strategy!'.  Wrap body
  in 'with-fluids' form that sets '%default-port-encoding' and
  '%default-port-conversion-strategy'.
* tests/guix-authenticate.sh: Add test.
* tests/pk-crypto.scm ("hash corrupt due to restrictive locale
  encoding"): Add reference to bug.
2014-04-22 11:30:58 +02:00
Ludovic Courtès 30ce8012cd offload: '{send,receive}-files' wait for completion of the transfer.
Fixes situations where the remote 'guix build' is invoked before the
.drv has been completely copied, as reported at
<https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00174.html>.

In some cases 'send-files' would return before the other end is done
importing the files, and so the subsequent 'guix build' invocation would
just miss the .drv file it refers to.

* guix/utils.scm (call-with-decompressed-port): Don't close PORT.
  (call-with-compressed-output-port): Likewise.
* tests/utils.scm ("compressed-output-port + decompressed-port"): Adjust
  accordingly.
* guix/scripts/offload.scm (send-files): Add explicit (close-pipe pipe)
  call.
  (retrieve-files): Likewise.
2014-04-14 00:24:24 +02:00
Ludovic Courtès 66ef541147 offload: Better synchronize with remote invocation of 'guix archive --missing'.
* guix/scripts/offload.scm (send-files)[missing-files]: Call 'waitpid'
  after reading all of MISSING.
2014-04-14 00:17:43 +02:00
Ludovic Courtès 2e7b5cea8c guix system: Add 'vm-image' action and '--image-size' option.
* guix/scripts/system.scm (%options): Add --image-size.
  (%default-options): Add 'image-size'.
  (guix-system)[parse-options]: Handle the 'vm-image' action.
  Honor them.
  (show-help): Update accordingly.
* doc/guix.texi (Invoking guix system): Add 'vm-image'.
2014-04-09 01:20:19 +02:00
Ludovic Courtès 1d6243cf70 ui: Add 'size->number'.
* guix/scripts/gc.scm (size->number): Remove.
* guix/ui.scm (size->number): New procedure.
* tests/ui.scm ("size->number, bytes",
  "size->number, MiB", "size->number, GiB", "size->number, 1.2GiB",
  "size->number, invalid unit"): New tests.
2014-04-08 22:01:44 +02:00
Ludovic Courtès c950141495 offload: Remove all the GC roots in case of multiple-output derivations.
* guix/scripts/offload.scm (remove-gc-root): Rename to...
  (remove-gc-roots): ... this.
  [builder]: Use 'scandir' and remove all the files starting with
  %GC-ROOT-FILE.
  (transfer-and-offload): Adjust to renaming; remove
  'false-if-exception' wraps.
2014-04-08 13:48:30 +02:00
Ludovic Courtès a4b42825a1 offload: Bail out when failing to register a GC root on the build machine.
* guix/scripts/offload.scm (register-gc-root): Call 'leave' when
  'close-pipe' returns non-zero.
2014-04-08 10:09:27 +02:00
Ludovic Courtès 731b996255 hydra: Add 'qemu-image' job.
* build-aux/hydra/demo-os.scm: New file.
* Makefile.am (EXTRA_DIST): Add it.
* build-aux/hydra/gnu-system.scm (qemu-jobs): New procedure.
  (hydra-jobs): Use it.
* guix/scripts/system.scm (read-operating-system): Export.
2014-04-05 22:40:16 +02:00
Ludovic Courtès 512314d738 guix package: Fix indentation of packages to remove.
* guix/scripts/package.scm (show-what-to-remove/install): Add space when
  showing packages to remove.
2014-04-05 21:04:17 +02:00
Ludovic Courtès ded1012f3c pki: Introduce 'write-acl', and fix wrong conversion in 'ensure-acl'.
* guix/pki.scm (write-acl): New procedure.
  (ensure-acl): Use it.  Fixes a regression introduced in 39831f1,
  whereby 'ensure-acl' would yield a wrong-type-arg error.
* guix/scripts/archive.scm (authorize-key): Use 'write-acl'.
2014-04-04 00:23:17 +02:00
Ludovic Courtès 4b00f3434e offload: Prevent the '.drv' and build result from being GC'd.
Before that, there was a small time window during which the GC could
wipe the .drv (before 'guix build' has been called), or the build
result (before 'retrieve-files' has started.)

* guix/scripts/offload.scm (remote-pipe): Add #:quote? parameter and
  honor it.
  (%gc-root-file): New variable.
  (register-gc-root, remove-gc-root): New procedures.
  (offload): Adjust comment.  Run 'guix build' with '-r %GC-ROOT-FILE'.
  (transfer-and-offload): Call 'register-gc-root' before
  sending (derivation-file-name DRV).  Call 'remove-gc-root' after the
  call to 'offload' or 'retrieve-files'.
  (send-files): Call 'remote-pipe' with #:quote? #f.
  (retrieve-files): Likewise.
2014-04-03 23:55:51 +02:00
Ludovic Courtès 27c68457d9 guix package: 'search-path-environment-variables' traverses module tree once.
* guix/scripts/package.scm (search-path-environment-variables)[manifest-entry->package]:
  Use 'find-best-packages-by-name' instead of 'find-packages-by-name'.
  On a profile with 140 packages, this reduces execution time of this
  procedure from 5.8 seconds to 2.9 seconds (50% improvement.)
2014-04-02 16:07:40 +02:00
Ludovic Courtès d2952326ae guix package: Register non-default profiles as GC roots.
* guix/scripts/package.scm (maybe-register-gc-root): New procedure.
* tests/guix-package.sh (profile): Grep the output of "guix gc
  --list-live" in a couple of places.
2014-04-02 16:07:40 +02:00
Ludovic Courtès 39831f1663 pki: Keep ACL in native sexp format to speed up 'authorized-key?'.
* guix/pki.scm (acl-entry-sexp, acl-sexp): Remove.
  (public-keys->acl, current-acl): Return a native sexp.
  (acl->public-keys, authorized-key?): Expect ACL to be a native sexp.
* guix/scripts/archive.scm (authorize-key): Convert ACL to
  canonical-sexp when writing it.
2014-04-01 23:47:51 +02:00
Ludovic Courtès 57832f2ce7 substitute-binary: Avoid consing 'regexp-exec' arguments.
* guix/scripts/substitute-binary.scm (regexp-exec): Change formals
  to (rx str . rest).
2014-04-01 23:47:51 +02:00
Ludovic Courtès c6e9485924 substitute-binary: Avoid reloading the ACL repeatedly.
* guix/scripts/substitute-binary.scm (guix-substitute-binary) <--query>:
  Cache the result of (current-acl); pass it to 'valid-narinfo?' calls.
  This saves 12% wall-clock time for "guix build emacs -n".
2014-04-01 23:47:51 +02:00
Ludovic Courtès e4687a5e68 Use 'signature-case' in (guix nar) and 'substitute-binary'.
* guix/nar.scm (restore-file-set)[assert-valid-signature]: Rewrite in
  terms of 'signature-case'.
* guix/scripts/substitute-binary.scm (narinfo-signature->canonical-sexp):
  Call 'leave' instead of 'raise' when SIGNATURE is invalid.
  (&nar-signature-error, &nar-invalid-hash-error): Remove.
  (assert-valid-signature): Add 'narinfo' parameter; remove 'port'.
  Rewrite in terms of 'signature-case' and 'leave'.  Mention NARINFO's
  URI in error messages.  Adjust caller.
  (narinfo-sha256): New procedure.
  (assert-valid-narinfo): Use it.
  (valid-narinfo?): Rewrite using 'narinfo-sha256' and
  'signature-case'.
* tests/substitute-binary.scm (assert-valid-signature,
  test-error-condition): Remove.
  ("corrupt signature data", "unauthorized public key", "invalid
  signature"): Remove.
2014-03-31 23:47:02 +02:00
Ludovic Courtès 8146fdb334 substitute-binary: Notify of valid signatures.
* guix/scripts/substitute-binary.scm (assert-valid-narinfo): Add
  #:verbose? parameter; when true, write "found valid signature".
  (valid-narinfo?): Pass #:verbose? #f.
2014-03-31 21:59:14 +02:00
Ludovic Courtès de28fefd77 guix archive: Make sure $sysconfdir/guix exists in '--authorize'.
* guix/scripts/archive.scm (authorize-key): Add 'mkdir-p' call.
  Reported by Alex Sassmannshausen <alex.sassmannshausen@gmail.com>.
2014-03-31 21:59:14 +02:00
Ludovic Courtès 36b5851df6 offload: Exit with code 100 upon build failures.
* guix/scripts/offload.scm (transfer-and-offload): Exit with code 100
  upon build failure.
2014-03-31 10:57:28 +02:00
Ludovic Courtès cdea30e061 substitute-binary: Defer narinfo authentication and authorization checks.
* guix/scripts/substitute-binary.scm (narinfo-signature->canonical-sexp):
  Catch 'gcry-error' around 'string->canonical-sexp' call, and re-raise
  as a SRFI-35 &message and &nar-signature-error.
  (narinfo-maker): Handle when SIGNATURE is #f or an invalid canonical
  sexp.
  (&nar-signature-error, &nar-invalid-hash-error): New variables.
  (assert-valid-signature): Use them.  Expect 'signature' to be a
  canonical sexp.
  (read-narinfo): Remove authentication and authorization checks.
  (%signature-line-rx): New variable.
  (assert-valid-narinfo, valid-narinfo?): New procedures.
  (guix-substitute-binary): Wrap body in 'with-error-handling'.
  [valid?]: New procedure.
  <--query>: Show only store items of narinfos that match
  'valid-narinfo?'.
  <--substitute>: Call 'assert-valid-narinfo'.
* tests/substitute-binary.scm (test-error*): Use 'test-equal'.
  (%keypair): Remove.
  (%public-key, %private-key): Load from signing-key.{pub,sec}.
  (signature-body): Add #:public-key parameter.
  (call-with-narinfo): New procedure.
  (with-narinfo): New macro.
  ("corrupt signature data", "unauthorized public key", "invalid
  signature"): Make the first argument to 'assert-valid-signature' a
  canonical sexp.
  ("invalid hash", "valid read-narinfo", "valid write-narinfo"):
  Remove.
  ("query narinfo with invalid hash", "query narinfo signed with
  authorized key", "query narinfo signed with unauthorized key",
  "substitute, invalid hash", "substitute, unauthorized key"): New
  tests.
2014-03-30 22:32:11 +02:00
Ludovic Courtès 00230df107 substitute-binary: Store the cache's URI in the local cached narinfo.
* guix/scripts/substitute-binary.scm (<narinfo>)[uri-base]: New field.
  (narinfo-maker): Pass CACHE-URL as the 'uri-base' value.
  (string->narinfo): Add 'cache-uri' parameter.
  (lookup-narinfo)[cache-entry]: Switch to version 1.  Add 'cache-uri'
  field.  Adjust body accordingly.
  (remove-expired-cached-narinfos): Switch to version 1 by default.
2014-03-30 12:02:10 +02:00
Nikita Karetnikov e9c6c58418 substitute-binary: Support the Signature field of a narinfo file.
* guix/scripts/substitute-binary.scm (<narinfo>): Add the 'signature'
  and 'contents' fields.
  (narinfo-signature->canonical-sexp): New function.
  (narinfo-maker): Add the 'signature' argument and use it.
  (assert-valid-signature): New function.
  (read-narinfo): Support the Signature field.
  (write-narinfo): Use 'narinfo-contents'.
  (%allow-unauthenticated-substitutes?): New variable.
* guix/base64.scm, tests/base64.scm, tests/substitute-binary.scm: New files.
* Makefile.am (SCM_TESTS): Add tests/base64.scm and
  tests/substitute-binary.scm.
  (MODULES): Add guix/base64.scm.
* test-env.in: Set 'GUIX_ALLOW_UNAUTHENTICATED_SUBSTITUTES'.
2014-03-30 12:02:10 +02:00
Ludovic Courtès 07fb21b231 offload: Remove erroneous 'close-pipe' call.
* guix/scripts/offload.scm (send-files): Remove 'close-pipe' call from
  'guard' handler ('pipe' here referred to Guile's 'pipe' procedure.)
2014-03-26 16:27:46 +01:00
Ludovic Courtès 6c41cce0be offload: Wait for the processes involved in 'guix archive --missing'.
* guix/scripts/offload.scm (send-files): Keep the second return value of
  'filtered-port'.  Call 'waitpid' on it.
2014-03-26 16:27:46 +01:00
Ludovic Courtès 236e66481d offload: Allow one transfer in each direction simultaneously.
* guix/scripts/offload.scm (transfer-and-offload): Use 'upload' lock
  instead of 'bandwidth' around 'send-files' calls, and 'download' lock
  around 'retrieve-files' call.
2014-03-26 15:06:52 +01:00
Ludovic Courtès 3dfd8af534 offload: Disable SSH-level compression.
* guix/scripts/offload.scm (remote-pipe): Remove '-z' lsh command line
  argument.  This makes transfers almost an order of magnitude slower.
  OpenSSH's ssh(1) man page notes: "Compression is desirable on modem lines
  and other slow connections, but will only slow down things on fast
  networks."  See also
  <http://www.spikelab.org/blog/transfer-largedata-scp-tarssh-tarnc-compared.html>.
2014-03-26 15:06:52 +01:00
Ludovic Courtès 8b7af63754 offload: Compress files being sent/retrieved.
* guix/scripts/offload.scm (send-files): Add "xz -dc |" to the remote
  pipe command.  Pass PIPE through 'call-with-compressed-output-port'.
  Remove 'close-pipe' call.
  (retrieve-files): Add "| xz -c" to the remote pipe command.  Pass PIPE
  through 'call-with-decompressed-port'.  Remove 'close-pipe' call.
2014-03-24 22:20:54 +01:00
Ludovic Courtès 9b0a2233db authenticate: Support reading the hash or key from stdin.
* guix/scripts/authenticate.scm (guix-authenticate): Add clauses
  for ("rsautl" "-sign" "-inkey" key) and ("rsautl" "-verify" "-inkey" _
  "-pubin").
* tests/guix-authenticate.sh (hash): Add test using -sign and -verify in
  a pipeline.
2014-03-22 22:57:10 +01:00
Ludovic Courtès 9dbe6e43ea authenticate: Move actual work to separate procedures.
* guix/scripts/authenticate.scm (read-canonical-sexp): Change to expect
  a port instead of a file name.
  (read-hash-data): Likewise.
  (sign-with-key, validate-signature): New procedures.
  (guix-authenticate): Rewrite in terms of these two procedures.
2014-03-22 22:57:10 +01:00
Ludovic Courtès 7a8024a33a utils: Add 'decompressed-port' and 'compressed-port'.
* guix/utils.scm (decompressed-port, compressed-port): New procedures.
* guix/scripts/substitute-binary.scm (decompressed-port): Remove.
  (guix-substitute-binary): Pass a symbol or #f as the first argument to
  'decompress-port'.
* tests/utils.scm ("compressed-port, decompressed-port, non-file"): New
  test.
2014-03-22 22:57:09 +01:00
Ludovic Courtès 1fda6840a8 pk-crypto: Don't use Ed25519 when libgcrypt is older than 1.6.0.
* guix/pk-crypto.scm (gcrypt-version): New procedure.
* guix/scripts/archive.scm (%key-generation-parameters): New variable.
  (%options) <generate-key>: Use it.
* tests/pk-crypto.scm ("sign + verify, Ed25519"): Skip if using gcrypt < 1.6.0.
2014-03-20 23:06:47 +01:00
Ludovic Courtès d81195bffd offload: Send build logs to file descriptor 4.
* guix/scripts/offload.scm (with-error-to-port): New macro.
  (remote-pipe): Add #:error-port parameter.  Use 'with-error-to-port'
  around 'open-pipe*' call.
  (build-log-port): New procedure.
  (offload): Change #:log-port to default to (build-log-port).  Call
  'remote-pipe' with #:error-port LOG-PORT.
2014-03-19 23:12:06 +01:00
Ludovic Courtès 19ee8c7dc5 substitute-binary: Quietly handle 404s when fetching narinfos.
* guix/scripts/substitute-binary.scm (fetch): Add #:quiet-404?
  parameter.  Upon &http-get-error, re-raise C if the QUIET-404? is
  true and the code is 404.
  (fetch-narinfo): Pass #:quiet-404? #t.
2014-03-19 22:26:08 +01:00
Ludovic Courtès 32a1eb8025 pk-crypto: Use RFC6979 when signing with an ECC or DSA key.
* guix/pk-crypto.scm (bytevector->hash-data): Add #:key-type parameter.
  Use the 'pkcs1' flag when KEY-TYPE is 'rsa', and 'rfc6979' when
  KEY-TYPE is 'ecc' or 'dsa'.
  (key-type): New procedure.
* guix/scripts/authenticate.scm (read-hash-data): Add 'key-type'
  parameter.  Pass it to 'bytevector->hash-data'.  Adjust caller
  accordingly.
* tests/pk-crypto.scm (%ecc-key-pair): New variable.
  ("key-type"): New test.
  ("sign + verify"): Pass #:key-type to 'bytevector->hash-data'.
  ("sign + verify, Ed25519"): New test.
2014-03-19 21:40:10 +01:00
Ludovic Courtès 1cbfce1669 guix archive: Generate curve Ed25519 keys by default.
* guix/scripts/archive.scm (%options) <generate-key>: Default to curve
  Ed25519.  Suggested by Christian Grothoff <grothoff@in.tum.de>.
2014-03-17 23:49:35 +01:00
Ludovic Courtès d0a850698a guix archive: Improve '--generate-key' error reporting.
* guix/scripts/archive.scm (%options) <generate-key>: Report the error
  source and string when 'string->canonical-sexp' fails.
2014-03-17 23:47:18 +01:00
Ludovic Courtès 1a8ea0a188 offload: Fix 'choose-build-machine' for several machines.
* guix/scripts/offload.scm (choose-build-machine)[undecorate]: Turn into
  a two-argument procedure.
2014-03-13 22:57:21 +01:00
Ludovic Courtès 3c0e6e6080 offload: Convert the port number to a string when invoking lsh.
* guix/scripts/offload.scm (remote-pipe, send-files): Pass the result of
  'build-machine-port' to 'number->string'.
2014-03-13 22:46:32 +01:00
Ludovic Courtès cecd72d55a offload: Allow build machines to specify a port number.
* guix/scripts/offload.scm (<build-machine>): Add 'port' field.
  (remote-pipe, send-files): Use lsh's '-p' option when invoking it.
2014-03-13 21:58:04 +01:00
Ludovic Courtès 257b93412a guix build: Support '--with-source' along with '-e'.
* guix/scripts/build.scm (derivation-from-expression): Remove.
  (options->derivations): Handle pairs of the form
  "('argument . (? derivation?))".
  (options/resolve-packages): Add 'store' parameter; update caller.  Add
  'system' variable.  Add case for 'expression pairs.
* guix/scripts/archive.scm (derivation-from-expression): New procedure.
2014-03-13 19:21:49 +01:00
Ludovic Courtès 7f3673f21d guix build: Add '--with-source'.
* guix/scripts/build.scm (package-with-source): New procedure.
  (show-help): Add '--with-source'.
  (%options): Likewise.
  (options->derivations): Call 'options/with-source' and
  'options/resolve-packages'.
  (options/resolve-packages, options/with-source): New procedures.
* doc/guix.texi (Invoking guix build): Document '--with-source'.
2014-03-12 00:22:41 +01:00
Ludovic Courtès 714084e6c0 offload: Honor absolute build timeouts.
* guix/scripts/offload.scm (offload): Remove default value for
  'build-timeout'.  Pass '--timeout' to the remote 'guix build'
  process.
  (transfer-and-offload, process-request): Remove default value for
  'build-timeout'.
2014-03-09 23:15:09 +01:00
Ludovic Courtès 002622b65b guix build: Add '--timeout' to the common build options.
* guix/scripts/build.scm (show-build-options-help): Document
  '--timeout'.
  (set-build-options-from-command-line): Pass #:timeout to
  'set-build-options'.
  (%standard-build-options): Add '--timeout'.
* doc/guix.texi (Invoking guix build): Document it.
2014-03-09 23:09:18 +01:00
Ludovic Courtès 59f704dff6 offload: Move macro definitions before use.
* guix/scripts/offload.scm (lock-file, unlock-file, with-file-lock,
  with-machine-lock, machine-slot-file, acquire-build-slot,
  release-build-slot): Move definitions above their first use.
2014-03-09 18:08:38 +01:00
Ludovic Courtès 88da0b6888 offload: Distinguish between 'decline' and 'postpone'.
* guix/scripts/offload.scm (transfer-and-offload): New procedure, with
  core formerly in 'process-request'.
  (choose-build-machine): Remove 'requirements' parameter.
  (process-request): Reply 'decline' when none of MACHINES matches the
  requirements, and 'postpone' when MACHINES are busy.
2014-03-09 14:06:35 +01:00
Ludovic Courtès 5cc569dc73 offload: Prevent locked files from being GC'd.
* guix/scripts/offload.scm (%slots): New variable.
  (choose-build-machine): Add SLOT to '%slots'.
2014-03-08 21:23:12 +01:00
Ludovic Courtès 7df3ade112 offload: Fix thinko.
* guix/scripts/offload.scm (choose-build-machine)[machine+slots]: Use
  'filter-map', not 'filter'.
2014-03-08 12:22:49 +01:00
Ludovic Courtès d652b85137 offload: Make 'parallel-builds' a hard limit.
* guix/scripts/offload.scm (machine-choice-lock-file,
  machine-slot-file, acquire-build-slot, release-build-slot): New
  procedures.
  (choose-build-machine): Operate with (machine-choice-lock-file)
  taken.  Acquire a build slot for each of MACHINES.  Release those not
  used.
2014-03-08 12:16:06 +01:00
Ludovic Courtès 4bf1eb4f88 offload: Further generalize lock files.
* guix/scripts/offload.scm (lock-machine, unlock-machine): Remove.
  (lock-file, unlock-file): New procedures.
  (with-file-lock): New macro.
  (with-machine-lock): Rewrite in terms of 'with-file-lock'.
2014-03-08 12:07:57 +01:00
Ludovic Courtès 178f5828eb offload: Generalize the machine lock mechanism.
* guix/scripts/offload.scm (lock-machine): Add 'hint' parameter.
  (unlock-machine): Remove 'machine' parameter.
  (with-machine-lock): Add 'hint' parameter, and pass it down.
  (process-request): Adjust uses of 'with-machine-lock' to pass the
  'bandwidth hint.
2014-03-08 11:29:52 +01:00
Ludovic Courtès f326fef8a8 offload: Serialize file transfers to build machines.
* guix/scripts/offload.scm (machine-lock-file, lock-machine,
  unlock-machine): New procedures.
  (with-machine-lock): New macro.
  (process-request): Wrap 'send-files' and 'retrieve-files' calls in
  'with-machine-lock'.
2014-03-06 21:42:24 +01:00
Ludovic Courtès dd67b429e1 guix package: Use the common build options from (guix scripts build).
* guix/scripts/build.scm (%standard-build-options): Change option
  handlers to support multiple seeds.
* guix/scripts/package.scm (show-help): Remove --dry-run, --fallback,
  --no-substitutes, and --max-silent-time.
  (%options): Likewise, and add %STANDARD-BUILD-OPTIONS.
  (%default-options): Add 'verbosity'.
  (guix-package): Call 'set-build-options-from-command-line' instead of
  'set-build-options'.
2014-03-01 18:29:29 +01:00
Ludovic Courtès 706e9e575d substitute-binary: Gracefully handle HTTP GET errors.
* guix/http-client.scm (&http-get-error): New condition type.
  (http-fetch): Raise it instead of using 'error'.
* guix/scripts/substitute-binary.scm (fetch) <http>: Wrap body into
  'guard' form; gracefully handle 'http-get-error?' conditions.
2014-03-01 15:38:11 +01:00
Ludovic Courtès 1f7fd80032 offload: Comment out attempt to set up an lsh gateway.
* guix/scripts/offload.scm (open-ssh-gateway): Comment out.
  (process-request): Remove call to 'open-ssh-gateway' and to 'kill'.
2014-03-01 12:24:39 +01:00
Ludovic Courtès aedbf9b873 offload: 'remote-pipe' uses the right SSH key.
* guix/scripts/offload.scm (remote-pipe): Pass -i when invoking
  %LSHG-COMMAND.
2014-03-01 12:15:47 +01:00
Ludovic Courtès 165f4b2add offload: Take the target machine load into account.
* guix/scripts/offload.scm (machine-load, machine-less-loaded?,
  machine-less-loaded-or-faster?): New procedures.
  (choose-build-machine): Use 'machine-less-loaded-or-faster?' when
  sorting.  Return the head of MACHINES unless it's loaded is >= 2.
2014-03-01 01:31:18 +01:00
Ludovic Courtès 36b56f081b guix archive: Change '--help' to show '--authorize'.
* guix/scripts/archive.scm (show-help): Add '--authorize'.
2014-02-28 22:31:16 +01:00
Ludovic Courtès 3140f2df42 guix hash: Add '--recursive'.
* guix/scripts/hash.scm (show-help): Add --recursive.
  (%options): Likewise.
  (guix-hash)[file-hash]: New procedure.  Honor --recursive.
  Use it.
* guix/nar.scm (write-file): Add missing field to the &nar-error
  condition raised upon unsupported file type; change its message to be
  more descriptive.
* tests/guix-hash.sh: Add tests with -r.
* doc/guix.texi (Invoking guix hash): Document --recursive.
2014-02-21 23:49:52 +01:00
Ludovic Courtès c6d37be951 guix hash: Don't load the whole file in memory.
* guix/scripts/hash.scm (guix-hash)[eof->null]: Remove.
  (guix-hash): Use 'port-sha256' to compute the hash instead of
  'get-bytevector-all' and co.
2014-02-20 23:18:08 +01:00
Ludovic Courtès db4fdc04cc gnu: Introduce the (gnu services ...) modules.
* gnu/system/dmd.scm: Remove file.  Move contents to...
* gnu/services.scm, gnu/services/base.scm, gnu/services/dmd.scm,
  gnu/services/networking.scm, gnu/services/xorg.scm: ... here.  New
  files.
* gnu/system.scm, gnu/system/vm.scm: Adjust accordingly.
* guix/scripts/system.scm (%user-module): Likewise.
* doc/guix.texi (Using the Configuration System): Likewise.
  (Defining Services): Likewise.
2014-02-19 20:58:24 +01:00
Ludovic Courtès 523e48969b Add 'guix system'.
* guix/scripts/system.scm: New file.
* Makefile.am (MODULES): Add it.
* po/POTFILES.in: Likewise.
* doc/guix.texi (Using the Configuration System): Link to "Invoking guix
  system".
  (Invoking guix system): New node.
2014-02-18 23:47:49 +01:00
Ludovic Courtès e7fc17b592 guix build: Factorize common options.
* guix/scripts/build.scm (show-build-options-help,
  set-build-options-from-command-line): New procedures.
  (show-help): Remove description of --dry-run,
  --fallback, --no-substitutes, --max-silent-time, and --cores.  Call
  'show-build-options-help'.
  (%standard-build-options): New variable.
  (%options): Remove --dry-run, --fallback, --no-substitutes,
  --verbosity, --max-silent-time, and --cores.  Add
  %STANDARD-BUILD-OPTIONS.
  (guix-build): Use 'set-build-options-from-command-line' instead of
  'set-build-options'.
* guix/scripts/archive.scm (show-help): Remove description of --dry-run,
  --fallback, --no-substitutes, --max-silent-time, and --cores.  Call
  'show-build-options-help'.
  (%options): Remove --dry-run, --fallback, --no-substitutes,
  --verbosity, --max-silent-time, and --cores.  Add
  %STANDARD-BUILD-OPTIONS.
  (export-from-store): Call 'set-build-options-from-command-line'
  instead of 'set-build-options.
2014-02-18 00:13:24 +01:00
Ludovic Courtès bdff90a16a guix build: Move 'set-build-options' call earlier.
* guix/scripts/build.scm (guix-build): Move 'set-build-options' call
  before 'show-what-to-build'.
2014-02-12 00:03:20 +01:00
Ludovic Courtès 92cb2e2888 offload: Have 'build-machines' honor its argument.
* guix/scripts/offload.scm (build-machines): Honor FILE.
2014-02-02 01:32:50 +01:00
Ludovic Courtès a76611c435 offload: Do not try to retrieve anything upon build failure.
* guix/scripts/offload.scm (offload): Add 'log-port' keyword parameter.
  Handle log display here.  Return the result of (close-pipe pipe).
  (process-request): Adjust 'offload' call site accordingly.  Call
  'retrieve-files' only when 'offload' returns zero; exit when 'offload'
  returns non-zero.
2014-01-27 21:32:59 +01:00
Ludovic Courtès 49e6291a7a Add 'guix offload' as a daemon build hook.
* nix/nix-daemon/guix-daemon.cc (GUIX_OPT_NO_BUILD_HOOK): New macro.
  (options): Add '--no-build-hook'.
  (parse_opt): Handle it.
  (main)[HAVE_DAEMON_OFFLOAD_HOOK]: Set 'useBuildHook' by default.
  Set $NIX_BUILD_HOOK to our offload hook unless otherwise specified.
  [!HAVE_DAEMON_OFFLOAD_HOOK]: Clear 'useBuildHook'.
* pre-inst-env.in: Set and export NIX_BUILD_HOOK.
* nix/scripts/offload.in, guix/scripts/offload.scm: New files.
* guix/ui.scm (show-guix-help)[internal?]: Add "offload".
* config-daemon.ac: Call 'GUIX_CHECK_UNBUFFERED_CBIP'.
  Instantiate 'nix/scripts/offload'.  Set 'BUILD_DAEMON_OFFLOAD'
  conditional, and optionally define 'HAVE_DEAMON_OFFLOAD_HOOK' cpp
  macro.
* daemon.am (nodist_pkglibexec_SCRIPTS)[BUILD_DAEMON_OFFLOAD]: Add it.
* Makefile.am (MODULES)[BUILD_DAEMON_OFFLOAD]: Add
  'guix/scripts/offload.scm'.
  (EXTRA_DIST)[!BUILD_DAEMON_OFFLOAD]: Likewise.
* m4/guix.m4 (GUIX_CHECK_UNBUFFERED_CBIP): New macro.
* doc/guix.texi (Setting Up the Daemon): Move most of the body to...
  (Build Environment Setup): ... this.  New subsection.
  (Daemon Offload Setup): New subsection.
2014-01-24 00:01:50 +01:00
Ludovic Courtès d28684b5a5 pki: Factorize signature manipulation procedures.
* guix/pki.scm (signature-subject, signature-signed-data,
  valid-signature?): New procedures.
* guix/scripts/authenticate.scm (guix-authenticate): Adjust to use
  them.
2014-01-24 00:01:49 +01:00
Ludovic Courtès d43eb499a6 Update 'nix-upstream' sub-module; adjust build system, doc, and substituter.
* nix-upstream: Update sub-module.
* daemon.am (libutil_a_SOURCES): Add affinity.cc.
  (libutil_headers): Add affinity.hh.
  (libexec_PROGRAMS, nix_setuid_helper_SOURCES,
  nix_setuid_helper_CPPFLAGS, nix_setuid_helper_LDADD): Remove.
* doc/guix.texi (Setting Up the Daemon): Remove paragraph about
  'nix-setuid-helper'.
* guix/scripts/substitute-binary.scm (guix-substitute-binary): Exit 0 when
  %CACHE-URL has an HTTP scheme and looking up its host fails.
  Always print a newline to stdout when starting.
2014-01-18 22:32:50 +01:00
Ludovic Courtès eb9a9feefd guix package: Gracefully handle EPIPE on '--search'.
* guix/scripts/package.scm (guix-package): Wrap body of 'search' in
  'leave-on-EPIPE'.
2014-01-13 18:51:07 +01:00
Ludovic Courtès 80d0447c95 config: '%state-directory' always honors $NIX_STATE_DIR.
* guix/config.scm.in (%state-directory): Honor $NIX_STATE_DIR.
* guix/scripts/package.scm (%profile-directory): Use %state-directory
  directly.
* guix/store.scm (%default-socket-path, log-file): Likewise.
2014-01-08 21:12:55 +01:00
Ludovic Courtès 87236aed77 archive: Add '--missing'.
* guix/scripts/archive.scm (show-help, %options): Add '--missing'.
  (guix-archive)[lines]: New procedure.
  Use it to honor '--missing'.
* tests/guix-archive.sh: Add tests.
* doc/guix.texi (Invoking guix archive): Document '--missing'.
2014-01-06 22:25:29 +01:00
Ludovic Courtès 590e4154b6 archive: Make sure $sysconfdir/guix exists.
* guix/pki.scm (ensure-acl): Make sure the directory of %ACL-FILE
  exists.
* guix/scripts/archive.scm (generate-key-pair): Likewise for
  %PUBLIC-KEY-FILE.
2014-01-05 23:40:06 +01:00
Ludovic Courtès 425b0bfc2e guix build: Add '--no-build-hook'.
* guix/scripts/build.scm (%default-options): Add 'build-hook?' pair.
  (show-help, %options): Add --no-build-hook.
  (guix-build): Pass the 'build-hook?' value to 'set-build-options'.
* doc/guix.texi (Invoking guix build): Document '--no-build-hook'.
2014-01-05 22:58:32 +01:00
Ludovic Courtès 1a43e4dc57 guix package: Gracefully deal with EPIPE on stdout for --list-*.
* guix/scripts/package.scm (leave-on-EPIPE): New macro.
  (guix-package): Use it for 'list-installed', 'list-available', and
  '--list-generations'.
* tests/guix-package.sh: Add test.
2014-01-04 22:45:33 +01:00
Ludovic Courtès f82cc5fdbe archive: Add '--authorize'.
* guix/scripts/archive.scm (authorize-key): New procedure.
  (guix-archive): Call it when OPTS contains 'authorize-key'.
* tests/guix-archive.sh: Add test with invalid public key.
* guix/pki.scm: Export '%acl-file'.
* doc/guix.texi (Invoking guix archive): Make it clear that '--import'
  works only with authorized keys.  Document '--authorize'.
2013-12-30 23:18:52 +01:00
Ludovic Courtès 554f26ece3 archive: Add '--generate-key'.
* guix/pk-crypto.scm (error-source, error-string): New procedures.
* guix/pki.scm (%private-key-file): New variable.
* guix/scripts/archive.scm (show-help): Document '--generate-key'.
  (%options): Add "generate-key".
  (generate-key-pair): New procedure.
  (guix-archive): Call 'generate-key' when OPTS contains a
  'generate-key' pair.
* doc/guix.texi (Setting Up the Daemon): Suggest generating a key pair.
  (Invoking guix archive): Document '--generate-key'.
2013-12-30 22:57:37 +01:00
Ludovic Courtès c909dab269 authenticate: Consistently use 'leave' for fatal error reporting.
* guix/scripts/authenticate.scm (guix-authenticate): Replace all uses of
  'format' + 'exit' with 'leave'.
2013-12-30 18:23:44 +01:00
Ludovic Courtès 96e5085c81 authenticate: Disallow imports signed with unauthorized keys.
* guix/scripts/authenticate.scm (signature-sexp): Remove.
  (guix-authenticate): Upon '-verify', check whether the signature's
  public key passes 'authorized-key?'.
2013-12-29 15:57:24 +01:00
Ludovic Courtès 04d4c8a439 Move 'with-atomic-file-output' to (guix utils).
* guix/scripts/substitute-binary.scm (with-atomic-file-output): Move to...
* guix/utils.scm (with-atomic-file-output): ... here.
2013-12-29 15:57:24 +01:00
Ludovic Courtès 6df1fb8991 authenticate: Store the public key as part of the signature.
* guix/scripts/authenticate.scm (signature-sexp): New procedure.
  (guix-authenticate): Use it to produce the signature.  Adjust
  verification code accordingly.
* tests/store.scm ("import corrupt path"): Adjust test accordingly.
2013-12-29 15:57:23 +01:00