summaryrefslogtreecommitdiff
path: root/guix
AgeCommit message (Collapse)Author
2014-04-05hydra: Add 'qemu-image' job.Ludovic Courtès
* 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-05guix package: Fix indentation of packages to remove.Ludovic Courtès
* guix/scripts/package.scm (show-what-to-remove/install): Add space when showing packages to remove.
2014-04-04ui: Improve reporting of 'system-error' exceptions.Ludovic Courtès
* guix/ui.scm (call-with-error-handling): Change 'system-error' handler to display the error message as it was raised.
2014-04-03union: Ensure that the output is always a directory.Mark H Weaver
Fixes the creation of single-package profiles, reported by Ludovic Courtès. * guix/build/union.scm (union-build): Add new internal procedure 'union-of-directories' that always creates a directory, containing the code previously used only to merge multiple directories. Call it from the multiple-directory case in 'union' and from the top-level 'union-build'.
2014-04-04pki: Introduce 'write-acl', and fix wrong conversion in 'ensure-acl'.Ludovic Courtès
* 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-03offload: Prevent the '.drv' and build result from being GC'd.Ludovic Courtès
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-02union: Rewrite to be faster; handle symlink/directory conflicts.Mark H Weaver
* guix/build/union.scm: Rewrite; only 'file=?' remains unchanged. Remove 'tree-union' and 'delete-duplicate-leaves' exports. Merge inputs in a breadth-first fashion. Follow symlinks for purposes of making decisions about the merge. * tests/union.scm: Remove tests of 'tree-union' and 'delete-duplicate-leaves'.
2014-04-02guix package: 'search-path-environment-variables' traverses module tree once.Ludovic Courtès
* 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-02guix package: Register non-default profiles as GC roots.Ludovic Courtès
* 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-01pki: Keep ACL in native sexp format to speed up 'authorized-key?'.Ludovic Courtès
* 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-01substitute-binary: Avoid consing 'regexp-exec' arguments.Ludovic Courtès
* guix/scripts/substitute-binary.scm (regexp-exec): Change formals to (rx str . rest).
2014-04-01substitute-binary: Avoid reloading the ACL repeatedly.Ludovic Courtès
* 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-03-31Use 'signature-case' in (guix nar) and 'substitute-binary'.Ludovic Courtès
* 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-31pki: Add 'signature-case' macro.Ludovic Courtès
* guix/pki.scm (%signature-status): New procedure. (signature-case): New macro. * tests/pki.scm (%secret-key, %alternate-secret-key): New variables. ("signature-case valid-signature", "signature-case invalid-signature", "signature-case hash-mismatch", "signature-case unauthorized-key", "signature-case corrupt-signature"): New tests.
2014-03-31substitute-binary: Notify of valid signatures.Ludovic Courtès
* guix/scripts/substitute-binary.scm (assert-valid-narinfo): Add #:verbose? parameter; when true, write "found valid signature". (valid-narinfo?): Pass #:verbose? #f.
2014-03-31guix archive: Make sure $sysconfdir/guix exists in '--authorize'.Ludovic Courtès
* guix/scripts/archive.scm (authorize-key): Add 'mkdir-p' call. Reported by Alex Sassmannshausen <alex.sassmannshausen@gmail.com>.
2014-03-31offload: Exit with code 100 upon build failures.Ludovic Courtès
* guix/scripts/offload.scm (transfer-and-offload): Exit with code 100 upon build failure.
2014-03-30substitute-binary: Defer narinfo authentication and authorization checks.Ludovic Courtès
* 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-30substitute-binary: Store the cache's URI in the local cached narinfo.Ludovic Courtès
* 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-30substitute-binary: Support the Signature field of a narinfo file.Nikita Karetnikov
* 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-30nar: Clarify that 'assert-valid-signature' accepts a string.Nikita Karetnikov
* guix/nar.scm (assert-valid-signature): Improve the wording.
2014-03-27Add (guix svn-download).Sree Harsha Totakura
* guix/svn-download.scm, guix/build/svn.scm: New files. * Makefile.am (MODULES): Add them. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2014-03-26Merge branch 'core-updates'Ludovic Courtès
2014-03-26offload: Remove erroneous 'close-pipe' call.Ludovic Courtès
* guix/scripts/offload.scm (send-files): Remove 'close-pipe' call from 'guard' handler ('pipe' here referred to Guile's 'pipe' procedure.)
2014-03-26offload: Wait for the processes involved in 'guix archive --missing'.Ludovic Courtès
* guix/scripts/offload.scm (send-files): Keep the second return value of 'filtered-port'. Call 'waitpid' on it.
2014-03-26offload: Allow one transfer in each direction simultaneously.Ludovic Courtès
* 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-26offload: Disable SSH-level compression.Ludovic Courtès
* 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-25download: Don't use 'http-get*' on Guile 2.0.10+.Ludovic Courtès
* guix/build/download.scm (http-fetch)[post-2.0.7?]: Use 'string->number' and numeric comparison. This fixes version comparison with "2.0.10" and subsequent 2.0 releases.
2014-03-24offload: Compress files being sent/retrieved.Ludovic Courtès
* 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-24utils: Add 'call-with-decompressed-port' and 'call-with-compressed-output-port'.Ludovic Courtès
* guix/utils.scm (call-with-decompressed-port, call-with-compressed-output-port): New procedures. * tests/utils.scm ("compressed-output-port + decompressed-port"): Rewrite to use them.
2014-03-24utils: Add 'filtered-output-port' and 'compressed-output-port'.Ludovic Courtès
* guix/utils.scm (filtered-output-port, compressed-output-port): New procedures. * tests/utils.scm ("compressed-output-port + decompressed-port"): New test.
2014-03-22authenticate: Support reading the hash or key from stdin.Ludovic Courtès
* 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-22authenticate: Move actual work to separate procedures.Ludovic Courtès
* 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-22utils: Add 'decompressed-port' and 'compressed-port'.Ludovic Courtès
* 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-22utils: 'filtered-port' doesn't leave dangling processes behind.Ludovic Courtès
* guix/utils.scm (filtered-port): Make sure the 'execl' child process always exits, and does (primitive-_exit 1) upon execution failure. Use 'primitive-_exit' in the 'dump-port' child process. * tests/utils.scm ("filtered-port, does not exist"): New test.
2014-03-22licenses: Fix Nixpkgs license URL.Yakkala Yagnesh Raghava
* guix/licenses.scm: Fix Nixpkgs URL in comment. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2014-03-22Merge branch 'master' into core-updatesMark H Weaver
2014-03-20pk-crypto: Don't use Ed25519 when libgcrypt is older than 1.6.0.Ludovic Courtès
* 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-19offload: Send build logs to file descriptor 4.Ludovic Courtès
* 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-19substitute-binary: Quietly handle 404s when fetching narinfos.Ludovic Courtès
* 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-19pk-crypto: Use RFC6979 when signing with an ECC or DSA key.Ludovic Courtès
* 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-17guix archive: Generate curve Ed25519 keys by default.Ludovic Courtès
* guix/scripts/archive.scm (%options) <generate-key>: Default to curve Ed25519. Suggested by Christian Grothoff <grothoff@in.tum.de>.
2014-03-17guix archive: Improve '--generate-key' error reporting.Ludovic Courtès
* guix/scripts/archive.scm (%options) <generate-key>: Report the error source and string when 'string->canonical-sexp' fails.
2014-03-17Merge branch 'master' into core-updatesLudovic Courtès
2014-03-14store: Add 'hash-part->path'.Ludovic Courtès
* guix/store.scm (hash-part->path): New procedure. * tests/store.scm ("hash-part->path"): New test.
2014-03-13offload: Fix 'choose-build-machine' for several machines.Ludovic Courtès
* guix/scripts/offload.scm (choose-build-machine)[undecorate]: Turn into a two-argument procedure.
2014-03-13offload: Convert the port number to a string when invoking lsh.Ludovic Courtès
* guix/scripts/offload.scm (remote-pipe, send-files): Pass the result of 'build-machine-port' to 'number->string'.
2014-03-13offload: Allow build machines to specify a port number.Ludovic Courtès
* guix/scripts/offload.scm (<build-machine>): Add 'port' field. (remote-pipe, send-files): Use lsh's '-p' option when invoking it.
2014-03-13guix build: Support '--with-source' along with '-e'.Ludovic Courtès
* 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-12guix build: Add '--with-source'.Ludovic Courtès
* 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'.