unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#24408: `make check` fails for builders, build-utils, cran, derivations, elpa, gexp, grafts, hackage, monads, packages, store, ui
@ 2016-09-11  1:11 rsiddharth
  2016-09-12 13:46 ` Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: rsiddharth @ 2016-09-11  1:11 UTC (permalink / raw)
  To: 24408


[-- Attachment #1.1: Type: text/plain, Size: 612 bytes --]

Ran `make check` like this:

  cd git/guix
  git pull
  git show
  commit debf4179b4312ad3ea02f994154a2d989bc16089
  ...

  guix environment guix --ad-hoc help2man git strace
  ./bootstrap
  ./configure --localstatedir=/var
  make check

Test machine information:

  guix (GNU Guix) 20160910.14 [binary installation on top debian testing]

  guile (GNU Guile) 2.0.11
  GNU Make 4.2 (Built for x86_64-unknown-linux-gnu)
  libgcrypt version 1.7.3

  zlib Version: 1.2.8

  SQLite Version: 3.12.2
  libbz2 Version 1.0.6
  g++ (GCC) 6.2.0

(This is my first bug report, please point out if I missed out
something.)


[-- Attachment #1.2: builders.log --]
[-- Type: application/octet-stream, Size: 3748 bytes --]

test-name: url-fetch
location: /home/rsd/v/git/others/guix/tests/builders.scm:66
source:
+ (test-assert
+   "url-fetch"
+   (let* ((url '("http://ftp.gnu.org/gnu/hello/hello-2.8.tar.gz"
+                 "ftp://ftp.gnu.org/gnu/hello/hello-2.8.tar.gz"))
+          (hash (nix-base32-string->bytevector
+                  "0wqd8sjmxfskrflaxywc7gqw7sfawrfvdxd9skxawzfgyy0pzdz6"))
+          (drv (url-fetch*
+                 %store
+                 url
+                 'sha256
+                 hash
+                 #:guile
+                 %bootstrap-guile))
+          (out-path (derivation->output-path drv)))
+     (and (build-derivations %store (list drv))
+          (file-exists? out-path)
+          (valid-path? %store out-path))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: url-fetch, file
location: /home/rsd/v/git/others/guix/tests/builders.scm:78
source:
+ (test-assert
+   "url-fetch, file"
+   (let* ((file (search-path %load-path "guix.scm"))
+          (hash (call-with-input-file file port-sha256))
+          (out (url-fetch* %store file 'sha256 hash)))
+     (and (file-exists? out) (valid-path? %store out))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: url-fetch, file URI
location: /home/rsd/v/git/others/guix/tests/builders.scm:85
source:
+ (test-assert
+   "url-fetch, file URI"
+   (let* ((file (search-path %load-path "guix.scm"))
+          (hash (call-with-input-file file port-sha256))
+          (out (url-fetch*
+                 %store
+                 (string-append
+                   "file://"
+                   (canonicalize-path file))
+                 'sha256
+                 hash)))
+     (and (file-exists? out) (valid-path? %store out))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: gnu-build-system
location: /home/rsd/v/git/others/guix/tests/builders.scm:94
source:
+ (test-assert
+   "gnu-build-system"
+   (build-system? gnu-build-system))
actual-value: #t
result: PASS

test-name: gnu-build
location: /home/rsd/v/git/others/guix/tests/builders.scm:99
source:
+ (test-assert
+   "gnu-build"
+   (let* ((url "http://ftp.gnu.org/gnu/hello/hello-2.8.tar.gz")
+          (hash (nix-base32-string->bytevector
+                  "0wqd8sjmxfskrflaxywc7gqw7sfawrfvdxd9skxawzfgyy0pzdz6"))
+          (tarball
+            (url-fetch*
+              %store
+              url
+              'sha256
+              hash
+              #:guile
+              %bootstrap-guile))
+          (build (gnu-build
+                   %store
+                   "hello-2.8"
+                   `(("source" ,tarball) ,@%bootstrap-inputs)
+                   #:guile
+                   %bootstrap-guile
+                   #:search-paths
+                   %bootstrap-search-paths))
+          (out (derivation->output-path build)))
+     (and (build-derivations
+            %store
+            (list (pk 'hello-drv build)))
+          (valid-path? %store out)
+          (file-exists? (string-append out "/bin/hello")))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

random seed for tests: 1473544873
warning: build daemon error: #<condition &nix-connection-error [file: "/home/rsd/v/git/others/guix/test-tmp/var/11853/daemon-socket/socket" errno: 2] 3357db0>

[-- Attachment #1.3: build-utils.log --]
[-- Type: application/octet-stream, Size: 6543 bytes --]

test-name: alist-cons-before
location: /home/rsd/v/git/others/guix/tests/build-utils.scm:41
source:
+ (test-equal
+   "alist-cons-before"
+   '((a . 1) (x . 42) (b . 2) (c . 3))
+   (alist-cons-before
+     'b
+     'x
+     42
+     '((a . 1) (b . 2) (c . 3))))
expected-value: ((a . 1) (x . 42) (b . 2) (c . 3))
actual-value: ((a . 1) (x . 42) (b . 2) (c . 3))
result: PASS

test-name: alist-cons-before, reference not found
location: /home/rsd/v/git/others/guix/tests/build-utils.scm:45
source:
+ (test-equal
+   "alist-cons-before, reference not found"
+   '((a . 1) (b . 2) (c . 3) (x . 42))
+   (alist-cons-before
+     'z
+     'x
+     42
+     '((a . 1) (b . 2) (c . 3))))
expected-value: ((a . 1) (b . 2) (c . 3) (x . 42))
actual-value: ((a . 1) (b . 2) (c . 3) (x . 42))
result: PASS

test-name: alist-cons-after
location: /home/rsd/v/git/others/guix/tests/build-utils.scm:49
source:
+ (test-equal
+   "alist-cons-after"
+   '((a . 1) (b . 2) (x . 42) (c . 3))
+   (alist-cons-after
+     'b
+     'x
+     42
+     '((a . 1) (b . 2) (c . 3))))
expected-value: ((a . 1) (b . 2) (x . 42) (c . 3))
actual-value: ((a . 1) (b . 2) (x . 42) (c . 3))
result: PASS

test-name: alist-cons-after, reference not found
location: /home/rsd/v/git/others/guix/tests/build-utils.scm:53
source:
+ (test-equal
+   "alist-cons-after, reference not found"
+   '((a . 1) (b . 2) (c . 3) (x . 42))
+   (alist-cons-after
+     'z
+     'x
+     42
+     '((a . 1) (b . 2) (c . 3))))
expected-value: ((a . 1) (b . 2) (c . 3) (x . 42))
actual-value: ((a . 1) (b . 2) (c . 3) (x . 42))
result: PASS

test-name: alist-replace
location: /home/rsd/v/git/others/guix/tests/build-utils.scm:57
source:
+ (test-equal
+   "alist-replace"
+   '((a . 1) (b . 77) (c . 3))
+   (alist-replace 'b 77 '((a . 1) (b . 2) (c . 3))))
expected-value: ((a . 1) (b . 77) (c . 3))
actual-value: ((a . 1) (b . 77) (c . 3))
result: PASS

test-name: alist-replace, key not found
location: /home/rsd/v/git/others/guix/tests/build-utils.scm:61
source:
+ (test-assert
+   "alist-replace, key not found"
+   (not (false-if-exception
+          (alist-replace 'z 77 '((a . 1) (b . 2) (c . 3))))))
actual-value: #t
result: PASS

test-name: fold-port-matches
location: /home/rsd/v/git/others/guix/tests/build-utils.scm:65
source:
+ (test-equal
+   "fold-port-matches"
+   (make-list 3 "Guix")
+   (call-with-input-string
+     "Guix is cool, Guix rocks, and it uses Guile, Guix!"
+     (lambda (port)
+       (fold-port-matches cons '() "Guix" port))))
expected-value: (Guix Guix Guix)
actual-value: (Guix Guix Guix)
result: PASS

test-name: fold-port-matches, trickier
location: /home/rsd/v/git/others/guix/tests/build-utils.scm:71
source:
+ (test-equal
+   "fold-port-matches, trickier"
+   (reverse '("Guix" "guix" "Guix" "guiX" "Guix"))
+   (call-with-input-string
+     "Guix, guix, GuiGuixguiX, Guix"
+     (lambda (port)
+       (fold-port-matches
+         cons
+         '()
+         (list (char-set #\G #\g)
+               (char-set #\u)
+               (char-set #\i)
+               (char-set #\x #\X))
+         port))))
expected-value: (Guix guiX Guix guix Guix)
actual-value: (Guix guiX Guix guix Guix)
result: PASS

test-name: fold-port-matches, with unmatched chars
location: /home/rsd/v/git/others/guix/tests/build-utils.scm:82
source:
+ (test-equal
+   "fold-port-matches, with unmatched chars"
+   '("Guix"
+     #\,
+     #\space
+     "guix"
+     #\,
+     #\space
+     #\G
+     #\u
+     #\i
+     "Guix"
+     "guiX"
+     #\,
+     #\space
+     "Guix")
+   (call-with-input-string
+     "Guix, guix, GuiGuixguiX, Guix"
+     (lambda (port)
+       (reverse
+         (fold-port-matches
+           cons
+           '()
+           (list (char-set #\G #\g)
+                 (char-set #\u)
+                 (char-set #\i)
+                 (char-set #\x #\X))
+           port
+           cons)))))
expected-value: (Guix ,   guix ,   G u i Guix guiX ,   Guix)
actual-value: (Guix ,   guix ,   G u i Guix guiX ,   Guix)
result: PASS

test-name: wrap-program, one input, multiple calls
location: /home/rsd/v/git/others/guix/tests/build-utils.scm:98
source:
+ (test-assert
+   "wrap-program, one input, multiple calls"
+   (let* ((p (package
+               (name "test-wrap-program")
+               (version "0")
+               (source #f)
+               (synopsis #f)
+               (description #f)
+               (license #f)
+               (home-page #f)
+               (build-system trivial-build-system)
+               (arguments
+                 `(#:guile
+                   ,%bootstrap-guile
+                   #:modules
+                   ((guix build utils))
+                   #:builder
+                   (let* ((out (assoc-ref %outputs "out"))
+                          (bash (assoc-ref %build-inputs "bash"))
+                          (foo (string-append out "/foo")))
+                     (begin
+                       (use-modules (guix build utils))
+                       (mkdir out)
+                       (call-with-output-file
+                         foo
+                         (lambda (p)
+                           (format
+                             p
+                             "#!~a~%echo \"${GUIX_FOO} ${GUIX_BAR}\"~%"
+                             bash)))
+                       (chmod foo 511)
+                       (symlink bash (string-append out "/bash"))
+                       (setenv "PATH" out)
+                       (wrap-program foo `("GUIX_FOO" prefix ("hello")))
+                       (wrap-program foo `("GUIX_BAR" prefix ("world")))
+                       #t))))
+               (inputs
+                 `(("bash"
+                    ,(search-bootstrap-binary
+                       "bash"
+                       (%current-system)))))))
+          (d (package-derivation %store p)))
+     (unsetenv "LOCPATH")
+     (and (build-derivations %store (pk 'drv d (list d)))
+          (let* ((p (derivation->output-path d))
+                 (foo (string-append p "/foo"))
+                 (pipe (open-input-pipe foo))
+                 (str (get-string-all pipe)))
+            (equal? str "hello world\n")))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

random seed for tests: 1473544751
warning: build daemon error: #<condition &nix-connection-error [file: "/home/rsd/v/git/others/guix/test-tmp/var/12064/daemon-socket/socket" errno: 2] 2630630>

[-- Attachment #1.4: cran.log --]
[-- Type: application/octet-stream, Size: 4644 bytes --]

test-name: description->alist: contains all valid keys
location: /home/rsd/v/git/others/guix/tests/cran.scm:64
source:
+ (test-assert
+   "description->alist: contains all valid keys"
+   (let ((keys '("Package"
+                 "Type"
+                 "Title"
+                 "Version"
+                 "Date"
+                 "Author"
+                 "Maintainer"
+                 "URL"
+                 "Description"
+                 "SystemRequirements"
+                 "Depends"
+                 "License"
+                 "Imports"
+                 "biocViews"
+                 "LinkingTo"
+                 "NeedsCompilation"
+                 "Repository"
+                 "Date/Publication")))
+     (lset= string=? keys (map car description-alist))))
actual-value: #t
result: PASS

test-name: listify: return empty list if key cannot be found
location: /home/rsd/v/git/others/guix/tests/cran.scm:73
source:
+ (test-equal
+   "listify: return empty list if key cannot be found"
+   '()
+   ((@@ (guix import cran) listify)
+    simple-alist
+    "Letters"))
expected-value: ()
actual-value: ()
result: PASS

test-name: listify: split comma-separated value into elements
location: /home/rsd/v/git/others/guix/tests/cran.scm:77
source:
+ (test-equal
+   "listify: split comma-separated value into elements"
+   '("R" "Rcpp" "something" "whatever")
+   ((@@ (guix import cran) listify)
+    simple-alist
+    "SimpleList"))
expected-value: (R Rcpp something whatever)
actual-value: (R Rcpp something whatever)
result: PASS

test-name: listify: strip off parentheses
location: /home/rsd/v/git/others/guix/tests/cran.scm:81
source:
+ (test-equal
+   "listify: strip off parentheses"
+   '("R" "BH" "GenomicRanges")
+   ((@@ (guix import cran) listify)
+    simple-alist
+    "List"))
expected-value: (R BH GenomicRanges)
actual-value: (R BH GenomicRanges)
result: PASS

test-name: listify: ignore values that are no lists
location: /home/rsd/v/git/others/guix/tests/cran.scm:85
source:
+ (test-equal
+   "listify: ignore values that are no lists"
+   '()
+   ((@@ (guix import cran) listify)
+    simple-alist
+    "BadList"))
expected-value: ()
actual-value: ()
result: PASS

test-name: description->package
location: /home/rsd/v/git/others/guix/tests/cran.scm:89
source:
+ (test-assert
+   "description->package"
+   (mock ((guix build download)
+          url-fetch
+          (lambda* (url file-name #:key (mirrors '()))
+            (with-output-to-file
+              file-name
+              (lambda ()
+                (display
+                  (match url
+                         ("mirror://cran/src/contrib/My-Example_1.2.3.tar.gz"
+                          "source")
+                         (_ (error "Unexpected URL: " url))))))))
+         (match ((@@ (guix import cran) description->package)
+                 'cran
+                 description-alist)
+                (('package
+                  ('name "r-my-example")
+                  ('version "1.2.3")
+                  ('source
+                   ('origin
+                    ('method 'url-fetch)
+                    ('uri ('cran-uri "My-Example" 'version))
+                    ('sha256 ('base32 (? string? hash)))))
+                  ('properties
+                   ('quasiquote
+                    (((quote upstream-name) . "My-Example"))))
+                  ('build-system 'r-build-system)
+                  ('inputs
+                   ('quasiquote (("cairo" ('unquote 'cairo)))))
+                  ('propagated-inputs
+                   ('quasiquote
+                    (("r-bh" ('unquote 'r-bh))
+                     ("r-proto" ('unquote 'r-proto))
+                     ("r-rcpp" ('unquote 'r-rcpp))
+                     ("r-scales" ('unquote 'r-scales)))))
+                  ('home-page "http://gnu.org/s/my-example")
+                  ('synopsis "Example package")
+                  ('description
+                   "This is a long description spanning multiple lines: and it could confuse the parser that there is a colon : on the lines.  And: this line continues the description.")
+                  ('license 'gpl3+)))
+                (x (begin (format #t "~s\n" x) (pk 'fail x #f))))))
actual-value: #f
actual-error:
+ (srfi-34
+   #<condition &nix-connection-error [file: "/home/rsd/v/git/others/guix/test-tmp/var/12170/daemon-socket/socket" errno: 2] 3345f30>)
result: FAIL

random seed for tests: 1473544863

Some deprecated features have been used.  Set the environment
variable GUILE_WARN_DEPRECATED to "detailed" and rerun the
program to get more information.  Set it to "no" to suppress
this message.

[-- Attachment #1.5: derivations.log --]
[-- Type: application/octet-stream, Size: 60592 bytes --]

test-name: parse & export
location: /home/rsd/v/git/others/guix/tests/derivations.scm:81
source:
+ (test-assert
+   "parse & export"
+   (let* ((f (search-path %load-path "tests/test.drv"))
+          (b1 (call-with-input-file f get-bytevector-all))
+          (d1 (read-derivation (open-bytevector-input-port b1)))
+          (b2 (call-with-bytevector-output-port
+                (cut write-derivation d1 <>)))
+          (d2 (read-derivation (open-bytevector-input-port b2))))
+     (and (equal? b1 b2) (equal? d1 d2))))
actual-value: #t
result: PASS

test-name: add-to-store, flat
location: /home/rsd/v/git/others/guix/tests/derivations.scm:92
source:
+ (test-assert
+   "add-to-store, flat"
+   (let* ((file (search-path
+                  %load-path
+                  "language/tree-il/spec.scm"))
+          (drv (add-to-store
+                 %store
+                 "flat-test"
+                 #f
+                 "sha256"
+                 file)))
+     (and (eq? 'regular (stat:type (stat drv)))
+          (valid-path? %store drv)
+          (equal?
+            (call-with-input-file file get-bytevector-all)
+            (call-with-input-file drv get-bytevector-all)))))
result: SKIP

test-name: add-to-store, recursive
location: /home/rsd/v/git/others/guix/tests/derivations.scm:100
source:
+ (test-assert
+   "add-to-store, recursive"
+   (let* ((dir (dirname
+                 (search-path
+                   %load-path
+                   "language/tree-il/spec.scm")))
+          (drv (add-to-store
+                 %store
+                 "dir-tree-test"
+                 #t
+                 "sha256"
+                 dir)))
+     (and (eq? 'directory (stat:type (stat drv)))
+          (valid-path? %store drv)
+          (equal?
+            (directory-contents dir)
+            (directory-contents drv)))))
result: SKIP

test-name: derivation with no inputs
location: /home/rsd/v/git/others/guix/tests/derivations.scm:108
source:
+ (test-assert
+   "derivation with no inputs"
+   (let* ((builder
+            (add-text-to-store
+              %store
+              "my-builder.sh"
+              "echo hello, world\n"
+              '()))
+          (drv (derivation
+                 %store
+                 "foo"
+                 %bash
+                 `("-e" ,builder)
+                 #:env-vars
+                 '(("HOME" . "/homeless")))))
+     (and (store-path? (derivation-file-name drv))
+          (valid-path? %store (derivation-file-name drv)))))
result: SKIP

test-name: build derivation with 1 source
location: /home/rsd/v/git/others/guix/tests/derivations.scm:118
source:
+ (test-assert
+   "build derivation with 1 source"
+   (let* ((builder
+            (add-text-to-store
+              %store
+              "my-builder.sh"
+              "echo hello, world > \"$out\"\n"
+              '()))
+          (drv (derivation
+                 %store
+                 "foo"
+                 %bash
+                 `(,builder)
+                 #:env-vars
+                 '(("HOME" . "/homeless")
+                   ("zzz" . "Z!")
+                   ("AAA" . "A!"))
+                 #:inputs
+                 `((,%bash) (,builder))))
+          (succeeded?
+            (build-derivations %store (list drv))))
+     (and succeeded?
+          (let ((path (derivation->output-path drv)))
+            (and (valid-path? %store path)
+                 (string=?
+                   (call-with-input-file path read-line)
+                   "hello, world"))))))
result: SKIP

test-name: derivation with local file as input
location: /home/rsd/v/git/others/guix/tests/derivations.scm:136
source:
+ (test-assert
+   "derivation with local file as input"
+   (let* ((builder
+            (add-text-to-store
+              %store
+              "my-builder.sh"
+              "(while read line ; do echo \"$line\" ; done) < $in > $out"
+              '()))
+          (input (search-path %load-path "ice-9/boot-9.scm"))
+          (input*
+            (add-to-store
+              %store
+              (basename input)
+              #t
+              "sha256"
+              input))
+          (drv (derivation
+                 %store
+                 "derivation-with-input-file"
+                 %bash
+                 `(,builder)
+                 #:env-vars
+                 `(("in" unquote input*))
+                 #:inputs
+                 `((,%bash) (,builder) (,input)))))
+     (and (build-derivations %store (list drv))
+          (valid-path?
+            %store
+            (derivation->output-path drv)))))
result: SKIP

test-name: derivation fails but keep going
location: /home/rsd/v/git/others/guix/tests/derivations.scm:159
source:
+ (test-assert
+   "derivation fails but keep going"
+   (with-store
+     store
+     (let* ((d1 (derivation
+                  %store
+                  "fails"
+                  %bash
+                  `("-c" "false")
+                  #:inputs
+                  `((,%bash))))
+            (d2 (build-expression->derivation
+                  %store
+                  "sleep-then-succeed"
+                  `(begin ,(random-text) (sleep 2) (mkdir %output)))))
+       (set-build-options
+         %store
+         #:use-substitutes?
+         #f
+         #:keep-going?
+         #t)
+       (guard (c ((nix-protocol-error? c)
+                  (and (= 100 (nix-protocol-error-status c))
+                       (string-contains
+                         (nix-protocol-error-message c)
+                         (derivation-file-name d1))
+                       (not (valid-path? %store (derivation->output-path d1)))
+                       (valid-path? %store (derivation->output-path d2)))))
+              (build-derivations %store (list d1 d2))
+              #f))))
result: SKIP

test-name: identical files are deduplicated
location: /home/rsd/v/git/others/guix/tests/derivations.scm:186
source:
+ (test-assert
+   "identical files are deduplicated"
+   (let* ((build1
+            (add-text-to-store
+              %store
+              "one.sh"
+              "echo hello, world > \"$out\"\n"
+              '()))
+          (build2
+            (add-text-to-store
+              %store
+              "two.sh"
+              "# Hey!\necho hello, world > \"$out\"\n"
+              '()))
+          (drv1 (derivation
+                  %store
+                  "foo"
+                  %bash
+                  `(,build1)
+                  #:inputs
+                  `((,%bash) (,build1))))
+          (drv2 (derivation
+                  %store
+                  "bar"
+                  %bash
+                  `(,build2)
+                  #:inputs
+                  `((,%bash) (,build2)))))
+     (and (build-derivations %store (list drv1 drv2))
+          (let ((file1 (derivation->output-path drv1))
+                (file2 (derivation->output-path drv2)))
+            (and (valid-path? %store file1)
+                 (valid-path? %store file2)
+                 (string=?
+                   (call-with-input-file file1 get-string-all)
+                   "hello, world\n")
+                 (= (stat:ino (lstat file1))
+                    (stat:ino (lstat file2))))))))
result: SKIP

test-name: derivation-name
location: /home/rsd/v/git/others/guix/tests/derivations.scm:208
source:
+ (test-equal
+   "derivation-name"
+   "foo-0.0"
+   (let ((drv (derivation %store "foo-0.0" %bash '())))
+     (derivation-name drv)))
result: SKIP

test-name: derivation-output-names
location: /home/rsd/v/git/others/guix/tests/derivations.scm:213
source:
+ (test-equal
+   "derivation-output-names"
+   '(("out") ("bar" "chbouib"))
+   (let ((drv1 (derivation %store "foo-0.0" %bash '()))
+         (drv2 (derivation
+                 %store
+                 "foo-0.0"
+                 %bash
+                 '()
+                 #:outputs
+                 '("bar" "chbouib"))))
+     (list (derivation-output-names drv1)
+           (derivation-output-names drv2))))
result: SKIP

test-name: offloadable-derivation?
location: /home/rsd/v/git/others/guix/tests/derivations.scm:221
source:
+ (test-assert
+   "offloadable-derivation?"
+   (and (offloadable-derivation?
+          (derivation %store "foo" %bash '()))
+        (offloadable-derivation?
+          (derivation
+            %store
+            "foo"
+            %bash
+            '()
+            #:substitutable?
+            #f))
+        (not (offloadable-derivation?
+               (derivation
+                 %store
+                 "foo"
+                 %bash
+                 '()
+                 #:local-build?
+                 #t)))))
result: SKIP

test-name: substitutable-derivation?
location: /home/rsd/v/git/others/guix/tests/derivations.scm:230
source:
+ (test-assert
+   "substitutable-derivation?"
+   (and (substitutable-derivation?
+          (derivation %store "foo" %bash '()))
+        (substitutable-derivation?
+          (derivation
+            %store
+            "foo"
+            %bash
+            '()
+            #:local-build?
+            #t))
+        (not (substitutable-derivation?
+               (derivation
+                 %store
+                 "foo"
+                 %bash
+                 '()
+                 #:substitutable?
+                 #f)))))
result: SKIP

test-name: fixed-output-derivation?
location: /home/rsd/v/git/others/guix/tests/derivations.scm:239
source:
+ (test-assert
+   "fixed-output-derivation?"
+   (let* ((builder
+            (add-text-to-store
+              %store
+              "my-fixed-builder.sh"
+              "echo -n hello > $out"
+              '()))
+          (hash (sha256 (string->utf8 "hello")))
+          (drv (derivation
+                 %store
+                 "fixed"
+                 %bash
+                 `(,builder)
+                 #:inputs
+                 `((,builder))
+                 #:hash
+                 hash
+                 #:hash-algo
+                 'sha256)))
+     (fixed-output-derivation? drv)))
result: SKIP

test-name: fixed-output derivation
location: /home/rsd/v/git/others/guix/tests/derivations.scm:249
source:
+ (test-assert
+   "fixed-output derivation"
+   (let* ((builder
+            (add-text-to-store
+              %store
+              "my-fixed-builder.sh"
+              "echo -n hello > $out"
+              '()))
+          (hash (sha256 (string->utf8 "hello")))
+          (drv (derivation
+                 %store
+                 "fixed"
+                 %bash
+                 `(,builder)
+                 #:inputs
+                 `((,builder))
+                 #:hash
+                 hash
+                 #:hash-algo
+                 'sha256))
+          (succeeded?
+            (build-derivations %store (list drv))))
+     (and succeeded?
+          (let ((p (derivation->output-path drv)))
+            (and (equal?
+                   (string->utf8 "hello")
+                   (call-with-input-file p get-bytevector-all))
+                 (bytevector? (query-path-hash %store p)))))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: fixed-output derivation: output paths are equal
location: /home/rsd/v/git/others/guix/tests/derivations.scm:264
source:
+ (test-assert
+   "fixed-output derivation: output paths are equal"
+   (let* ((builder1
+            (add-text-to-store
+              %store
+              "fixed-builder1.sh"
+              "echo -n hello > $out"
+              '()))
+          (builder2
+            (add-text-to-store
+              %store
+              "fixed-builder2.sh"
+              "echo hey; echo -n hello > $out"
+              '()))
+          (hash (sha256 (string->utf8 "hello")))
+          (drv1 (derivation
+                  %store
+                  "fixed"
+                  %bash
+                  `(,builder1)
+                  #:hash
+                  hash
+                  #:hash-algo
+                  'sha256))
+          (drv2 (derivation
+                  %store
+                  "fixed"
+                  %bash
+                  `(,builder2)
+                  #:hash
+                  hash
+                  #:hash-algo
+                  'sha256))
+          (succeeded?
+            (build-derivations %store (list drv1 drv2))))
+     (and succeeded?
+          (equal?
+            (derivation->output-path drv1)
+            (derivation->output-path drv2)))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: fixed-output derivation, recursive
location: /home/rsd/v/git/others/guix/tests/derivations.scm:281
source:
+ (test-assert
+   "fixed-output derivation, recursive"
+   (let* ((builder
+            (add-text-to-store
+              %store
+              "my-fixed-builder.sh"
+              "echo -n hello > $out"
+              '()))
+          (hash (sha256 (string->utf8 "hello")))
+          (drv (derivation
+                 %store
+                 "fixed-rec"
+                 %bash
+                 `(,builder)
+                 #:inputs
+                 `((,builder))
+                 #:hash
+                 (base32
+                   "0sg9f58l1jj88w6pdrfdpj5x9b1zrwszk84j81zvby36q9whhhqa")
+                 #:hash-algo
+                 'sha256
+                 #:recursive?
+                 #t))
+          (succeeded?
+            (build-derivations %store (list drv))))
+     (and succeeded?
+          (let ((p (derivation->output-path drv)))
+            (and (equal?
+                   (string->utf8 "hello")
+                   (call-with-input-file p get-bytevector-all))
+                 (bytevector? (query-path-hash %store p)))))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: derivation with a fixed-output input
location: /home/rsd/v/git/others/guix/tests/derivations.scm:298
source:
+ (test-assert
+   "derivation with a fixed-output input"
+   (let* ((builder1
+            (add-text-to-store
+              %store
+              "fixed-builder1.sh"
+              "echo -n hello > $out"
+              '()))
+          (builder2
+            (add-text-to-store
+              %store
+              "fixed-builder2.sh"
+              "echo hey; echo -n hello > $out"
+              '()))
+          (hash (sha256 (string->utf8 "hello")))
+          (fixed1
+            (derivation
+              %store
+              "fixed"
+              %bash
+              `(,builder1)
+              #:hash
+              hash
+              #:hash-algo
+              'sha256))
+          (fixed2
+            (derivation
+              %store
+              "fixed"
+              %bash
+              `(,builder2)
+              #:hash
+              hash
+              #:hash-algo
+              'sha256))
+          (fixed-out (derivation->output-path fixed1))
+          (builder3
+            (add-text-to-store
+              %store
+              "final-builder.sh"
+              "echo $in ; (read -u 3 c; echo $c) 3< $in > $out"
+              '()))
+          (final1
+            (derivation
+              %store
+              "final"
+              %bash
+              `(,builder3)
+              #:env-vars
+              `(("in" unquote fixed-out))
+              #:inputs
+              `((,%bash) (,builder3) (,fixed1))))
+          (final2
+            (derivation
+              %store
+              "final"
+              %bash
+              `(,builder3)
+              #:env-vars
+              `(("in" unquote fixed-out))
+              #:inputs
+              `((,%bash) (,builder3) (,fixed2))))
+          (succeeded?
+            (build-derivations %store (list final1 final2))))
+     (and succeeded?
+          (equal?
+            (derivation->output-path final1)
+            (derivation->output-path final2)))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: multiple-output derivation
location: /home/rsd/v/git/others/guix/tests/derivations.scm:332
source:
+ (test-assert
+   "multiple-output derivation"
+   (let* ((builder
+            (add-text-to-store
+              %store
+              "my-fixed-builder.sh"
+              "echo one > $out ; echo two > $second"
+              '()))
+          (drv (derivation
+                 %store
+                 "fixed"
+                 %bash
+                 `(,builder)
+                 #:env-vars
+                 '(("HOME" . "/homeless")
+                   ("zzz" . "Z!")
+                   ("AAA" . "A!"))
+                 #:inputs
+                 `((,%bash) (,builder))
+                 #:outputs
+                 '("out" "second")))
+          (succeeded?
+            (build-derivations %store (list drv))))
+     (and succeeded?
+          (let ((one (derivation->output-path drv "out"))
+                (two (derivation->output-path drv "second")))
+            (and (lset= equal?
+                        (derivation->output-paths drv)
+                        `(("out" unquote one) ("second" unquote two)))
+                 (eq? 'one (call-with-input-file one read))
+                 (eq? 'two (call-with-input-file two read)))))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: multiple-output derivation, non-alphabetic order
location: /home/rsd/v/git/others/guix/tests/derivations.scm:353
source:
+ (test-assert
+   "multiple-output derivation, non-alphabetic order"
+   (let* ((builder
+            (add-text-to-store
+              %store
+              "my-fixed-builder.sh"
+              "echo one > $out ; echo two > $AAA"
+              '()))
+          (drv (derivation
+                 %store
+                 "fixed"
+                 %bash
+                 `(,builder)
+                 #:inputs
+                 `((,%bash) (,builder))
+                 #:outputs
+                 '("out" "AAA")))
+          (succeeded?
+            (build-derivations %store (list drv))))
+     (and succeeded?
+          (let ((one (derivation->output-path drv "out"))
+                (two (derivation->output-path drv "AAA")))
+            (and (eq? 'one (call-with-input-file one read))
+                 (eq? 'two (call-with-input-file two read)))))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: read-derivation vs. derivation
location: /home/rsd/v/git/others/guix/tests/derivations.scm:370
source:
+ (test-assert
+   "read-derivation vs. derivation"
+   (let* ((sources
+            (unfold
+              (cut >= <> 10)
+              (lambda (n)
+                (add-text-to-store
+                  %store
+                  (format #f "input~a" n)
+                  (random-text)))
+              #{1+}#
+              0))
+          (inputs
+            (map (lambda (file)
+                   (derivation
+                     %store
+                     "derivation-input"
+                     %bash
+                     '()
+                     #:inputs
+                     `((,%bash) (,file))))
+                 sources))
+          (builder
+            (add-text-to-store
+              %store
+              "builder.sh"
+              "echo one > $one ; echo two > $two"
+              '()))
+          (drv (derivation
+                 %store
+                 "derivation"
+                 %bash
+                 `(,builder)
+                 #:inputs
+                 `((,%bash)
+                   (,builder)
+                   ,@(map list (append sources inputs)))
+                 #:outputs
+                 '("two" "one")))
+          (drv* (call-with-input-file
+                  (derivation-file-name drv)
+                  read-derivation)))
+     (equal? drv* drv)))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: multiple-output derivation, derivation-path->output-path
location: /home/rsd/v/git/others/guix/tests/derivations.scm:397
source:
+ (test-assert
+   "multiple-output derivation, derivation-path->output-path"
+   (let* ((builder
+            (add-text-to-store
+              %store
+              "builder.sh"
+              "echo one > $out ; echo two > $second"
+              '()))
+          (drv (derivation
+                 %store
+                 "multiple"
+                 %bash
+                 `(,builder)
+                 #:outputs
+                 '("out" "second")))
+          (drv-file (derivation-file-name drv))
+          (one (derivation->output-path drv "out"))
+          (two (derivation->output-path drv "second"))
+          (first (derivation-path->output-path drv-file "out"))
+          (second
+            (derivation-path->output-path drv-file "second")))
+     (and (not (string=? one two))
+          (string-suffix? "-second" two)
+          (string=? first one)
+          (string=? second two))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: user of multiple-output derivation
location: /home/rsd/v/git/others/guix/tests/derivations.scm:414
source:
+ (test-assert
+   "user of multiple-output derivation"
+   (let* ((builder1
+            (add-text-to-store
+              %store
+              "my-mo-builder.sh"
+              "echo one > $out ; echo two > $two"
+              '()))
+          (mdrv (derivation
+                  %store
+                  "multiple-output"
+                  %bash
+                  `(,builder1)
+                  #:inputs
+                  `((,%bash) (,builder1))
+                  #:outputs
+                  '("out" "two")))
+          (builder2
+            (add-text-to-store
+              %store
+              "my-mo-user-builder.sh"
+              "read x < $one;\n                                         read y < $two;\n                                         echo \"($x $y)\" > $out"
+              '()))
+          (udrv (derivation
+                  %store
+                  "multiple-output-user"
+                  %bash
+                  `(,builder2)
+                  #:env-vars
+                  `(("one"
+                     unquote
+                     (derivation->output-path mdrv "out"))
+                    ("two"
+                     unquote
+                     (derivation->output-path mdrv "two")))
+                  #:inputs
+                  `((,%bash) (,builder2) (,mdrv) (,mdrv "two")))))
+     (and (build-derivations %store (list (pk 'udrv udrv)))
+          (let ((p (derivation->output-path udrv)))
+            (and (valid-path? %store p)
+                 (equal? '(one two) (call-with-input-file p read)))))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: derivation with #:references-graphs
location: /home/rsd/v/git/others/guix/tests/derivations.scm:447
source:
+ (test-assert
+   "derivation with #:references-graphs"
+   (let* ((input1
+            (add-text-to-store
+              %store
+              "foo"
+              "hello"
+              (list %bash)))
+          (input2
+            (add-text-to-store
+              %store
+              "bar"
+              (number->string (random 7777))
+              (list input1)))
+          (builder
+            (add-text-to-store
+              %store
+              "build-graph"
+              (format
+                #f
+                "\n~a $out\n (while read l ; do echo $l ; done) < bash > $out/bash\n (while read l ; do echo $l ; done) < input1 > $out/input1\n (while read l ; do echo $l ; done) < input2 > $out/input2"
+                %mkdir)
+              (list %mkdir)))
+          (drv (derivation
+                 %store
+                 "closure-graphs"
+                 %bash
+                 `(,builder)
+                 #:references-graphs
+                 `(("bash" unquote %bash)
+                   ("input1" unquote input1)
+                   ("input2" unquote input2))
+                 #:inputs
+                 `((,%bash) (,builder))))
+          (out (derivation->output-path drv)))
+     (define (deps path . deps)
+       (let ((count (length deps)))
+         (string-append
+           path
+           "\n\n"
+           (number->string count)
+           "\n"
+           (string-join (sort deps string<?) "\n")
+           (if (zero? count) "" "\n"))))
+     (and (build-derivations %store (list drv))
+          (equal?
+            (directory-contents out get-string-all)
+            `(("/bash" unquote (string-append %bash "\n\n0\n"))
+              ("/input1"
+               unquote
+               (if (string>? input1 %bash)
+                 (string-append (deps %bash) (deps input1 %bash))
+                 (string-append (deps input1 %bash) (deps %bash))))
+              ("/input2"
+               unquote
+               (string-concatenate
+                 (map cdr
+                      (sort (map (lambda (p d) (cons p (apply deps p d)))
+                                 (list %bash input1 input2)
+                                 (list '() (list %bash) (list input1)))
+                            (lambda (x y)
+                              (match x
+                                     ((p1 . _)
+                                      (match y
+                                             ((p2 . _)
+                                              (string<? p1 p2)))))))))))))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: derivation #:allowed-references, ok
location: /home/rsd/v/git/others/guix/tests/derivations.scm:497
source:
+ (test-assert
+   "derivation #:allowed-references, ok"
+   (let ((drv (derivation
+                %store
+                "allowed"
+                %bash
+                '("-c" "echo hello > $out")
+                #:inputs
+                `((,%bash))
+                #:allowed-references
+                '())))
+     (build-derivations %store (list drv))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "string-prefix?"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (2 "string" #f)
+   (#f))
result: FAIL

test-name: derivation #:allowed-references, not allowed
location: /home/rsd/v/git/others/guix/tests/derivations.scm:504
source:
+ (test-assert
+   "derivation #:allowed-references, not allowed"
+   (let* ((txt (add-text-to-store %store "foo" "Hello, world."))
+          (drv (derivation
+                 %store
+                 "disallowed"
+                 %bash
+                 `("-c" ,(string-append "echo " txt "> $out"))
+                 #:inputs
+                 `((,%bash) (,txt))
+                 #:allowed-references
+                 '())))
+     (guard (c ((nix-protocol-error? c) #t))
+            (build-derivations %store (list drv))
+            #f)))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: derivation #:allowed-references, self allowed
location: /home/rsd/v/git/others/guix/tests/derivations.scm:516
source:
+ (test-assert
+   "derivation #:allowed-references, self allowed"
+   (let ((drv (derivation
+                %store
+                "allowed"
+                %bash
+                '("-c" "echo $out > $out")
+                #:inputs
+                `((,%bash))
+                #:allowed-references
+                '("out"))))
+     (build-derivations %store (list drv))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "string-prefix?"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (2 "string" #f)
+   (#f))
result: FAIL

test-name: derivation #:allowed-references, self not allowed
location: /home/rsd/v/git/others/guix/tests/derivations.scm:523
source:
+ (test-assert
+   "derivation #:allowed-references, self not allowed"
+   (let ((drv (derivation
+                %store
+                "disallowed"
+                %bash
+                `("-c" ,"echo $out > $out")
+                #:inputs
+                `((,%bash))
+                #:allowed-references
+                '())))
+     (guard (c ((nix-protocol-error? c) #t))
+            (build-derivations %store (list drv))
+            #f)))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "string-prefix?"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (2 "string" #f)
+   (#f))
result: FAIL

test-name: derivation #:disallowed-references, ok
location: /home/rsd/v/git/others/guix/tests/derivations.scm:534
source:
+ (test-assert
+   "derivation #:disallowed-references, ok"
+   (let ((drv (derivation
+                %store
+                "disallowed"
+                %bash
+                '("-c" "echo hello > $out")
+                #:inputs
+                `((,%bash))
+                #:disallowed-references
+                '("out"))))
+     (build-derivations %store (list drv))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "string-prefix?"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (2 "string" #f)
+   (#f))
result: FAIL

test-name: derivation #:disallowed-references, not ok
location: /home/rsd/v/git/others/guix/tests/derivations.scm:541
source:
+ (test-assert
+   "derivation #:disallowed-references, not ok"
+   (let* ((txt (add-text-to-store %store "foo" "Hello, world."))
+          (drv (derivation
+                 %store
+                 "disdisallowed"
+                 %bash
+                 `("-c" ,(string-append "echo " txt "> $out"))
+                 #:inputs
+                 `((,%bash) (,txt))
+                 #:disallowed-references
+                 (list txt))))
+     (guard (c ((nix-protocol-error? c) #t))
+            (build-derivations %store (list drv))
+            #f)))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: derivation #:leaked-env-vars
location: /home/rsd/v/git/others/guix/tests/derivations.scm:556
source:
+ (test-equal
+   "derivation #:leaked-env-vars"
+   (getenv "NIX_STATE_DIR")
+   (let* ((value (getenv "NIX_STATE_DIR"))
+          (drv (derivation
+                 %store
+                 "leaked-env-vars"
+                 %bash
+                 '("-c" "echo -n $NIX_STATE_DIR > $out")
+                 #:hash
+                 (sha256 (string->utf8 value))
+                 #:hash-algo
+                 'sha256
+                 #:inputs
+                 `((,%bash))
+                 #:leaked-env-vars
+                 '("NIX_STATE_DIR"))))
+     (and (build-derivations %store (list drv))
+          (call-with-input-file
+            (derivation->output-path drv)
+            get-string-all))))
expected-value: /home/rsd/v/git/others/guix/test-tmp/var/11878
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "string-prefix?"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (2 "string" #f)
+   (#f))
result: FAIL

test-name: build derivation with coreutils
location: /home/rsd/v/git/others/guix/tests/derivations.scm:577
source:
+ (test-assert
+   "build derivation with coreutils"
+   (let* ((builder
+            (add-text-to-store
+              %store
+              "build-with-coreutils.sh"
+              "echo $PATH ; mkdir --version ; mkdir $out ; touch $out/good"
+              '()))
+          (drv (derivation
+                 %store
+                 "foo"
+                 %bash
+                 `(,builder)
+                 #:env-vars
+                 `(("PATH"
+                    unquote
+                    (string-append
+                      (derivation->output-path %coreutils)
+                      "/bin")))
+                 #:inputs
+                 `((,builder) (,%coreutils))))
+          (succeeded?
+            (build-derivations %store (list drv))))
+     (and succeeded?
+          (let ((p (derivation->output-path drv)))
+            (and (valid-path? %store p)
+                 (file-exists? (string-append p "/good")))))))
result: SKIP

test-name: build-expression->derivation and invalid module name
location: /home/rsd/v/git/others/guix/tests/derivations.scm:600
source:
+ (test-equal
+   "build-expression->derivation and invalid module name"
+   '(file-search-error
+      "guix/module/that/does/not/exist.scm")
+   (guard (c ((file-search-error? c)
+              (list 'file-search-error
+                    (file-search-error-file-name c))))
+          (build-expression->derivation
+            %store
+            "foo"
+            #t
+            #:modules
+            '((guix module that does not exist)))))
result: SKIP

test-name: build-expression->derivation and derivation-prerequisites
location: /home/rsd/v/git/others/guix/tests/derivations.scm:609
source:
+ (test-assert
+   "build-expression->derivation and derivation-prerequisites"
+   (let ((drv (build-expression->derivation %store "fail" #f)))
+     (any (match-lambda
+            (($ <derivation-input> path)
+             (string=?
+               path
+               (derivation-file-name (%guile-for-build)))))
+          (derivation-prerequisites drv))))
result: SKIP

test-name: derivation-prerequisites and valid-derivation-input?
location: /home/rsd/v/git/others/guix/tests/derivations.scm:616
source:
+ (test-assert
+   "derivation-prerequisites and valid-derivation-input?"
+   (let* ((a (build-expression->derivation
+               %store
+               "a"
+               '(mkdir %output)))
+          (b (build-expression->derivation
+               %store
+               "b"
+               `(list ,(random-text))))
+          (c (build-expression->derivation
+               %store
+               "c"
+               `(mkdir %output)
+               #:inputs
+               `(("a" ,a) ("b" ,b)))))
+     (build-derivations
+       %store
+       (list a
+             (package-derivation %store %bootstrap-guile)))
+     (match (derivation-prerequisites
+              c
+              (cut valid-derivation-input? %store <>))
+            ((($ <derivation-input> file ("out")))
+             (string=? file (derivation-file-name b)))
+            (x (pk 'fail x #f)))))
result: SKIP

test-name: build-expression->derivation without inputs
location: /home/rsd/v/git/others/guix/tests/derivations.scm:634
source:
+ (test-assert
+   "build-expression->derivation without inputs"
+   (let* ((builder
+            '(begin
+               (mkdir %output)
+               (call-with-output-file
+                 (string-append %output "/test")
+                 (lambda (p) (display '(hello guix) p)))))
+          (drv (build-expression->derivation
+                 %store
+                 "goo"
+                 builder))
+          (succeeded?
+            (build-derivations %store (list drv))))
+     (and succeeded?
+          (let ((p (derivation->output-path drv)))
+            (equal?
+              '(hello guix)
+              (call-with-input-file
+                (string-append p "/test")
+                read))))))
result: SKIP

test-name: build-expression->derivation and max-silent-time
location: /home/rsd/v/git/others/guix/tests/derivations.scm:647
source:
+ (test-assert
+   "build-expression->derivation and max-silent-time"
+   (let* ((store (let ((s (open-connection)))
+                   (set-build-options s #:max-silent-time 1)
+                   s))
+          (builder '(begin (sleep 100) (mkdir %output) #t))
+          (drv (build-expression->derivation
+                 store
+                 "silent"
+                 builder))
+          (out-path (derivation->output-path drv)))
+     (guard (c ((nix-protocol-error? c)
+                (and (string-contains
+                       (nix-protocol-error-message c)
+                       "failed")
+                     (not (valid-path? store out-path)))))
+            (build-derivations store (list drv))
+            #f)))
result: SKIP

test-name: build-expression->derivation and timeout
location: /home/rsd/v/git/others/guix/tests/derivations.scm:661
source:
+ (test-assert
+   "build-expression->derivation and timeout"
+   (let* ((store (let ((s (open-connection)))
+                   (set-build-options s #:timeout 1)
+                   s))
+          (builder '(begin (sleep 100) (mkdir %output) #t))
+          (drv (build-expression->derivation
+                 store
+                 "slow"
+                 builder))
+          (out-path (derivation->output-path drv)))
+     (guard (c ((nix-protocol-error? c)
+                (and (string-contains
+                       (nix-protocol-error-message c)
+                       "failed")
+                     (not (valid-path? store out-path)))))
+            (build-derivations store (list drv))
+            #f)))
result: SKIP

test-name: build-expression->derivation and derivation-prerequisites-to-build
location: /home/rsd/v/git/others/guix/tests/derivations.scm:675
source:
+ (test-assert
+   "build-expression->derivation and derivation-prerequisites-to-build"
+   (let ((drv (build-expression->derivation %store "fail" #f)))
+     (null? (derivation-prerequisites-to-build %store drv))))
result: SKIP

test-name: derivation-prerequisites-to-build when outputs already present
location: /home/rsd/v/git/others/guix/tests/derivations.scm:681
source:
+ (test-assert
+   "derivation-prerequisites-to-build when outputs already present"
+   (let* ((builder '(begin (mkdir %output) #t))
+          (input-drv
+            (build-expression->derivation
+              %store
+              "input"
+              builder))
+          (input-path
+            (derivation-output-path
+              (assoc-ref (derivation-outputs input-drv) "out")))
+          (drv (build-expression->derivation
+                 %store
+                 "something"
+                 builder
+                 #:inputs
+                 `(("i" ,input-drv))))
+          (output (derivation->output-path drv)))
+     (when (valid-path? %store input-path)
+           (delete-paths %store (list input-path)))
+     (when (valid-path? %store output)
+           (delete-paths %store (list output)))
+     (and (equal?
+            (map derivation-input-path
+                 (derivation-prerequisites-to-build %store drv))
+            (list (derivation-file-name input-drv)))
+          (build-derivations %store (list drv))
+          (delete-paths %store (list input-path))
+          (not (valid-path? %store input-path))
+          (null? (derivation-prerequisites-to-build %store drv)))))
result: SKIP

test-name: derivation-prerequisites-to-build and substitutes
location: /home/rsd/v/git/others/guix/tests/derivations.scm:710
source:
+ (test-assert
+   "derivation-prerequisites-to-build and substitutes"
+   (let* ((store (open-connection))
+          (drv (build-expression->derivation
+                 store
+                 "prereq-subst"
+                 (random 1000)))
+          (output (derivation->output-path drv)))
+     (set-build-options
+       store
+       #:use-substitutes?
+       #t
+       #:substitute-urls
+       (%test-substitute-urls))
+     (with-derivation-narinfo
+       drv
+       (let-values
+         (((build download)
+           (derivation-prerequisites-to-build store drv))
+          ((build* download*)
+           (derivation-prerequisites-to-build
+             store
+             drv
+             #:substitutable?
+             (const #f))))
+         (and (null? build)
+              (equal? download (list output))
+              (null? download*)
+              (null? build*))))))
actual-value: #f
actual-error:
+ (srfi-34
+   #<condition &nix-connection-error [file: "/home/rsd/v/git/others/guix/test-tmp/var/11878/daemon-socket/socket" errno: 2] 4c927b0>)
result: FAIL

test-name: derivation-prerequisites-to-build and substitutes, non-substitutable build
location: /home/rsd/v/git/others/guix/tests/derivations.scm:732
source:
+ (test-assert
+   "derivation-prerequisites-to-build and substitutes, non-substitutable build"
+   (let* ((store (open-connection))
+          (drv (build-expression->derivation
+                 store
+                 "prereq-no-subst"
+                 (random 1000)
+                 #:substitutable?
+                 #f))
+          (output (derivation->output-path drv)))
+     (set-build-options
+       store
+       #:use-substitutes?
+       #t
+       #:substitute-urls
+       (%test-substitute-urls))
+     (with-derivation-narinfo
+       drv
+       (let-values
+         (((build download)
+           (derivation-prerequisites-to-build store drv)))
+         (and (null? download)
+              (match build
+                     (((? derivation-input? input))
+                      (string=?
+                        (derivation-input-path input)
+                        (derivation-file-name drv)))))))))
actual-value: #f
actual-error:
+ (srfi-34
+   #<condition &nix-connection-error [file: "/home/rsd/v/git/others/guix/test-tmp/var/11878/daemon-socket/socket" errno: 2] 4e3f150>)
result: FAIL

test-name: derivation-prerequisites-to-build and substitutes, local build
location: /home/rsd/v/git/others/guix/tests/derivations.scm:754
source:
+ (test-assert
+   "derivation-prerequisites-to-build and substitutes, local build"
+   (with-store
+     store
+     (let* ((drv (build-expression->derivation
+                   store
+                   "prereq-subst-local"
+                   (random 1000)
+                   #:local-build?
+                   #t))
+            (output (derivation->output-path drv)))
+       (set-build-options
+         store
+         #:use-substitutes?
+         #t
+         #:substitute-urls
+         (%test-substitute-urls))
+       (with-derivation-narinfo
+         drv
+         (let-values
+           (((build download)
+             (derivation-prerequisites-to-build store drv)))
+           (and (null? build)
+                (match download
+                       (((? string? item))
+                        (string=? item (derivation->output-path drv))))))))))
actual-value: #f
actual-error:
+ (srfi-34
+   #<condition &nix-connection-error [file: "/home/rsd/v/git/others/guix/test-tmp/var/11878/daemon-socket/socket" errno: 2] 48866f0>)
result: FAIL

test-name: derivation-prerequisites-to-build in 'check' mode
location: /home/rsd/v/git/others/guix/tests/derivations.scm:776
source:
+ (test-assert
+   "derivation-prerequisites-to-build in 'check' mode"
+   (with-store
+     store
+     (let* ((dep (build-expression->derivation
+                   store
+                   "dep"
+                   `(begin ,(random-text) (mkdir %output))))
+            (drv (build-expression->derivation
+                   store
+                   "to-check"
+                   '(mkdir %output)
+                   #:inputs
+                   `(("dep" ,dep)))))
+       (build-derivations store (list drv))
+       (delete-paths
+         store
+         (list (derivation->output-path dep)))
+       (and (null? (derivation-prerequisites-to-build store drv))
+            (match (derivation-prerequisites-to-build
+                     store
+                     drv
+                     #:mode
+                     (build-mode check))
+                   ((input)
+                    (string=?
+                      (derivation-input-path input)
+                      (derivation-file-name dep))))))))
actual-value: #f
actual-error:
+ (srfi-34
+   #<condition &nix-connection-error [file: "/home/rsd/v/git/others/guix/test-tmp/var/11878/daemon-socket/socket" errno: 2] 4786630>)
result: FAIL

test-name: build-expression->derivation with expression returning #f
location: /home/rsd/v/git/others/guix/tests/derivations.scm:796
source:
+ (test-assert
+   "build-expression->derivation with expression returning #f"
+   (let* ((builder '(begin (mkdir %output) #f))
+          (drv (build-expression->derivation
+                 %store
+                 "fail"
+                 builder))
+          (out-path (derivation->output-path drv)))
+     (guard (c ((nix-protocol-error? c)
+                (and (string-match
+                       "build .* failed"
+                       (nix-protocol-error-message c))
+                     (not (valid-path? %store out-path)))))
+            (build-derivations %store (list drv))
+            #f)))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: build-expression->derivation with two outputs
location: /home/rsd/v/git/others/guix/tests/derivations.scm:811
source:
+ (test-assert
+   "build-expression->derivation with two outputs"
+   (let* ((builder
+            '(begin
+               (call-with-output-file
+                 (assoc-ref %outputs "out")
+                 (lambda (p) (display '(hello) p)))
+               (call-with-output-file
+                 (assoc-ref %outputs "second")
+                 (lambda (p) (display '(world) p)))))
+          (drv (build-expression->derivation
+                 %store
+                 "double"
+                 builder
+                 #:outputs
+                 '("out" "second")))
+          (succeeded?
+            (build-derivations %store (list drv))))
+     (and succeeded?
+          (let ((one (derivation->output-path drv))
+                (two (derivation->output-path drv "second")))
+            (and (equal? '(hello) (call-with-input-file one read))
+                 (equal? '(world) (call-with-input-file two read)))))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: build-expression->derivation with one input
location: /home/rsd/v/git/others/guix/tests/derivations.scm:830
source:
+ (test-assert
+   "build-expression->derivation with one input"
+   (let* ((builder
+            '(call-with-output-file
+               %output
+               (lambda (p)
+                 (let ((cu (assoc-ref %build-inputs "cu")))
+                   (close 1)
+                   (dup2 (port->fdes p) 1)
+                   (execl (string-append cu "/bin/uname")
+                          "uname"
+                          "-a")))))
+          (drv (build-expression->derivation
+                 %store
+                 "uname"
+                 builder
+                 #:inputs
+                 `(("cu" ,%coreutils))))
+          (succeeded?
+            (build-derivations %store (list drv))))
+     (and succeeded?
+          (let ((p (derivation->output-path drv)))
+            (string-contains
+              (call-with-input-file p read-line)
+              "GNU")))))
result: SKIP

test-name: build-expression->derivation with modules
location: /home/rsd/v/git/others/guix/tests/derivations.scm:846
source:
+ (test-assert
+   "build-expression->derivation with modules"
+   (let* ((builder
+            `(begin
+               (use-modules (guix build utils))
+               (let ((out (assoc-ref %outputs "out")))
+                 (mkdir-p (string-append out "/guile/guix/nix"))
+                 #t)))
+          (drv (build-expression->derivation
+                 %store
+                 "test-with-modules"
+                 builder
+                 #:modules
+                 '((guix build utils)))))
+     (and (build-derivations %store (list drv))
+          (let* ((p (derivation->output-path drv))
+                 (s (stat (string-append p "/guile/guix/nix"))))
+            (eq? (stat:type s) 'directory)))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: build-expression->derivation: same fixed-output path
location: /home/rsd/v/git/others/guix/tests/derivations.scm:861
source:
+ (test-assert
+   "build-expression->derivation: same fixed-output path"
+   (let* ((builder1
+            '(call-with-output-file
+               %output
+               (lambda (p) (write "hello" p))))
+          (builder2
+            '(call-with-output-file
+               (pk 'difference-here! %output)
+               (lambda (p) (write "hello" p))))
+          (hash (sha256 (string->utf8 "hello")))
+          (input1
+            (build-expression->derivation
+              %store
+              "fixed"
+              builder1
+              #:hash
+              hash
+              #:hash-algo
+              'sha256))
+          (input2
+            (build-expression->derivation
+              %store
+              "fixed"
+              builder2
+              #:hash
+              hash
+              #:hash-algo
+              'sha256))
+          (succeeded?
+            (build-derivations %store (list input1 input2))))
+     (and succeeded?
+          (not (string=?
+                 (derivation-file-name input1)
+                 (derivation-file-name input2)))
+          (string=?
+            (derivation->output-path input1)
+            (derivation->output-path input2)))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: build-expression->derivation with a fixed-output input
location: /home/rsd/v/git/others/guix/tests/derivations.scm:882
source:
+ (test-assert
+   "build-expression->derivation with a fixed-output input"
+   (let* ((builder1
+            '(call-with-output-file
+               %output
+               (lambda (p) (write "hello" p))))
+          (builder2
+            '(call-with-output-file
+               (pk 'difference-here! %output)
+               (lambda (p) (write "hello" p))))
+          (hash (sha256 (string->utf8 "hello")))
+          (input1
+            (build-expression->derivation
+              %store
+              "fixed"
+              builder1
+              #:hash
+              hash
+              #:hash-algo
+              'sha256))
+          (input2
+            (build-expression->derivation
+              %store
+              "fixed"
+              builder2
+              #:hash
+              hash
+              #:hash-algo
+              'sha256))
+          (builder3
+            '(let ((input (assoc-ref %build-inputs "input")))
+               (call-with-output-file
+                 %output
+                 (lambda (out)
+                   (format #f "My input is ~a.~%" input)))))
+          (final1
+            (build-expression->derivation
+              %store
+              "final"
+              builder3
+              #:inputs
+              `(("input" ,input1))))
+          (final2
+            (build-expression->derivation
+              %store
+              "final"
+              builder3
+              #:inputs
+              `(("input" ,input2)))))
+     (and (string=?
+            (derivation->output-path final1)
+            (derivation->output-path final2))
+          (string=?
+            (derivation->output-path final1)
+            (derivation-path->output-path
+              (derivation-file-name final1)))
+          (build-derivations %store (list final1 final2)))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: build-expression->derivation produces recursive fixed-output
location: /home/rsd/v/git/others/guix/tests/derivations.scm:913
source:
+ (test-assert
+   "build-expression->derivation produces recursive fixed-output"
+   (let* ((builder
+            '(begin
+               (use-modules (srfi srfi-26))
+               (mkdir %output)
+               (chdir %output)
+               (call-with-output-file
+                 "exe"
+                 (cut display "executable" <>))
+               (chmod "exe" 511)
+               (symlink "exe" "symlink")
+               (mkdir "subdir")))
+          (drv (build-expression->derivation
+                 %store
+                 "fixed-rec"
+                 builder
+                 #:hash-algo
+                 'sha256
+                 #:hash
+                 (base32
+                   "10k1lw41wyrjf9mxydi0is5nkpynlsvgslinics4ppir13g7d74p")
+                 #:recursive?
+                 #t)))
+     (and (build-derivations %store (list drv))
+          (let* ((dir (derivation->output-path drv))
+                 (exe (string-append dir "/exe"))
+                 (link (string-append dir "/symlink"))
+                 (subdir (string-append dir "/subdir")))
+            (and (executable-file? exe)
+                 (string=?
+                   "executable"
+                   (call-with-input-file exe get-string-all))
+                 (string=? "exe" (readlink link))
+                 (file-is-directory? subdir))))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: build-expression->derivation uses recursive fixed-output
location: /home/rsd/v/git/others/guix/tests/derivations.scm:939
source:
+ (test-assert
+   "build-expression->derivation uses recursive fixed-output"
+   (let* ((builder
+            '(call-with-output-file
+               %output
+               (lambda (port) (display "hello" port))))
+          (fixed (build-expression->derivation
+                   %store
+                   "small-fixed-rec"
+                   builder
+                   #:hash-algo
+                   'sha256
+                   #:hash
+                   (base32
+                     "0sg9f58l1jj88w6pdrfdpj5x9b1zrwszk84j81zvby36q9whhhqa")
+                   #:recursive?
+                   #t))
+          (in (derivation->output-path fixed))
+          (builder
+            `(begin
+               (mkdir %output)
+               (chdir %output)
+               (symlink ,in "symlink")))
+          (drv (build-expression->derivation
+                 %store
+                 "fixed-rec-user"
+                 builder
+                 #:inputs
+                 `(("fixed" ,fixed)))))
+     (and (build-derivations %store (list drv))
+          (let ((out (derivation->output-path drv)))
+            (string=?
+              (readlink (string-append out "/symlink"))
+              in)))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: build-expression->derivation with #:references-graphs
location: /home/rsd/v/git/others/guix/tests/derivations.scm:961
source:
+ (test-assert
+   "build-expression->derivation with #:references-graphs"
+   (let* ((input (add-text-to-store
+                   %store
+                   "foo"
+                   "hello"
+                   (list %bash %mkdir)))
+          (builder '(copy-file "input" %output))
+          (drv (build-expression->derivation
+                 %store
+                 "references-graphs"
+                 builder
+                 #:references-graphs
+                 `(("input" unquote input))))
+          (out (derivation->output-path drv)))
+     (define (deps path . deps)
+       (let ((count (length deps)))
+         (string-append
+           path
+           "\n\n"
+           (number->string count)
+           "\n"
+           (string-join (sort deps string<?) "\n")
+           (if (zero? count) "" "\n"))))
+     (and (build-derivations %store (list drv))
+          (equal?
+            (call-with-input-file out get-string-all)
+            (string-concatenate
+              (map cdr
+                   (sort (map (lambda (p d) (cons p (apply deps p d)))
+                              (list input %bash %mkdir)
+                              (list (list %bash %mkdir) '() '()))
+                         (lambda (x y)
+                           (match x
+                                  ((p1 . _)
+                                   (match y
+                                          ((p2 . _)
+                                           (string<? p1 p2)))))))))))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: map-derivation
location: /home/rsd/v/git/others/guix/tests/derivations.scm:992
source:
+ (test-equal
+   "map-derivation"
+   "hello"
+   (let* ((joke (package-derivation %store guile-1.8))
+          (good (package-derivation %store %bootstrap-guile))
+          (drv1 (build-expression->derivation
+                  %store
+                  "original-drv1"
+                  #f
+                  #:guile-for-build
+                  joke))
+          (drv2 (build-expression->derivation
+                  %store
+                  "original-drv2"
+                  '(call-with-output-file
+                     %output
+                     (lambda (p) (display "hello" p)))))
+          (drv3 (build-expression->derivation
+                  %store
+                  "drv-to-remap"
+                  '(let ((in (assoc-ref %build-inputs "in")))
+                     (copy-file in %output))
+                  #:inputs
+                  `(("in" ,drv1))
+                  #:guile-for-build
+                  joke))
+          (drv4 (map-derivation
+                  %store
+                  drv3
+                  `((,drv1 unquote drv2) (,joke unquote good))))
+          (out (derivation->output-path drv4)))
+     (and (build-derivations
+            %store
+            (list (pk 'remapped drv4)))
+          (call-with-input-file out get-string-all))))
expected-value: hello
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: map-derivation, sources
location: /home/rsd/v/git/others/guix/tests/derivations.scm:1015
source:
+ (test-equal
+   "map-derivation, sources"
+   "hello"
+   (let* ((script1
+            (add-text-to-store %store "fail.sh" "exit 1"))
+          (script2
+            (add-text-to-store
+              %store
+              "hi.sh"
+              "echo -n hello > $out"))
+          (bash-full
+            (package-derivation
+              %store
+              (@ (gnu packages bash) bash)))
+          (drv1 (derivation
+                  %store
+                  "drv-to-remap"
+                  (derivation->output-path bash-full)
+                  `("-e" ,script1)
+                  #:inputs
+                  `((,bash-full) (,script1))))
+          (drv2 (map-derivation
+                  %store
+                  drv1
+                  `((,bash-full unquote %bash)
+                    (,script1 unquote script2))))
+          (out (derivation->output-path drv2)))
+     (and (build-derivations
+            %store
+            (list (pk 'remapped* drv2)))
+          (call-with-input-file out get-string-all))))
expected-value: hello
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

random seed for tests: 1473545071
warning: build daemon error: #<condition &nix-connection-error [file: "/home/rsd/v/git/others/guix/test-tmp/var/11878/daemon-socket/socket" errno: 2] 4965960>

[-- Attachment #1.6: elpa.log --]
[-- Type: application/octet-stream, Size: 410 bytes --]

test-name: elpa->guix-package test 1
location: /home/rsd/v/git/others/guix/tests/elpa.scm:103
source:
+ (test-assert
+   "elpa->guix-package test 1"
+   (eval-test-with-elpa "auctex"))
actual-value: #f
actual-error:
+ (srfi-34
+   #<condition &nix-connection-error [file: "/home/rsd/v/git/others/guix/test-tmp/var/12195/daemon-socket/socket" errno: 2] 3c62e10>)
result: FAIL

random seed for tests: 1473544865

[-- Attachment #1.7: gexp.log --]
[-- Type: application/octet-stream, Size: 50746 bytes --]

test-name: no refs
location: /home/rsd/v/git/others/guix/tests/gexp.scm:71
source:
+ (test-equal
+   "no refs"
+   '(display "hello!")
+   (let ((exp (gexp (display "hello!"))))
+     (and (gexp? exp)
+          (null? (gexp-inputs exp))
+          (gexp->sexp* exp))))
expected-value: (display hello!)
actual-value: (display hello!)
result: PASS

test-name: unquote
location: /home/rsd/v/git/others/guix/tests/gexp.scm:78
source:
+ (test-equal
+   "unquote"
+   '(display `(foo ,(+ 2 3)))
+   (let ((exp (gexp (display `(foo ,(+ 2 3))))))
+     (and (gexp? exp)
+          (null? (gexp-inputs exp))
+          (gexp->sexp* exp))))
expected-value: (display (quasiquote (foo (unquote (+ 2 3)))))
actual-value: (display (quasiquote (foo (unquote (+ 2 3)))))
result: PASS

test-name: one input package
location: /home/rsd/v/git/others/guix/tests/gexp.scm:85
source:
+ (test-assert
+   "one input package"
+   (let ((exp (gexp (display (ungexp coreutils)))))
+     (and (gexp? exp)
+          (match (gexp-inputs exp)
+                 (((p "out")) (eq? p coreutils)))
+          (equal?
+            `(display
+               ,(derivation->output-path
+                  (package-derivation %store coreutils)))
+            (gexp->sexp* exp)))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: one input origin
location: /home/rsd/v/git/others/guix/tests/gexp.scm:95
source:
+ (test-assert
+   "one input origin"
+   (let ((exp (gexp (display (ungexp (package-source coreutils))))))
+     (and (gexp? exp)
+          (match (gexp-inputs exp)
+                 (((o "out")) (eq? o (package-source coreutils))))
+          (equal?
+            `(display
+               ,(derivation->output-path
+                  (package-source-derivation
+                    %store
+                    (package-source coreutils))))
+            (gexp->sexp* exp)))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: one local file
location: /home/rsd/v/git/others/guix/tests/gexp.scm:106
source:
+ (test-assert
+   "one local file"
+   (let* ((file (search-path %load-path "guix.scm"))
+          (local (local-file file))
+          (exp (gexp (display (ungexp local))))
+          (intd (add-to-store
+                  %store
+                  (basename file)
+                  #f
+                  "sha256"
+                  file)))
+     (and (gexp? exp)
+          (match (gexp-inputs exp)
+                 (((x "out")) (eq? x local)))
+          (equal? `(display ,intd) (gexp->sexp* exp)))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: one local file, symlink
location: /home/rsd/v/git/others/guix/tests/gexp.scm:118
source:
+ (test-assert
+   "one local file, symlink"
+   (let ((file (search-path %load-path "guix.scm"))
+         (link (tmpnam)))
+     (dynamic-wind
+       (const #t)
+       (lambda ()
+         (symlink (canonicalize-path file) link)
+         (let* ((local (local-file link "my-file" #:recursive? #f))
+                (exp (gexp (display (ungexp local))))
+                (intd (add-to-store %store "my-file" #f "sha256" file)))
+           (and (gexp? exp)
+                (match (gexp-inputs exp)
+                       (((x "out")) (eq? x local)))
+                (equal? `(display ,intd) (gexp->sexp* exp)))))
+       (lambda ()
+         (false-if-exception (delete-file link))))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: local-file, relative file name
location: /home/rsd/v/git/others/guix/tests/gexp.scm:137
source:
+ (test-equal
+   "local-file, relative file name"
+   (canonicalize-path
+     (search-path %load-path "guix/base32.scm"))
+   (let ((directory
+           (dirname
+             (search-path
+               %load-path
+               "guix/build-system/gnu.scm"))))
+     (with-directory-excursion
+       directory
+       (let ((file (local-file "../guix/base32.scm")))
+         (local-file-absolute-file-name file)))))
expected-value: /home/rsd/v/git/others/guix/guix/base32.scm
actual-value: /home/rsd/v/git/others/guix/guix/base32.scm
result: PASS

test-name: local-file, #:select?
location: /home/rsd/v/git/others/guix/tests/gexp.scm:145
source:
+ (test-assert
+   "local-file, #:select?"
+   (run-with-store
+     %store
+     (mlet* %store-monad
+            ((select?
+               ->
+               (lambda (file stat)
+                 (member
+                   (basename file)
+                   '("guix.scm" "tests" "gexp.scm"))))
+             (file ->
+                   (local-file
+                     ".."
+                     "directory"
+                     #:recursive?
+                     #t
+                     #:select?
+                     select?))
+             (dir (lower-object file)))
+            (return
+              (and (store-path? dir)
+                   (equal?
+                     (scandir dir)
+                     '("." ".." "guix.scm" "tests"))
+                   (equal?
+                     (scandir (string-append dir "/tests"))
+                     '("." ".." "gexp.scm")))))
+     #:guile-for-build
+     (%guile-for-build)))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: one plain file
location: /home/rsd/v/git/others/guix/tests/gexp.scm:160
source:
+ (test-assert
+   "one plain file"
+   (let* ((file (plain-file "hi" "Hello, world!"))
+          (exp (gexp (display (ungexp file))))
+          (expected
+            (add-text-to-store %store "hi" "Hello, world!")))
+     (and (gexp? exp)
+          (match (gexp-inputs exp)
+                 (((x "out")) (eq? x file)))
+          (equal? `(display ,expected) (gexp->sexp* exp)))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: same input twice
location: /home/rsd/v/git/others/guix/tests/gexp.scm:170
source:
+ (test-assert
+   "same input twice"
+   (let ((exp (gexp (begin
+                      (display (ungexp coreutils))
+                      (display (ungexp coreutils))))))
+     (and (gexp? exp)
+          (match (gexp-inputs exp)
+                 (((p "out")) (eq? p coreutils)))
+          (let ((e `(display
+                      ,(derivation->output-path
+                         (package-derivation %store coreutils)))))
+            (equal? `(begin ,e ,e) (gexp->sexp* exp))))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: two input packages, one derivation, one file
location: /home/rsd/v/git/others/guix/tests/gexp.scm:182
source:
+ (test-assert
+   "two input packages, one derivation, one file"
+   (let* ((drv (build-expression->derivation
+                 %store
+                 "foo"
+                 'bar
+                 #:guile-for-build
+                 (package-derivation %store %bootstrap-guile)))
+          (txt (add-text-to-store %store "foo" "Hello, world!"))
+          (exp (gexp (begin
+                       (display (ungexp coreutils))
+                       (display (ungexp %bootstrap-guile))
+                       (display (ungexp drv))
+                       (display (ungexp txt))))))
+     (define (match-input thing)
+       (match-lambda
+         ((drv-or-pkg _ ...) (eq? thing drv-or-pkg))))
+     (and (gexp? exp)
+          (= 4 (length (gexp-inputs exp)))
+          (every (lambda (input)
+                   (find (match-input input) (gexp-inputs exp)))
+                 (list drv coreutils %bootstrap-guile txt))
+          (let ((e0 `(display
+                       ,(derivation->output-path
+                          (package-derivation %store coreutils))))
+                (e1 `(display
+                       ,(derivation->output-path
+                          (package-derivation %store %bootstrap-guile))))
+                (e2 `(display ,(derivation->output-path drv)))
+                (e3 `(display ,txt)))
+            (equal?
+              `(begin ,e0 ,e1 ,e2 ,e3)
+              (gexp->sexp* exp))))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: file-append
location: /home/rsd/v/git/others/guix/tests/gexp.scm:210
source:
+ (test-assert
+   "file-append"
+   (let* ((drv (package-derivation %store %bootstrap-guile))
+          (fa (file-append %bootstrap-guile "/bin/guile"))
+          (exp (gexp (here we go (ungexp fa)))))
+     (and (match (gexp->sexp* exp)
+                 (('here 'we 'go (? string? result))
+                  (string=?
+                    result
+                    (string-append
+                      (derivation->output-path drv)
+                      "/bin/guile"))))
+          (match (gexp-inputs exp)
+                 (((thing "out")) (eq? thing fa))))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: file-append, output
location: /home/rsd/v/git/others/guix/tests/gexp.scm:223
source:
+ (test-assert
+   "file-append, output"
+   (let* ((drv (package-derivation %store glibc))
+          (fa (file-append glibc "/lib" "/debug"))
+          (exp (gexp (foo (ungexp fa "debug")))))
+     (and (match (gexp->sexp* exp)
+                 (('foo (? string? result))
+                  (string=?
+                    result
+                    (string-append
+                      (derivation->output-path drv "debug")
+                      "/lib/debug"))))
+          (match (gexp-inputs exp)
+                 (((thing "debug")) (eq? thing fa))))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: file-append, nested
location: /home/rsd/v/git/others/guix/tests/gexp.scm:236
source:
+ (test-assert
+   "file-append, nested"
+   (let* ((drv (package-derivation %store glibc))
+          (dir (file-append glibc "/bin"))
+          (slash (file-append dir "/"))
+          (file (file-append slash "getent"))
+          (exp (gexp (foo (ungexp file)))))
+     (and (match (gexp->sexp* exp)
+                 (('foo (? string? result))
+                  (string=?
+                    result
+                    (string-append
+                      (derivation->output-path drv)
+                      "/bin/getent"))))
+          (match (gexp-inputs exp)
+                 (((thing "out")) (eq? thing file))))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: ungexp + ungexp-native
location: /home/rsd/v/git/others/guix/tests/gexp.scm:251
source:
+ (test-assert
+   "ungexp + ungexp-native"
+   (let* ((exp (gexp (list (ungexp-native %bootstrap-guile)
+                           (ungexp coreutils)
+                           (ungexp-native glibc)
+                           (ungexp binutils))))
+          (target "mips64el-linux")
+          (guile (derivation->output-path
+                   (package-derivation %store %bootstrap-guile)))
+          (cu (derivation->output-path
+                (package-cross-derivation
+                  %store
+                  coreutils
+                  target)))
+          (libc (derivation->output-path
+                  (package-derivation %store glibc)))
+          (bu (derivation->output-path
+                (package-cross-derivation %store binutils target))))
+     (and (lset= equal?
+                 `((,%bootstrap-guile "out") (,glibc "out"))
+                 (gexp-native-inputs exp))
+          (lset= equal?
+                 `((,coreutils "out") (,binutils "out"))
+                 (gexp-inputs exp))
+          (equal?
+            `(list ,guile ,cu ,libc ,bu)
+            (gexp->sexp* exp target)))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: ungexp + ungexp-native, nested
location: /home/rsd/v/git/others/guix/tests/gexp.scm:274
source:
+ (test-equal
+   "ungexp + ungexp-native, nested"
+   (list `((,%bootstrap-guile "out"))
+         '<>
+         `((,coreutils "out")))
+   (let* ((exp (gexp (list (ungexp-native (gexp (ungexp coreutils)))
+                           (ungexp %bootstrap-guile)))))
+     (list (gexp-inputs exp)
+           '<>
+           (gexp-native-inputs exp))))
expected-value: (((#<package guile-bootstrap@2.0 gnu/packages/bootstrap.scm:277 1a88480> out)) <> ((#<package coreutils@8.25 gnu/packages/base.scm:263 369db40> out)))
actual-value: (((#<package guile-bootstrap@2.0 gnu/packages/bootstrap.scm:277 1a88480> out)) <> ((#<package coreutils@8.25 gnu/packages/base.scm:263 369db40> out)))
result: PASS

test-name: input list
location: /home/rsd/v/git/others/guix/tests/gexp.scm:280
source:
+ (test-assert
+   "input list"
+   (let ((exp (gexp (display
+                      '(ungexp (list %bootstrap-guile coreutils)))))
+         (guile (derivation->output-path
+                  (package-derivation %store %bootstrap-guile)))
+         (cu (derivation->output-path
+               (package-derivation %store coreutils))))
+     (and (lset= equal?
+                 `((,%bootstrap-guile "out") (,coreutils "out"))
+                 (gexp-inputs exp))
+          (equal?
+            `(display '(,guile ,cu))
+            (gexp->sexp* exp)))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: input list + ungexp-native
location: /home/rsd/v/git/others/guix/tests/gexp.scm:293
source:
+ (test-assert
+   "input list + ungexp-native"
+   (let* ((target "mips64el-linux")
+          (exp (gexp (display
+                       (cons '(ungexp-native
+                                (list %bootstrap-guile coreutils))
+                             '(ungexp (list glibc binutils))))))
+          (guile (derivation->output-path
+                   (package-derivation %store %bootstrap-guile)))
+          (cu (derivation->output-path
+                (package-derivation %store coreutils)))
+          (xlibc (derivation->output-path
+                   (package-cross-derivation %store glibc target)))
+          (xbu (derivation->output-path
+                 (package-cross-derivation %store binutils target))))
+     (and (lset= equal?
+                 `((,%bootstrap-guile "out") (,coreutils "out"))
+                 (gexp-native-inputs exp))
+          (lset= equal?
+                 `((,glibc "out") (,binutils "out"))
+                 (gexp-inputs exp))
+          (equal?
+            `(display (cons '(,guile ,cu) '(,xlibc ,xbu)))
+            (gexp->sexp* exp target)))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: input list splicing
location: /home/rsd/v/git/others/guix/tests/gexp.scm:315
source:
+ (test-assert
+   "input list splicing"
+   (let* ((inputs
+            (list (gexp-input glibc "debug")
+                  %bootstrap-guile))
+          (outputs
+            (list (derivation->output-path
+                    (package-derivation %store glibc)
+                    "debug")
+                  (derivation->output-path
+                    (package-derivation %store %bootstrap-guile))))
+          (exp (gexp (list (ungexp-splicing (cons (+ 2 3) inputs))))))
+     (and (lset= equal?
+                 `((,glibc "debug") (,%bootstrap-guile "out"))
+                 (gexp-inputs exp))
+          (equal?
+            (gexp->sexp* exp)
+            `(list ,@(cons 5 outputs))))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: input list splicing + ungexp-native-splicing
location: /home/rsd/v/git/others/guix/tests/gexp.scm:329
source:
+ (test-assert
+   "input list splicing + ungexp-native-splicing"
+   (let* ((inputs
+            (list (gexp-input glibc "debug")
+                  %bootstrap-guile))
+          (exp (gexp (list (ungexp-native-splicing (cons (+ 2 3) inputs))))))
+     (and (lset= equal?
+                 `((,glibc "debug") (,%bootstrap-guile "out"))
+                 (gexp-native-inputs exp))
+          (null? (gexp-inputs exp))
+          (equal?
+            (gexp->sexp* exp)
+            (gexp->sexp* exp "mips64el-linux")))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: output list
location: /home/rsd/v/git/others/guix/tests/gexp.scm:339
source:
+ (test-equal
+   "output list"
+   2
+   (let ((exp (gexp (begin
+                      (mkdir (ungexp output))
+                      (mkdir (ungexp output "bar"))))))
+     (length (gexp-outputs exp))))
expected-value: 2
actual-value: 2
result: PASS

test-name: output list, combined gexps
location: /home/rsd/v/git/others/guix/tests/gexp.scm:345
source:
+ (test-assert
+   "output list, combined gexps"
+   (let* ((exp0 (gexp (mkdir (ungexp output))))
+          (exp1 (gexp (mkdir (ungexp output "foo"))))
+          (exp2 (gexp (begin
+                        (display "hi!")
+                        (ungexp exp0)
+                        (ungexp exp1)))))
+     (and (lset= equal?
+                 (append (gexp-outputs exp0) (gexp-outputs exp1))
+                 (gexp-outputs exp2))
+          (= 2 (length (gexp-outputs exp2))))))
actual-value: #t
result: PASS

test-name: output list, combined gexps, duplicate output
location: /home/rsd/v/git/others/guix/tests/gexp.scm:354
source:
+ (test-equal
+   "output list, combined gexps, duplicate output"
+   1
+   (let* ((exp0 (gexp (mkdir (ungexp output))))
+          (exp1 (gexp (begin (mkdir (ungexp output)) (ungexp exp0))))
+          (exp2 (gexp (begin (mkdir (ungexp output)) (ungexp exp1)))))
+     (length (gexp-outputs exp2))))
expected-value: 1
actual-value: 1
result: PASS

test-name: output list + ungexp-splicing list, combined gexps
location: /home/rsd/v/git/others/guix/tests/gexp.scm:361
source:
+ (test-assert
+   "output list + ungexp-splicing list, combined gexps"
+   (let* ((exp0 (gexp (mkdir (ungexp output))))
+          (exp1 (gexp (mkdir (ungexp output "foo"))))
+          (exp2 (gexp (begin
+                        (display "hi!")
+                        (ungexp-splicing (list exp0 exp1))))))
+     (and (lset= equal?
+                 (append (gexp-outputs exp0) (gexp-outputs exp1))
+                 (gexp-outputs exp2))
+          (= 2 (length (gexp-outputs exp2))))))
actual-value: #t
result: PASS

test-name: gexp->file
location: /home/rsd/v/git/others/guix/tests/gexp.scm:371
source:
+ (test-assert
+   "gexp->file"
+   (run-with-store
+     %store
+     (mlet* %store-monad
+            ((exp ->
+                  (gexp (display (ungexp %bootstrap-guile))))
+             (guile (package-file %bootstrap-guile))
+             (sexp (gexp->sexp exp))
+             (drv (gexp->file "foo" exp))
+             (out -> (derivation->output-path drv))
+             (done (built-derivations (list drv)))
+             (refs ((store-lift references) out)))
+            (return
+              (and (equal? sexp (call-with-input-file out read))
+                   (equal? (list guile) refs))))
+     #:guile-for-build
+     (%guile-for-build)))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: gexp->file + file-append
location: /home/rsd/v/git/others/guix/tests/gexp.scm:382
source:
+ (test-assert
+   "gexp->file + file-append"
+   (run-with-store
+     %store
+     (mlet* %store-monad
+            ((exp ->
+                  (gexp (ungexp
+                          (file-append %bootstrap-guile "/bin/guile"))))
+             (guile (package-file %bootstrap-guile))
+             (drv (gexp->file "foo" exp))
+             (out -> (derivation->output-path drv))
+             (done (built-derivations (list drv)))
+             (refs ((store-lift references) out)))
+            (return
+              (and (equal?
+                     (string-append guile "/bin/guile")
+                     (call-with-input-file out read))
+                   (equal? (list guile) refs))))
+     #:guile-for-build
+     (%guile-for-build)))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: gexp->derivation
location: /home/rsd/v/git/others/guix/tests/gexp.scm:394
source:
+ (test-assert
+   "gexp->derivation"
+   (run-with-store
+     %store
+     (mlet* %store-monad
+            ((file (text-file "foo" "Hello, world!"))
+             (exp ->
+                  (gexp (begin
+                          (mkdir (ungexp output))
+                          (chdir (ungexp output))
+                          (symlink
+                            (string-append
+                              (ungexp %bootstrap-guile)
+                              "/bin/guile")
+                            "foo")
+                          (symlink (ungexp file) (ungexp output "2nd")))))
+             (drv (gexp->derivation "foo" exp))
+             (out -> (derivation->output-path drv))
+             (out2 -> (derivation->output-path drv "2nd"))
+             (done (built-derivations (list drv)))
+             (refs ((store-lift references) out))
+             (refs2 ((store-lift references) out2))
+             (guile (package-file %bootstrap-guile "bin/guile")))
+            (return
+              (and (string=?
+                     (readlink (string-append out "/foo"))
+                     guile)
+                   (string=? (readlink out2) file)
+                   (equal? refs (list (dirname (dirname guile))))
+                   (equal? refs2 (list file)))))
+     #:guile-for-build
+     (%guile-for-build)))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: gexp->derivation vs. grafts
location: /home/rsd/v/git/others/guix/tests/gexp.scm:418
source:
+ (test-assert
+   "gexp->derivation vs. grafts"
+   (run-with-store
+     %store
+     (mlet* %store-monad
+            ((graft? (set-grafting #f))
+             (p0 ->
+                 (dummy-package
+                   "dummy"
+                   (arguments '(#:implicit-inputs? #f))))
+             (r -> (package (inherit p0) (name "DuMMY")))
+             (p1 -> (package (inherit p0) (replacement r)))
+             (exp0 ->
+                   (gexp (frob (ungexp p0) (ungexp output))))
+             (exp1 ->
+                   (gexp (frob (ungexp p1) (ungexp output))))
+             (void (set-guile-for-build %bootstrap-guile))
+             (drv0 (gexp->derivation "t" exp0 #:graft? #t))
+             (drv1 (gexp->derivation "t" exp1 #:graft? #t))
+             (drv1* (gexp->derivation "t" exp1 #:graft? #f))
+             (_ (set-grafting graft?)))
+            (return
+              (and (not (string=?
+                          (derivation->output-path drv0)
+                          (derivation->output-path drv1)))
+                   (string=?
+                     (derivation->output-path drv0)
+                     (derivation->output-path drv1*)))))
+     #:guile-for-build
+     (%guile-for-build)))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: gexp->derivation, composed gexps
location: /home/rsd/v/git/others/guix/tests/gexp.scm:437
source:
+ (test-assert
+   "gexp->derivation, composed gexps"
+   (run-with-store
+     %store
+     (mlet* %store-monad
+            ((exp0 ->
+                   (gexp (begin
+                           (mkdir (ungexp output))
+                           (chdir (ungexp output)))))
+             (exp1 ->
+                   (gexp (symlink
+                           (string-append
+                             (ungexp %bootstrap-guile)
+                             "/bin/guile")
+                           "foo")))
+             (exp ->
+                  (gexp (begin (ungexp exp0) (ungexp exp1))))
+             (drv (gexp->derivation "foo" exp))
+             (out -> (derivation->output-path drv))
+             (done (built-derivations (list drv)))
+             (guile (package-file %bootstrap-guile "bin/guile")))
+            (return
+              (string=?
+                (readlink (string-append out "/foo"))
+                guile)))
+     #:guile-for-build
+     (%guile-for-build)))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: gexp->derivation, default system
location: /home/rsd/v/git/others/guix/tests/gexp.scm:453
source:
+ (test-assert
+   "gexp->derivation, default system"
+   (run-with-store
+     %store
+     (let ((system (%current-system))
+           (mdrv (parameterize
+                   ((%current-system "foobar64-linux"))
+                   (gexp->derivation
+                     "foo"
+                     (gexp (mkdir (ungexp output)))))))
+       (mlet %store-monad
+             ((drv mdrv))
+             (return
+               (string=? system (derivation-system drv)))))
+     #:guile-for-build
+     (%guile-for-build)))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: gexp->derivation, local-file
location: /home/rsd/v/git/others/guix/tests/gexp.scm:464
source:
+ (test-assert
+   "gexp->derivation, local-file"
+   (run-with-store
+     %store
+     (mlet* %store-monad
+            ((file -> (search-path %load-path "guix.scm"))
+             (intd (interned-file file #:recursive? #f))
+             (local -> (local-file file))
+             (exp ->
+                  (gexp (begin
+                          (stat (ungexp local))
+                          (symlink (ungexp local) (ungexp output)))))
+             (drv (gexp->derivation "local-file" exp)))
+            (mbegin
+              %store-monad
+              (built-derivations (list drv))
+              (return
+                (string=?
+                  (readlink (derivation->output-path drv))
+                  intd))))
+     #:guile-for-build
+     (%guile-for-build)))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: gexp->derivation, cross-compilation
location: /home/rsd/v/git/others/guix/tests/gexp.scm:478
source:
+ (test-assert
+   "gexp->derivation, cross-compilation"
+   (run-with-store
+     %store
+     (mlet* %store-monad
+            ((target -> "mips64el-linux")
+             (exp ->
+                  (gexp (list (ungexp coreutils) (ungexp output))))
+             (xdrv (gexp->derivation "foo" exp #:target target))
+             (refs ((store-lift references)
+                    (derivation-file-name xdrv)))
+             (xcu (package->cross-derivation coreutils target))
+             (cu (package->derivation coreutils)))
+            (return
+              (and (member (derivation-file-name xcu) refs)
+                   (not (member (derivation-file-name cu) refs)))))
+     #:guile-for-build
+     (%guile-for-build)))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: gexp->derivation, ungexp-native
location: /home/rsd/v/git/others/guix/tests/gexp.scm:492
source:
+ (test-assert
+   "gexp->derivation, ungexp-native"
+   (run-with-store
+     %store
+     (mlet* %store-monad
+            ((target -> "mips64el-linux")
+             (exp ->
+                  (gexp (list (ungexp-native coreutils) (ungexp output))))
+             (xdrv (gexp->derivation "foo" exp #:target target))
+             (drv (gexp->derivation "foo" exp)))
+            (return
+              (string=?
+                (derivation-file-name drv)
+                (derivation-file-name xdrv))))
+     #:guile-for-build
+     (%guile-for-build)))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: gexp->derivation, ungexp + ungexp-native
location: /home/rsd/v/git/others/guix/tests/gexp.scm:502
source:
+ (test-assert
+   "gexp->derivation, ungexp + ungexp-native"
+   (run-with-store
+     %store
+     (mlet* %store-monad
+            ((target -> "mips64el-linux")
+             (exp ->
+                  (gexp (list (ungexp-native coreutils)
+                              (ungexp glibc)
+                              (ungexp output))))
+             (xdrv (gexp->derivation "foo" exp #:target target))
+             (refs ((store-lift references)
+                    (derivation-file-name xdrv)))
+             (xglibc (package->cross-derivation glibc target))
+             (cu (package->derivation coreutils)))
+            (return
+              (and (member (derivation-file-name cu) refs)
+                   (member (derivation-file-name xglibc) refs))))
+     #:guile-for-build
+     (%guile-for-build)))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: gexp->derivation, ungexp-native + composed gexps
location: /home/rsd/v/git/others/guix/tests/gexp.scm:516
source:
+ (test-assert
+   "gexp->derivation, ungexp-native + composed gexps"
+   (run-with-store
+     %store
+     (mlet* %store-monad
+            ((target -> "mips64el-linux")
+             (exp0 -> (gexp (list 1 2 (ungexp coreutils))))
+             (exp -> (gexp (list 0 (ungexp-native exp0))))
+             (xdrv (gexp->derivation "foo" exp #:target target))
+             (drv (gexp->derivation "foo" exp)))
+            (return
+              (string=?
+                (derivation-file-name drv)
+                (derivation-file-name xdrv))))
+     #:guile-for-build
+     (%guile-for-build)))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: gexp->derivation, store copy
location: /home/rsd/v/git/others/guix/tests/gexp.scm:527
source:
+ (test-assert
+   "gexp->derivation, store copy"
+   (run-with-store
+     %store
+     (let ((build-one
+             (gexp (call-with-output-file
+                     (ungexp output)
+                     (lambda (port) (display "This is the one." port)))))
+           (build-two
+             (lambda (one)
+               (gexp (begin
+                       (mkdir (ungexp output))
+                       (symlink
+                         (ungexp one)
+                         (string-append (ungexp output) "/one"))
+                       (call-with-output-file
+                         (string-append (ungexp output) "/two")
+                         (lambda (port)
+                           (display "This is the second one." port)))))))
+           (build-drv
+             (gexp (begin
+                     (use-modules (guix build store-copy))
+                     (mkdir (ungexp output))
+                     (populate-store '("graph") (ungexp output))))))
+       (mlet* %store-monad
+              ((one (gexp->derivation "one" build-one))
+               (two (gexp->derivation "two" (build-two one)))
+               (drv (gexp->derivation
+                      "store-copy"
+                      build-drv
+                      #:references-graphs
+                      `(("graph" ,two))
+                      #:modules
+                      '((guix build store-copy) (guix build utils))))
+               (ok? (built-derivations (list drv)))
+               (out -> (derivation->output-path drv)))
+              (let ((one (derivation->output-path one))
+                    (two (derivation->output-path two)))
+                (return
+                  (and ok?
+                       (file-exists? (string-append out "/" one))
+                       (file-exists? (string-append out "/" two))
+                       (file-exists? (string-append out "/" two "/two"))
+                       (string=?
+                         (readlink (string-append out "/" two "/one"))
+                         one))))))
+     #:guile-for-build
+     (%guile-for-build)))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: imported-files
location: /home/rsd/v/git/others/guix/tests/gexp.scm:562
source:
+ (test-assert
+   "imported-files"
+   (run-with-store
+     %store
+     (mlet* %store-monad
+            ((files ->
+                    `(("x"
+                       unquote
+                       (search-path %load-path "ice-9/q.scm"))
+                      ("a/b/c"
+                       unquote
+                       (search-path %load-path "guix/derivations.scm"))
+                      ("p/q"
+                       unquote
+                       (search-path %load-path "guix.scm"))
+                      ("p/z"
+                       unquote
+                       (search-path %load-path "guix/store.scm"))))
+             (drv (imported-files files)))
+            (mbegin
+              %store-monad
+              (built-derivations (list drv))
+              (let ((dir (derivation->output-path drv)))
+                (return
+                  (every (match-lambda
+                           ((path . source)
+                            (equal?
+                              (call-with-input-file
+                                (string-append dir "/" path)
+                                get-bytevector-all)
+                              (call-with-input-file
+                                source
+                                get-bytevector-all))))
+                         files)))))
+     #:guile-for-build
+     (%guile-for-build)))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: gexp-modules & ungexp
location: /home/rsd/v/git/others/guix/tests/gexp.scm:582
source:
+ (test-equal
+   "gexp-modules & ungexp"
+   '((bar) (foo))
+   ((@@ (guix gexp) gexp-modules)
+    (gexp (foo (ungexp
+                 (with-imported-modules '((foo)) (gexp +)))
+               (ungexp-native
+                 (with-imported-modules '((bar)) (gexp -)))))))
expected-value: ((bar) (foo))
actual-value: ((bar) (foo))
result: PASS

test-name: gexp-modules & ungexp-splicing
location: /home/rsd/v/git/others/guix/tests/gexp.scm:588
source:
+ (test-equal
+   "gexp-modules & ungexp-splicing"
+   '((foo) (bar))
+   ((@@ (guix gexp) gexp-modules)
+    (gexp (foo (ungexp-splicing
+                 (list (with-imported-modules '((foo)) (gexp +))
+                       (with-imported-modules '((bar)) (gexp -))))))))
expected-value: ((foo) (bar))
actual-value: ((foo) (bar))
result: PASS

test-name: gexp->derivation #:modules
location: /home/rsd/v/git/others/guix/tests/gexp.scm:594
source:
+ (test-assert
+   "gexp->derivation #:modules"
+   (run-with-store
+     %store
+     (mlet* %store-monad
+            ((build ->
+                    (gexp (begin
+                            (use-modules (guix build utils))
+                            (mkdir-p
+                              (string-append
+                                (ungexp output)
+                                "/guile/guix/nix"))
+                            #t)))
+             (drv (gexp->derivation
+                    "test-with-modules"
+                    build
+                    #:modules
+                    '((guix build utils)))))
+            (mbegin
+              %store-monad
+              (built-derivations (list drv))
+              (let* ((p (derivation->output-path drv))
+                     (s (stat (string-append p "/guile/guix/nix"))))
+                (return (eq? (stat:type s) 'directory)))))
+     #:guile-for-build
+     (%guile-for-build)))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: gexp->derivation & with-imported-modules
location: /home/rsd/v/git/others/guix/tests/gexp.scm:608
source:
+ (test-assert
+   "gexp->derivation & with-imported-modules"
+   (run-with-store
+     %store
+     (mlet* %store-monad
+            ((build ->
+                    (with-imported-modules
+                      '((guix build utils))
+                      (gexp (begin
+                              (use-modules (guix build utils))
+                              (mkdir-p
+                                (string-append
+                                  (ungexp output)
+                                  "/guile/guix/nix"))
+                              #t))))
+             (drv (gexp->derivation "test-with-modules" build)))
+            (mbegin
+              %store-monad
+              (built-derivations (list drv))
+              (let* ((p (derivation->output-path drv))
+                     (s (stat (string-append p "/guile/guix/nix"))))
+                (return (eq? (stat:type s) 'directory)))))
+     #:guile-for-build
+     (%guile-for-build)))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: gexp->derivation & nested with-imported-modules
location: /home/rsd/v/git/others/guix/tests/gexp.scm:623
source:
+ (test-assert
+   "gexp->derivation & nested with-imported-modules"
+   (run-with-store
+     %store
+     (mlet* %store-monad
+            ((build1
+               ->
+               (with-imported-modules
+                 '((guix build utils))
+                 (gexp (begin
+                         (use-modules (guix build utils))
+                         (mkdir-p
+                           (string-append (ungexp output) "/guile/guix/nix"))
+                         #t))))
+             (build2
+               ->
+               (with-imported-modules
+                 '((guix build bournish))
+                 (gexp (begin
+                         (use-modules
+                           (guix build bournish)
+                           (system base compile))
+                         (ungexp-native build1)
+                         (call-with-output-file
+                           (string-append (ungexp output) "/b")
+                           (lambda (port)
+                             (write (read-and-compile
+                                      (open-input-string "cd /foo")
+                                      #:from
+                                      %bournish-language
+                                      #:to
+                                      'scheme)
+                                    port)))))))
+             (drv (gexp->derivation "test-with-modules" build2)))
+            (mbegin
+              %store-monad
+              (built-derivations (list drv))
+              (let* ((p (derivation->output-path drv))
+                     (s (stat (string-append p "/guile/guix/nix")))
+                     (b (string-append p "/b")))
+                (return
+                  (and (eq? (stat:type s) 'directory)
+                       (equal?
+                         '(chdir "/foo")
+                         (call-with-input-file b read)))))))
+     #:guile-for-build
+     (%guile-for-build)))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: gexp->derivation #:references-graphs
location: /home/rsd/v/git/others/guix/tests/gexp.scm:652
source:
+ (test-assert
+   "gexp->derivation #:references-graphs"
+   (run-with-store
+     %store
+     (mlet* %store-monad
+            ((one (text-file "one" (random-text)))
+             (two (gexp->derivation
+                    "two"
+                    (gexp (symlink (ungexp one) (ungexp output "chbouib")))))
+             (build ->
+                    (with-imported-modules
+                      '((guix build store-copy) (guix build utils))
+                      (gexp (begin
+                              (use-modules (guix build store-copy))
+                              (with-output-to-file
+                                (ungexp output)
+                                (lambda ()
+                                  (write (call-with-input-file
+                                           "guile"
+                                           read-reference-graph))))
+                              (with-output-to-file
+                                (ungexp output "one")
+                                (lambda ()
+                                  (write (call-with-input-file
+                                           "one"
+                                           read-reference-graph))))
+                              (with-output-to-file
+                                (ungexp output "two")
+                                (lambda ()
+                                  (write (call-with-input-file
+                                           "two"
+                                           read-reference-graph))))))))
+             (drv (gexp->derivation
+                    "ref-graphs"
+                    build
+                    #:references-graphs
+                    `(("one" ,one)
+                      ("two" ,two "chbouib")
+                      ("guile" ,%bootstrap-guile))))
+             (ok? (built-derivations (list drv)))
+             (guile-drv
+               (package->derivation %bootstrap-guile))
+             (bash (interned-file
+                     (search-bootstrap-binary
+                       "bash"
+                       (%current-system))
+                     "bash"
+                     #:recursive?
+                     #t))
+             (g-one -> (derivation->output-path drv "one"))
+             (g-two -> (derivation->output-path drv "two"))
+             (g-guile -> (derivation->output-path drv)))
+            (return
+              (and ok?
+                   (equal?
+                     (call-with-input-file g-one read)
+                     (list one))
+                   (lset= string=?
+                          (call-with-input-file g-two read)
+                          (list one
+                                (derivation->output-path two "chbouib")))
+                   (lset= string=?
+                          (call-with-input-file g-guile read)
+                          (list (derivation->output-path guile-drv) bash)))))
+     #:guile-for-build
+     (%guile-for-build)))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: gexp->derivation #:allowed-references
location: /home/rsd/v/git/others/guix/tests/gexp.scm:696
source:
+ (test-assert
+   "gexp->derivation #:allowed-references"
+   (run-with-store
+     %store
+     (mlet %store-monad
+           ((drv (gexp->derivation
+                   "allowed-refs"
+                   (gexp (begin
+                           (mkdir (ungexp output))
+                           (chdir (ungexp output))
+                           (symlink (ungexp output) "self")
+                           (symlink (ungexp %bootstrap-guile) "guile")))
+                   #:allowed-references
+                   (list "out" %bootstrap-guile))))
+           (built-derivations (list drv)))
+     #:guile-for-build
+     (%guile-for-build)))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: gexp->derivation #:allowed-references, specific output
location: /home/rsd/v/git/others/guix/tests/gexp.scm:708
source:
+ (test-assert
+   "gexp->derivation #:allowed-references, specific output"
+   (run-with-store
+     %store
+     (mlet* %store-monad
+            ((in (gexp->derivation
+                   "thing"
+                   (gexp (begin
+                           (mkdir (ungexp output "ok"))
+                           (mkdir (ungexp output "not-ok"))))))
+             (drv (gexp->derivation
+                    "allowed-refs"
+                    (gexp (begin
+                            (pk (ungexp in "not-ok"))
+                            (mkdir (ungexp output))
+                            (chdir (ungexp output))
+                            (symlink (ungexp output) "self")
+                            (symlink (ungexp in "ok") "ok")))
+                    #:allowed-references
+                    (list "out" (gexp-input in "ok")))))
+            (built-derivations (list drv)))
+     #:guile-for-build
+     (%guile-for-build)))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: gexp->derivation #:allowed-references, disallowed
location: /home/rsd/v/git/others/guix/tests/gexp.scm:725
source:
+ (test-assert
+   "gexp->derivation #:allowed-references, disallowed"
+   (let ((drv (run-with-store
+                %store
+                (gexp->derivation
+                  "allowed-refs"
+                  (gexp (begin
+                          (mkdir (ungexp output))
+                          (chdir (ungexp output))
+                          (symlink (ungexp %bootstrap-guile) "guile")))
+                  #:allowed-references
+                  '()))))
+     (guard (c ((nix-protocol-error? c) #t))
+            (build-derivations %store (list drv))
+            #f)))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: gexp->derivation #:disallowed-references, allowed
location: /home/rsd/v/git/others/guix/tests/gexp.scm:737
source:
+ (test-assert
+   "gexp->derivation #:disallowed-references, allowed"
+   (run-with-store
+     %store
+     (mlet %store-monad
+           ((drv (gexp->derivation
+                   "disallowed-refs"
+                   (gexp (begin
+                           (mkdir (ungexp output))
+                           (chdir (ungexp output))
+                           (symlink (ungexp output) "self")
+                           (symlink (ungexp %bootstrap-guile) "guile")))
+                   #:disallowed-references
+                   '())))
+           (built-derivations (list drv)))
+     #:guile-for-build
+     (%guile-for-build)))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: gexp->derivation #:disallowed-references
location: /home/rsd/v/git/others/guix/tests/gexp.scm:749
source:
+ (test-assert
+   "gexp->derivation #:disallowed-references"
+   (let ((drv (run-with-store
+                %store
+                (gexp->derivation
+                  "disallowed-refs"
+                  (gexp (begin
+                          (mkdir (ungexp output))
+                          (chdir (ungexp output))
+                          (symlink (ungexp %bootstrap-guile) "guile")))
+                  #:disallowed-references
+                  (list %bootstrap-guile)))))
+     (guard (c ((nix-protocol-error? c) #t))
+            (build-derivations %store (list drv))
+            #f)))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

random seed for tests: 1473544935
warning: build daemon error: #<condition &nix-connection-error [file: "/home/rsd/v/git/others/guix/test-tmp/var/12270/daemon-socket/socket" errno: 2] 2d01180>
Backtrace:
In ice-9/boot-9.scm:
 157: 12 [catch #t #<catch-closure ee3760> ...]
In unknown file:
   ?: 11 [apply-smob/1 #<catch-closure ee3760>]
In ice-9/boot-9.scm:
  63: 10 [call-with-prompt prompt0 ...]
In ice-9/eval.scm:
 432: 9 [eval # #]
 432: 8 [eval # #]
 432: 7 [eval # #]
In ice-9/r4rs.scm:
  90: 6 [dynamic-wind #<procedure 10f1f60 at ice-9/eval.scm:416:20 ()> ...]
In ice-9/boot-9.scm:
1724: 5 [%start-stack load-stack #<procedure 11b85a0 at ice-9/boot-9.scm:1745:2 ()>]
1729: 4 [#<procedure 10f17b0 ()>]
In unknown file:
   ?: 3 [primitive-load-path "tests/gexp.scm"]
In ice-9/eval.scm:
 453: 2 [eval # ()]
 387: 1 [eval # ()]
In guix/derivations.scm:
 565: 0 [derivation->output-path #f "out"]

guix/derivations.scm:565:28: In procedure derivation->output-path:
guix/derivations.scm:565:28: In procedure struct_vtable: Wrong type argument in position 1 (expecting struct): #f

[-- Attachment #1.8: grafts.log --]
[-- Type: application/octet-stream, Size: 9888 bytes --]

test-name: graft-derivation, grafted item is a direct dependency
location: /home/rsd/v/git/others/guix/tests/grafts.scm:49
source:
+ (test-assert
+   "graft-derivation, grafted item is a direct dependency"
+   (let* ((build `(begin
+                    (mkdir %output)
+                    (chdir %output)
+                    (symlink %output "self")
+                    (call-with-output-file
+                      "text"
+                      (lambda (output)
+                        (format output "foo/~a/bar" ,%mkdir)))
+                    (symlink ,%bash "sh")))
+          (orig (build-expression->derivation
+                  %store
+                  "grafted"
+                  build
+                  #:inputs
+                  `(("a" ,%bash) ("b" ,%mkdir))))
+          (one (add-text-to-store %store "bash" "fake bash"))
+          (two (build-expression->derivation
+                 %store
+                 "mkdir"
+                 '(call-with-output-file
+                    %output
+                    (lambda (port) (display "fake mkdir" port)))))
+          (grafted
+            (graft-derivation
+              %store
+              orig
+              (list (graft (origin %bash) (replacement one))
+                    (graft (origin %mkdir) (replacement two))))))
+     (and (build-derivations %store (list grafted))
+          (let ((two (derivation->output-path two))
+                (grafted (derivation->output-path grafted)))
+            (and (string=?
+                   (format #f "foo/~a/bar" two)
+                   (call-with-input-file
+                     (string-append grafted "/text")
+                     get-string-all))
+                 (string=?
+                   (readlink (string-append grafted "/sh"))
+                   one)
+                 (string=?
+                   (readlink (string-append grafted "/self"))
+                   grafted))))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: graft-derivation, grafted item is an indirect dependency
location: /home/rsd/v/git/others/guix/tests/grafts.scm:86
source:
+ (test-assert
+   "graft-derivation, grafted item is an indirect dependency"
+   (let* ((build `(begin
+                    (mkdir %output)
+                    (chdir %output)
+                    (symlink %output "self")
+                    (call-with-output-file
+                      "text"
+                      (lambda (output)
+                        (format output "foo/~a/bar" ,%mkdir)))
+                    (symlink ,%bash "sh")))
+          (dep (build-expression->derivation
+                 %store
+                 "dep"
+                 build
+                 #:inputs
+                 `(("a" ,%bash) ("b" ,%mkdir))))
+          (orig (build-expression->derivation
+                  %store
+                  "thing"
+                  '(symlink (assoc-ref %build-inputs "dep") %output)
+                  #:inputs
+                  `(("dep" ,dep))))
+          (one (add-text-to-store %store "bash" "fake bash"))
+          (two (build-expression->derivation
+                 %store
+                 "mkdir"
+                 '(call-with-output-file
+                    %output
+                    (lambda (port) (display "fake mkdir" port)))))
+          (grafted
+            (graft-derivation
+              %store
+              orig
+              (list (graft (origin %bash) (replacement one))
+                    (graft (origin %mkdir) (replacement two))))))
+     (and (build-derivations %store (list grafted))
+          (let* ((two (derivation->output-path two))
+                 (grafted (derivation->output-path grafted))
+                 (dep (readlink grafted)))
+            (and (string=?
+                   (format #f "foo/~a/bar" two)
+                   (call-with-input-file
+                     (string-append dep "/text")
+                     get-string-all))
+                 (string=?
+                   (readlink (string-append dep "/sh"))
+                   one)
+                 (string=?
+                   (readlink (string-append dep "/self"))
+                   dep)
+                 (equal? (references %store grafted) (list dep))
+                 (lset= string=?
+                        (list one two dep)
+                        (references %store dep)))))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: graft-derivation, preserve empty directories
location: /home/rsd/v/git/others/guix/tests/grafts.scm:130
source:
+ (test-assert
+   "graft-derivation, preserve empty directories"
+   (run-with-store
+     %store
+     (mlet* %store-monad
+            ((fake (text-file "bash" "Fake bash."))
+             (graft ->
+                    (graft (origin %bash) (replacement fake)))
+             (drv (gexp->derivation
+                    "to-graft"
+                    (with-imported-modules
+                      '((guix build utils))
+                      (gexp (begin
+                              (use-modules (guix build utils))
+                              (mkdir-p
+                                (string-append (ungexp output) "/a/b/c/d"))
+                              (symlink
+                                (ungexp %bash)
+                                (string-append (ungexp output) "/bash")))))))
+             (grafted
+               ((store-lift graft-derivation) drv (list graft)))
+             (_ (built-derivations (list grafted)))
+             (out -> (derivation->output-path grafted)))
+            (return
+              (and (string=?
+                     (readlink (string-append out "/bash"))
+                     fake)
+                   (file-is-directory?
+                     (string-append out "/a/b/c/d")))))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: graft-derivation, no dependencies on grafted output
location: /home/rsd/v/git/others/guix/tests/grafts.scm:154
source:
+ (test-assert
+   "graft-derivation, no dependencies on grafted output"
+   (run-with-store
+     %store
+     (mlet* %store-monad
+            ((fake (text-file "bash" "Fake bash."))
+             (graft ->
+                    (graft (origin %bash) (replacement fake)))
+             (drv (gexp->derivation
+                    "foo"
+                    (gexp (mkdir (ungexp output)))))
+             (grafted
+               ((store-lift graft-derivation) drv (list graft))))
+            (return (eq? grafted drv)))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: graft-derivation, multiple outputs
location: /home/rsd/v/git/others/guix/tests/grafts.scm:165
source:
+ (test-assert
+   "graft-derivation, multiple outputs"
+   (let* ((build `(begin
+                    (symlink
+                      (assoc-ref %build-inputs "a")
+                      (assoc-ref %outputs "one"))
+                    (symlink
+                      (assoc-ref %outputs "one")
+                      (assoc-ref %outputs "two"))))
+          (orig (build-expression->derivation
+                  %store
+                  "grafted"
+                  build
+                  #:inputs
+                  `(("a" ,%bash))
+                  #:outputs
+                  '("one" "two")))
+          (repl (add-text-to-store %store "bash" "fake bash"))
+          (grafted
+            (graft-derivation
+              %store
+              orig
+              (list (graft (origin %bash) (replacement repl))))))
+     (and (build-derivations %store (list grafted))
+          (let ((one (derivation->output-path grafted "one"))
+                (two (derivation->output-path grafted "two")))
+            (and (string=? (readlink one) repl)
+                 (string=? (readlink two) one))))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: graft-derivation, renaming
location: /home/rsd/v/git/others/guix/tests/grafts.scm:185
source:
+ (test-assert
+   "graft-derivation, renaming"
+   (let* ((build `(begin
+                    (use-modules (guix build utils))
+                    (mkdir-p
+                      (string-append
+                        (assoc-ref %outputs "out")
+                        "/"
+                        (assoc-ref %build-inputs "in")))))
+          (orig (build-expression->derivation
+                  %store
+                  "thing-to-graft"
+                  build
+                  #:modules
+                  '((guix build utils))
+                  #:inputs
+                  `(("in" ,%bash))))
+          (repl (add-text-to-store %store "bash" "fake bash"))
+          (grafted
+            (graft-derivation
+              %store
+              orig
+              (list (graft (origin %bash) (replacement repl))))))
+     (and (build-derivations %store (list grafted))
+          (let ((out (derivation->output-path grafted)))
+            (file-is-directory? (string-append out "/" repl))))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

random seed for tests: 1473545098
warning: build daemon error: #<condition &nix-connection-error [file: "/home/rsd/v/git/others/guix/test-tmp/var/11903/daemon-socket/socket" errno: 2] 33d0420>

[-- Attachment #1.9: hackage.log --]
[-- Type: application/octet-stream, Size: 2386 bytes --]

test-name: hackage->guix-package test 1
location: /home/rsd/v/git/others/guix/tests/hackage.scm:132
source:
+ (test-assert
+   "hackage->guix-package test 1"
+   (eval-test-with-cabal test-cabal-1))
actual-value: #f
actual-error:
+ (srfi-34
+   #<condition &nix-connection-error [file: "/home/rsd/v/git/others/guix/test-tmp/var/12141/daemon-socket/socket" errno: 2] 308c360>)
result: FAIL

test-name: hackage->guix-package test 2
location: /home/rsd/v/git/others/guix/tests/hackage.scm:135
source:
+ (test-assert
+   "hackage->guix-package test 2"
+   (eval-test-with-cabal test-cabal-2))
actual-value: #f
actual-error:
+ (srfi-34
+   #<condition &nix-connection-error [file: "/home/rsd/v/git/others/guix/test-tmp/var/12141/daemon-socket/socket" errno: 2] 30c4810>)
result: FAIL

test-name: hackage->guix-package test 3
location: /home/rsd/v/git/others/guix/tests/hackage.scm:138
source:
+ (test-assert
+   "hackage->guix-package test 3"
+   (eval-test-with-cabal
+     test-cabal-3
+     #:cabal-environment
+     '(("impl" . "ghc-7.8"))))
actual-value: #f
actual-error:
+ (srfi-34
+   #<condition &nix-connection-error [file: "/home/rsd/v/git/others/guix/test-tmp/var/12141/daemon-socket/socket" errno: 2] 3109960>)
result: FAIL

test-name: read-cabal test 1
location: /home/rsd/v/git/others/guix/tests/hackage.scm:142
source:
+ (test-assert
+   "read-cabal test 1"
+   (match (call-with-input-string
+            test-read-cabal-1
+            read-cabal)
+          ((("name" ("test-me"))
+            ('section
+             'library
+             (('if
+               ('flag "base4point8")
+               (("build-depends" ("base >= 4.8 && < 5")))
+               (('if
+                 ('flag "base4")
+                 (("build-depends" ("base >= 4 && < 4.8")))
+                 (('if
+                   ('flag "base3")
+                   (("build-depends" ("base >= 3 && < 4")))
+                   (("build-depends" ("base < 3"))))))))
+              ('if
+               ('or
+                ('flag "base4point8")
+                ('and ('flag "base4") ('flag "base3")))
+               (("build-depends" ("random")))
+               ())
+              ("build-depends" ("containers"))
+              ("exposed-modules" ("Test.QuickCheck.Exception")))))
+           #t)
+          (x (pk 'fail x #f))))
actual-value: #t
result: PASS

random seed for tests: 1473544826

[-- Attachment #1.10: monads.log --]
[-- Type: application/octet-stream, Size: 10436 bytes --]

test-name: monad?
location: /home/rsd/v/git/others/guix/tests/monads.scm:58
source:
+ (test-assert
+   "monad?"
+   (and (every monad? %monads)
+        (every (compose procedure? monad-bind) %monads)
+        (every (compose procedure? monad-return) %monads)))
actual-value: #t
result: PASS

test-name: left identity
location: /home/rsd/v/git/others/guix/tests/monads.scm:65
source:
+ (test-assert
+   "left identity"
+   (every (lambda (monad run)
+            (let ((number (random 777)))
+              (with-monad
+                monad
+                (define (f x) (return (* (#{1+}# number) 2)))
+                (= (run (>>= (return number) f))
+                   (run (f number))))))
+          %monads
+          %monad-run))
actual-value: #t
result: PASS

test-name: right identity
location: /home/rsd/v/git/others/guix/tests/monads.scm:77
source:
+ (test-assert
+   "right identity"
+   (every (lambda (monad run)
+            (with-monad
+              monad
+              (let ((number (return (random 777))))
+                (= (run (>>= number return)) (run number)))))
+          %monads
+          %monad-run))
actual-value: #t
result: PASS

test-name: associativity
location: /home/rsd/v/git/others/guix/tests/monads.scm:86
source:
+ (test-assert
+   "associativity"
+   (every (lambda (monad run)
+            (with-monad
+              monad
+              (define (f x) (return (+ 1 x)))
+              (define (g x) (return (* 2 x)))
+              (let ((number (return (random 777))))
+                (= (run (>>= (>>= number f) g))
+                   (run (>>= number (lambda (x) (>>= (f x) g))))))))
+          %monads
+          %monad-run))
actual-value: #t
result: PASS

test-name: lift
location: /home/rsd/v/git/others/guix/tests/monads.scm:100
source:
+ (test-assert
+   "lift"
+   (every (lambda (monad run)
+            (let ((f (lift1 #{1+}# monad))
+                  (g (apply lift1 #{1+}# (list monad))))
+              (with-monad
+                monad
+                (let ((number (random 777)))
+                  (= (run (>>= (return number) f))
+                     (run (>>= (return number) g))
+                     (#{1+}# number))))))
+          %monads
+          %monad-run))
actual-value: #t
result: PASS

test-name: >>= with more than two arguments
location: /home/rsd/v/git/others/guix/tests/monads.scm:112
source:
+ (test-assert
+   ">>= with more than two arguments"
+   (every (lambda (monad run)
+            (let ((#{1+}# (lift1 #{1+}# monad))
+                  (#{2*}# (lift1 (cut * 2 <>) monad)))
+              (with-monad
+                monad
+                (let ((number (random 777)))
+                  (= (run (>>= (return number)
+                               #{1+}#
+                               #{1+}#
+                               #{1+}#
+                               #{2*}#
+                               #{2*}#
+                               #{2*}#))
+                     (* 8 (+ number 3)))))))
+          %monads
+          %monad-run))
actual-value: #t
result: PASS

test-name: mbegin
location: /home/rsd/v/git/others/guix/tests/monads.scm:125
source:
+ (test-assert
+   "mbegin"
+   (every (lambda (monad run)
+            (with-monad
+              monad
+              (let* ((been-there? #f)
+                     (number
+                       (mbegin
+                         monad
+                         (return 1)
+                         (begin (set! been-there? #t) (return 2))
+                         (return 3))))
+                (and (= (run number) 3) been-there?))))
+          %monads
+          %monad-run))
actual-value: #t
result: PASS

test-name: mlet* + text-file + package-file
location: /home/rsd/v/git/others/guix/tests/monads.scm:140
source:
+ (test-assert
+   "mlet* + text-file + package-file"
+   (run-with-store
+     %store
+     (mlet* %store-monad
+            ((guile (package-file %bootstrap-guile "bin/guile"))
+             (file (text-file "monadic" guile)))
+            (return
+              (equal?
+                (call-with-input-file file get-string-all)
+                guile)))
+     #:guile-for-build
+     (package-derivation %store %bootstrap-guile)))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: package-file, default system
location: /home/rsd/v/git/others/guix/tests/monads.scm:148
source:
+ (test-assert
+   "package-file, default system"
+   (run-with-store
+     %store
+     (mlet* %store-monad
+            ((system -> (%current-system))
+             (file (parameterize
+                     ((%current-system "foobar64-linux"))
+                     (package-file coreutils "bin/ls")))
+             (cu (package->derivation coreutils)))
+            (return
+              (string=?
+                file
+                (string-append
+                  (derivation->output-path cu)
+                  "/bin/ls"))))
+     #:guile-for-build
+     (package-derivation %store %bootstrap-guile)))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: package-file + package->cross-derivation
location: /home/rsd/v/git/others/guix/tests/monads.scm:162
source:
+ (test-assert
+   "package-file + package->cross-derivation"
+   (run-with-store
+     %store
+     (mlet* %store-monad
+            ((target -> "mips64el-linux-gnu")
+             (file (package-file coreutils "bin/ls" #:target target))
+             (xcu (package->cross-derivation coreutils target)))
+            (let ((output (derivation->output-path xcu)))
+              (return
+                (string=? file (string-append output "/bin/ls")))))
+     #:guile-for-build
+     (package-derivation %store %bootstrap-guile)))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: interned-file
location: /home/rsd/v/git/others/guix/tests/monads.scm:172
source:
+ (test-assert
+   "interned-file"
+   (run-with-store
+     %store
+     (mlet* %store-monad
+            ((file -> (search-path %load-path "guix.scm"))
+             (a (interned-file file))
+             (b (interned-file file "b")))
+            (return
+              (equal?
+                (call-with-input-file file get-string-all)
+                (call-with-input-file a get-string-all)
+                (call-with-input-file b get-string-all))))
+     #:guile-for-build
+     (package-derivation %store %bootstrap-guile)))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: mapm
location: /home/rsd/v/git/others/guix/tests/monads.scm:182
source:
+ (test-assert
+   "mapm"
+   (every (lambda (monad run)
+            (with-monad
+              monad
+              (equal?
+                (run (mapm monad (lift1 #{1+}# monad) (iota 10)))
+                (map #{1+}# (iota 10)))))
+          %monads
+          %monad-run))
actual-value: #t
result: PASS

test-name: sequence
location: /home/rsd/v/git/others/guix/tests/monads.scm:190
source:
+ (test-assert
+   "sequence"
+   (every (lambda (monad run)
+            (let* ((input (iota 100)) (order '()))
+              (define (frob i)
+                (mlet monad
+                      ((foo (return 'foo)))
+                      (set! order (cons i order))
+                      (return i)))
+              (and (equal?
+                     input
+                     (run (sequence monad (map frob input))))
+                   (equal? order (reverse input)))))
+          %monads
+          %monad-run))
actual-value: #t
result: PASS

test-name: listm
location: /home/rsd/v/git/others/guix/tests/monads.scm:211
source:
+ (test-assert
+   "listm"
+   (every (lambda (monad run)
+            (run (with-monad
+                   monad
+                   (let ((lst (listm monad (return 1) (return 2) (return 3))))
+                     (mlet monad
+                           ((lst lst))
+                           (return (equal? '(1 2 3) lst)))))))
+          %monads
+          %monad-run))
actual-value: #t
result: PASS

test-name: anym
location: /home/rsd/v/git/others/guix/tests/monads.scm:221
source:
+ (test-assert
+   "anym"
+   (every (lambda (monad run)
+            (eq? (run (with-monad
+                        monad
+                        (anym monad
+                              (lift1 (lambda (x) (and (odd? x) 'odd!)) monad)
+                              (append (make-list 1000 0) (list 1 2)))))
+                 'odd!))
+          %monads
+          %monad-run))
actual-value: #t
result: PASS

test-name: set-current-state
location: /home/rsd/v/git/others/guix/tests/monads.scm:234
source:
+ (test-equal
+   "set-current-state"
+   (list '(a a d) 'd)
+   (values->list
+     (run-with-state
+       (mlet* %state-monad
+              ((init (current-state))
+               (init2 (set-current-state 'b)))
+              (mbegin
+                %state-monad
+                (set-current-state 'c)
+                (set-current-state 'd)
+                (mlet %state-monad
+                      ((last (current-state)))
+                      (return (list init init2 last)))))
+       'a)))
expected-value: ((a a d) d)
actual-value: ((a a d) d)
result: PASS

test-name: state-push etc.
location: /home/rsd/v/git/others/guix/tests/monads.scm:247
source:
+ (test-equal
+   "state-push etc."
+   (list '((z . 2) (p 1) (a 1)) '(2 1))
+   (values->list
+     (run-with-state
+       (mbegin
+         %state-monad
+         (state-push 1)
+         (state-push 2)
+         (mlet* %state-monad
+                ((z (state-pop))
+                 (p (current-state))
+                 (a (state-push z)))
+                (return
+                  `((z unquote z) (p unquote p) (a unquote a)))))
+       '())))
expected-value: (((z . 2) (p 1) (a 1)) (2 1))
actual-value: (((z . 2) (p 1) (a 1)) (2 1))
result: PASS

random seed for tests: 1473544913
warning: build daemon error: #<condition &nix-connection-error [file: "/home/rsd/v/git/others/guix/test-tmp/var/12245/daemon-socket/socket" errno: 2] 41692d0>

[-- Attachment #1.11: packages.log --]
[-- Type: application/octet-stream, Size: 52065 bytes --]

test-name: printer with location
location: /home/rsd/v/git/others/guix/tests/packages.scm:68
source:
+ (test-assert
+   "printer with location"
+   (string-match
+     "^#<package foo@0 foo.scm:42 [[:xdigit:]]+>$"
+     (with-output-to-string
+       (lambda ()
+         (write (dummy-package
+                  "foo"
+                  (location (make-location "foo.scm" 42 7))))))))
actual-value: #(#<package foo@0 foo.scm:42 495bd80> (0 . 35))
result: PASS

test-name: printer without location
location: /home/rsd/v/git/others/guix/tests/packages.scm:76
source:
+ (test-assert
+   "printer without location"
+   (string-match
+     "^#<package foo@0 [[:xdigit:]]+>$"
+     (with-output-to-string
+       (lambda ()
+         (write (dummy-package "foo" (location #f)))))))
actual-value: #(#<package foo@0 495b600> (0 . 24))
result: PASS

test-name: hidden-package
location: /home/rsd/v/git/others/guix/tests/packages.scm:83
source:
+ (test-assert
+   "hidden-package"
+   (and (hidden-package?
+          (hidden-package (dummy-package "foo")))
+        (not (hidden-package? (dummy-package "foo")))))
actual-value: #t
result: PASS

test-name: package-superseded
location: /home/rsd/v/git/others/guix/tests/packages.scm:87
source:
+ (test-assert
+   "package-superseded"
+   (let* ((new (dummy-package "bar"))
+          (old (deprecated-package "foo" new)))
+     (and (eq? (package-superseded old) new)
+          (mock ((gnu packages)
+                 find-best-packages-by-name
+                 (const (list old)))
+                (specification->package "foo")
+                (and (eq? new (specification->package "foo"))
+                     (eq? new (specification->package+output "foo")))))))
actual-value: #t
result: PASS

test-name: transaction-upgrade-entry, zero upgrades
location: /home/rsd/v/git/others/guix/tests/packages.scm:96
source:
+ (test-assert
+   "transaction-upgrade-entry, zero upgrades"
+   (let* ((old (dummy-package "foo" (version "1")))
+          (tx (mock ((gnu packages)
+                     find-newest-available-packages
+                     (const vlist-null))
+                    ((@@ (guix scripts package)
+                         transaction-upgrade-entry)
+                     (manifest-entry
+                       (inherit (package->manifest-entry old))
+                       (item (string-append
+                               (%store-prefix)
+                               "/"
+                               (make-string 32 #\e)
+                               "-foo-1")))
+                     (manifest-transaction)))))
+     (manifest-transaction-null? tx)))
actual-value: #t
result: PASS

test-name: transaction-upgrade-entry, one upgrade
location: /home/rsd/v/git/others/guix/tests/packages.scm:108
source:
+ (test-assert
+   "transaction-upgrade-entry, one upgrade"
+   (let* ((old (dummy-package "foo" (version "1")))
+          (new (dummy-package "foo" (version "2")))
+          (tx (mock ((gnu packages)
+                     find-newest-available-packages
+                     (const (vhash-cons "foo" (list "2" new) vlist-null)))
+                    ((@@ (guix scripts package)
+                         transaction-upgrade-entry)
+                     (manifest-entry
+                       (inherit (package->manifest-entry old))
+                       (item (string-append
+                               (%store-prefix)
+                               "/"
+                               (make-string 32 #\e)
+                               "-foo-1")))
+                     (manifest-transaction)))))
+     (and (match (manifest-transaction-install tx)
+                 ((($ <manifest-entry> "foo" "2" "out" item))
+                  (eq? item new)))
+          (null? (manifest-transaction-remove tx)))))
actual-value: #t
result: PASS

test-name: transaction-upgrade-entry, superseded package
location: /home/rsd/v/git/others/guix/tests/packages.scm:124
source:
+ (test-assert
+   "transaction-upgrade-entry, superseded package"
+   (let* ((old (dummy-package "foo" (version "1")))
+          (new (dummy-package "bar" (version "2")))
+          (dep (deprecated-package "foo" new))
+          (tx (mock ((gnu packages)
+                     find-newest-available-packages
+                     (const (vhash-cons "foo" (list "2" dep) vlist-null)))
+                    ((@@ (guix scripts package)
+                         transaction-upgrade-entry)
+                     (manifest-entry
+                       (inherit (package->manifest-entry old))
+                       (item (string-append
+                               (%store-prefix)
+                               "/"
+                               (make-string 32 #\e)
+                               "-foo-1")))
+                     (manifest-transaction)))))
+     (and (match (manifest-transaction-install tx)
+                 ((($ <manifest-entry> "bar" "2" "out" item))
+                  (eq? item new)))
+          (match (manifest-transaction-remove tx)
+                 (((? manifest-pattern? pattern))
+                  (and (string=? (manifest-pattern-name pattern) "foo")
+                       (string=? (manifest-pattern-version pattern) "1")
+                       (string=?
+                         (manifest-pattern-output pattern)
+                         "out")))))))
actual-value: #t
result: PASS

test-name: package-field-location
location: /home/rsd/v/git/others/guix/tests/packages.scm:145
source:
+ (test-assert
+   "package-field-location"
+   (let ()
+     (define (goto port line column)
+       (unless
+         (and (= (port-column port) (- column 1))
+              (= (port-line port) (- line 1)))
+         (unless
+           (eof-object? (get-char port))
+           (goto port line column))))
+     (define read-at
+       (match-lambda
+         (($ <location> file line column)
+          (call-with-input-file
+            (search-path %load-path file)
+            (lambda (port)
+              (goto port line column)
+              (read port))))))
+     (and (member
+            (read-at
+              (package-field-location %bootstrap-guile 'name))
+            (let ((name (package-name %bootstrap-guile)))
+              (list name `(name ,name))))
+          (member
+            (read-at
+              (package-field-location
+                %bootstrap-guile
+                'version))
+            (let ((version (package-version %bootstrap-guile)))
+              (list version `(version ,version))))
+          (not (package-field-location
+                 %bootstrap-guile
+                 'does-not-exist)))))
actual-value: #t
result: PASS

test-name: package-field-location, relative file name
location: /home/rsd/v/git/others/guix/tests/packages.scm:172
source:
+ (test-equal
+   "package-field-location, relative file name"
+   (location-file
+     (package-location %bootstrap-guile))
+   (with-fluids
+     ((%file-port-name-canonicalization 'absolute))
+     (location-file
+       (package-field-location
+         %bootstrap-guile
+         'version))))
expected-value: gnu/packages/bootstrap.scm
actual-value: gnu/packages/bootstrap.scm
result: PASS

test-name: package-transitive-inputs
location: /home/rsd/v/git/others/guix/tests/packages.scm:177
source:
+ (test-assert
+   "package-transitive-inputs"
+   (let* ((a (dummy-package "a"))
+          (b (dummy-package
+               "b"
+               (propagated-inputs `(("a" ,a)))))
+          (c (dummy-package "c" (inputs `(("a" ,a)))))
+          (d (dummy-package
+               "d"
+               (propagated-inputs `(("x" "something.drv")))))
+          (e (dummy-package
+               "e"
+               (inputs `(("b" ,b) ("c" ,c) ("d" ,d))))))
+     (and (null? (package-transitive-inputs a))
+          (equal?
+            `(("a" ,a))
+            (package-transitive-inputs b))
+          (equal?
+            `(("a" ,a))
+            (package-transitive-inputs c))
+          (equal?
+            (package-propagated-inputs d)
+            (package-transitive-inputs d))
+          (equal?
+            `(("b" ,b)
+              ("c" ,c)
+              ("d" ,d)
+              ("a" ,a)
+              ("x" "something.drv"))
+            (pk 'x (package-transitive-inputs e))))))

;;; (x (("b" #<package b@0 /home/rsd/v/git/others/guix/tests/packages.scm:179 4868840>) ("c" #<package c@0 /home/rsd/v/git/others/guix/tests/packages.scm:181 4868780>) ("d" #<package d@0 /home/rsd/v/git/others/guix/tests/packages.scm:183 48686c0>) ("a" #<package a@0 /home/rsd/v/git/others/guix/tests/packages.scm:178 4868900>) ("x" "something.drv")))
actual-value: #t
result: PASS

test-name: package-transitive-inputs, no duplicates
location: /home/rsd/v/git/others/guix/tests/packages.scm:196
source:
+ (test-assert
+   "package-transitive-inputs, no duplicates"
+   (let* ((a (dummy-package "a"))
+          (b (dummy-package
+               "b"
+               (inputs `(("a+" ,a)))
+               (native-inputs `(("a*" ,a)))
+               (propagated-inputs `(("a" ,a)))))
+          (c (dummy-package
+               "c"
+               (propagated-inputs `(("b" ,b)))))
+          (d (dummy-package "d" (inputs `(("a" ,a) ("c" ,c)))))
+          (e (dummy-package "e" (inputs `(("b" ,b) ("c" ,c))))))
+     (and (null? (package-transitive-inputs a))
+          (equal?
+            `(("a*" ,a) ("a+" ,a) ("a" ,a))
+            (package-transitive-inputs b))
+          (equal?
+            `(("b" ,b) ("a" ,a))
+            (package-transitive-inputs c))
+          (equal?
+            `(("a" ,a) ("c" ,c) ("b" ,b))
+            (package-transitive-inputs d))
+          (equal?
+            `(("b" ,b) ("c" ,c) ("a" ,a))
+            (package-transitive-inputs e)))))
actual-value: #t
result: PASS

test-name: package-transitive-supported-systems
location: /home/rsd/v/git/others/guix/tests/packages.scm:218
source:
+ (test-equal
+   "package-transitive-supported-systems"
+   '(("x" "y" "z") ("x" "y") ("y") ("y") ("y"))
+   (let* ((a (dummy-package
+               "a"
+               (build-system trivial-build-system)
+               (supported-systems '("x" "y" "z"))))
+          (b (dummy-package
+               "b"
+               (build-system trivial-build-system)
+               (supported-systems '("x" "y"))
+               (inputs `(("a" ,a)))))
+          (c (dummy-package
+               "c"
+               (build-system trivial-build-system)
+               (supported-systems '("y" "z"))
+               (inputs `(("b" ,b)))))
+          (d (dummy-package
+               "d"
+               (build-system trivial-build-system)
+               (supported-systems '("x" "y" "z"))
+               (inputs `(("b" ,b) ("c" ,c)))))
+          (e (dummy-package
+               "e"
+               (build-system trivial-build-system)
+               (supported-systems '("x" "y" "z"))
+               (inputs `(("d" ,d))))))
+     (list (package-transitive-supported-systems a)
+           (package-transitive-supported-systems b)
+           (package-transitive-supported-systems c)
+           (package-transitive-supported-systems d)
+           (package-transitive-supported-systems e))))
expected-value: ((x y z) (x y) (y) (y) (y))
actual-value: ((x y z) (x y) (y) (y) (y))
result: PASS

test-name: origin-actual-file-name
location: /home/rsd/v/git/others/guix/tests/packages.scm:251
source:
+ (test-equal
+   "origin-actual-file-name"
+   "foo-1.tar.gz"
+   (let ((o (dummy-origin
+              (uri "http://www.example.com/foo-1.tar.gz"))))
+     (origin-actual-file-name o)))
expected-value: foo-1.tar.gz
actual-value: foo-1.tar.gz
result: PASS

test-name: origin-actual-file-name, file-name
location: /home/rsd/v/git/others/guix/tests/packages.scm:256
source:
+ (test-equal
+   "origin-actual-file-name, file-name"
+   "foo-1.tar.gz"
+   (let ((o (dummy-origin
+              (uri "http://www.example.com/tarball")
+              (file-name "foo-1.tar.gz"))))
+     (origin-actual-file-name o)))
expected-value: foo-1.tar.gz
actual-value: foo-1.tar.gz
result: PASS

test-name: package-direct-sources, no source
location: /home/rsd/v/git/others/guix/tests/packages.scm:273
source:
+ (test-assert
+   "package-direct-sources, no source"
+   (null? (package-direct-sources a)))
actual-value: #t
result: PASS

test-name: package-direct-sources, #f source
location: /home/rsd/v/git/others/guix/tests/packages.scm:275
source:
+ (test-equal
+   "package-direct-sources, #f source"
+   (list i)
+   (package-direct-sources b))
expected-value: (#<origin "http://www.example.com" xx35467pxx35467pxx35467pxx35467pxx35467pxx35467pxx3q () 5474240>)
actual-value: (#<origin "http://www.example.com" xx35467pxx35467pxx35467pxx35467pxx35467pxx35467pxx3q () 5474240>)
result: PASS

test-name: package-direct-sources, not input source
location: /home/rsd/v/git/others/guix/tests/packages.scm:278
source:
+ (test-equal
+   "package-direct-sources, not input source"
+   (list u)
+   (package-direct-sources d))
expected-value: (#<origin "http://www.example.com" xx35467pxx35467pxx35467pxx35467pxx35467pxx35467pxx3q () 54742a0>)
actual-value: (#<origin "http://www.example.com" xx35467pxx35467pxx35467pxx35467pxx35467pxx35467pxx3q () 54742a0>)
result: PASS

test-name: package-direct-sources
location: /home/rsd/v/git/others/guix/tests/packages.scm:281
source:
+ (test-assert
+   "package-direct-sources"
+   (let ((s (package-direct-sources c)))
+     (and (= (length (pk 's-sources s)) 2)
+          (member o s)
+          (member i s))))

;;; (s-sources (#<origin "http://www.example.com" xx35467pxx35467pxx35467pxx35467pxx35467pxx35467pxx3q () 5474300> #<origin "http://www.example.com" xx35467pxx35467pxx35467pxx35467pxx35467pxx35467pxx3q () 5474240>))
actual-value: (#<origin "http://www.example.com" xx35467pxx35467pxx35467pxx35467pxx35467pxx35467pxx3q () 5474240>)
result: PASS

test-name: package-transitive-sources
location: /home/rsd/v/git/others/guix/tests/packages.scm:286
source:
+ (test-assert
+   "package-transitive-sources"
+   (let ((s (package-transitive-sources d)))
+     (and (= (length (pk 'd-sources s)) 3)
+          (member o s)
+          (member i s)
+          (member u s))))

;;; (d-sources (#<origin "http://www.example.com" xx35467pxx35467pxx35467pxx35467pxx35467pxx35467pxx3q () 54742a0> #<origin "http://www.example.com" xx35467pxx35467pxx35467pxx35467pxx35467pxx35467pxx3q () 5474300> #<origin "http://www.example.com" xx35467pxx35467pxx35467pxx35467pxx35467pxx35467pxx3q () 5474240>))
actual-value: (#<origin "http://www.example.com" xx35467pxx35467pxx35467pxx35467pxx35467pxx35467pxx3q () 54742a0> #<origin "http://www.example.com" xx35467pxx35467pxx35467pxx35467pxx35467pxx35467pxx3q () 5474300> #<origin "http://www.example.com" xx35467pxx35467pxx35467pxx35467pxx35467pxx35467pxx3q () 5474240>)
result: PASS

test-name: transitive-input-references
location: /home/rsd/v/git/others/guix/tests/packages.scm:293
source:
+ (test-assert
+   "transitive-input-references"
+   (let* ((a (dummy-package "a"))
+          (b (dummy-package "b"))
+          (c (dummy-package
+               "c"
+               (inputs `(("a" ,a)))
+               (propagated-inputs `(("boo" ,b)))))
+          (d (dummy-package "d" (inputs `(("c*" ,c)))))
+          (keys (map (match-lambda (('assoc-ref 'l key) key))
+                     (pk 'refs
+                         (transitive-input-references
+                           'l
+                           (package-inputs d))))))
+     (and (= (length keys) 2)
+          (member "c*" keys)
+          (member "boo" keys))))

;;; (refs ((assoc-ref l "c*") (assoc-ref l "boo")))
actual-value: (boo)
result: PASS

test-name: package-transitive-supported-systems, implicit inputs
location: /home/rsd/v/git/others/guix/tests/packages.scm:310
source:
+ (test-equal
+   "package-transitive-supported-systems, implicit inputs"
+   %supported-systems
+   (let ((p (dummy-package
+              "foo"
+              (build-system gnu-build-system)
+              (supported-systems
+                `("does-not-exist" "foobar" ,@%supported-systems)))))
+     (package-transitive-supported-systems p)))
expected-value: (x86_64-linux i686-linux armhf-linux mips64el-linux)
actual-value: (x86_64-linux i686-linux armhf-linux mips64el-linux)
result: PASS

test-name: supported-package?
location: /home/rsd/v/git/others/guix/tests/packages.scm:321
source:
+ (test-assert
+   "supported-package?"
+   (let ((p (dummy-package
+              "foo"
+              (build-system gnu-build-system)
+              (supported-systems
+                '("x86_64-linux" "does-not-exist")))))
+     (and (supported-package? p "x86_64-linux")
+          (not (supported-package? p "does-not-exist"))
+          (not (supported-package? p "i686-linux")))))
actual-value: #t
result: PASS

test-name: package-source-derivation, file
location: /home/rsd/v/git/others/guix/tests/packages.scm:331
source:
+ (test-assert
+   "package-source-derivation, file"
+   (let* ((file (search-path %load-path "guix.scm"))
+          (package
+            (package
+              (inherit (dummy-package "p"))
+              (source file)))
+          (source
+            (package-source-derivation
+              %store
+              (package-source package))))
+     (and (store-path? source)
+          (valid-path? %store source)
+          (equal?
+            (call-with-input-file source get-bytevector-all)
+            (call-with-input-file file get-bytevector-all)))))
result: SKIP

test-name: package-source-derivation, store path
location: /home/rsd/v/git/others/guix/tests/packages.scm:342
source:
+ (test-assert
+   "package-source-derivation, store path"
+   (let* ((file (add-to-store
+                  %store
+                  "guix.scm"
+                  #t
+                  "sha256"
+                  (search-path %load-path "guix.scm")))
+          (package
+            (package
+              (inherit (dummy-package "p"))
+              (source file)))
+          (source
+            (package-source-derivation
+              %store
+              (package-source package))))
+     (string=? file source)))
result: SKIP

test-name: package-source-derivation, indirect store path
location: /home/rsd/v/git/others/guix/tests/packages.scm:351
source:
+ (test-assert
+   "package-source-derivation, indirect store path"
+   (let* ((dir (add-to-store
+                 %store
+                 "guix-build"
+                 #t
+                 "sha256"
+                 (dirname
+                   (search-path %load-path "guix/build/utils.scm"))))
+          (package
+            (package
+              (inherit (dummy-package "p"))
+              (source (string-append dir "/utils.scm"))))
+          (source
+            (package-source-derivation
+              %store
+              (package-source package))))
+     (and (direct-store-path? source)
+          (string-suffix? "utils.scm" source))))
result: SKIP

test-name: package-source-derivation, local-file
location: /home/rsd/v/git/others/guix/tests/packages.scm:362
source:
+ (test-assert
+   "package-source-derivation, local-file"
+   (let* ((file (local-file "../guix/base32.scm"))
+          (package
+            (package
+              (inherit (dummy-package "p"))
+              (source file)))
+          (source
+            (package-source-derivation
+              %store
+              (package-source package))))
+     (and (store-path? source)
+          (string-suffix? "base32.scm" source)
+          (valid-path? %store source)
+          (equal?
+            (call-with-input-file source get-bytevector-all)
+            (call-with-input-file
+              (search-path %load-path "guix/base32.scm")
+              get-bytevector-all)))))
result: SKIP

test-name: package-source-derivation, snippet
location: /home/rsd/v/git/others/guix/tests/packages.scm:377
source:
+ (test-equal
+   "package-source-derivation, snippet"
+   "OK"
+   (let* ((file (search-bootstrap-binary
+                  (match (%current-system)
+                         ("armhf-linux" "guile-2.0.11.tar.xz")
+                         (_ "guile-2.0.9.tar.xz"))
+                  (%current-system)))
+          (sha256 (call-with-input-file file port-sha256))
+          (fetch (lambda* (url hash-algo hash #:optional name #:key system)
+                   (pk 'fetch url hash-algo hash name system)
+                   (interned-file url)))
+          (source
+            (bootstrap-origin
+              (origin
+                (method fetch)
+                (uri file)
+                (sha256 sha256)
+                (patch-inputs
+                  `(("tar" ,%bootstrap-coreutils&co)
+                    ("xz" ,%bootstrap-coreutils&co)
+                    ("patch" ,%bootstrap-coreutils&co)))
+                (patch-guile %bootstrap-guile)
+                (modules '((guix build utils)))
+                (snippet
+                  '(begin
+                     (chmod "." 511)
+                     (symlink "guile" "guile-rocks")
+                     (copy-recursively
+                       "../share/guile/2.0/scripts"
+                       "scripts")
+                     (chmod ".." 511))))))
+          (package
+            (package
+              (inherit (dummy-package "with-snippet"))
+              (source source)
+              (build-system trivial-build-system)
+              (inputs
+                `(("tar"
+                   ,(search-bootstrap-binary "tar" (%current-system)))
+                  ("xz"
+                   ,(search-bootstrap-binary "xz" (%current-system)))))
+              (arguments
+                `(#:guile
+                  ,%bootstrap-guile
+                  #:builder
+                  (let ((tar (assoc-ref %build-inputs "tar"))
+                        (xz (assoc-ref %build-inputs "xz"))
+                        (source (assoc-ref %build-inputs "source")))
+                    (and (zero? (system*
+                                  tar
+                                  "xvf"
+                                  source
+                                  "--use-compress-program"
+                                  xz))
+                         (string=? "guile" (readlink "bin/guile-rocks"))
+                         (file-exists? "bin/scripts/compile.scm")
+                         (let ((out (assoc-ref %outputs "out")))
+                           (call-with-output-file
+                             out
+                             (lambda (p) (display "OK" p))))))))))
+          (drv (package-derivation %store package))
+          (out (derivation->output-path drv)))
+     (and (build-derivations
+            %store
+            (list (pk 'snippet-drv drv)))
+          (call-with-input-file out get-string-all))))
result: SKIP

test-name: return value
location: /home/rsd/v/git/others/guix/tests/packages.scm:439
source:
+ (test-assert
+   "return value"
+   (let ((drv (package-derivation %store (dummy-package "p"))))
+     (and (derivation? drv)
+          (file-exists? (derivation-file-name drv)))))
result: SKIP

test-name: package-output
location: /home/rsd/v/git/others/guix/tests/packages.scm:444
source:
+ (test-assert
+   "package-output"
+   (let* ((package (dummy-package "p"))
+          (drv (package-derivation %store package)))
+     (and (derivation? drv)
+          (string=?
+            (derivation->output-path drv)
+            (package-output %store package "out")))))
result: SKIP

test-name: patch not found yields a run-time error
location: /home/rsd/v/git/others/guix/tests/packages.scm:451
source:
+ (test-assert
+   "patch not found yields a run-time error"
+   (guard (c ((condition-has-type? c &message)
+              (and (string-contains
+                     (condition-message c)
+                     "does-not-exist.patch")
+                   (string-contains
+                     (condition-message c)
+                     "not found"))))
+          (let ((p (package
+                     (inherit (dummy-package "p"))
+                     (source
+                       (origin
+                         (method (const #f))
+                         (uri "http://whatever")
+                         (patches
+                           (list (search-patch "does-not-exist.patch")))
+                         (sha256
+                           (base32
+                             "0amn0bbwqvsvvsh6drfwz20ydc2czk374lzw5kksbh6bf78k4ks4")))))))
+            (package-derivation %store p)
+            #f)))
result: SKIP

test-name: reference to non-existent output
location: /home/rsd/v/git/others/guix/tests/packages.scm:470
source:
+ (test-assert
+   "reference to non-existent output"
+   (parameterize
+     ((%graft? #f))
+     (let* ((dep (dummy-package "dep"))
+            (p (dummy-package
+                 "p"
+                 (inputs `(("dep" ,dep "non-existent"))))))
+       (guard (c ((derivation-missing-output-error? c)
+                  (and (string=?
+                         (derivation-missing-output c)
+                         "non-existent")
+                       (equal?
+                         (package-derivation %store dep)
+                         (derivation-error-derivation c)))))
+              (package-derivation %store p)))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: trivial
location: /home/rsd/v/git/others/guix/tests/packages.scm:482
source:
+ (test-assert
+   "trivial"
+   (let* ((p (package
+               (inherit (dummy-package "trivial"))
+               (build-system trivial-build-system)
+               (source #f)
+               (arguments
+                 `(#:guile
+                   ,%bootstrap-guile
+                   #:builder
+                   (begin
+                     (mkdir %output)
+                     (call-with-output-file
+                       (string-append %output "/test")
+                       (lambda (p) (display '(hello guix) p))))))))
+          (d (package-derivation %store p)))
+     (and (build-derivations %store (list d))
+          (let ((p (pk 'drv d (derivation->output-path d))))
+            (equal?
+              '(hello guix)
+              (call-with-input-file
+                (string-append p "/test")
+                read))))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: trivial with local file as input
location: /home/rsd/v/git/others/guix/tests/packages.scm:500
source:
+ (test-assert
+   "trivial with local file as input"
+   (let* ((i (search-path %load-path "ice-9/boot-9.scm"))
+          (p (package
+               (inherit
+                 (dummy-package "trivial-with-input-file"))
+               (build-system trivial-build-system)
+               (source #f)
+               (arguments
+                 `(#:guile
+                   ,%bootstrap-guile
+                   #:builder
+                   (copy-file
+                     (assoc-ref %build-inputs "input")
+                     %output)))
+               (inputs `(("input" ,i)))))
+          (d (package-derivation %store p)))
+     (and (build-derivations %store (list d))
+          (let ((p (pk 'drv d (derivation->output-path d))))
+            (equal?
+              (call-with-input-file p get-bytevector-all)
+              (call-with-input-file i get-bytevector-all))))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: trivial with source
location: /home/rsd/v/git/others/guix/tests/packages.scm:516
source:
+ (test-assert
+   "trivial with source"
+   (let* ((i (search-path %load-path "ice-9/boot-9.scm"))
+          (p (package
+               (inherit (dummy-package "trivial-with-source"))
+               (build-system trivial-build-system)
+               (source i)
+               (arguments
+                 `(#:guile
+                   ,%bootstrap-guile
+                   #:builder
+                   (copy-file
+                     (assoc-ref %build-inputs "source")
+                     %output)))))
+          (d (package-derivation %store p)))
+     (and (build-derivations %store (list d))
+          (let ((p (derivation->output-path d)))
+            (equal?
+              (call-with-input-file p get-bytevector-all)
+              (call-with-input-file i get-bytevector-all))))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: trivial with system-dependent input
location: /home/rsd/v/git/others/guix/tests/packages.scm:531
source:
+ (test-assert
+   "trivial with system-dependent input"
+   (let* ((p (package
+               (inherit
+                 (dummy-package "trivial-system-dependent-input"))
+               (build-system trivial-build-system)
+               (source #f)
+               (arguments
+                 `(#:guile
+                   ,%bootstrap-guile
+                   #:builder
+                   (let ((out (assoc-ref %outputs "out"))
+                         (bash (assoc-ref %build-inputs "bash")))
+                     (zero? (system*
+                              bash
+                              "-c"
+                              (format #f "echo hello > ~a" out))))))
+               (inputs
+                 `(("bash"
+                    ,(search-bootstrap-binary
+                       "bash"
+                       (%current-system)))))))
+          (d (package-derivation %store p)))
+     (and (build-derivations %store (list d))
+          (let ((p (pk 'drv d (derivation->output-path d))))
+            (eq? 'hello (call-with-input-file p read))))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: search paths
location: /home/rsd/v/git/others/guix/tests/packages.scm:549
source:
+ (test-assert
+   "search paths"
+   (let* ((p (make-prompt-tag "return-search-paths"))
+          (s (build-system
+               (name 'raw)
+               (description
+                 "Raw build system with direct store access")
+               (lower (lambda* (name
+                                #:key
+                                source
+                                inputs
+                                system
+                                target
+                                #:allow-other-keys)
+                        (bag (name name)
+                             (system system)
+                             (target target)
+                             (build-inputs inputs)
+                             (build (lambda* (store
+                                              name
+                                              inputs
+                                              #:key
+                                              outputs
+                                              system
+                                              search-paths)
+                                      search-paths)))))))
+          (x (list (search-path-specification
+                     (variable "GUILE_LOAD_PATH")
+                     (files '("share/guile/site/2.0")))
+                   (search-path-specification
+                     (variable "GUILE_LOAD_COMPILED_PATH")
+                     (files '("share/guile/site/2.0")))))
+          (a (package
+               (inherit (dummy-package "guile"))
+               (build-system s)
+               (native-search-paths x)))
+          (b (package
+               (inherit (dummy-package "guile-foo"))
+               (build-system s)
+               (inputs `(("guile" ,a)))))
+          (c (package
+               (inherit (dummy-package "guile-bar"))
+               (build-system s)
+               (inputs `(("guile" ,a) ("guile-foo" ,b))))))
+     (let-syntax ((collect
+                    (syntax-rules ()
+                      ((_ body ...)
+                       (call-with-prompt
+                         p
+                         (lambda () body ...)
+                         (lambda (k search-paths) search-paths))))))
+       (and (null? (collect (package-derivation %store a)))
+            (equal?
+              x
+              (collect (package-derivation %store b)))
+            (equal?
+              x
+              (collect (package-derivation %store c)))))))
actual-value: #t
result: PASS

test-name: package-transitive-native-search-paths
location: /home/rsd/v/git/others/guix/tests/packages.scm:591
source:
+ (test-assert
+   "package-transitive-native-search-paths"
+   (let* ((sp (lambda (name)
+                (list (search-path-specification
+                        (variable name)
+                        (files '("foo/bar"))))))
+          (p0 (dummy-package
+                "p0"
+                (native-search-paths (sp "PATH0"))))
+          (p1 (dummy-package
+                "p1"
+                (native-search-paths (sp "PATH1"))))
+          (p2 (dummy-package
+                "p2"
+                (native-search-paths (sp "PATH2"))
+                (inputs `(("p0" ,p0)))
+                (propagated-inputs `(("p1" ,p1)))))
+          (p3 (dummy-package
+                "p3"
+                (native-search-paths (sp "PATH3"))
+                (native-inputs `(("p0" ,p0)))
+                (propagated-inputs `(("p2" ,p2))))))
+     (lset= string=?
+            '("PATH1" "PATH2" "PATH3")
+            (map search-path-specification-variable
+                 (package-transitive-native-search-paths p3)))))
actual-value: #t
result: PASS

test-name: package-cross-derivation
location: /home/rsd/v/git/others/guix/tests/packages.scm:611
source:
+ (test-assert
+   "package-cross-derivation"
+   (let ((drv (package-cross-derivation
+                %store
+                (dummy-package "p")
+                "mips64el-linux-gnu")))
+     (and (derivation? drv)
+          (file-exists? (derivation-file-name drv)))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: package-cross-derivation, trivial-build-system
location: /home/rsd/v/git/others/guix/tests/packages.scm:617
source:
+ (test-assert
+   "package-cross-derivation, trivial-build-system"
+   (let ((p (package
+              (inherit (dummy-package "p"))
+              (build-system trivial-build-system)
+              (arguments '(#:builder (exit 1))))))
+     (let ((drv (package-cross-derivation
+                  %store
+                  p
+                  "mips64el-linux-gnu")))
+       (derivation? drv))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: package-cross-derivation, no cross builder
location: /home/rsd/v/git/others/guix/tests/packages.scm:624
source:
+ (test-assert
+   "package-cross-derivation, no cross builder"
+   (let* ((b (build-system
+               (inherit trivial-build-system)
+               (lower (const #f))))
+          (p (package
+               (inherit (dummy-package "p"))
+               (build-system b))))
+     (guard (c ((package-cross-build-system-error? c)
+                (eq? (package-error-package c) p)))
+            (package-cross-derivation
+              %store
+              p
+              "mips64el-linux-gnu")
+            #f)))
actual-value: #t
result: PASS

test-name: package-grafts, indirect grafts
location: /home/rsd/v/git/others/guix/tests/packages.scm:652
source:
+ (test-assert
+   "package-grafts, indirect grafts"
+   (let* ((new (dummy-package
+                 "dep"
+                 (arguments '(#:implicit-inputs? #f))))
+          (dep (package (inherit new) (version "0.0")))
+          (dep* (package (inherit dep) (replacement new)))
+          (dummy (dummy-package
+                   "dummy"
+                   (arguments '(#:implicit-inputs? #f))
+                   (inputs `(("dep" ,dep*))))))
+     (equal?
+       (package-grafts %store dummy)
+       (list (graft (origin (package-derivation %store dep))
+                    (replacement (package-derivation %store new)))))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: package-grafts, indirect grafts, cross
location: /home/rsd/v/git/others/guix/tests/packages.scm:665
source:
+ (test-assert
+   "package-grafts, indirect grafts, cross"
+   (let* ((new (dummy-package
+                 "dep"
+                 (arguments '(#:implicit-inputs? #f))))
+          (dep (package (inherit new) (version "0.0")))
+          (dep* (package (inherit dep) (replacement new)))
+          (dummy (dummy-package
+                   "dummy"
+                   (arguments '(#:implicit-inputs? #f))
+                   (inputs `(("dep" ,dep*)))))
+          (target "mips64el-linux-gnu"))
+     (member
+       (graft (origin
+                (package-cross-derivation %store dep target))
+              (replacement
+                (package-cross-derivation %store new target)))
+       (package-grafts %store dummy #:target target))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: package-grafts, indirect grafts, propagated inputs
location: /home/rsd/v/git/others/guix/tests/packages.scm:682
source:
+ (test-assert
+   "package-grafts, indirect grafts, propagated inputs"
+   (let* ((new (dummy-package
+                 "dep"
+                 (arguments '(#:implicit-inputs? #f))))
+          (dep (package (inherit new) (version "0.0")))
+          (dep* (package (inherit dep) (replacement new)))
+          (prop (dummy-package
+                  "propagated"
+                  (propagated-inputs `(("dep" ,dep*)))
+                  (arguments '(#:implicit-inputs? #f))))
+          (dummy (dummy-package
+                   "dummy"
+                   (arguments '(#:implicit-inputs? #f))
+                   (inputs `(("prop" ,prop))))))
+     (equal?
+       (package-grafts %store dummy)
+       (list (graft (origin (package-derivation %store dep))
+                    (replacement (package-derivation %store new)))))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: package-grafts, same replacement twice
location: /home/rsd/v/git/others/guix/tests/packages.scm:698
source:
+ (test-assert
+   "package-grafts, same replacement twice"
+   (let* ((new (dummy-package
+                 "dep"
+                 (version "1")
+                 (arguments '(#:implicit-inputs? #f))))
+          (dep (package
+                 (inherit new)
+                 (version "0")
+                 (replacement new)))
+          (p1 (dummy-package
+                "intermediate1"
+                (arguments '(#:implicit-inputs? #f))
+                (inputs `(("dep" ,dep)))))
+          (p2 (dummy-package
+                "intermediate2"
+                (arguments '(#:implicit-inputs? #f))
+                (inputs `(("dep" ,(package (inherit dep)))))))
+          (p3 (dummy-package
+                "final"
+                (arguments '(#:implicit-inputs? #f))
+                (inputs `(("p1" ,p1) ("p2" ,p2))))))
+     (equal?
+       (package-grafts %store p3)
+       (list (graft (origin
+                      (package-derivation
+                        %store
+                        (package (inherit dep) (replacement #f))))
+                    (replacement (package-derivation %store new)))))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: package->bag
location: /home/rsd/v/git/others/guix/tests/packages.scm:744
source:
+ (test-equal
+   "package->bag"
+   `("foo86-hurd"
+     #f
+     (,(package-source gnu-make))
+     (,(canonical-package glibc))
+     (,(canonical-package coreutils)))
+   (let ((bag (package->bag gnu-make "foo86-hurd")))
+     (list (bag-system bag)
+           (bag-target bag)
+           (assoc-ref (bag-build-inputs bag) "source")
+           (assoc-ref (bag-build-inputs bag) "libc")
+           (assoc-ref (bag-build-inputs bag) "coreutils"))))
expected-value: (foo86-hurd #f (#<origin "mirror://gnu/make/make-4.2.tar.bz2" jzoohnrp4xlv76g3sk37nx4r4r3ncdb2z3v7cy4xs3ofx7womvpq ("/home/rsd/v/git/others/guix/gnu/packages/patches/make-impure-dirs.patch") 491b960>) (#<package glibc@2.23 gnu/packages/commencement.scm:514 47e4d80>) (#<package coreutils@8.25 gnu/packages/bootstrap.scm:146 4374600>))
actual-value: (foo86-hurd #f (#<origin "mirror://gnu/make/make-4.2.tar.bz2" jzoohnrp4xlv76g3sk37nx4r4r3ncdb2z3v7cy4xs3ofx7womvpq ("/home/rsd/v/git/others/guix/gnu/packages/patches/make-impure-dirs.patch") 491b960>) (#<package glibc@2.23 gnu/packages/commencement.scm:514 47e4d80>) (#<package coreutils@8.25 gnu/packages/bootstrap.scm:146 4374600>))
result: PASS

test-name: package->bag, cross-compilation
location: /home/rsd/v/git/others/guix/tests/packages.scm:753
source:
+ (test-equal
+   "package->bag, cross-compilation"
+   `(,(%current-system)
+     "foo86-hurd"
+     (,(package-source gnu-make))
+     (,(canonical-package glibc))
+     (,(canonical-package coreutils)))
+   (let ((bag (package->bag
+                gnu-make
+                (%current-system)
+                "foo86-hurd")))
+     (list (bag-system bag)
+           (bag-target bag)
+           (assoc-ref (bag-build-inputs bag) "source")
+           (assoc-ref (bag-build-inputs bag) "libc")
+           (assoc-ref (bag-build-inputs bag) "coreutils"))))
expected-value: (x86_64-linux foo86-hurd (#<origin "mirror://gnu/make/make-4.2.tar.bz2" jzoohnrp4xlv76g3sk37nx4r4r3ncdb2z3v7cy4xs3ofx7womvpq ("/home/rsd/v/git/others/guix/gnu/packages/patches/make-impure-dirs.patch") 491b960>) (#<package glibc@2.23 gnu/packages/commencement.scm:514 47e4d80>) (#<package coreutils@8.25 gnu/packages/bootstrap.scm:146 4374600>))
actual-value: (x86_64-linux foo86-hurd (#<origin "mirror://gnu/make/make-4.2.tar.bz2" jzoohnrp4xlv76g3sk37nx4r4r3ncdb2z3v7cy4xs3ofx7womvpq ("/home/rsd/v/git/others/guix/gnu/packages/patches/make-impure-dirs.patch") 491b960>) (#<package glibc@2.23 gnu/packages/commencement.scm:514 47e4d80>) (#<package coreutils@8.25 gnu/packages/bootstrap.scm:146 4374600>))
result: PASS

test-name: package->bag, propagated inputs
location: /home/rsd/v/git/others/guix/tests/packages.scm:763
source:
+ (test-assert
+   "package->bag, propagated inputs"
+   (let* ((dep (dummy-package "dep"))
+          (prop (dummy-package
+                  "prop"
+                  (propagated-inputs `(("dep" ,dep)))))
+          (dummy (dummy-package
+                   "dummy"
+                   (inputs `(("prop" ,prop)))))
+          (inputs
+            (bag-transitive-inputs
+              (package->bag dummy #:graft? #f))))
+     (match (assoc "dep" inputs)
+            (("dep" package) (eq? package dep)))))
actual-value: #t
result: PASS

test-name: bag->derivation
location: /home/rsd/v/git/others/guix/tests/packages.scm:774
source:
+ (test-assert
+   "bag->derivation"
+   (parameterize
+     ((%graft? #f))
+     (let ((bag (package->bag gnu-make))
+           (drv (package-derivation %store gnu-make)))
+       (parameterize
+         ((%current-system "foox86-hurd"))
+         (equal? drv (bag->derivation %store bag))))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: bag->derivation, cross-compilation
location: /home/rsd/v/git/others/guix/tests/packages.scm:781
source:
+ (test-assert
+   "bag->derivation, cross-compilation"
+   (parameterize
+     ((%graft? #f))
+     (let* ((target "mips64el-linux-gnu")
+            (bag (package->bag gnu-make (%current-system) target))
+            (drv (package-cross-derivation %store gnu-make target)))
+       (parameterize
+         ((%current-system "foox86-hurd")
+          (%current-target-system "foo64-linux-gnu"))
+         (equal? drv (bag->derivation %store bag))))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: GNU Make, bootstrap
location: /home/rsd/v/git/others/guix/tests/packages.scm:792
source:
+ (test-assert
+   "GNU Make, bootstrap"
+   (let ((gnu-make
+           (@@ (gnu packages commencement) gnu-make-boot0)))
+     (and (package? gnu-make)
+          (or (location? (package-location gnu-make))
+              (not (package-location gnu-make)))
+          (let* ((drv (package-derivation %store gnu-make))
+                 (out (derivation->output-path drv)))
+            (and (build-derivations %store (list drv))
+                 (file-exists? (string-append out "/bin/make")))))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: package-input-rewriting
location: /home/rsd/v/git/others/guix/tests/packages.scm:804
source:
+ (test-assert
+   "package-input-rewriting"
+   (let* ((dep (dummy-package
+                 "chbouib"
+                 (native-inputs `(("x" ,grep)))))
+          (p0 (dummy-package
+                "example"
+                (inputs
+                  `(("foo" ,coreutils) ("bar" ,grep) ("baz" ,dep)))))
+          (rewrite
+            (package-input-rewriting
+              `((,coreutils unquote sed)
+                (,grep unquote findutils))
+              (cut string-append "r-" <>)))
+          (p1 (rewrite p0))
+          (p2 (rewrite p0)))
+     (and (not (eq? p1 p0))
+          (eq? p1 p2)
+          (string=? "r-example" (package-name p1))
+          (match (package-inputs p1)
+                 ((("foo" dep1) ("bar" dep2) ("baz" dep3))
+                  (and (eq? dep1 sed)
+                       (eq? dep2 findutils)
+                       (string=? (package-name dep3) "r-chbouib")
+                       (eq? dep3 (rewrite dep))
+                       (match (package-native-inputs dep3)
+                              ((("x" dep)) (eq? dep findutils)))))))))
actual-value: #t
result: PASS

test-name: fold-packages
location: /home/rsd/v/git/others/guix/tests/packages.scm:829
source:
+ (test-eq
+   "fold-packages"
+   hello
+   (fold-packages
+     (lambda (p r)
+       (if (string=? (package-name p) "hello") p r))
+     #f))
expected-value: #<package hello@2.10 gnu/packages/base.scm:58 49196c0>
actual-value: #<package hello@2.10 gnu/packages/base.scm:58 49196c0>
result: PASS

test-name: fold-packages, hidden package
location: /home/rsd/v/git/others/guix/tests/packages.scm:836
source:
+ (test-assert
+   "fold-packages, hidden package"
+   (match (fold-packages
+            (lambda (p r)
+              (if (and (string=? (package-name p) "guile")
+                       (string-prefix? "2.0" (package-version p)))
+                (cons p r)
+                r))
+            '())
+          ((one) (eq? one guile-2.0/fixed))))
actual-value: #t
result: PASS

test-name: find-packages-by-name
location: /home/rsd/v/git/others/guix/tests/packages.scm:850
source:
+ (test-assert
+   "find-packages-by-name"
+   (match (find-packages-by-name "hello")
+          (((? (cut eq? hello <>))) #t)
+          (wrong (pk 'find-packages-by-name wrong #f))))
actual-value: #t
result: PASS

test-name: find-packages-by-name with version
location: /home/rsd/v/git/others/guix/tests/packages.scm:855
source:
+ (test-assert
+   "find-packages-by-name with version"
+   (match (find-packages-by-name
+            "hello"
+            (package-version hello))
+          (((? (cut eq? hello <>))) #t)
+          (wrong (pk 'find-packages-by-name wrong #f))))
actual-value: #t
result: PASS

test-name: --search-paths with pattern
location: /home/rsd/v/git/others/guix/tests/packages.scm:860
source:
+ (test-assert
+   "--search-paths with pattern"
+   (let* ((p1 (package
+                (name "foo")
+                (version "0")
+                (source #f)
+                (build-system trivial-build-system)
+                (arguments
+                  `(#:guile
+                    ,%bootstrap-guile
+                    #:modules
+                    ((guix build utils))
+                    #:builder
+                    (begin
+                      (use-modules (guix build utils))
+                      (let ((out (assoc-ref %outputs "out")))
+                        (mkdir-p (string-append out "/xml/bar/baz"))
+                        (call-with-output-file
+                          (string-append out "/xml/bar/baz/catalog.xml")
+                          (lambda (port) (display "xml? wat?!" port)))))))
+                (synopsis #f)
+                (description #f)
+                (home-page #f)
+                (license #f)))
+          (p2 (package
+                (name "libxml2")
+                (version "0.0.0")
+                (source #f)
+                (build-system trivial-build-system)
+                (arguments
+                  `(#:guile
+                    ,%bootstrap-guile
+                    #:builder
+                    (mkdir (assoc-ref %outputs "out"))))
+                (native-search-paths
+                  (package-native-search-paths libxml2))
+                (synopsis #f)
+                (description #f)
+                (home-page #f)
+                (license #f)))
+          (prof (run-with-store
+                  %store
+                  (profile-derivation
+                    (manifest
+                      (map package->manifest-entry (list p1 p2)))
+                    #:hooks
+                    '())
+                  #:guile-for-build
+                  (%guile-for-build))))
+     (build-derivations %store (list prof))
+     (string-match
+       (format
+         #f
+         "^export XML_CATALOG_FILES=\"~a/xml/+bar/baz/catalog\\.xml\"\n"
+         (regexp-quote (derivation->output-path prof)))
+       (with-output-to-string
+         (lambda ()
+           (guix-package
+             "-p"
+             (derivation->output-path prof)
+             "--search-paths"))))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: specification->package when not found
location: /home/rsd/v/git/others/guix/tests/packages.scm:907
source:
+ (test-equal
+   "specification->package when not found"
+   'quit
+   (catch 'quit
+          (lambda ()
+            (specification->package
+              "this-package-does-not-exist"))
+          (lambda (key . args) key)))
expected-value: quit
actual-value: quit
result: PASS

random seed for tests: 1473544773
warning: build daemon error: #<condition &nix-connection-error [file: "/home/rsd/v/git/others/guix/test-tmp/var/12089/daemon-socket/socket" errno: 2] 492cb40>
package 'foo' has been superseded by 'bar'
package 'foo' has been superseded by 'bar'
package 'foo' has been superseded by 'bar'
package 'foo' has been superseded by 'bar'
error: this-package-does-not-exist: unknown package

[-- Attachment #1.12: store.log --]
[-- Type: application/octet-stream, Size: 53069 bytes --]

test-name: store-path-hash-part
location: /home/rsd/v/git/others/guix/tests/store.scm:51
source:
+ (test-equal
+   "store-path-hash-part"
+   "283gqy39v3g9dxjy26rynl0zls82fmcg"
+   (store-path-hash-part
+     (string-append
+       (%store-prefix)
+       "/283gqy39v3g9dxjy26rynl0zls82fmcg-guile-2.0.7")))
expected-value: 283gqy39v3g9dxjy26rynl0zls82fmcg
actual-value: 283gqy39v3g9dxjy26rynl0zls82fmcg
result: PASS

test-name: store-path-hash-part #f
location: /home/rsd/v/git/others/guix/tests/store.scm:57
source:
+ (test-equal
+   "store-path-hash-part #f"
+   #f
+   (store-path-hash-part
+     (string-append
+       (%store-prefix)
+       "/foo/bar/283gqy39v3g9dxjy26rynl0zls82fmcg-guile-2.0.7")))
expected-value: #f
actual-value: #f
result: PASS

test-name: store-path-package-name
location: /home/rsd/v/git/others/guix/tests/store.scm:63
source:
+ (test-equal
+   "store-path-package-name"
+   "guile-2.0.7"
+   (store-path-package-name
+     (string-append
+       (%store-prefix)
+       "/283gqy39v3g9dxjy26rynl0zls82fmcg-guile-2.0.7")))
expected-value: guile-2.0.7
actual-value: guile-2.0.7
result: PASS

test-name: store-path-package-name #f
location: /home/rsd/v/git/others/guix/tests/store.scm:69
source:
+ (test-equal
+   "store-path-package-name #f"
+   #f
+   (store-path-package-name
+     "/foo/bar/283gqy39v3g9dxjy26rynl0zls82fmcg-guile-2.0.7"))
expected-value: #f
actual-value: #f
result: PASS

test-name: direct-store-path?
location: /home/rsd/v/git/others/guix/tests/store.scm:74
source:
+ (test-assert
+   "direct-store-path?"
+   (and (direct-store-path?
+          (string-append
+            (%store-prefix)
+            "/283gqy39v3g9dxjy26rynl0zls82fmcg-guile-2.0.7"))
+        (not (direct-store-path?
+               (string-append
+                 (%store-prefix)
+                 "/283gqy39v3g9dxjy26rynl0zls82fmcg-guile-2.0.7/bin/guile")))
+        (not (direct-store-path? (%store-prefix)))))
actual-value: #t
result: PASS

test-name: valid-path? live
location: /home/rsd/v/git/others/guix/tests/store.scm:86
source:
+ (test-assert
+   "valid-path? live"
+   (let ((p (add-text-to-store %store "hello" "hello, world")))
+     (valid-path? %store p)))
result: SKIP

test-name: valid-path? false
location: /home/rsd/v/git/others/guix/tests/store.scm:90
source:
+ (test-assert
+   "valid-path? false"
+   (not (valid-path?
+          %store
+          (string-append
+            (%store-prefix)
+            "/"
+            (make-string 32 #\e)
+            "-foobar"))))
result: SKIP

test-name: valid-path? error
location: /home/rsd/v/git/others/guix/tests/store.scm:95
source:
+ (test-assert
+   "valid-path? error"
+   (with-store
+     s
+     (guard (c ((nix-protocol-error? c) #t))
+            (valid-path? s "foo")
+            #f)))
result: SKIP

test-name: valid-path? recovery
location: /home/rsd/v/git/others/guix/tests/store.scm:101
source:
+ (test-assert
+   "valid-path? recovery"
+   (with-store
+     s
+     (let-syntax ((true-if-error
+                    (syntax-rules ()
+                      ((_ exp)
+                       (guard (c ((nix-protocol-error? c) #t)) exp #f)))))
+       (and (true-if-error (valid-path? s "foo"))
+            (true-if-error (valid-path? s "bar"))
+            (true-if-error (valid-path? s "baz"))
+            (true-if-error (valid-path? s "chbouib"))
+            (valid-path?
+              s
+              (add-text-to-store s "valid" "yeah"))))))
result: SKIP

test-name: hash-part->path
location: /home/rsd/v/git/others/guix/tests/store.scm:118
source:
+ (test-assert
+   "hash-part->path"
+   (let ((p (add-text-to-store %store "hello" "hello, world")))
+     (equal?
+       (hash-part->path %store (store-path-hash-part p))
+       p)))
result: SKIP

test-name: dead-paths
location: /home/rsd/v/git/others/guix/tests/store.scm:123
source:
+ (test-assert
+   "dead-paths"
+   (let ((p (add-text-to-store
+              %store
+              "random-text"
+              (random-text))))
+     (->bool (member p (dead-paths %store)))))
result: SKIP

test-name: permanent root
location: /home/rsd/v/git/others/guix/tests/store.scm:144
source:
+ (test-assert
+   "permanent root"
+   (let* ((p (with-store
+               store
+               (let ((p (add-text-to-store
+                          store
+                          "random-text"
+                          (random-text))))
+                 (add-permanent-root p)
+                 (add-permanent-root p)
+                 p))))
+     (and (member p (live-paths %store))
+          (begin
+            (remove-permanent-root p)
+            (->bool (member p (dead-paths %store)))))))
result: SKIP

test-name: dead path can be explicitly collected
location: /home/rsd/v/git/others/guix/tests/store.scm:156
source:
+ (test-assert
+   "dead path can be explicitly collected"
+   (let ((p (add-text-to-store
+              %store
+              "random-text"
+              (random-text)
+              '())))
+     (let-values
+       (((paths freed) (delete-paths %store (list p))))
+       (and (equal? paths (list p))
+            (> freed 0)
+            (not (file-exists? p))))))
result: SKIP

test-name: add-text-to-store vs. delete-paths
location: /home/rsd/v/git/others/guix/tests/store.scm:164
source:
+ (test-assert
+   "add-text-to-store vs. delete-paths"
+   (with-store
+     store
+     (let* ((text (random-text))
+            (path (add-text-to-store store "delete-me" text))
+            (deleted (delete-paths store (list path)))
+            (path2 (add-text-to-store store "delete-me" text)))
+       (and (string=? path path2)
+            (equal? deleted (list path))
+            (valid-path? store path)
+            (file-exists? path)))))
result: SKIP

test-name: add-to-store vs. delete-paths
location: /home/rsd/v/git/others/guix/tests/store.scm:177
source:
+ (test-assert
+   "add-to-store vs. delete-paths"
+   (with-store
+     store
+     (let* ((file (search-path %load-path "guix.scm"))
+            (path (add-to-store store "delete-me" #t "sha256" file))
+            (deleted (delete-paths store (list path)))
+            (path2 (add-to-store store "delete-me" #t "sha256" file)))
+       (and (string=? path path2)
+            (equal? deleted (list path))
+            (valid-path? store path)
+            (file-exists? path)))))
result: SKIP

test-name: references
location: /home/rsd/v/git/others/guix/tests/store.scm:189
source:
+ (test-assert
+   "references"
+   (let* ((t1 (add-text-to-store
+                %store
+                "random1"
+                (random-text)))
+          (t2 (add-text-to-store
+                %store
+                "random2"
+                (random-text)
+                (list t1))))
+     (and (equal? (list t1) (references %store t2))
+          (equal? (list t2) (referrers %store t1))
+          (null? (references %store t1))
+          (null? (referrers %store t2)))))
result: SKIP

test-name: references/substitutes missing reference info
location: /home/rsd/v/git/others/guix/tests/store.scm:199
source:
+ (test-assert
+   "references/substitutes missing reference info"
+   (with-store
+     s
+     (set-build-options s #:use-substitutes? #f)
+     (guard (c ((nix-protocol-error? c) #t))
+            (let* ((b (add-to-store
+                        s
+                        "bash"
+                        #t
+                        "sha256"
+                        (search-bootstrap-binary
+                          "bash"
+                          (%current-system))))
+                   (d (derivation
+                        s
+                        "the-thing"
+                        b
+                        '("--help")
+                        #:inputs
+                        `((,b)))))
+              (references/substitutes
+                s
+                (list (derivation->output-path d) b))
+              #f))))
result: SKIP

test-name: references/substitutes with substitute info
location: /home/rsd/v/git/others/guix/tests/store.scm:211
source:
+ (test-assert
+   "references/substitutes with substitute info"
+   (with-store
+     s
+     (set-build-options s #:use-substitutes? #t)
+     (let* ((t1 (add-text-to-store s "random1" (random-text)))
+            (t2 (add-text-to-store
+                  s
+                  "random2"
+                  (random-text)
+                  (list t1)))
+            (t3 (add-text-to-store
+                  s
+                  "build"
+                  "echo -n $t2 > $out"))
+            (b (add-to-store
+                 s
+                 "bash"
+                 #t
+                 "sha256"
+                 (search-bootstrap-binary
+                   "bash"
+                   (%current-system))))
+            (d (derivation
+                 s
+                 "the-thing"
+                 b
+                 `("-e" ,t3)
+                 #:inputs
+                 `((,b) (,t3) (,t2))
+                 #:env-vars
+                 `(("t2" unquote t2))))
+            (o (derivation->output-path d)))
+       (with-derivation-narinfo
+         d
+         (sha256 => (sha256 (string->utf8 t2)))
+         (references => (list t2))
+         (equal?
+           (references/substitutes s (list o t3 t2 t1))
+           `((,t2) () (,t1) ()))))))
result: SKIP

test-name: substitutable-path-info when substitutes are turned off
location: /home/rsd/v/git/others/guix/tests/store.scm:235
source:
+ (test-equal
+   "substitutable-path-info when substitutes are turned off"
+   '()
+   (with-store
+     s
+     (set-build-options s #:use-substitutes? #f)
+     (let* ((b (add-to-store
+                 s
+                 "bash"
+                 #t
+                 "sha256"
+                 (search-bootstrap-binary
+                   "bash"
+                   (%current-system))))
+            (d (derivation
+                 s
+                 "the-thing"
+                 b
+                 '("--version")
+                 #:inputs
+                 `((,b))))
+            (o (derivation->output-path d)))
+       (with-derivation-narinfo
+         d
+         (substitutable-path-info s (list o))))))
expected-value: ()
actual-value: #f
actual-error:
+ (srfi-34
+   #<condition &nix-connection-error [file: "/home/rsd/v/git/others/guix/test-tmp/var/12220/daemon-socket/socket" errno: 2] 1f76b40>)
result: FAIL

test-name: substitutable-paths when substitutes are turned off
location: /home/rsd/v/git/others/guix/tests/store.scm:248
source:
+ (test-equal
+   "substitutable-paths when substitutes are turned off"
+   '()
+   (with-store
+     s
+     (set-build-options s #:use-substitutes? #f)
+     (let* ((b (add-to-store
+                 s
+                 "bash"
+                 #t
+                 "sha256"
+                 (search-bootstrap-binary
+                   "bash"
+                   (%current-system))))
+            (d (derivation
+                 s
+                 "the-thing"
+                 b
+                 '("--version")
+                 #:inputs
+                 `((,b))))
+            (o (derivation->output-path d)))
+       (with-derivation-narinfo
+         d
+         (substitutable-paths s (list o))))))
expected-value: ()
actual-value: #f
actual-error:
+ (srfi-34
+   #<condition &nix-connection-error [file: "/home/rsd/v/git/others/guix/test-tmp/var/12220/daemon-socket/socket" errno: 2] 1fb5bd0>)
result: FAIL

test-name: requisites
location: /home/rsd/v/git/others/guix/tests/store.scm:261
source:
+ (test-assert
+   "requisites"
+   (let* ((t1 (add-text-to-store
+                %store
+                "random1"
+                (random-text)
+                '()))
+          (t2 (add-text-to-store
+                %store
+                "random2"
+                (random-text)
+                (list t1)))
+          (t3 (add-text-to-store
+                %store
+                "random3"
+                (random-text)
+                (list t2)))
+          (t4 (add-text-to-store
+                %store
+                "random4"
+                (random-text)
+                (list t1 t3))))
+     (define (same? x y)
+       (and (= (length x) (length y))
+            (lset= equal? x y)))
+     (and (same? (requisites %store (list t1)) (list t1))
+          (same? (requisites %store (list t2))
+                 (list t1 t2))
+          (same? (requisites %store (list t3))
+                 (list t1 t2 t3))
+          (same? (requisites %store (list t4))
+                 (list t1 t2 t3 t4))
+          (same? (requisites %store (list t1 t2 t3 t4))
+                 (list t1 t2 t3 t4)))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: derivers
location: /home/rsd/v/git/others/guix/tests/store.scm:281
source:
+ (test-assert
+   "derivers"
+   (let* ((b (add-text-to-store
+               %store
+               "build"
+               "echo $foo > $out"
+               '()))
+          (s (add-to-store
+               %store
+               "bash"
+               #t
+               "sha256"
+               (search-bootstrap-binary
+                 "bash"
+                 (%current-system))))
+          (d (derivation
+               %store
+               "the-thing"
+               s
+               `("-e" ,b)
+               #:env-vars
+               `(("foo" unquote (random-text)))
+               #:inputs
+               `((,b) (,s))))
+          (o (derivation->output-path d)))
+     (and (build-derivations %store (list d))
+          (equal?
+            (query-derivation-outputs
+              %store
+              (derivation-file-name d))
+            (list o))
+          (equal?
+            (valid-derivers %store o)
+            (list (derivation-file-name d))))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: topologically-sorted, one item
location: /home/rsd/v/git/others/guix/tests/store.scm:297
source:
+ (test-assert
+   "topologically-sorted, one item"
+   (let* ((a (add-text-to-store %store "a" "a"))
+          (b (add-text-to-store %store "b" "b" (list a)))
+          (c (add-text-to-store %store "c" "c" (list b)))
+          (d (add-text-to-store %store "d" "d" (list c)))
+          (s (topologically-sorted %store (list d))))
+     (equal? s (list a b c d))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: topologically-sorted, several items
location: /home/rsd/v/git/others/guix/tests/store.scm:305
source:
+ (test-assert
+   "topologically-sorted, several items"
+   (let* ((a (add-text-to-store %store "a" "a"))
+          (b (add-text-to-store %store "b" "b" (list a)))
+          (c (add-text-to-store %store "c" "c" (list b)))
+          (d (add-text-to-store %store "d" "d" (list c)))
+          (s1 (topologically-sorted %store (list d a c b)))
+          (s2 (topologically-sorted %store (list b d c a b d))))
+     (equal? s1 s2 (list a b c d))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: topologically-sorted, more difficult
location: /home/rsd/v/git/others/guix/tests/store.scm:314
source:
+ (test-assert
+   "topologically-sorted, more difficult"
+   (let* ((a (add-text-to-store %store "a" "a"))
+          (b (add-text-to-store %store "b" "b" (list a)))
+          (c (add-text-to-store %store "c" "c" (list b)))
+          (d (add-text-to-store %store "d" "d" (list c)))
+          (w (add-text-to-store %store "w" "w"))
+          (x (add-text-to-store %store "x" "x" (list w)))
+          (y (add-text-to-store %store "y" "y" (list x d)))
+          (s1 (topologically-sorted %store (list y)))
+          (s2 (topologically-sorted %store (list c y)))
+          (s3 (topologically-sorted
+                %store
+                (cons y (references %store y)))))
+     (let* ((x-then-d?
+              (equal? (references %store y) (list x d))))
+       (and (equal?
+              s1
+              (if x-then-d?
+                (list w x a b c d y)
+                (list a b c d w x y)))
+            (equal?
+              s2
+              (if x-then-d?
+                (list a b c w x d y)
+                (list a b c d w x y)))
+            (lset= string=? s1 s3)))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: current-build-output-port, UTF-8
location: /home/rsd/v/git/others/guix/tests/store.scm:338
source:
+ (test-assert
+   "current-build-output-port, UTF-8"
+   (string-contains
+     (with-fluids
+       ((%default-port-encoding "UTF-8"))
+       (call-with-output-string
+         (lambda (port)
+           (parameterize
+             ((current-build-output-port port))
+             (let* ((s "Here\u2019s a Greek letter: \u03bb.")
+                    (d (build-expression->derivation
+                         %store
+                         "foo"
+                         `(display ,s)
+                         #:guile-for-build
+                         (package-derivation
+                           s
+                           %bootstrap-guile
+                           (%current-system)))))
+               (guard (c ((nix-protocol-error? c) #t))
+                      (build-derivations %store (list d))))))))
+     "Here\u2019s a Greek letter: \u03bb."))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1
+    "struct"
+    "Here\u2019s a Greek letter: \u03bb.")
+   ("Here\u2019s a Greek letter: \u03bb."))
result: FAIL

test-name: current-build-output-port, UTF-8 + garbage
location: /home/rsd/v/git/others/guix/tests/store.scm:354
source:
+ (test-assert
+   "current-build-output-port, UTF-8 + garbage"
+   (string-contains
+     (with-fluids
+       ((%default-port-encoding "UTF-8"))
+       (call-with-output-string
+         (lambda (port)
+           (parameterize
+             ((current-build-output-port port))
+             (let ((d (build-expression->derivation
+                        %store
+                        "foo"
+                        `(begin
+                           (use-modules (rnrs io ports))
+                           (display "garbage: ")
+                           (put-bytevector (current-output-port) #vu8(128))
+                           (display "lambda: \u03bb\n"))
+                        #:guile-for-build
+                        (package-derivation %store %bootstrap-guile))))
+               (guard (c ((nix-protocol-error? c) #t))
+                      (build-derivations %store (list d))))))))
+     "garbage: ?lambda: \u03bb"))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: log-file, derivation
location: /home/rsd/v/git/others/guix/tests/store.scm:374
source:
+ (test-assert
+   "log-file, derivation"
+   (let* ((b (add-text-to-store
+               %store
+               "build"
+               "echo $foo > $out"
+               '()))
+          (s (add-to-store
+               %store
+               "bash"
+               #t
+               "sha256"
+               (search-bootstrap-binary
+                 "bash"
+                 (%current-system))))
+          (d (derivation
+               %store
+               "the-thing"
+               s
+               `("-e" ,b)
+               #:env-vars
+               `(("foo" unquote (random-text)))
+               #:inputs
+               `((,b) (,s)))))
+     (and (build-derivations %store (list d))
+          (file-exists?
+            (pk (log-file %store (derivation-file-name d)))))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: log-file, output file name
location: /home/rsd/v/git/others/guix/tests/store.scm:386
source:
+ (test-assert
+   "log-file, output file name"
+   (let* ((b (add-text-to-store
+               %store
+               "build"
+               "echo $foo > $out"
+               '()))
+          (s (add-to-store
+               %store
+               "bash"
+               #t
+               "sha256"
+               (search-bootstrap-binary
+                 "bash"
+                 (%current-system))))
+          (d (derivation
+               %store
+               "the-thing"
+               s
+               `("-e" ,b)
+               #:env-vars
+               `(("foo" unquote (random-text)))
+               #:inputs
+               `((,b) (,s))))
+          (o (derivation->output-path d)))
+     (and (build-derivations %store (list d))
+          (file-exists? (pk (log-file %store o)))
+          (string=?
+            (log-file %store (derivation-file-name d))
+            (log-file %store o)))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: no substitutes
location: /home/rsd/v/git/others/guix/tests/store.scm:401
source:
+ (test-assert
+   "no substitutes"
+   (with-store
+     s
+     (let* ((d1 (package-derivation
+                  s
+                  %bootstrap-guile
+                  (%current-system)))
+            (d2 (package-derivation
+                  s
+                  %bootstrap-glibc
+                  (%current-system)))
+            (o (map derivation->output-path (list d1 d2))))
+       (set-build-options s #:use-substitutes? #f)
+       (and (not (has-substitutes? s (derivation-file-name d1)))
+            (not (has-substitutes? s (derivation-file-name d2)))
+            (null? (substitutable-paths s o))
+            (null? (substitutable-path-info s o))))))
actual-value: #f
actual-error:
+ (srfi-34
+   #<condition &nix-connection-error [file: "/home/rsd/v/git/others/guix/test-tmp/var/12220/daemon-socket/socket" errno: 2] 1edbf30>)
result: FAIL

test-name: build-things with output path
location: /home/rsd/v/git/others/guix/tests/store.scm:412
source:
+ (test-assert
+   "build-things with output path"
+   (with-store
+     s
+     (let* ((c (random-text))
+            (d (build-expression->derivation
+                 s
+                 "substitute-me"
+                 `(call-with-output-file
+                    %output
+                    (lambda (p) (display ,c p)))
+                 #:guile-for-build
+                 (package-derivation
+                   s
+                   %bootstrap-guile
+                   (%current-system))))
+            (o (derivation->output-path d)))
+       (set-build-options s #:use-substitutes? #f)
+       (build-things s (list o))
+       (not (valid-path? s o)))))
actual-value: #f
actual-error:
+ (srfi-34
+   #<condition &nix-connection-error [file: "/home/rsd/v/git/others/guix/test-tmp/var/12220/daemon-socket/socket" errno: 2] 1e44000>)
result: FAIL

test-name: substitute query
location: /home/rsd/v/git/others/guix/tests/store.scm:432
source:
+ (test-assert
+   "substitute query"
+   (with-store
+     s
+     (let* ((d (package-derivation
+                 s
+                 %bootstrap-guile
+                 (%current-system)))
+            (o (derivation->output-path d)))
+       (with-derivation-narinfo
+         d
+         (false-if-exception
+           (delete-file-recursively
+             (string-append
+               (getenv "XDG_CACHE_HOME")
+               "/guix/substitute")))
+         (set-build-options
+           s
+           #:use-substitutes?
+           #t
+           #:substitute-urls
+           (%test-substitute-urls))
+         (and (has-substitutes? s o)
+              (equal?
+                (list o)
+                (substitutable-paths s (list o)))
+              (match (pk 'spi (substitutable-path-info s (list o)))
+                     (((? substitutable? s))
+                      (and (string=?
+                             (substitutable-deriver s)
+                             (derivation-file-name d))
+                           (null? (substitutable-references s))
+                           (equal? (substitutable-nar-size s) 1234)))))))))
actual-value: #f
actual-error:
+ (srfi-34
+   #<condition &nix-connection-error [file: "/home/rsd/v/git/others/guix/test-tmp/var/12220/daemon-socket/socket" errno: 2] 1ebb150>)
result: FAIL

test-name: substitute query, alternating URLs
location: /home/rsd/v/git/others/guix/tests/store.scm:456
source:
+ (test-assert
+   "substitute query, alternating URLs"
+   (let* ((d (with-store
+               s
+               (package-derivation
+                 s
+                 %bootstrap-guile
+                 (%current-system))))
+          (o (derivation->output-path d)))
+     (with-derivation-narinfo
+       d
+       (false-if-exception
+         (delete-file-recursively
+           (string-append
+             (getenv "XDG_CACHE_HOME")
+             "/guix/substitute")))
+       (and (with-store
+              s
+              (set-build-options
+                s
+                #:use-substitutes?
+                #t
+                #:substitute-urls
+                (%test-substitute-urls))
+              (has-substitutes? s o))
+            (with-store
+              s
+              (set-build-options
+                s
+                #:use-substitutes?
+                #t
+                #:substitute-urls
+                (list "http://does-not-exist"))
+              (not (has-substitutes? s o)))
+            (with-store
+              s
+              (set-build-options
+                s
+                #:use-substitutes?
+                #t
+                #:substitute-urls
+                (%test-substitute-urls))
+              (has-substitutes? s o))
+            (with-store
+              s
+              (set-build-options
+                s
+                #:use-substitutes?
+                #t
+                #:substitute-urls
+                '())
+              (not (has-substitutes? s o)))))))
actual-value: #f
actual-error:
+ (srfi-34
+   #<condition &nix-connection-error [file: "/home/rsd/v/git/others/guix/test-tmp/var/12220/daemon-socket/socket" errno: 2] 1ffe0f0>)
result: FAIL

test-name: substitute
location: /home/rsd/v/git/others/guix/tests/store.scm:488
source:
+ (test-assert
+   "substitute"
+   (with-store
+     s
+     (let* ((c (random-text))
+            (d (build-expression->derivation
+                 s
+                 "substitute-me"
+                 `(call-with-output-file
+                    %output
+                    (lambda (p) (exit 1) (display ,c p)))
+                 #:guile-for-build
+                 (package-derivation
+                   s
+                   %bootstrap-guile
+                   (%current-system))))
+            (o (derivation->output-path d)))
+       (with-derivation-substitute
+         d
+         c
+         (set-build-options
+           s
+           #:use-substitutes?
+           #t
+           #:substitute-urls
+           (%test-substitute-urls))
+         (and (has-substitutes? s o)
+              (build-derivations s (list d))
+              (equal?
+                c
+                (call-with-input-file o get-string-all)))))))
actual-value: #f
actual-error:
+ (srfi-34
+   #<condition &nix-connection-error [file: "/home/rsd/v/git/others/guix/test-tmp/var/12220/daemon-socket/socket" errno: 2] 1eb7510>)
result: FAIL

test-name: substitute + build-things with output path
location: /home/rsd/v/git/others/guix/tests/store.scm:507
source:
+ (test-assert
+   "substitute + build-things with output path"
+   (with-store
+     s
+     (let* ((c (random-text))
+            (d (build-expression->derivation
+                 s
+                 "substitute-me"
+                 `(call-with-output-file
+                    %output
+                    (lambda (p) (exit 1) (display ,c p)))
+                 #:guile-for-build
+                 (package-derivation
+                   s
+                   %bootstrap-guile
+                   (%current-system))))
+            (o (derivation->output-path d)))
+       (with-derivation-substitute
+         d
+         c
+         (set-build-options
+           s
+           #:use-substitutes?
+           #t
+           #:substitute-urls
+           (%test-substitute-urls))
+         (and (has-substitutes? s o)
+              (build-things s (list o))
+              (valid-path? s o)
+              (equal?
+                c
+                (call-with-input-file o get-string-all)))))))
actual-value: #f
actual-error:
+ (srfi-34
+   #<condition &nix-connection-error [file: "/home/rsd/v/git/others/guix/test-tmp/var/12220/daemon-socket/socket" errno: 2] 1e98930>)
result: FAIL

test-name: substitute, corrupt output hash
location: /home/rsd/v/git/others/guix/tests/store.scm:527
source:
+ (test-assert
+   "substitute, corrupt output hash"
+   (with-store
+     s
+     (let* ((c "hello, world")
+            (d (build-expression->derivation
+                 s
+                 "corrupt-substitute"
+                 `(mkdir %output)
+                 #:guile-for-build
+                 (package-derivation
+                   s
+                   %bootstrap-guile
+                   (%current-system))))
+            (o (derivation->output-path d)))
+       (with-derivation-substitute
+         d
+         c
+         (sha256 => (make-bytevector 32 0))
+         (set-build-options
+           s
+           #:use-substitutes?
+           #t
+           #:fallback?
+           #f
+           #:substitute-urls
+           (%test-substitute-urls))
+         (and (has-substitutes? s o)
+              (guard (c ((nix-protocol-error? c)
+                         (pk 'corrupt c)
+                         (not (zero? (nix-protocol-error-status c)))))
+                     (build-derivations s (list d))
+                     #f))))))
actual-value: #f
actual-error:
+ (srfi-34
+   #<condition &nix-connection-error [file: "/home/rsd/v/git/others/guix/test-tmp/var/12220/daemon-socket/socket" errno: 2] 1bfa840>)
result: FAIL

test-name: substitute --fallback
location: /home/rsd/v/git/others/guix/tests/store.scm:557
source:
+ (test-assert
+   "substitute --fallback"
+   (with-store
+     s
+     (let* ((t (random-text))
+            (d (build-expression->derivation
+                 s
+                 "substitute-me-not"
+                 `(call-with-output-file
+                    %output
+                    (lambda (p) (display ,t p)))
+                 #:guile-for-build
+                 (package-derivation
+                   s
+                   %bootstrap-guile
+                   (%current-system))))
+            (o (derivation->output-path d)))
+       (with-derivation-narinfo
+         d
+         (set-build-options
+           s
+           #:use-substitutes?
+           #t
+           #:substitute-urls
+           (%test-substitute-urls))
+         (and (has-substitutes? s o)
+              (guard (c ((nix-protocol-error? c)
+                         (set-build-options
+                           s
+                           #:use-substitutes?
+                           #t
+                           #:substitute-urls
+                           (%test-substitute-urls)
+                           #:fallback?
+                           #t)
+                         (and (build-derivations s (list d))
+                              (equal?
+                                t
+                                (call-with-input-file o get-string-all)))))
+                     (build-derivations s (list d))
+                     #f))))))
actual-value: #f
actual-error:
+ (srfi-34
+   #<condition &nix-connection-error [file: "/home/rsd/v/git/others/guix/test-tmp/var/12220/daemon-socket/socket" errno: 2] 1eae690>)
result: FAIL

test-name: export/import several paths
location: /home/rsd/v/git/others/guix/tests/store.scm:589
source:
+ (test-assert
+   "export/import several paths"
+   (let* ((texts (unfold
+                   (cut >= <> 10)
+                   (lambda _ (random-text))
+                   #{1+}#
+                   0))
+          (files (map (cut add-text-to-store %store "text" <>)
+                      texts))
+          (dump (call-with-bytevector-output-port
+                  (cut export-paths %store files <>))))
+     (delete-paths %store files)
+     (and (every (negate file-exists?) files)
+          (let* ((source (open-bytevector-input-port dump))
+                 (imported (import-paths %store source)))
+            (and (equal? imported files)
+                 (every file-exists? files)
+                 (equal?
+                   texts
+                   (map (lambda (file)
+                          (call-with-input-file file get-string-all))
+                        files)))))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: export/import paths, ensure topological order
location: /home/rsd/v/git/others/guix/tests/store.scm:609
source:
+ (test-assert
+   "export/import paths, ensure topological order"
+   (let* ((file0 (add-text-to-store %store "baz" (random-text)))
+          (file1 (add-text-to-store
+                   %store
+                   "foo"
+                   (random-text)
+                   (list file0)))
+          (file2 (add-text-to-store
+                   %store
+                   "bar"
+                   (random-text)
+                   (list file1)))
+          (files (list file1 file2))
+          (dump1 (call-with-bytevector-output-port
+                   (cute export-paths %store (list file1 file2) <>)))
+          (dump2 (call-with-bytevector-output-port
+                   (cute export-paths %store (list file2 file1) <>))))
+     (delete-paths %store files)
+     (and (every (negate file-exists?) files)
+          (bytevector=? dump1 dump2)
+          (let* ((source (open-bytevector-input-port dump1))
+                 (imported (import-paths %store source)))
+            (and (equal? imported (list file1 file2))
+                 (every file-exists? files)
+                 (equal? (list file0) (references %store file1))
+                 (equal? (list file1) (references %store file2)))))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: export/import incomplete
location: /home/rsd/v/git/others/guix/tests/store.scm:631
source:
+ (test-assert
+   "export/import incomplete"
+   (let* ((file0 (add-text-to-store %store "baz" (random-text)))
+          (file1 (add-text-to-store
+                   %store
+                   "foo"
+                   (random-text)
+                   (list file0)))
+          (file2 (add-text-to-store
+                   %store
+                   "bar"
+                   (random-text)
+                   (list file1)))
+          (dump (call-with-bytevector-output-port
+                  (cute export-paths %store (list file2) <>))))
+     (delete-paths %store (list file0 file1 file2))
+     (guard (c ((nix-protocol-error? c)
+                (and (not (zero? (nix-protocol-error-status c)))
+                     (string-contains
+                       (nix-protocol-error-message c)
+                       "not valid"))))
+            (import-paths
+              %store
+              (open-bytevector-input-port dump)))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: export/import recursive
location: /home/rsd/v/git/others/guix/tests/store.scm:648
source:
+ (test-assert
+   "export/import recursive"
+   (let* ((file0 (add-text-to-store %store "baz" (random-text)))
+          (file1 (add-text-to-store
+                   %store
+                   "foo"
+                   (random-text)
+                   (list file0)))
+          (file2 (add-text-to-store
+                   %store
+                   "bar"
+                   (random-text)
+                   (list file1)))
+          (dump (call-with-bytevector-output-port
+                  (cute export-paths
+                        %store
+                        (list file2)
+                        <>
+                        #:recursive?
+                        #t))))
+     (delete-paths %store (list file0 file1 file2))
+     (let ((imported
+             (import-paths
+               %store
+               (open-bytevector-input-port dump))))
+       (and (equal? imported (list file0 file1 file2))
+            (every file-exists? (list file0 file1 file2))
+            (equal? (list file0) (references %store file1))
+            (equal? (list file1) (references %store file2))))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: write-file & export-path yield the same result
location: /home/rsd/v/git/others/guix/tests/store.scm:664
source:
+ (test-assert
+   "write-file & export-path yield the same result"
+   (run-with-store
+     %store
+     (mlet* %store-monad
+            ((drv1 (package->derivation %bootstrap-guile))
+             (out1 -> (derivation->output-path drv1))
+             (data ->
+                   (unfold
+                     (cut >= <> 26)
+                     (lambda (i) (random-bytevector 128))
+                     #{1+}#
+                     0))
+             (build ->
+                    (gexp (begin
+                            (use-modules (rnrs io ports) (srfi srfi-1))
+                            (let ()
+                              (define letters
+                                (map (lambda (i)
+                                       (string
+                                         (integer->char
+                                           (+ i (char->integer #\a)))))
+                                     (iota 26)))
+                              (define (touch file data)
+                                (call-with-output-file
+                                  file
+                                  (lambda (port) (put-bytevector port data))))
+                              (mkdir (ungexp output))
+                              (chdir (ungexp output))
+                              (for-each
+                                touch
+                                (append (drop letters 10) (take letters 10))
+                                (list (ungexp-splicing data)))
+                              #t))))
+             (drv2 (gexp->derivation "bunch" build))
+             (out2 -> (derivation->output-path drv2))
+             (item-info -> (store-lift query-path-info)))
+            (mbegin
+              %store-monad
+              (built-derivations (list drv1 drv2))
+              (foldm %store-monad
+                     (lambda (item result)
+                       (define ref-hash
+                         (let-values
+                           (((port get) (open-sha256-port)))
+                           (write-file item port)
+                           (close-port port)
+                           (get)))
+                       (>>= (item-info item)
+                            (lambda (info)
+                              (return
+                                (and result
+                                     (bytevector=?
+                                       (path-info-hash info)
+                                       ref-hash))))))
+                     #t
+                     (list out1 out2))))
+     #:guile-for-build
+     (%guile-for-build)))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: import corrupt path
location: /home/rsd/v/git/others/guix/tests/store.scm:730
source:
+ (test-assert
+   "import corrupt path"
+   (let* ((text (random-text))
+          (file (add-text-to-store %store "text" text))
+          (dump (call-with-bytevector-output-port
+                  (cut export-paths %store (list file) <>))))
+     (delete-paths %store (list file))
+     (let* ((index (quotient (bytevector-length dump) 4))
+            (byte (bytevector-u8-ref dump index)))
+       (bytevector-u8-set! dump index (logxor 255 byte)))
+     (and (not (file-exists? file))
+          (guard (c ((nix-protocol-error? c)
+                     (pk 'c c)
+                     (and (not (zero? (nix-protocol-error-status c)))
+                          (string-contains
+                            (nix-protocol-error-message c)
+                            "corrupt"))))
+                 (let* ((source (open-bytevector-input-port dump))
+                        (imported (import-paths %store source)))
+                   (pk 'corrupt-imported imported)
+                   #f)))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: register-path
location: /home/rsd/v/git/others/guix/tests/store.scm:753
source:
+ (test-assert
+   "register-path"
+   (let ((file (string-append
+                 (%store-prefix)
+                 "/"
+                 (make-string 32 #\f)
+                 "-fake")))
+     (when (valid-path? %store file)
+           (delete-paths %store (list file)))
+     (false-if-exception (delete-file file))
+     (let ((ref (add-text-to-store
+                  %store
+                  "ref-of-fake"
+                  (random-text)))
+           (drv (string-append file ".drv")))
+       (call-with-output-file
+         file
+         (cut display "This is a fake store item.\n" <>))
+       (register-path
+         file
+         #:references
+         (list ref)
+         #:deriver
+         drv)
+       (and (valid-path? %store file)
+            (equal? (references %store file) (list ref))
+            (null? (valid-derivers %store file))
+            (null? (referrers %store file))))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: verify-store
location: /home/rsd/v/git/others/guix/tests/store.scm:773
source:
+ (test-assert
+   "verify-store"
+   (let* ((text (random-text))
+          (file1 (add-text-to-store %store "foo" text))
+          (file2 (add-text-to-store
+                   %store
+                   "bar"
+                   (random-text)
+                   (list file1))))
+     (and (pk 'verify1 (verify-store %store))
+          (begin
+            (delete-file file1)
+            (not (pk 'verify2 (verify-store %store))))
+          (begin
+            (call-with-output-file
+              file1
+              (lambda (port) (display text port)))
+            (pk 'verify3 (verify-store %store))))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: verify-store + check-contents
location: /home/rsd/v/git/others/guix/tests/store.scm:790
source:
+ (test-assert
+   "verify-store + check-contents"
+   (with-store
+     s
+     (let* ((text (random-text))
+            (drv (build-expression->derivation
+                   s
+                   "corrupt"
+                   `(let ((out (assoc-ref %outputs "out")))
+                      (call-with-output-file
+                        out
+                        (lambda (port) (display ,text port)))
+                      #t)
+                   #:guile-for-build
+                   (package-derivation
+                     s
+                     %bootstrap-guile
+                     (%current-system))))
+            (file (derivation->output-path drv)))
+       (with-derivation-substitute
+         drv
+         text
+         (and (build-derivations s (list drv))
+              (verify-store s #:check-contents? #t)
+              (begin
+                (chmod file 420)
+                (call-with-output-file
+                  file
+                  (lambda (port) (display "corrupt!" port)))
+                #t)
+              (not (verify-store s #:check-contents? #t))
+              (delete-paths s (list file)))))))
actual-value: #f
actual-error:
+ (srfi-34
+   #<condition &nix-connection-error [file: "/home/rsd/v/git/others/guix/test-tmp/var/12220/daemon-socket/socket" errno: 2] 23363f0>)
result: FAIL

test-name: build-things, check mode
location: /home/rsd/v/git/others/guix/tests/store.scm:827
source:
+ (test-assert
+   "build-things, check mode"
+   (with-store
+     store
+     (call-with-temporary-output-file
+       (lambda (entropy entropy-port)
+         (write (random-text) entropy-port)
+         (force-output entropy-port)
+         (let* ((drv (build-expression->derivation
+                       store
+                       "non-deterministic"
+                       `(begin
+                          (use-modules (rnrs io ports))
+                          (let ((out (assoc-ref %outputs "out")))
+                            (call-with-output-file
+                              out
+                              (lambda (port)
+                                (display
+                                  (call-with-input-file
+                                    ,entropy
+                                    get-string-all)
+                                  port)))
+                            #t))
+                       #:guile-for-build
+                       (package-derivation
+                         store
+                         %bootstrap-guile
+                         (%current-system))))
+                (file (derivation->output-path drv)))
+           (and (build-things
+                  store
+                  (list (derivation-file-name drv)))
+                (begin
+                  (write (random-text) entropy-port)
+                  (force-output entropy-port)
+                  (guard (c ((nix-protocol-error? c)
+                             (pk 'determinism-exception c)
+                             (and (not (zero? (nix-protocol-error-status c)))
+                                  (string-contains
+                                    (nix-protocol-error-message c)
+                                    "deterministic"))))
+                         (build-things
+                           store
+                           (list (derivation-file-name drv))
+                           (build-mode check))
+                         #f))))))))
actual-value: #f
actual-error:
+ (srfi-34
+   #<condition &nix-connection-error [file: "/home/rsd/v/git/others/guix/test-tmp/var/12220/daemon-socket/socket" errno: 2] 1e5a780>)
result: FAIL

test-name: build multiple times
location: /home/rsd/v/git/others/guix/tests/store.scm:864
source:
+ (test-assert
+   "build multiple times"
+   (with-store
+     store
+     (set-build-options
+       store
+       #:rounds
+       2
+       #:use-substitutes?
+       #f)
+     (call-with-temporary-output-file
+       (lambda (entropy entropy-port)
+         (write (random-text) entropy-port)
+         (force-output entropy-port)
+         (let* ((drv (build-expression->derivation
+                       store
+                       "non-deterministic"
+                       `(begin
+                          (use-modules (rnrs io ports))
+                          (let ((out (assoc-ref %outputs "out")))
+                            (call-with-output-file
+                              out
+                              (lambda (port)
+                                (display
+                                  (call-with-input-file
+                                    ,entropy
+                                    get-string-all)
+                                  port)
+                                (call-with-output-file
+                                  ,entropy
+                                  (lambda (port) (write 'foobar port)))))
+                            #t))
+                       #:guile-for-build
+                       (package-derivation
+                         store
+                         %bootstrap-guile
+                         (%current-system))))
+                (file (derivation->output-path drv)))
+           (guard (c ((nix-protocol-error? c)
+                      (pk 'multiple-build c)
+                      (and (not (zero? (nix-protocol-error-status c)))
+                           (string-contains
+                             (nix-protocol-error-message c)
+                             "deterministic"))))
+                  (current-build-output-port (current-error-port))
+                  (build-things
+                    store
+                    (list (derivation-file-name drv)))
+                  #f))))))
actual-value: #f
actual-error:
+ (srfi-34
+   #<condition &nix-connection-error [file: "/home/rsd/v/git/others/guix/test-tmp/var/12220/daemon-socket/socket" errno: 2] 2417480>)
result: FAIL

test-name: store-lower
location: /home/rsd/v/git/others/guix/tests/store.scm:902
source:
+ (test-equal
+   "store-lower"
+   "Lowered."
+   (let* ((add (store-lower text-file))
+          (file (add %store "foo" "Lowered.")))
+     (call-with-input-file file get-string-all)))
expected-value: Lowered.
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: current-system
location: /home/rsd/v/git/others/guix/tests/store.scm:908
source:
+ (test-equal
+   "current-system"
+   "bar"
+   (parameterize
+     ((%current-system "frob"))
+     (run-with-store
+       %store
+       (mbegin
+         %store-monad
+         (set-current-system "bar")
+         (current-system))
+       #:system
+       "foo")))
expected-value: bar
actual-value: bar
result: PASS

test-name: query-path-info
location: /home/rsd/v/git/others/guix/tests/store.scm:917
source:
+ (test-assert
+   "query-path-info"
+   (let* ((ref (add-text-to-store %store "ref" "foo"))
+          (item (add-text-to-store
+                  %store
+                  "item"
+                  "bar"
+                  (list ref)))
+          (info (query-path-info %store item)))
+     (and (equal? (path-info-references info) (list ref))
+          (equal?
+            (path-info-hash info)
+            (sha256
+              (string->utf8
+                (call-with-output-string
+                  (cut write-file item <>))))))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

test-name: path-info-deriver
location: /home/rsd/v/git/others/guix/tests/store.scm:927
source:
+ (test-assert
+   "path-info-deriver"
+   (let* ((b (add-text-to-store
+               %store
+               "build"
+               "echo $foo > $out"
+               '()))
+          (s (add-to-store
+               %store
+               "bash"
+               #t
+               "sha256"
+               (search-bootstrap-binary
+                 "bash"
+                 (%current-system))))
+          (d (derivation
+               %store
+               "the-thing"
+               s
+               `("-e" ,b)
+               #:env-vars
+               `(("foo" unquote (random-text)))
+               #:inputs
+               `((,b) (,s))))
+          (o (derivation->output-path d)))
+     (and (build-derivations %store (list d))
+          (not (path-info-deriver (query-path-info %store b)))
+          (string=?
+            (derivation-file-name d)
+            (path-info-deriver (query-path-info %store o))))))
actual-value: #f
actual-error:
+ (wrong-type-arg
+   "struct_vtable"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1 "struct" #f)
+   (#f))
result: FAIL

random seed for tests: 1473544907
warning: build daemon error: #<condition &nix-connection-error [file: "/home/rsd/v/git/others/guix/test-tmp/var/12220/daemon-socket/socket" errno: 2] 1e2c840>

[-- Attachment #1.13: ui.log --]
[-- Type: application/octet-stream, Size: 12487 bytes --]

test-name: fill-paragraph
location: /home/rsd/v/git/others/guix/tests/ui.scm:59
source:
+ (test-assert
+   "fill-paragraph"
+   (every (lambda (column)
+            (every (lambda (width)
+                     (every (lambda (line) (<= (string-length line) width))
+                            (string-split
+                              (fill-paragraph %paragraph width column)
+                              #\newline)))
+                   '(15 30 35 40 45 50 60 70 80 90 100)))
+          '(0 5)))
actual-value: #t
result: PASS

test-name: fill-paragraph, consecutive newlines
location: /home/rsd/v/git/others/guix/tests/ui.scm:70
source:
+ (test-assert
+   "fill-paragraph, consecutive newlines"
+   (every (lambda (width)
+            (any (lambda (line) (string-prefix? "When STR" line))
+                 (string-split
+                   (fill-paragraph
+                     (procedure-documentation fill-paragraph)
+                     width)
+                   #\newline)))
+          '(15 20 25 30 40 50 60)))
actual-value: #t
result: PASS

test-name: fill-paragraph, large unbreakable word
location: /home/rsd/v/git/others/guix/tests/ui.scm:80
source:
+ (test-equal
+   "fill-paragraph, large unbreakable word"
+   '("Here is a"
+     "very-very-long-word"
+     "and that's"
+     "it.")
+   (string-split
+     (fill-paragraph
+       "Here is a very-very-long-word and that's it."
+       10)
+     #\newline))
expected-value: (Here is a very-very-long-word and that's it.)
actual-value: (Here is a very-very-long-word and that's it.)
result: PASS

test-name: fill-paragraph, two spaces after period
location: /home/rsd/v/git/others/guix/tests/ui.scm:88
source:
+ (test-equal
+   "fill-paragraph, two spaces after period"
+   "First line.  Second line"
+   (fill-paragraph "First line.\nSecond line" 24))
expected-value: First line.  Second line
actual-value: First line.  Second line
result: PASS

test-name: package-description-string vs. Unicode
location: /home/rsd/v/git/others/guix/tests/ui.scm:93
source:
+ (test-equal
+   "package-description-string vs. Unicode"
+   "b\u2022ll\u2022t\n\n"
+   (with-fluids
+     ((%default-port-encoding "ISO-8859-1"))
+     (package-description-string
+       (dummy-package
+         "foo"
+         (description "b\u2022ll\u2022t")))))
expected-value: b?ll?t


actual-value: b?ll?t


result: PASS

test-name: package-specification->name+version+output
location: /home/rsd/v/git/others/guix/tests/ui.scm:99
source:
+ (test-equal
+   "package-specification->name+version+output"
+   '(("guile" #f "out")
+     ("guile" "2.0.9" "out")
+     ("guile" #f "debug")
+     ("guile" "2.0.9" "debug")
+     ("guile-cairo" "1.4.1" "out"))
+   (map (lambda (spec)
+          (call-with-values
+            (lambda ()
+              (package-specification->name+version+output spec))
+            list))
+        '("guile"
+          "guile@2.0.9"
+          "guile:debug"
+          "guile@2.0.9:debug"
+          "guile-cairo@1.4.1")))
expected-value: ((guile #f out) (guile 2.0.9 out) (guile #f debug) (guile 2.0.9 debug) (guile-cairo 1.4.1 out))
actual-value: ((guile #f out) (guile 2.0.9 out) (guile #f debug) (guile 2.0.9 debug) (guile-cairo 1.4.1 out))
result: PASS

test-name: integer
location: /home/rsd/v/git/others/guix/tests/ui.scm:116
source:
+ (test-equal
+   "integer"
+   '(1)
+   (string->generations "1"))
expected-value: (1)
actual-value: (1)
result: PASS

test-name: comma-separated integers
location: /home/rsd/v/git/others/guix/tests/ui.scm:120
source:
+ (test-equal
+   "comma-separated integers"
+   '(3 7 1 4 6)
+   (string->generations "3,7,1,4,6"))
expected-value: (3 7 1 4 6)
actual-value: (3 7 1 4 6)
result: PASS

test-name: closed range
location: /home/rsd/v/git/others/guix/tests/ui.scm:124
source:
+ (test-equal
+   "closed range"
+   '(4 5 6 7 8 9 10 11 12)
+   (string->generations "4..12"))
expected-value: (4 5 6 7 8 9 10 11 12)
actual-value: (4 5 6 7 8 9 10 11 12)
result: PASS

test-name: closed range, equal endpoints
location: /home/rsd/v/git/others/guix/tests/ui.scm:128
source:
+ (test-equal
+   "closed range, equal endpoints"
+   '(3)
+   (string->generations "3..3"))
expected-value: (3)
actual-value: (3)
result: PASS

test-name: indefinite end range
location: /home/rsd/v/git/others/guix/tests/ui.scm:132
source:
+ (test-equal
+   "indefinite end range"
+   '(>= 7)
+   (string->generations "7.."))
expected-value: (>= 7)
actual-value: (>= 7)
result: PASS

test-name: indefinite start range
location: /home/rsd/v/git/others/guix/tests/ui.scm:136
source:
+ (test-equal
+   "indefinite start range"
+   '(<= 42)
+   (string->generations "..42"))
expected-value: (<= 42)
actual-value: (<= 42)
result: PASS

test-name: integer, char
location: /home/rsd/v/git/others/guix/tests/ui.scm:140
source:
+ (test-equal
+   "integer, char"
+   #f
+   (string->generations "a"))
expected-value: #f
actual-value: #f
result: PASS

test-name: comma-separated integers, consecutive comma
location: /home/rsd/v/git/others/guix/tests/ui.scm:144
source:
+ (test-equal
+   "comma-separated integers, consecutive comma"
+   #f
+   (string->generations "1,,2"))
expected-value: #f
actual-value: #f
result: PASS

test-name: comma-separated integers, trailing comma
location: /home/rsd/v/git/others/guix/tests/ui.scm:148
source:
+ (test-equal
+   "comma-separated integers, trailing comma"
+   #f
+   (string->generations "1,2,"))
expected-value: #f
actual-value: #f
result: PASS

test-name: comma-separated integers, chars
location: /home/rsd/v/git/others/guix/tests/ui.scm:152
source:
+ (test-equal
+   "comma-separated integers, chars"
+   #f
+   (string->generations "a,b"))
expected-value: #f
actual-value: #f
result: PASS

test-name: closed range, start > end
location: /home/rsd/v/git/others/guix/tests/ui.scm:156
source:
+ (test-equal
+   "closed range, start > end"
+   #f
+   (string->generations "9..2"))
expected-value: #f
actual-value: #f
result: PASS

test-name: closed range, chars
location: /home/rsd/v/git/others/guix/tests/ui.scm:160
source:
+ (test-equal
+   "closed range, chars"
+   #f
+   (string->generations "a..b"))
expected-value: #f
actual-value: #f
result: PASS

test-name: indefinite end range, char
location: /home/rsd/v/git/others/guix/tests/ui.scm:164
source:
+ (test-equal
+   "indefinite end range, char"
+   #f
+   (string->generations "a.."))
expected-value: #f
actual-value: #f
result: PASS

test-name: indefinite start range, char
location: /home/rsd/v/git/others/guix/tests/ui.scm:168
source:
+ (test-equal
+   "indefinite start range, char"
+   #f
+   (string->generations "..a"))
expected-value: #f
actual-value: #f
result: PASS

test-name: duration, 1 day
location: /home/rsd/v/git/others/guix/tests/ui.scm:172
source:
+ (test-equal
+   "duration, 1 day"
+   (make-time time-duration 0 (* 3600 24))
+   (string->duration "1d"))
expected-value: #<time type: time-duration nanosecond: 0 second: 86400>
actual-value: #<time type: time-duration nanosecond: 0 second: 86400>
result: PASS

test-name: duration, 1 week
location: /home/rsd/v/git/others/guix/tests/ui.scm:176
source:
+ (test-equal
+   "duration, 1 week"
+   (make-time time-duration 0 (* 3600 24 7))
+   (string->duration "1w"))
expected-value: #<time type: time-duration nanosecond: 0 second: 604800>
actual-value: #<time type: time-duration nanosecond: 0 second: 604800>
result: PASS

test-name: duration, 1 month
location: /home/rsd/v/git/others/guix/tests/ui.scm:180
source:
+ (test-equal
+   "duration, 1 month"
+   (make-time time-duration 0 (* 3600 24 30))
+   (string->duration "1m"))
expected-value: #<time type: time-duration nanosecond: 0 second: 2592000>
actual-value: #<time type: time-duration nanosecond: 0 second: 2592000>
result: PASS

test-name: duration, 1 week == 7 days
location: /home/rsd/v/git/others/guix/tests/ui.scm:184
source:
+ (test-equal
+   "duration, 1 week == 7 days"
+   (string->duration "1w")
+   (string->duration "7d"))
expected-value: #<time type: time-duration nanosecond: 0 second: 604800>
actual-value: #<time type: time-duration nanosecond: 0 second: 604800>
result: PASS

test-name: duration, 1 month == 30 days
location: /home/rsd/v/git/others/guix/tests/ui.scm:188
source:
+ (test-equal
+   "duration, 1 month == 30 days"
+   (string->duration "1m")
+   (string->duration "30d"))
expected-value: #<time type: time-duration nanosecond: 0 second: 2592000>
actual-value: #<time type: time-duration nanosecond: 0 second: 2592000>
result: PASS

test-name: duration, 1 second
location: /home/rsd/v/git/others/guix/tests/ui.scm:192
source:
+ (test-equal
+   "duration, 1 second"
+   (make-time time-duration 0 1)
+   (string->duration "1s"))
expected-value: #<time type: time-duration nanosecond: 0 second: 1>
actual-value: #<time type: time-duration nanosecond: 0 second: 1>
result: PASS

test-name: duration, integer
location: /home/rsd/v/git/others/guix/tests/ui.scm:196
source:
+ (test-equal
+   "duration, integer"
+   #f
+   (string->duration "1"))
expected-value: #f
actual-value: #f
result: PASS

test-name: duration, char
location: /home/rsd/v/git/others/guix/tests/ui.scm:200
source:
+ (test-equal
+   "duration, char"
+   #f
+   (string->duration "d"))
expected-value: #f
actual-value: #f
result: PASS

test-name: size->number, bytes
location: /home/rsd/v/git/others/guix/tests/ui.scm:204
source:
+ (test-equal
+   "size->number, bytes"
+   42
+   (size->number "42"))
expected-value: 42
actual-value: 42
result: PASS

test-name: size->number, MiB
location: /home/rsd/v/git/others/guix/tests/ui.scm:208
source:
+ (test-equal
+   "size->number, MiB"
+   (* 42 (expt 2 20))
+   (size->number "42MiB"))
expected-value: 44040192
actual-value: 44040192
result: PASS

test-name: size->number, GiB
location: /home/rsd/v/git/others/guix/tests/ui.scm:212
source:
+ (test-equal
+   "size->number, GiB"
+   (* 3 (expt 2 30))
+   (size->number "3GiB"))
expected-value: 3221225472
actual-value: 3221225472
result: PASS

test-name: size->number, 1.2GiB
location: /home/rsd/v/git/others/guix/tests/ui.scm:216
source:
+ (test-equal
+   "size->number, 1.2GiB"
+   (inexact->exact (round (* 1.2 (expt 2 30))))
+   (size->number "1.2GiB"))
expected-value: 1288490189
actual-value: 1288490189
result: PASS

test-name: size->number, 1T
location: /home/rsd/v/git/others/guix/tests/ui.scm:220
source:
+ (test-equal
+   "size->number, 1T"
+   (expt 2 40)
+   (size->number "1T"))
expected-value: 1099511627776
actual-value: 1099511627776
result: PASS

test-name: size->number, invalid unit
location: /home/rsd/v/git/others/guix/tests/ui.scm:224
source:
+ (test-assert
+   "size->number, invalid unit"
+   (catch 'quit
+          (lambda () (size->number "9X"))
+          (lambda args #t)))
actual-value: #t
result: PASS

test-name: show-what-to-build, zero outputs
location: /home/rsd/v/git/others/guix/tests/ui.scm:231
source:
+ (test-equal
+   "show-what-to-build, zero outputs"
+   ""
+   (with-store
+     store
+     (let ((drv (derivation
+                  store
+                  "zero"
+                  "/bin/sh"
+                  '()
+                  #:outputs
+                  '())))
+       (with-error-to-string
+         (lambda () (show-what-to-build store (list drv)))))))
expected-value: 
actual-value: #f
actual-error:
+ (srfi-34
+   #<condition &nix-connection-error [file: "/home/rsd/v/git/others/guix/test-tmp/var/11928/daemon-socket/socket" errno: 2] 3078900>)
result: FAIL

test-name: show-manifest-transaction
location: /home/rsd/v/git/others/guix/tests/ui.scm:241
source:
+ (test-assert
+   "show-manifest-transaction"
+   (let* ((m (manifest (list guile-1.8.8)))
+          (t (manifest-transaction
+               (install (list guile-2.0.9)))))
+     (with-store
+       store
+       (and (string-match
+              "guile\t1.8.8 \u2192 2.0.9"
+              (with-fluids
+                ((%default-port-encoding "UTF-8"))
+                (with-error-to-string
+                  (lambda () (show-manifest-transaction store m t)))))
+            (string-match
+              "guile\t1.8.8 -> 2.0.9"
+              (with-fluids
+                ((%default-port-encoding "ISO-8859-1"))
+                (with-error-to-string
+                  (lambda () (show-manifest-transaction store m t)))))))))
actual-value: #f
actual-error:
+ (srfi-34
+   #<condition &nix-connection-error [file: "/home/rsd/v/git/others/guix/test-tmp/var/11928/daemon-socket/socket" errno: 2] 306da20>)
result: FAIL

random seed for tests: 1473545122
error: unknown unit: X

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 808 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#24408: `make check` fails for builders, build-utils, cran, derivations, elpa, gexp, grafts, hackage, monads, packages, store, ui
  2016-09-11  1:11 bug#24408: `make check` fails for builders, build-utils, cran, derivations, elpa, gexp, grafts, hackage, monads, packages, store, ui rsiddharth
@ 2016-09-12 13:46 ` Ludovic Courtès
  2016-09-12 21:59   ` rsiddharth
  0 siblings, 1 reply; 3+ messages in thread
From: Ludovic Courtès @ 2016-09-12 13:46 UTC (permalink / raw)
  To: rsiddharth; +Cc: 24408

Hi,

rsiddharth <s@ricketyspace.net> skribis:

> actual-error:
> + (srfi-34
> +   #<condition &nix-connection-error [file: "/home/rsd/v/git/others/guix/test-tmp/var/12220/daemon-socket/socket" errno: 2] 1fb5bd0>)
> result: FAIL

2 == ENOENT (“No such file or directory”), which would mean that
guix-daemon did not start properly.

What does this return:

  ./test-env ps aux | grep guix-daemon

?

Thanks for reporting the issue!

Ludo’.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#24408: `make check` fails for builders, build-utils, cran, derivations, elpa, gexp, grafts, hackage, monads, packages, store, ui
  2016-09-12 13:46 ` Ludovic Courtès
@ 2016-09-12 21:59   ` rsiddharth
  0 siblings, 0 replies; 3+ messages in thread
From: rsiddharth @ 2016-09-12 21:59 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 24408

Hi,

>> actual-error:
>> + (srfi-34
>> +   #<condition &nix-connection-error [file: "/home/rsd/v/git/others/guix/test-tmp/var/12220/daemon-socket/socket" errno: 2] 1fb5bd0>)
>> result: FAIL
>
> 2 == ENOENT (“No such file or directory”), which would mean that
> guix-daemon did not start properly.
>
> What does this return:
>
>   ./test-env ps aux | grep guix-daemon

~/v/git/others/guix 
↳ ./test-env ps aux | grep guix-daemon
root      2193  0.0  0.0  33876   140 ?        Ss   Sep04   0:00 /gnu/store/3g6zn8y5sfwywr4pqiwqrab735a0x4zl-guix-0.10.0/bin/guix-daemon --build-users-group=guixbuild
rsd      15898  0.0  0.0  12796   924 pts/3    S+   17:54   0:00 grep guix-daemon
rsd      15906  0.0  0.0   1124     8 pts/3    D+   17:54   0:00 /home/rsd/v/git/others/guix/guix-daemon --disable-chroot --substitute-urls=file:///home/rsd/v/git/others/guix/test-tmp/var/15897/substituter-data

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-09-12 22:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-11  1:11 bug#24408: `make check` fails for builders, build-utils, cran, derivations, elpa, gexp, grafts, hackage, monads, packages, store, ui rsiddharth
2016-09-12 13:46 ` Ludovic Courtès
2016-09-12 21:59   ` rsiddharth

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).