1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161<eelco.dolstra@logicblox.com> Date: Tue Oct 14 10:51:19 2014 +0200 Improved error message when encountering unsupported file types Fixes #269. commit c2b65dd197a1b2e14d517b0b5ff307b149538917 Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Fri Oct 3 22:37:51 2014 +0200 Remove some duplicate code commit c95742283595cb01b44ddc8e6ff5e9c1d66db444 Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Fri Oct 3 16:53:28 2014 +0200 createDirs(): Handle ‘path’ being a symlink In particular, this fixes "nix-build -o /tmp/result" on Mac OS X (where /tmp is a symlink). commit 6092a48603ea7888f8a1f69db87835bc339c973a Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Thu Sep 25 18:45:43 2014 +0200 nix-daemon: Close unnecessary fd commit e74390a16f74233283572661f64ed4f03ae1650d Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Fri Sep 19 15:07:22 2014 +0200 Remove bogus comment commit e63c8aaa0511d1d0a5487c45dec9f8cbd66b4cc6 Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Wed Sep 17 17:21:13 2014 +0200 On Linux, disable address space randomization commit 55939b1a4b34b904eedba90ac6c14efc6258f40d Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Wed Sep 17 15:18:13 2014 +0200 Settings: Add bool get() commit 6621195e48f8e0cbbe6e19dbcde30bd8a7da0399 Author: Ludovic Courtès <ludo@gnu.org> Date: Mon Sep 1 22:21:42 2014 +0200 Add an 'optimiseStore' remote procedure call. commit 3bb89c3a31b9cf6e056f3659389e2d2e7afd17fa Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Thu Aug 28 18:57:13 2014 +0200 Add disallowedReferences / disallowedRequisites For the "stdenv accidentally referring to bootstrap-tools", it seems easier to specify the path that we don't want to depend on, e.g. disallowedRequisites = [ bootstrapTools ]; commit abd9d61e6201ddbde3305dd27c286e883e950bec Author: Gergely Risko <errge@nilcons.com> Date: Wed Aug 27 16:46:02 2014 +0200 Introduce allowedRequisites feature commit 8c766e48d5c4741b63a4f24dc91138f587c04a5a Author: Joel Taylor <me@joelt.io> Date: Thu Aug 21 14:06:49 2014 -0700 fix disappearing bash arguments commit d4e7c195fabf0f24c2ffbd4ca8f189489bbbf44d Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Tue Aug 19 17:44:59 2014 +0200 Make hook shutdown more reliable commit ea837e470f70900481d00b0d1cd73e6855c4f70d Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Mon Aug 18 11:35:50 2014 +0200 Doh commit 790271559cb8b36cd8fcdc533f41be88ec15ad08 Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Sun Aug 17 19:11:50 2014 +0200 Reduce verbosity commit 3f6d4f63ec0d1d6cfc3233998b7dd9608b2f6ff3 Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Sun Aug 17 19:09:03 2014 +0200 Propagate remote timeouts properly commit aa98ba506739b885b3ce0b392dade5e1e1bb07f7 Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Wed Aug 13 17:44:41 2014 +0200 Use regular file GC roots if possible This makes hydra-eval-jobs create roots as regular files. See 1c208f2b7ef8ffb5e6d435d703dad83223a67bd6. commit 5fe5ff77800c2911c011f582d8dfa90c44d4a3a5 Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Tue Aug 5 16:41:42 2014 +0200 Remove unnecessary call to addTempRoot() commit 1820845c44c8cbe1121e78d5f16e7778532477f6 Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Tue Aug 5 10:19:57 2014 +0200 Doh commit e9070bf4226b225a0b42798b20ea3947abf58a6f Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Mon Aug 4 18:13:14 2014 +0200 Move some options out of globals commit 31909515634d74e4c3d92be6186c5c48244582ae Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Mon Aug 4 18:02:29 2014 +0200 Refactor commit f530ee6f356f4299ca343dde7f4c0742300ffa08 Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Mon Aug 4 18:00:00 2014 +0200 Add option ‘build-extra-chroot-dirs’ This is useful for extending (rather than overriding) the default set of chroot paths. commit 75f746f018e34868b8057bed87c90d2cbe2c0b6c Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Mon Aug 4 17:27:45 2014 +0200 Get rid of "killing <pid>" message for unused build hooks commit 42c6246f674ca2d5ea166d1ae676b7087ea1b0d8 Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Fri Aug 1 19:38:21 2014 +0200 Remove ugly hack for detecting build environment setup errors commit b732ffd28ddf50d3150e4f276a0e8488e38eaacb Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Fri Aug 1 19:29:03 2014 +0200 Call commonChildInit() before doing chroot init This ensures that daemon clients see error messages from the chroot setup. commit c51374c128cbe1f06acd95ba2d627a118a95aabf Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Fri Aug 1 17:30:51 2014 +0200 Eliminate redundant copy commit 666c9b7108e460f0d3450015a3379bfeb3e3a497 Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Fri Aug 1 17:20:25 2014 +0200 findRoots(): Prevent a call to lstat() This means that getting the roots from /nix/var/nix/.../hydra-roots doesn't need any I/O other than reading the directory. commit 82d463d9cacbf2a93b95ab5313567d593fd00d02 Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Fri Aug 1 16:37:47 2014 +0200 Make readDirectory() return inode / file type commit a98fa2d9e2b06e2561330c5ef845ffaf131e95ac Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Fri Aug 1 16:46:01 2014 +0200 Allow regular files as GC roots If a root is a regular file, then its name must denote a store path. For instance, the existence of the file /nix/var/nix/gcroots/per-user/eelco/hydra-roots/wzc3cy1wwwd6d0dgxpa77ijr1yp50s6v-libxml2-2.7.7 would cause /nix/store/wzc3cy1wwwd6d0dgxpa77ijr1yp50s6v-libxml2-2.7.7 to be a root. This is useful because it involves less I/O (no need for a readlink() call) and takes up less disk space (the symlink target typically takes up a full disk block, while directory entries are packed more efficiently). This is particularly important for hydra.nixos.org, which has hundreds of thousands of roots, and where reading the roots can take 25 minutes. commit 4ab4b0c109734bd6e265ca5f1b6415c31c03ab11 Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Thu Jul 24 00:00:53 2014 +0200 Remove some dead code commit 1cffdf5847b065183c9aac86df3a9578020e6712 Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Wed Jul 23 19:43:46 2014 +0200 nix-daemon: Less verbosity commit bb07dfe96f0d07aa18db385d3ec93b24b5568213 Author: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Wed Jul 23 19:37:40 2014 +0200 nix-daemon: Simplify stderr handling commit 766481d606e4b1860307692d6a44723983662d45 Merge: c69944c fdee1ce Author: Ludovic Courtès <ludo@gnu.org> Date: Mon May 11 17:04:26 2015 +0200 Merge commit 'fdee1ced43fb495d612a29e955141cdf6b9a95ba' into nix commit c69944c511b89d3fdbffe00353e27d1e1c5f670c Merge: a1dd396 8e9140c Author: Ludovic Courtès <ludo@gnu.org> Date: Wed May 6 23:22:04 2015 +0200 Merge commit '8e9140cfdef9dbd1eb61e4c75c91d452ab5e4a74' into nix Conflicts: Makefile.config.in configure.ac dev-shell doc/manual/builtins.xml doc/manual/conf-file.xml doc/manual/local.mk doc/manual/nix-instantiate.xml doc/manual/nix-store.xml doc/manual/writing-nix-expressions.xml misc/emacs/nix-mode.el perl/lib/Nix/CopyClosure.pm release.nix scripts/nix-build.in scripts/nix-copy-closure.in src/download-via-ssh/download-via-ssh.cc src/libexpr/common-opts.cc src/libexpr/common-opts.hh src/libexpr/eval.cc src/libexpr/eval.hh src/libexpr/local.mk src/libexpr/nixexpr.cc src/libexpr/nixexpr.hh >list entry) (list (manifest-entry-name entry) (manifest-entry-version entry) (manifest-entry-output entry) (manifest-entry-search-paths entry) (map manifest-entry->list (manifest-entry-dependencies entry)))) (test-begin "inferior") (test-equal "open-inferior" '(42 #t) (let ((inferior (open-inferior %top-builddir #:command "scripts/guix"))) (and (inferior? inferior) (let ((a (inferior-eval '(apply * '(6 7)) inferior)) (b (inferior-eval '(@ (gnu packages base) coreutils) inferior))) (close-inferior inferior) (list a (inferior-object? b)))))) (test-equal "close-inferior" '((hello) (world)) (let* ((inferior1 (open-inferior %top-builddir #:command "scripts/guix")) (lst1 (inferior-eval '(list 'hello) inferior1)) (inferior2 (open-inferior %top-builddir #:command "scripts/guix")) (lst2 (inferior-eval '(list 'world) inferior2))) ;; This call succeeds if and only if INFERIOR2 does not also hold a file ;; descriptor to the socketpair beneath INFERIOR1; otherwise it blocks. ;; See <https://issues.guix.gnu.org/55441#10>. (close-inferior inferior1) (close-inferior inferior2) (list lst1 lst2))) (test-equal "&inferior-exception" '(a b c d) (let ((inferior (open-inferior %top-builddir #:command "scripts/guix"))) (guard (c ((inferior-exception? c) (close-inferior inferior) (and (eq? inferior (inferior-exception-inferior c)) (match (inferior-exception-stack c) (((_ (files lines columns)) ..1) (member "guix/repl.scm" files))) (inferior-exception-arguments c)))) (inferior-eval '(throw 'a 'b 'c 'd) inferior) 'badness))) (test-equal "&inferior-exception, legacy mode" '(a b c d) ;; Omit #:command to open an inferior in "legacy" mode, where Guile runs ;; directly. (let ((inferior (open-inferior %top-builddir))) (guard (c ((inferior-exception? c) (close-inferior inferior) (and (eq? inferior (inferior-exception-inferior c)) (inferior-exception-arguments c)))) (inferior-eval '(throw 'a 'b 'c 'd) inferior) 'badness))) (test-equal "inferior-packages" (take (sort (fold-packages (lambda (package lst) (cons (list (package-name package) (package-version package) (package-home-page package) (package-location package)) lst)) '()) (lambda (x y) (string<? (car x) (car y)))) 10) (let* ((inferior (open-inferior %top-builddir #:command "scripts/guix")) (packages (inferior-packages inferior))) (and (every string? (map inferior-package-synopsis packages)) (let () (define result (take (sort (map (lambda (package) (list (inferior-package-name package) (inferior-package-version package) (inferior-package-home-page package) (inferior-package-location package))) packages) (lambda (x y) (string<? (car x) (car y)))) 10)) (close-inferior inferior) result)))) (test-equal "inferior-available-packages" (take (sort (fold-available-packages (lambda* (name version result #:key supported? deprecated? #:allow-other-keys) (if (and supported? (not deprecated?)) (alist-cons name version result) result)) '()) (lambda (x y) (string<? (car x) (car y)))) 10) (let* ((inferior (open-inferior %top-builddir #:command "scripts/guix")) (packages (inferior-available-packages inferior))) (close-inferior inferior) (take (sort packages (lambda (x y) (string<? (car x) (car y)))) 10))) (test-equal "lookup-inferior-packages" (let ((->list (lambda (package) (list (package-name package) (package-version package) (package-location package))))) (list (map ->list (find-packages-by-name "guile" #f)) (map ->list (find-packages-by-name "guile" "2.2")))) (let* ((inferior (open-inferior %top-builddir #:command "scripts/guix")) (->list (lambda (package) (list (inferior-package-name package) (inferior-package-version package) (inferior-package-location package)))) (lst1 (map ->list (lookup-inferior-packages inferior "guile"))) (lst2 (map ->list (lookup-inferior-packages inferior "guile" "2.2")))) (close-inferior inferior) (list lst1 lst2))) (test-assert "lookup-inferior-packages and eq?-ness" (let* ((inferior (open-inferior %top-builddir #:command "scripts/guix")) (lst1 (lookup-inferior-packages inferior "guile")) (lst2 (lookup-inferior-packages inferior "guile"))) (close-inferior inferior) (every eq? lst1 lst2))) (test-equal "inferior-package-inputs" (let ((->list (match-lambda ((label (? package? package) . rest) `(,label (package ,(package-name package) ,(package-version package) ,(package-location package)) ,@rest))))) (list (map ->list (package-inputs guile-3.0-latest)) (map ->list (package-native-inputs guile-3.0-latest)) (map ->list (package-propagated-inputs guile-3.0-latest)))) (let* ((inferior (open-inferior %top-builddir #:command "scripts/guix")) (guile (first (lookup-inferior-packages inferior "guile"))) (->list (match-lambda ((label (? inferior-package? package) . rest) `(,label (package ,(inferior-package-name package) ,(inferior-package-version package) ,(inferior-package-location package)) ,@rest)))) (result (list (map ->list (inferior-package-inputs guile)) (map ->list (inferior-package-native-inputs guile)) (map ->list (inferior-package-propagated-inputs guile))))) (close-inferior inferior) result)) (test-equal "inferior-package-search-paths" (package-native-search-paths guile-3.0) (let* ((inferior (open-inferior %top-builddir #:command "scripts/guix")) (guile (first (lookup-inferior-packages inferior "guile"))) (result (inferior-package-native-search-paths guile))) (close-inferior inferior) result)) (test-equal "inferior-eval-with-store" (add-text-to-store %store "foo" "Hello, world!") (let* ((inferior (open-inferior %top-builddir #:command "scripts/guix"))) (inferior-eval-with-store inferior %store '(lambda (store) (add-text-to-store store "foo" "Hello, world!"))))) (test-assert "inferior-eval-with-store, &store-protocol-error" (let* ((inferior (open-inferior %top-builddir #:command "scripts/guix"))) (guard (c ((store-protocol-error? c) (string-contains (store-protocol-error-message c) "invalid character"))) (inferior-eval-with-store inferior %store '(lambda (store) (add-text-to-store store "we|rd/?!@" "uh uh"))) #f))) (test-equal "inferior-eval-with-store, exception" '(the-answer = 42) (let ((inferior (open-inferior %top-builddir #:command "scripts/guix"))) (guard (c ((inferior-exception? c) (close-inferior inferior) (inferior-exception-arguments c))) (inferior-eval-with-store inferior %store '(lambda (store) (throw 'the-answer '= 42)))))) (test-equal "inferior-eval-with-store, not a procedure" 'wrong-type-arg (let ((inferior (open-inferior %top-builddir #:command "scripts/guix"))) (guard (c ((inferior-exception? c) (close-inferior inferior) (car (inferior-exception-arguments c)))) (inferior-eval-with-store inferior %store '(+ 1 2))))) (test-equal "inferior-package-derivation" (map derivation-file-name (list (package-derivation %store %bootstrap-guile "x86_64-linux") (package-derivation %store %bootstrap-guile "armhf-linux"))) (let* ((inferior (open-inferior %top-builddir #:command "scripts/guix")) (packages (inferior-packages inferior)) (guile (find (lambda (package) (string=? (package-name %bootstrap-guile) (inferior-package-name package))) packages))) (map derivation-file-name (list (inferior-package-derivation %store guile "x86_64-linux") (inferior-package-derivation %store guile "armhf-linux"))))) (unless (package-replacement sqlite) (test-skip 1)) (test-equal "inferior-package-replacement" (package-derivation %store (package-replacement sqlite) "x86_64-linux") (let* ((inferior (open-inferior %top-builddir #:command "scripts/guix")) (packages (inferior-packages inferior))) (match (lookup-inferior-packages inferior (package-name sqlite) (package-version sqlite)) ((inferior-sqlite rest ...) (inferior-package-derivation %store (inferior-package-replacement inferior-sqlite) "x86_64-linux"))))) (test-equal "inferior-package->manifest-entry" (manifest-entry->list (package->manifest-entry (first (find-best-packages-by-name "guile" #f)))) (let* ((inferior (open-inferior %top-builddir #:command "scripts/guix")) (guile (first (lookup-inferior-packages inferior "guile"))) (entry (inferior-package->manifest-entry guile))) (close-inferior inferior) (manifest-entry->list entry))) (test-equal "packages->manifest" (map manifest-entry->list (manifest-entries (packages->manifest (find-best-packages-by-name "guile" #f)))) (let* ((inferior (open-inferior %top-builddir #:command "scripts/guix")) (guile (first (lookup-inferior-packages inferior "guile"))) (manifest (packages->manifest (list guile)))) (close-inferior inferior) (map manifest-entry->list (manifest-entries manifest)))) (test-equal "#:error-port stderr" 42 ;; There's a special case in open-bidirectional-pipe for ;; (current-error-port) being stderr, so this test just checks that ;; open-inferior doesn't raise an exception (let ((inferior (open-inferior %top-builddir #:command "scripts/guix" #:error-port (current-error-port)))) (and (inferior? inferior) (inferior-eval '(display "test" (current-error-port)) inferior) (let ((result (inferior-eval '(apply * '(6 7)) inferior))) (close-inferior inferior) result)))) (test-equal "#:error-port pipe" "42" (match (pipe) ((port-to-read-from . port-to-write-to) (setvbuf port-to-read-from 'line) (setvbuf port-to-write-to 'line) (let ((inferior (open-inferior %top-builddir #:command "scripts/guix" #:error-port port-to-write-to))) (and (inferior? inferior) (begin (inferior-eval '(display "42\n" (current-error-port)) inferior) (let loop ((line (read-line port-to-read-from))) (if (string=? line "42") (begin (close-inferior inferior) line) (loop (read-line port-to-read-from)))))))))) (test-end "inferior") |