Advertisement
Guest User

GuixSD 0.13 install failure

a guest
May 22nd, 2017
658
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 430.96 KB | None | 0 0
  1. =================================
  2.    GNU Guix : ./test-suite.log
  3. =================================
  4.  
  5. # TOTAL: 708
  6. # PASS:  674
  7. # SKIP:  32
  8. # XFAIL: 0
  9. # FAIL:  2
  10. # XPASS: 0
  11. # ERROR: 0
  12.  
  13. .. contents:: :depth: 2
  14.  
  15. SKIP: tests/base32
  16. ==================
  17.  
  18. sh: nix-hash: command not found
  19. test-name: bytevector->base32-string
  20. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/base32.scm:48
  21. source:
  22. + (test-assert
  23. +   "bytevector->base32-string"
  24. +   (fold (lambda (bv expected result)
  25. +           (and result
  26. +                (string=?
  27. +                  (bytevector->base32-string bv)
  28. +                  expected)))
  29. +         #t
  30. +         (map string->utf8
  31. +              '("" "f" "fo" "foo" "foob" "fooba" "foobar"))
  32. +         '(""
  33. +           "my"
  34. +           "mzxq"
  35. +           "mzxw6"
  36. +           "mzxw6yq"
  37. +           "mzxw6ytb"
  38. +           "mzxw6ytboi")))
  39. actual-value: #t
  40. result: PASS
  41.  
  42. test-name: base32-string->bytevector
  43. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/base32.scm:65
  44. source:
  45. + (test-assert
  46. +   "base32-string->bytevector"
  47. +   (every (lambda (bv)
  48. +            (equal?
  49. +              (base32-string->bytevector
  50. +                (bytevector->base32-string bv))
  51. +              bv))
  52. +          (map string->utf8
  53. +               '("" "f" "fo" "foo" "foob" "fooba" "foobar"))))
  54. actual-value: #t
  55. result: PASS
  56.  
  57. test-name: nix-base32-string->bytevector
  58. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/base32.scm:73
  59. source:
  60. + (test-assert
  61. +   "nix-base32-string->bytevector"
  62. +   (every (lambda (bv)
  63. +            (equal?
  64. +              (nix-base32-string->bytevector
  65. +                (bytevector->nix-base32-string bv))
  66. +              bv))
  67. +          (map string->utf8
  68. +               '("" "f" "fo" "foo" "foob" "fooba" "foobar"))))
  69. actual-value: #t
  70. result: PASS
  71.  
  72. test-name: &invalid-base32-character
  73. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/base32.scm:81
  74. source:
  75. + (test-equal
  76. +   "&invalid-base32-character"
  77. +   #\e
  78. +   (guard (c ((invalid-base32-character? c)
  79. +              (invalid-base32-character-value c)))
  80. +          (nix-base32-string->bytevector
  81. +            (string-append (make-string 51 #\a) "e"))))
  82. expected-value: #\e
  83. actual-value: #\e
  84. result: PASS
  85.  
  86. test-name: sha256 & bytevector->nix-base32-string
  87. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/base32.scm:92
  88. source:
  89. + (test-assert
  90. +   "sha256 & bytevector->nix-base32-string"
  91. +   (let ((file (search-path %load-path "tests/test.drv")))
  92. +     (equal?
  93. +       (bytevector->nix-base32-string
  94. +         (sha256
  95. +           (call-with-input-file file get-bytevector-all)))
  96. +       (let* ((c (format
  97. +                   #f
  98. +                   "~a --type sha256 --base32 --flat \"~a\""
  99. +                   %nix-hash
  100. +                   file))
  101. +              (p (open-input-pipe c))
  102. +              (l (read-line p)))
  103. +         (close-pipe p)
  104. +         l))))
  105. result: SKIP
  106.  
  107.  
  108. SKIP: tests/cpio
  109. ================
  110.  
  111. random seed for tests: 1495493959
  112. test-name: file->cpio-header + write-cpio-header + read-cpio-header
  113. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/cpio.scm:37
  114. source:
  115. + (test-assert
  116. +   "file->cpio-header + write-cpio-header + read-cpio-header"
  117. +   (let* ((file (search-path %load-path "guix.scm"))
  118. +          (header (file->cpio-header file)))
  119. +     (call-with-values
  120. +       (lambda () (open-bytevector-output-port))
  121. +       (lambda (port get-bv)
  122. +         (write-cpio-header header port)
  123. +         (let ((port (open-bytevector-input-port (get-bv))))
  124. +           (equal? header (read-cpio-header port)))))))
  125. actual-value: #t
  126. result: PASS
  127.  
  128. test-name: bit-identical to GNU cpio's output
  129. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/cpio.scm:49
  130. source:
  131. + (test-assert
  132. +   "bit-identical to GNU cpio's output"
  133. +   (call-with-temporary-output-file
  134. +     (lambda (link _)
  135. +       (delete-file link)
  136. +       (symlink "chbouib" link)
  137. +       (let ((files (cons* "/"
  138. +                           (canonicalize-path
  139. +                             (dirname (search-path %load-path "guix.scm")))
  140. +                           link
  141. +                           (map (compose
  142. +                                  canonicalize-path
  143. +                                  (cut search-path %load-path <>))
  144. +                                '("guix.scm"
  145. +                                  "guix/build/syscalls.scm"
  146. +                                  "guix/packages.scm")))))
  147. +         (call-with-temporary-output-file
  148. +           (lambda (ref-file _)
  149. +             (let ((pipe (open-pipe*
  150. +                           OPEN_WRITE
  151. +                           %cpio-program
  152. +                           "-o"
  153. +                           "-O"
  154. +                           ref-file
  155. +                           "-H"
  156. +                           "newc"
  157. +                           "--null")))
  158. +               (for-each
  159. +                 (lambda (file) (format pipe "~a\x00" file))
  160. +                 files)
  161. +               (and (zero? (close-pipe pipe))
  162. +                    (call-with-temporary-output-file
  163. +                      (lambda (file port)
  164. +                        (write-cpio-archive files port)
  165. +                        (close-port port)
  166. +                        (or (file=? ref-file file)
  167. +                            (throw 'cpio-archives-differ
  168. +                                   files
  169. +                                   ref-file
  170. +                                   file
  171. +                                   (stat:size (stat ref-file))
  172. +                                   (stat:size (stat file))))))))))))))
  173. result: SKIP
  174.  
  175.  
  176. SKIP: tests/builders
  177. ====================
  178.  
  179. random seed for tests: 1495493745
  180. test-name: url-fetch
  181. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/builders.scm:66
  182. source:
  183. + (test-assert
  184. +   "url-fetch"
  185. +   (let* ((url '("http://ftp.gnu.org/gnu/hello/hello-2.8.tar.gz"
  186. +                 "ftp://ftp.gnu.org/gnu/hello/hello-2.8.tar.gz"))
  187. +          (hash (nix-base32-string->bytevector
  188. +                  "0wqd8sjmxfskrflaxywc7gqw7sfawrfvdxd9skxawzfgyy0pzdz6"))
  189. +          (drv (url-fetch*
  190. +                 %store
  191. +                 url
  192. +                 'sha256
  193. +                 hash
  194. +                 #:guile
  195. +                 %bootstrap-guile))
  196. +          (out-path (derivation->output-path drv)))
  197. +     (and (build-derivations %store (list drv))
  198. +          (file-exists? out-path)
  199. +          (valid-path? %store out-path))))
  200. result: SKIP
  201.  
  202. test-name: url-fetch, file
  203. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/builders.scm:78
  204. source:
  205. + (test-assert
  206. +   "url-fetch, file"
  207. +   (let* ((file (search-path %load-path "guix.scm"))
  208. +          (hash (call-with-input-file file port-sha256))
  209. +          (out (url-fetch* %store file 'sha256 hash)))
  210. +     (and (file-exists? out) (valid-path? %store out))))
  211. actual-value: #t
  212. result: PASS
  213.  
  214. test-name: url-fetch, file URI
  215. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/builders.scm:85
  216. source:
  217. + (test-assert
  218. +   "url-fetch, file URI"
  219. +   (let* ((file (search-path %load-path "guix.scm"))
  220. +          (hash (call-with-input-file file port-sha256))
  221. +          (out (url-fetch*
  222. +                 %store
  223. +                 (string-append
  224. +                   "file://"
  225. +                   (canonicalize-path file))
  226. +                 'sha256
  227. +                 hash)))
  228. +     (and (file-exists? out) (valid-path? %store out))))
  229. actual-value: #t
  230. result: PASS
  231.  
  232. test-name: gnu-build-system
  233. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/builders.scm:94
  234. source:
  235. + (test-assert
  236. +   "gnu-build-system"
  237. +   (build-system? gnu-build-system))
  238. actual-value: #t
  239. result: PASS
  240.  
  241. test-name: gnu-build
  242. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/builders.scm:99
  243. source:
  244. + (test-assert
  245. +   "gnu-build"
  246. +   (let* ((url "http://ftp.gnu.org/gnu/hello/hello-2.8.tar.gz")
  247. +          (hash (nix-base32-string->bytevector
  248. +                  "0wqd8sjmxfskrflaxywc7gqw7sfawrfvdxd9skxawzfgyy0pzdz6"))
  249. +          (tarball
  250. +            (url-fetch*
  251. +              %store
  252. +              url
  253. +              'sha256
  254. +              hash
  255. +              #:guile
  256. +              %bootstrap-guile))
  257. +          (build (gnu-build
  258. +                   %store
  259. +                   "hello-2.8"
  260. +                   `(("source" ,tarball) ,@%bootstrap-inputs)
  261. +                   #:guile
  262. +                   %bootstrap-guile
  263. +                   #:search-paths
  264. +                   %bootstrap-search-paths))
  265. +          (out (derivation->output-path build)))
  266. +     (and (build-derivations
  267. +            %store
  268. +            (list (pk 'hello-drv build)))
  269. +          (valid-path? %store out)
  270. +          (file-exists? (string-append out "/bin/hello")))))
  271. result: SKIP
  272.  
  273.  
  274. SKIP: tests/derivations
  275. =======================
  276.  
  277. random seed for tests: 1495493721
  278. @ build-started /tmp/guix-tests/store/vcj9833sk577wd7qxzvmgqcfbf9b4sjz-foo.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/vc//j9833sk577wd7qxzvmgqcfbf9b4sjz-foo.drv.bz2
  279. @ build-succeeded /tmp/guix-tests/store/vcj9833sk577wd7qxzvmgqcfbf9b4sjz-foo.drv -
  280. test-name: parse & export
  281. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:87
  282. source:
  283. + (test-assert
  284. +   "parse & export"
  285. +   (let* ((f (search-path %load-path "tests/test.drv"))
  286. +          (b1 (call-with-input-file f get-bytevector-all))
  287. +          (d1 (read-derivation (open-bytevector-input-port b1)))
  288. +          (b2 (call-with-bytevector-output-port
  289. +                (cut write-derivation d1 <>)))
  290. +          (d2 (read-derivation (open-bytevector-input-port b2))))
  291. +     (and (equal? b1 b2) (equal? d1 d2))))
  292. actual-value: #t
  293. result: PASS
  294.  
  295. test-name: add-to-store, flat
  296. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:98
  297. source:
  298. + (test-assert
  299. +   "add-to-store, flat"
  300. +   (let* ((file (search-path
  301. +                  %load-path
  302. +                  "language/tree-il/spec.scm"))
  303. +          (drv (add-to-store
  304. +                 %store
  305. +                 "flat-test"
  306. +                 #f
  307. +                 "sha256"
  308. +                 file)))
  309. +     (and (eq? 'regular (stat:type (stat drv)))
  310. +          (valid-path? %store drv)
  311. +          (equal?
  312. +            (call-with-input-file file get-bytevector-all)
  313. +            (call-with-input-file drv get-bytevector-all)))))
  314. actual-value: #t
  315. result: PASS
  316.  
  317. test-name: add-to-store, recursive
  318. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:106
  319. source:
  320. + (test-assert
  321. +   "add-to-store, recursive"
  322. +   (let* ((dir (dirname
  323. +                 (search-path
  324. +                   %load-path
  325. +                   "language/tree-il/spec.scm")))
  326. +          (drv (add-to-store
  327. +                 %store
  328. +                 "dir-tree-test"
  329. +                 #t
  330. +                 "sha256"
  331. +                 dir)))
  332. +     (and (eq? 'directory (stat:type (stat drv)))
  333. +          (valid-path? %store drv)
  334. +          (equal?
  335. +            (directory-contents dir)
  336. +            (directory-contents drv)))))
  337. actual-value: #t
  338. result: PASS
  339.  
  340. test-name: derivation with no inputs
  341. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:114
  342. source:
  343. + (test-assert
  344. +   "derivation with no inputs"
  345. +   (let* ((builder
  346. +            (add-text-to-store
  347. +              %store
  348. +              "my-builder.sh"
  349. +              "echo hello, world\n"
  350. +              '()))
  351. +          (drv (derivation
  352. +                 %store
  353. +                 "foo"
  354. +                 %bash
  355. +                 `("-e" ,builder)
  356. +                 #:env-vars
  357. +                 '(("HOME" . "/homeless")))))
  358. +     (and (store-path? (derivation-file-name drv))
  359. +          (valid-path? %store (derivation-file-name drv)))))
  360. actual-value: #t
  361. result: PASS
  362.  
  363. test-name: build derivation with 1 source
  364. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:124
  365. source:
  366. + (test-assert
  367. +   "build derivation with 1 source"
  368. +   (let* ((builder
  369. +            (add-text-to-store
  370. +              %store
  371. +              "my-builder.sh"
  372. +              "echo hello, world > \"$out\"\n"
  373. +              '()))
  374. +          (drv (derivation
  375. +                 %store
  376. +                 "foo"
  377. +                 %bash
  378. +                 `(,builder)
  379. +                 #:env-vars
  380. +                 '(("HOME" . "/homeless")
  381. +                   ("zzz" . "Z!")
  382. +                   ("AAA" . "A!"))
  383. +                 #:inputs
  384. +                 `((,%bash) (,builder))))
  385. +          (succeeded?
  386. +            (build-derivations %store (list drv))))
  387. +     (and succeeded?
  388. +          (let ((path (derivation->output-path drv)))
  389. +            (and (valid-path? %store path)
  390. +                 (string=?
  391. +                   (call-with-input-file path read-line)
  392. +                   "hello, world"))))))
  393. actual-value: #t
  394. result: PASS
  395.  
  396. test-name: derivation with local file as input
  397. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:142
  398. source:
  399. + (test-assert
  400. +   "derivation with local file as input"
  401. +   (let* ((builder
  402. +            (add-text-to-store
  403. +              %store
  404. +              "my-builder.sh"
  405. +              "(while read line ; do echo \"$line\" ; done) < $in > $out"
  406. +              '()))
  407. +          (input @ build-started /tmp/guix-tests/store/fjv236z7l209d8zz9z8jxmnw3dfi8lam-derivation-with-input-file.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/fj//v236z7l209d8zz9z8jxmnw3dfi8lam-derivation-with-input-file.drv.bz2
  408. @ build-succeeded /tmp/guix-tests/store/fjv236z7l209d8zz9z8jxmnw3dfi8lam-derivation-with-input-file.drv -
  409. @ build-started /tmp/guix-tests/store/p81vnkbra9z5w45hg0hni5l3yf596ja2-fails.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/p8//1vnkbra9z5w45hg0hni5l3yf596ja2-fails.drv.bz2
  410. builder for `/tmp/guix-tests/store/p81vnkbra9z5w45hg0hni5l3yf596ja2-fails.drv' failed with exit code 1
  411. @ build-failed /tmp/guix-tests/store/p81vnkbra9z5w45hg0hni5l3yf596ja2-fails.drv - 1 builder for `/tmp/guix-tests/store/p81vnkbra9z5w45hg0hni5l3yf596ja2-fails.drv' failed with exit code 1
  412. @ build-started /tmp/guix-tests/store/kn0gx5na8k2nilq6c362bmavywnilkhq-guile-bootstrap-2.0.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/kn//0gx5na8k2nilq6c362bmavywnilkhq-guile-bootstrap-2.0.drv.bz2
  413. unpacking bootstrap Guile to '/tmp/guix-tests/store/7y0q8n6zv41lr9viybhihlcmhri6939f-guile-bootstrap-2.0'...
  414. ./
  415. ./share/
  416. ./share/guile/
  417. ./share/guile/2.0/
  418. ./share/guile/2.0/system/
  419. ./share/guile/2.0/system/xref.scm
  420. ./share/guile/2.0/system/foreign.scm
  421. ./share/guile/2.0/system/repl/
  422. ./share/guile/2.0/system/repl/error-handling.scm
  423. ./share/guile/2.0/system/repl/debug.scm
  424. ./share/guile/2.0/system/repl/describe.scm
  425. ./share/guile/2.0/system/repl/common.scm
  426. ./share/guile/2.0/system/repl/command.scm
  427. ./share/guile/2.0/system/repl/server.scm
  428. ./share/guile/2.0/system/repl/repl.scm
  429. ./share/guile/2.0/system/base/
  430. ./share/guile/2.0/system/base/lalr.upstream.scm
  431. ./share/guile/2.0/system/base/pmatch.scm
  432. ./share/guile/2.0/system/base/lalr.scm
  433. ./share/guile/2.0/system/base/language.scm
  434. ./share/guile/2.0/system/base/syntax.scm
  435. ./share/guile/2.0/system/base/compile.scm
  436. ./share/guile/2.0/system/base/ck.scm
  437. ./share/guile/2.0/system/base/message.scm
  438. ./share/guile/2.0/system/base/target.scm
  439. ./share/guile/2.0/system/vm/
  440. ./share/guile/2.0/system/vm/trace.scm
  441. ./share/guile/2.0/system/vm/trap-state.scm
  442. ./share/guile/2.0/system/vm/vm.scm
  443. ./share/guile/2.0/system/vm/coverage.scm
  444. ./share/guile/2.0/system/vm/program.scm
  445. ./share/guile/2.0/system/vm/objcode.scm
  446. ./share/guile/2.0/system/vm/traps.scm
  447. ./share/guile/2.0/system/vm/inspect.scm
  448. ./share/guile/2.0/system/vm/instruction.scm
  449. ./share/guile/2.0/system/vm/frame.scm
  450. ./share/guile/2.0/scripts/
  451. ./share/guile/2.0/scripts/scan-api.scm
  452. ./share/guile/2.0/scripts/autofrisk.scm
  453. ./share/guile/2.0/scripts/snarf-check-and-output-texi.scm
  454. ./share/guile/2.0/scripts/read-rfc822.scm
  455. ./share/guile/2.0/scripts/read-text-outline.scm
  456. ./share/guile/2.0/scripts/help.scm
  457. ./share/guile/2.0/scripts/frisk.scm
  458. ./share/guile/2.0/scripts/punify.scm
  459. ./share/guile/2.0/scripts/lint.scm
  460. ./share/guile/2.0/scripts/disassemble.scm
  461. ./share/guile/2.0/scripts/summarize-guile-TODO.scm
  462. ./share/guile/2.0/scripts/generate-autoload.scm
  463. ./share/guile/2.0/scripts/display-commentary.scm
  464. ./share/guile/2.0/scripts/compile.scm
  465. ./share/guile/2.0/scripts/api-diff.scm
  466. ./share/guile/2.0/scripts/use2dot.scm
  467. ./share/guile/2.0/scripts/doc-snarf.scm
  468. ./share/guile/2.0/scripts/read-scheme-source.scm
  469. ./share/guile/2.0/scripts/snarf-guile-m4-docs.scm
  470. ./share/guile/2.0/scripts/list.scm
  471. ./share/guile/2.0/texinfo/
  472. ./share/guile/2.0/texinfo/indexing.scm
  473. ./share/guile/2.0/texinfo/html.scm
  474. ./share/guile/2.0/texinfo/docbook.scm
  475. ./share/guile/2.0/texinfo/serialize.scm
  476. ./share/guile/2.0/texinfo/reflection.scm
  477. ./share/guile/2.0/texinfo/plain-text.scm
  478. ./share/guile/2.0/texinfo/string-utils.scm
  479. ./share/guile/2.0/ice-9/
  480. ./share/guile/2.0/ice-9/documentation.scm
  481. ./share/guile/2.0/ice-9/scm-style-repl.scm
  482. ./share/guile/2.0/ice-9/time.scm
  483. ./share/guile/2.0/ice-9/format.scm
  484. ./share/guile/2.0/ice-9/networking.scm
  485. ./share/guile/2.0/ice-9/getopt-long.scm
  486. ./share/guile/2.0/ice-9/vlist.scm
  487. ./share/guile/2.0/ice-9/psyntax.scm
  488. ./share/guile/2.0/ice-9/gap-buffer.scm
  489. ./share/guile/2.0/ice-9/and-let-star.scm
  490. ./share/guile/2.0/ice-9/posix.scm
  491. ./share/guile/2.0/ice-9/ls.scm
  492. ./share/guile/2.0/ice-9/syncase.scm
  493. ./share/guile/2.0/ice-9/save-stack.scm
  494. ./share/guile/2.0/ice-9/stack-catch.scm
  495. ./share/guile/2.0/ice-9/futures.scm
  496. ./share/guile/2.0/ice-9/debug.scm
  497. ./share/guile/2.0/ice-9/pretty-print.scm
  498. ./share/guile/2.0/ice-9/mapping.scm
  499. ./share/guile/2.0/ice-9/occam-channel.scm
  500. ./share/guile/2.0/ice-9/top-repl.scm
  501. ./share/guile/2.0/ice-9/boot-9.scm
  502. ./share/guile/2.0/ice-9/string-fun.scm
  503. ./share/guile/2.0/ice-9/i18n.scm
  504. ./share/guile/2.0/ice-9/match.upstream.scm
  505. ./share/guile/2.0/ice-9/streams.scm
  506. ./share/guile/2.0/ice-9/lineio.scm
  507. ./share/guile/2.0/ice-9/threads.scm
  508. ./share/guile/2.0/ice-9/weak-vector.scm
  509. ./share/guile/2.0/ice-9/history.scm
  510. ./share/guile/2.0/ice-9/expect.scm
  511. ./share/guile/2.0/ice-9/poll.scm
  512. ./share/guile/2.0/ice-9/popen.scm
  513. ./share/guile/2.0/ice-9/control.scm
  514. ./share/guile/2.0/ice-9/session.scm
  515. ./share/guile/2.0/ice-9/ftw.scm
  516. ./share/guile/2.0/ice-9/local-eval.scm
  517. ./share/guile/2.0/ice-9/receive.scm
  518. ./share/guile/2.0/ice-9/safe-r5rs.scm
  519. ./share/guile/2.0/ice-9/calling.scm
  520. ./share/guile/2.0/ice-9/curried-definitions.scm
  521. ./share/guile/2.0/ice-9/eval-string.scm
  522. ./share/guile/2.0/ice-9/q.scm
  523. ./share/guile/2.0/ice-9/serialize.scm
  524. ./share/guile/2.0/ice-9/quasisyntax.scm
  525. ./share/guile/2.0/ice-9/slib.scm
  526. ./share/guile/2.0/ice-9/hcons.scm
  527. ./share/guile/2.0/ice-9/rw.scm
  528. ./share/guile/2.0/ice-9/regex.scm
  529. ./share/guile/2.0/ice-9/match.scm
  530. ./share/guile/2.0/ice-9/buffered-input.scm
  531. ./share/guile/2.0/ice-9/iconv.scm
  532. ./share/guile/2.0/ice-9/poe.scm
  533. ./share/guile/2.0/ice-9/common-list.scm
  534. ./share/guile/2.0/ice-9/r5rs.scm
  535. ./share/guile/2.0/ice-9/command-line.scm
  536. ./share/guile/2.0/ice-9/deprecated.scm
  537. ./share/guile/2.0/ice-9/psyntax-pp.scm
  538. ./share/guile/2.0/ice-9/null.scm
  539. ./share/guile/2.0/ice-9/optargs.scm
  540. ./share/guile/2.0/ice-9/rdelim.scm
  541. ./share/guile/2.0/ice-9/runq.scm
  542. ./share/guile/2.0/ice-9/safe.scm
  543. ./share/guile/2.0/ice-9/channel.scm
  544. ./share/guile/2.0/ice-9/readline.scm
  545. ./share/guile/2.0/ice-9/binary-ports.scm
  546. ./share/guile/2.0/ice-9/eval.scm
  547. ./share/guile/2.0/ice-9/r4rs.scm
  548. ./share/guile/2.0/ice-9/r6rs-libraries.scm
  549. ./share/guile/2.0/ice-9/list.scm
  550. ./share/guile/2.0/language/
  551. ./share/guile/2.0/language/elisp/
  552. ./share/guile/2.0/language/elisp/compile-tree-il.scm
  553. ./share/guile/2.0/language/elisp/bindings.scm
  554. ./share/guile/2.0/language/elisp/runtime.scm
  555. ./share/guile/2.0/language/elisp/lexer.scm
  556. ./share/guile/2.0/language/elisp/spec.scm
  557. ./share/guile/2.0/language/elisp/runtime/
  558. ./share/guile/2.0/language/elisp/runtime/macros.scm
  559. ./share/guile/2.0/language/elisp/runtime/function-slot.scm
  560. ./share/guile/2.0/language/elisp/runtime/subrs.scm
  561. ./share/guile/2.0/language/elisp/runtime/value-slot.scm
  562. ./share/guile/2.0/language/elisp/parser.scm
  563. ./share/guile/2.0/language/assembly/
  564. ./share/guile/2.0/language/assembly/compile-bytecode.scm
  565. ./share/guile/2.0/language/assembly/disassemble.scm
  566. ./share/guile/2.0/language/assembly/spec.scm
  567. ./share/guile/2.0/language/assembly/decompile-bytecode.scm
  568. ./share/guile/2.0/language/scheme/
  569. ./share/guile/2.0/language/scheme/compile-tree-il.scm
  570. ./share/guile/2.0/language/scheme/decompile-tree-il.scm
  571. ./share/guile/2.0/language/scheme/spec.scm
  572. ./share/guile/2.0/language/brainfuck/
  573. ./share/guile/2.0/language/brainfuck/compile-tree-il.scm
  574. ./share/guile/2.0/language/brainfuck/compile-scheme.scm
  575. ./share/guile/2.0/language/brainfuck/spec.scm
  576. ./share/guile/2.0/language/brainfuck/parse.scm
  577. ./share/guile/2.0/language/objcode/
  578. ./share/guile/2.0/language/objcode/spec.scm
  579. ./share/guile/2.0/language/assembly.scm
  580. ./share/guile/2.0/language/bytecode/
  581. ./share/guile/2.0/language/bytecode/spec.scm
  582. ./share/guile/2.0/language/glil/
  583. ./share/guile/2.0/language/glil/spec.scm
  584. ./share/guile/2.0/language/glil/compile-assembly.scm
  585. ./share/guile/2.0/language/tree-il/
  586. ./share/guile/2.0/language/tree-il/analyze.scm
  587. ./share/guile/2.0/language/tree-il/inline.scm
  588. ./share/guile/2.0/language/tree-il/debug.scm
  589. ./share/guile/2.0/language/tree-il/primitives.scm
  590. ./share/guile/2.0/language/tree-il/optimize.scm
  591. ./share/guile/2.0/language/tree-il/fix-letrec.scm
  592. ./share/guile/2.0/language/tree-il/spec.scm
  593. ./share/guile/2.0/language/tree-il/peval.scm
  594. ./share/guile/2.0/language/tree-il/compile-glil.scm
  595. ./share/guile/2.0/language/tree-il/cse.scm
  596. ./share/guile/2.0/language/tree-il/canonicalize.scm
  597. ./share/guile/2.0/language/tree-il/effects.scm
  598. ./share/guile/2.0/language/ecmascript/
  599. ./share/guile/2.0/language/ecmascript/base.scm
  600. ./share/guile/2.0/language/ecmascript/compile-tree-il.scm
  601. ./share/guile/2.0/language/ecmascript/function.scm
  602. ./share/guile/2.0/language/ecmascript/array.scm
  603. ./share/guile/2.0/language/ecmascript/tokenize.scm
  604. ./share/guile/2.0/language/ecmascript/spec.scm
  605. ./share/guile/2.0/language/ecmascript/impl.scm
  606. ./share/guile/2.0/language/ecmascript/parse.scm
  607. ./share/guile/2.0/language/value/
  608. ./share/guile/2.0/language/value/spec.scm
  609. ./share/guile/2.0/language/glil.scm
  610. ./share/guile/2.0/language/tree-il.scm
  611. ./share/guile/2.0/rnrs.scm
  612. ./share/guile/2.0/statprof.scm
  613. ./share/guile/2.0/web/
  614. ./share/guile/2.0/web/client.scm
  615. ./share/guile/2.0/web/response.scm
  616. ./share/guile/2.0/web/uri.scm
  617. ./share/guile/2.0/web/server/
  618. ./share/guile/2.0/web/server/http.scm
  619. ./share/guile/2.0/web/request.scm
  620. ./share/guile/2.0/web/server.scm
  621. ./share/guile/2.0/web/http.scm
  622. ./share/guile/2.0/oop/
  623. ./share/guile/2.0/oop/goops.scm
  624. ./share/guile/2.0/oop/goops/
  625. ./share/guile/2.0/oop/goops/save.scm
  626. ./share/guile/2.0/oop/goops/stklos.scm
  627. ./share/guile/2.0/oop/goops/accessors.scm
  628. ./share/guile/2.0/oop/goops/describe.scm
  629. ./share/guile/2.0/oop/goops/dispatch.scm
  630. ./share/guile/2.0/oop/goops/active-slot.scm
  631. ./share/guile/2.0/oop/goops/composite-slot.scm
  632. ./share/guile/2.0/oop/goops/compile.scm
  633. ./share/guile/2.0/oop/goops/internal.scm
  634. ./share/guile/2.0/oop/goops/util.scm
  635. ./share/guile/2.0/oop/goops/simple.scm
  636. ./share/guile/2.0/guile-procedures.txt
  637. ./share/guile/2.0/texinfo.scm
  638. ./share/guile/2.0/rnrs/
  639. ./share/guile/2.0/rnrs/base.scm
  640. ./share/guile/2.0/rnrs/records/
  641. ./share/guile/2.0/rnrs/records/syntactic.scm
  642. ./share/guile/2.0/rnrs/records/inspection.scm
  643. ./share/guile/2.0/rnrs/records/procedural.scm
  644. ./share/guile/2.0/rnrs/arithmetic/
  645. ./share/guile/2.0/rnrs/arithmetic/bitwise.scm
  646. ./share/guile/2.0/rnrs/arithmetic/fixnums.scm
  647. ./share/guile/2.0/rnrs/arithmetic/flonums.scm
  648. ./share/guile/2.0/rnrs/unicode.scm
  649. ./share/guile/2.0/rnrs/enums.scm
  650. ./share/guile/2.0/rnrs/hashtables.scm
  651. ./share/guile/2.0/rnrs/control.scm
  652. ./share/guile/2.0/rnrs/syntax-case.scm
  653. ./share/guile/2.0/rnrs/sorting.scm
  654. ./share/guile/2.0/rnrs/lists.scm
  655. ./share/guile/2.0/rnrs/mutable-strings.scm
  656. ./share/guile/2.0/rnrs/conditions.scm
  657. ./share/guile/2.0/rnrs/r5rs.scm
  658. ./share/guile/2.0/rnrs/mutable-pairs.scm
  659. ./share/guile/2.0/rnrs/programs.scm
  660. ./share/guile/2.0/rnrs/exceptions.scm
  661. ./share/guile/2.0/rnrs/eval.scm
  662. ./share/guile/2.0/rnrs/files.scm
  663. ./share/guile/2.0/rnrs/io/
  664. ./share/guile/2.0/rnrs/io/ports.scm
  665. ./share/guile/2.0/rnrs/io/simple.scm
  666. ./share/guile/2.0/rnrs/bytevectors.scm
  667. ./share/guile/2.0/sxml/
  668. ./share/guile/2.0/sxml/sxml-match.ss
  669. ./share/guile/2.0/sxml/fold.scm
  670. ./share/guile/2.0/sxml/ssax.scm
  671. ./share/guile/2.0/sxml/apply-templates.scm
  672. ./share/guile/2.0/sxml/xpath.scm
  673. ./share/guile/2.0/sxml/upstream/
  674. ./share/guile/2.0/sxml/upstream/SSAX.scm
  675. ./share/guile/2.0/sxml/upstream/assert.scm
  676. ./share/guile/2.0/sxml/upstream/SXPath-old.scm
  677. ./share/guile/2.0/sxml/upstream/input-parse.scm
  678. ./share/guile/2.0/sxml/upstream/SXML-tree-trans.scm
  679. ./share/guile/2.0/sxml/transform.scm
  680. ./share/guile/2.0/sxml/match.scm
  681. ./share/guile/2.0/sxml/simple.scm
  682. ./share/guile/2.0/sxml/ssax/
  683. ./share/guile/2.0/sxml/ssax/input-parse.scm
  684. ./share/guile/2.0/srfi/
  685. ./share/guile/2.0/srfi/srfi-88.scm
  686. ./share/guile/2.0/srfi/srfi-14.scm
  687. ./share/guile/2.0/srfi/srfi-6.scm
  688. ./share/guile/2.0/srfi/srfi-67.scm
  689. ./share/guile/2.0/srfi/srfi-42/
  690. ./share/guile/2.0/srfi/srfi-42/ec.scm
  691. ./share/guile/2.0/srfi/srfi-19.scm
  692. ./share/guile/2.0/srfi/srfi-31.scm
  693. ./share/guile/2.0/srfi/srfi-41.scm
  694. ./share/guile/2.0/srfi/srfi-35.scm
  695. ./share/guile/2.0/srfi/srfi-34.scm
  696. ./share/guile/2.0/srfi/srfi-60.scm
  697. ./share/guile/2.0/srfi/srfi-18.scm
  698. ./share/guile/2.0/srfi/srfi-37.scm
  699. ./share/guile/2.0/srfi/srfi-4/
  700. ./share/guile/2.0/srfi/srfi-4/gnu.scm
  701. ./share/guile/2.0/srfi/srfi-16.scm
  702. ./share/guile/2.0/srfi/srfi-69.scm
  703. ./share/guile/2.0/srfi/srfi-17.scm
  704. ./share/guile/2.0/srfi/srfi-2.scm
  705. ./share/guile/2.0/srfi/srfi-27.scm
  706. ./share/guile/2.0/srfi/srfi-26.scm
  707. ./share/guile/2.0/srfi/srfi-8.scm
  708. ./share/guile/2.0/srfi/srfi-4.scm
  709. ./share/guile/2.0/srfi/srfi-11.scm
  710. ./share/guile/2.0/srfi/srfi-13.scm
  711. ./share/guile/2.0/srfi/srfi-67/
  712. ./share/guile/2.0/srfi/srfi-67/compare.scm
  713. ./share/guile/2.0/srfi/srfi-45.scm
  714. ./share/guile/2.0/srfi/srfi-9.scm
  715. ./share/guile/2.0/srfi/srfi-9/
  716. ./share/guile/2.0/srfi/srfi-9/gnu.scm
  717. ./share/guile/2.0/srfi/srfi-10.scm
  718. ./share/guile/2.0/srfi/srfi-42.scm
  719. ./share/guile/2.0/srfi/srfi-39.scm
  720. ./share/guile/2.0/srfi/srfi-1.scm
  721. ./share/guile/2.0/srfi/srfi-38.scm
  722. ./share/guile/2.0/srfi/srfi-98.scm
  723. ./lib/
  724. ./lib/guile/
  725. ./lib/guile/2.0/
  726. ./lib/guile/2.0/ccache/
  727. ./lib/guile/2.0/ccache/system/
  728. ./lib/guile/2.0/ccache/system/foreign.go
  729. ./lib/guile/2.0/ccache/system/repl/
  730. ./lib/guile/2.0/ccache/system/repl/command.go
  731. ./lib/guile/2.0/ccache/system/repl/error-handling.go
  732. ./lib/guile/2.0/ccache/system/repl/repl.go
  733. ./lib/guile/2.0/ccache/system/repl/debug.go
  734. ./lib/guile/2.0/ccache/system/repl/server.go
  735. ./lib/guile/2.0/ccache/system/repl/common.go
  736. ./lib/guile/2.0/ccache/system/xref.go
  737. ./lib/guile/2.0/ccache/system/base/
  738. ./lib/guile/2.0/ccache/system/base/ck.go
  739. ./lib/guile/2.0/ccache/system/base/lalr.go
  740. ./lib/guile/2.0/ccache/system/base/pmatch.go
  741. ./lib/guile/2.0/ccache/system/base/message.go
  742. ./lib/guile/2.0/ccache/system/base/syntax.go
  743. ./lib/guile/2.0/ccache/system/base/language.go
  744. ./lib/guile/2.0/ccache/system/base/target.go
  745. ./lib/guile/2.0/ccache/system/base/compile.go
  746. ./lib/guile/2.0/ccache/system/vm/
  747. ./lib/guile/2.0/ccache/system/vm/traps.go
  748. ./lib/guile/2.0/ccache/system/vm/frame.go
  749. ./lib/guile/2.0/ccache/system/vm/objcode.go
  750. ./lib/guile/2.0/ccache/system/vm/program.go
  751. ./lib/guile/2.0/ccache/system/vm/instruction.go
  752. ./lib/guile/2.0/ccache/system/vm/coverage.go
  753. ./lib/guile/2.0/ccache/system/vm/vm.go
  754. ./lib/guile/2.0/ccache/system/vm/trap-state.go
  755. ./lib/guile/2.0/ccache/system/vm/inspect.go
  756. ./lib/guile/2.0/ccache/system/vm/trace.go
  757. ./lib/guile/2.0/ccache/scripts/
  758. ./lib/guile/2.0/ccache/scripts/scan-api.go
  759. ./lib/guile/2.0/ccache/scripts/use2dot.go
  760. ./lib/guile/2.0/ccache/scripts/autofrisk.go
  761. ./lib/guile/2.0/ccache/scripts/api-diff.go
  762. ./lib/guile/2.0/ccache/scripts/read-text-outline.go
  763. ./lib/guile/2.0/ccache/scripts/punify.go
  764. ./lib/guile/2.0/ccache/scripts/snarf-guile-m4-docs.go
  765. ./lib/guile/2.0/ccache/scripts/read-scheme-source.go
  766. ./lib/guile/2.0/ccache/scripts/frisk.go
  767. ./lib/guile/2.0/ccache/scripts/summarize-guile-TODO.go
  768. ./lib/guile/2.0/ccache/scripts/lint.go
  769. ./lib/guile/2.0/ccache/scripts/display-commentary.go
  770. ./lib/guile/2.0/ccache/scripts/disassemble.go
  771. ./lib/guile/2.0/ccache/scripts/generate-autoload.go
  772. ./lib/guile/2.0/ccache/scripts/snarf-check-and-output-texi.go
  773. ./lib/guile/2.0/ccache/scripts/read-rfc822.go
  774. ./lib/guile/2.0/ccache/scripts/doc-snarf.go
  775. ./lib/guile/2.0/ccache/scripts/compile.go
  776. ./lib/guile/2.0/ccache/scripts/help.go
  777. ./lib/guile/2.0/ccache/scripts/list.go
  778. ./lib/guile/2.0/ccache/texinfo/
  779. ./lib/guile/2.0/ccache/texinfo/docbook.go
  780. ./lib/guile/2.0/ccache/texinfo/serialize.go
  781. ./lib/guile/2.0/ccache/texinfo/html.go
  782. ./lib/guile/2.0/ccache/texinfo/reflection.go
  783. ./lib/guile/2.0/ccache/texinfo/indexing.go
  784. ./lib/guile/2.0/ccache/texinfo/plain-text.go
  785. ./lib/guile/2.0/ccache/texinfo/string-utils.go
  786. ./lib/guile/2.0/ccache/ice-9/
  787. ./lib/guile/2.0/ccache/ice-9/r4rs.go
  788. ./lib/guile/2.0/ccache/ice-9/poll.go
  789. ./lib/guile/2.0/ccache/ice-9/syncase.go
  790. ./lib/guile/2.0/ccache/ice-9/common-list.go
  791. ./lib/guile/2.0/ccache/ice-9/stack-catch.go
  792. ./lib/guile/2.0/ccache/ice-9/control.go
  793. ./lib/guile/2.0/ccache/ice-9/binary-ports.go
  794. ./lib/guile/2.0/ccache/ice-9/regex.go
  795. ./lib/guile/2.0/ccache/ice-9/safe.go
  796. ./lib/guile/2.0/ccache/ice-9/buffered-input.go
  797. ./lib/guile/2.0/ccache/ice-9/boot-9.go
  798. ./lib/guile/2.0/ccache/ice-9/and-let-star.go
  799. ./lib/guile/2.0/ccache/ice-9/expect.go
  800. ./lib/guile/2.0/ccache/ice-9/gap-buffer.go
  801. ./lib/guile/2.0/ccache/ice-9/pretty-print.go
  802. ./lib/guile/2.0/ccache/ice-9/time.go
  803. ./lib/guile/2.0/ccache/ice-9/serialize.go
  804. ./lib/guile/2.0/ccache/ice-9/debug.go
  805. ./lib/guile/2.0/ccache/ice-9/rw.go
  806. ./lib/guile/2.0/ccache/ice-9/command-line.go
  807. ./lib/guile/2.0/ccache/ice-9/networking.go
  808. ./lib/guile/2.0/ccache/ice-9/posix.go
  809. ./lib/guile/2.0/ccache/ice-9/psyntax-pp.go
  810. ./lib/guile/2.0/ccache/ice-9/format.go
  811. ./lib/guile/2.0/ccache/ice-9/optargs.go
  812. ./lib/guile/2.0/ccache/ice-9/history.go
  813. ./lib/guile/2.0/ccache/ice-9/vlist.go
  814. ./lib/guile/2.0/ccache/ice-9/threads.go
  815. ./lib/guile/2.0/ccache/ice-9/safe-r5rs.go
  816. ./lib/guile/2.0/ccache/ice-9/streams.go
  817. ./lib/guile/2.0/ccache/ice-9/readline.go
  818. ./lib/guile/2.0/ccache/ice-9/slib.go
  819. ./lib/guile/2.0/ccache/ice-9/scm-style-repl.go
  820. ./lib/guile/2.0/ccache/ice-9/session.go
  821. ./lib/guile/2.0/ccache/ice-9/top-repl.go
  822. ./lib/guile/2.0/ccache/ice-9/channel.go
  823. ./lib/guile/2.0/ccache/ice-9/q.go
  824. ./lib/guile/2.0/ccache/ice-9/string-fun.go
  825. ./lib/guile/2.0/ccache/ice-9/r5rs.go
  826. ./lib/guile/2.0/ccache/ice-9/calling.go
  827. ./lib/guile/2.0/ccache/ice-9/futures.go
  828. ./lib/guile/2.0/ccache/ice-9/null.go
  829. ./lib/guile/2.0/ccache/ice-9/occam-channel.go
  830. ./lib/guile/2.0/ccache/ice-9/eval.go
  831. ./lib/guile/2.0/ccache/ice-9/receive.go
  832. ./lib/guile/2.0/ccache/ice-9/ftw.go
  833. ./lib/guile/2.0/ccache/ice-9/runq.go
  834. ./lib/guile/2.0/ccache/ice-9/rdelim.go
  835. ./lib/guile/2.0/ccache/ice-9/save-stack.go
  836. ./lib/guile/2.0/ccache/ice-9/local-eval.go
  837. ./lib/guile/2.0/ccache/ice-9/getopt-long.go
  838. ./lib/guile/2.0/ccache/ice-9/ls.go
  839. ./lib/guile/2.0/ccache/ice-9/lineio.go
  840. ./lib/guile/2.0/ccache/ice-9/i18n.go
  841. ./lib/guile/2.0/ccache/ice-9/deprecated.go
  842. ./lib/guile/2.0/ccache/ice-9/hcons.go
  843. ./lib/guile/2.0/ccache/ice-9/popen.go
  844. ./lib/guile/2.0/ccache/ice-9/curried-definitions.go
  845. ./lib/guile/2.0/ccache/ice-9/eval-string.go
  846. ./lib/guile/2.0/ccache/ice-9/match.go
  847. ./lib/guile/2.0/ccache/ice-9/weak-vector.go
  848. ./lib/guile/2.0/ccache/ice-9/poe.go
  849. ./lib/guile/2.0/ccache/ice-9/mapping.go
  850. ./lib/guile/2.0/ccache/ice-9/list.go
  851. ./lib/guile/2.0/ccache/ice-9/documentation.go
  852. ./lib/guile/2.0/ccache/ice-9/iconv.go
  853. ./lib/guile/2.0/ccache/language/
  854. ./lib/guile/2.0/ccache/language/assembly.go
  855. ./lib/guile/2.0/ccache/language/elisp/
  856. ./lib/guile/2.0/ccache/language/elisp/compile-tree-il.go
  857. ./lib/guile/2.0/ccache/language/elisp/spec.go
  858. ./lib/guile/2.0/ccache/language/elisp/parser.go
  859. ./lib/guile/2.0/ccache/language/elisp/runtime.go
  860. ./lib/guile/2.0/ccache/language/elisp/bindings.go
  861. ./lib/guile/2.0/ccache/language/elisp/lexer.go
  862. ./lib/guile/2.0/ccache/language/elisp/runtime/
  863. ./lib/guile/2.0/ccache/language/elisp/runtime/value-slot.go
  864. ./lib/guile/2.0/ccache/language/elisp/runtime/function-slot.go
  865. ./lib/guile/2.0/ccache/language/elisp/runtime/subrs.go
  866. ./lib/guile/2.0/ccache/language/elisp/runtime/macros.go
  867. ./lib/guile/2.0/ccache/language/assembly/
  868. ./lib/guile/2.0/ccache/language/assembly/decompile-bytecode.go
  869. ./lib/guile/2.0/ccache/language/assembly/spec.go
  870. ./lib/guile/2.0/ccache/language/assembly/compile-bytecode.go
  871. ./lib/guile/2.0/ccache/language/assembly/disassemble.go
  872. ./lib/guile/2.0/ccache/language/tree-il.go
  873. ./lib/guile/2.0/ccache/language/glil.go
  874. ./lib/guile/2.0/ccache/language/scheme/
  875. ./lib/guile/2.0/ccache/language/scheme/compile-tree-il.go
  876. ./lib/guile/2.0/ccache/language/scheme/spec.go
  877. ./lib/guile/2.0/ccache/language/scheme/decompile-tree-il.go
  878. ./lib/guile/2.0/ccache/language/brainfuck/
  879. ./lib/guile/2.0/ccache/language/brainfuck/compile-tree-il.go
  880. ./lib/guile/2.0/ccache/language/brainfuck/spec.go
  881. ./lib/guile/2.0/ccache/language/brainfuck/parse.go
  882. ./lib/guile/2.0/ccache/language/brainfuck/compile-scheme.go
  883. ./lib/guile/2.0/ccache/language/objcode/
  884. ./lib/guile/2.0/ccache/language/objcode/spec.go
  885. ./lib/guile/2.0/ccache/language/bytecode/
  886. ./lib/guile/2.0/ccache/language/bytecode/spec.go
  887. ./lib/guile/2.0/ccache/language/glil/
  888. ./lib/guile/2.0/ccache/language/glil/compile-assembly.go
  889. ./lib/guile/2.0/ccache/language/glil/spec.go
  890. ./lib/guile/2.0/ccache/language/tree-il/
  891. ./lib/guile/2.0/ccache/language/tree-il/debug.go
  892. ./lib/guile/2.0/ccache/language/tree-il/compile-glil.go
  893. ./lib/guile/2.0/ccache/language/tree-il/optimize.go
  894. ./lib/guile/2.0/ccache/language/tree-il/spec.go
  895. ./lib/guile/2.0/ccache/language/tree-il/canonicalize.go
  896. ./lib/guile/2.0/ccache/language/tree-il/inline.go
  897. ./lib/guile/2.0/ccache/language/tree-il/analyze.go
  898. ./lib/guile/2.0/ccache/language/tree-il/peval.go
  899. ./lib/guile/2.0/ccache/language/tree-il/cse.go
  900. ./lib/guile/2.0/ccache/language/tree-il/fix-letrec.go
  901. ./lib/guile/2.0/ccache/language/tree-il/effects.go
  902. ./lib/guile/2.0/ccache/language/tree-il/primitives.go
  903. ./lib/guile/2.0/ccache/language/ecmascript/
  904. ./lib/guile/2.0/ccache/language/ecmascript/compile-tree-il.go
  905. ./lib/guile/2.0/ccache/language/ecmascript/spec.go
  906. ./lib/guile/2.0/ccache/language/ecmascript/parse.go
  907. ./lib/guile/2.0/ccache/language/ecmascript/tokenize.go
  908. ./lib/guile/2.0/ccache/language/ecmascript/array.go
  909. ./lib/guile/2.0/ccache/language/ecmascript/impl.go
  910. ./lib/guile/2.0/ccache/language/ecmascript/function.go
  911. ./lib/guile/2.0/ccache/language/ecmascript/base.go
  912. ./lib/guile/2.0/ccache/language/value/
  913. ./lib/guile/2.0/ccache/language/value/spec.go
  914. ./lib/guile/2.0/ccache/web/
  915. ./lib/guile/2.0/ccache/web/http.go
  916. ./lib/guile/2.0/ccache/web/server/
  917. ./lib/guile/2.0/ccache/web/server/http.go
  918. ./lib/guile/2.0/ccache/web/client.go
  919. ./lib/guile/2.0/ccache/web/request.go
  920. ./lib/guile/2.0/ccache/web/server.go
  921. ./lib/guile/2.0/ccache/web/uri.go
  922. ./lib/guile/2.0/ccache/web/response.go
  923. ./lib/guile/2.0/ccache/oop/
  924. ./lib/guile/2.0/ccache/oop/goops.go
  925. ./lib/guile/2.0/ccache/oop/goops/
  926. ./lib/guile/2.0/ccache/oop/goops/composite-slot.go
  927. ./lib/guile/2.0/ccache/oop/goops/internal.go
  928. ./lib/guile/2.0/ccache/oop/goops/stklos.go
  929. ./lib/guile/2.0/ccache/oop/goops/save.go
  930. ./lib/guile/2.0/ccache/oop/goops/dispatch.go
  931. ./lib/guile/2.0/ccache/oop/goops/util.go
  932. ./lib/guile/2.0/ccache/oop/goops/active-slot.go
  933. ./lib/guile/2.0/ccache/oop/goops/simple.go
  934. ./lib/guile/2.0/ccache/oop/goops/describe.go
  935. ./lib/guile/2.0/ccache/oop/goops/compile.go
  936. ./lib/guile/2.0/ccache/oop/goops/accessors.go
  937. ./lib/guile/2.0/ccache/rnrs/
  938. ./lib/guile/2.0/ccache/rnrs/mutable-pairs.go
  939. ./lib/guile/2.0/ccache/rnrs/control.go
  940. ./lib/guile/2.0/ccache/rnrs/records/
  941. ./lib/guile/2.0/ccache/rnrs/records/procedural.go
  942. ./lib/guile/2.0/ccache/rnrs/records/syntactic.go
  943. ./lib/guile/2.0/ccache/rnrs/records/inspection.go
  944. ./lib/guile/2.0/ccache/rnrs/arithmetic/
  945. ./lib/guile/2.0/ccache/rnrs/arithmetic/fixnums.go
  946. ./lib/guile/2.0/ccache/rnrs/arithmetic/bitwise.go
  947. ./lib/guile/2.0/ccache/rnrs/arithmetic/flonums.go
  948. ./lib/guile/2.0/ccache/rnrs/enums.go
  949. ./lib/guile/2.0/ccache/rnrs/programs.go
  950. ./lib/guile/2.0/ccache/rnrs/exceptions.go
  951. ./lib/guile/2.0/ccache/rnrs/files.go
  952. ./lib/guile/2.0/ccache/rnrs/syntax-case.go
  953. ./lib/guile/2.0/ccache/rnrs/lists.go
  954. ./lib/guile/2.0/ccache/rnrs/mutable-strings.go
  955. ./lib/guile/2.0/ccache/rnrs/unicode.go
  956. ./lib/guile/2.0/ccache/rnrs/r5rs.go
  957. ./lib/guile/2.0/ccache/rnrs/hashtables.go
  958. ./lib/guile/2.0/ccache/rnrs/eval.go
  959. ./lib/guile/2.0/ccache/rnrs/conditions.go
  960. ./lib/guile/2.0/ccache/rnrs/bytevectors.go
  961. ./lib/guile/2.0/ccache/rnrs/sorting.go
  962. ./lib/guile/2.0/ccache/rnrs/base.go
  963. ./lib/guile/2.0/ccache/rnrs/io/
  964. ./lib/guile/2.0/ccache/rnrs/io/ports.go
  965. ./lib/guile/2.0/ccache/rnrs/io/simple.go
  966. ./lib/guile/2.0/ccache/sxml/
  967. ./lib/guile/2.0/ccache/sxml/transform.go
  968. ./lib/guile/2.0/ccache/sxml/ssax.go
  969. ./lib/guile/2.0/ccache/sxml/simple.go
  970. ./lib/guile/2.0/ccache/sxml/apply-templates.go
  971. ./lib/guile/2.0/ccache/sxml/xpath.go
  972. ./lib/guile/2.0/ccache/sxml/match.go
  973. ./lib/guile/2.0/ccache/sxml/fold.go
  974. ./lib/guile/2.0/ccache/sxml/ssax/
  975. ./lib/guile/2.0/ccache/sxml/ssax/input-parse.go
  976. ./lib/guile/2.0/ccache/rnrs.go
  977. ./lib/guile/2.0/ccache/srfi/
  978. ./lib/guile/2.0/ccache/srfi/srfi-4.go
  979. ./lib/guile/2.0/ccache/srfi/srfi-14.go
  980. ./lib/guile/2.0/ccache/srfi/srfi-26.go
  981. ./lib/guile/2.0/ccache/srfi/srfi-17.go
  982. ./lib/guile/2.0/ccache/srfi/srfi-27.go
  983. ./lib/guile/2.0/ccache/srfi/srfi-38.go
  984. ./lib/guile/2.0/ccache/srfi/srfi-34.go
  985. ./lib/guile/2.0/ccache/srfi/srfi-13.go
  986. ./lib/guile/2.0/ccache/srfi/srfi-41.go
  987. ./lib/guile/2.0/ccache/srfi/srfi-19.go
  988. ./lib/guile/2.0/ccache/srfi/srfi-67.go
  989. ./lib/guile/2.0/ccache/srfi/srfi-9.go
  990. ./lib/guile/2.0/ccache/srfi/srfi-2.go
  991. ./lib/guile/2.0/ccache/srfi/srfi-4/
  992. ./lib/guile/2.0/ccache/srfi/srfi-4/gnu.go
  993. ./lib/guile/2.0/ccache/srfi/srfi-60.go
  994. ./lib/guile/2.0/ccache/srfi/srfi-11.go
  995. ./lib/guile/2.0/ccache/srfi/srfi-69.go
  996. ./lib/guile/2.0/ccache/srfi/srfi-6.go
  997. ./lib/guile/2.0/ccache/srfi/srfi-37.go
  998. ./lib/guile/2.0/ccache/srfi/srfi-39.go
  999. ./lib/guile/2.0/ccache/srfi/srfi-1.go
  1000. ./lib/guile/2.0/ccache/srfi/srfi-8.go
  1001. ./lib/guile/2.0/ccache/srfi/srfi-9/
  1002. ./lib/guile/2.0/ccache/srfi/srfi-9/gnu.go
  1003. ./lib/guile/2.0/ccache/srfi/srfi-45.go
  1004. ./lib/guile/2.0/ccache/srfi/srfi-42.go
  1005. ./lib/guile/2.0/ccache/srfi/srfi-16.go
  1006. ./lib/guile/2.0/ccache/srfi/srfi-31.go
  1007. ./lib/guile/2.0/ccache/srfi/srfi-18.go
  1008. ./lib/guile/2.0/ccache/srfi/srfi-88.go
  1009. ./lib/guile/2.0/ccache/srfi/srfi-10.go
  1010. ./lib/guile/2.0/ccache/srfi/srfi-35.go
  1011. ./lib/guile/2.0/ccache/srfi/srfi-98.go
  1012. ./lib/guile/2.0/ccache/texinfo.go
  1013. ./lib/guile/2.0/ccache/statprof.go
  1014. ./bin/
  1015. ./bin/guile
  1016. guile (GNU Guile) 2.0.9
  1017. Copyright (C) 2013 Free Software Foundation, Inc.
  1018.  
  1019. License LGPLv3+: GNU LGPL 3 or later <http://gnu.org/licenses/lgpl.html>.
  1020. This is free software: you are free to change and redistribute it.
  1021. There is NO WARRANTY, to the extent permitted by law.
  1022. @ build-succeeded /tmp/guix-tests/store/kn0gx5na8k2nilq6c362bmavywnilkhq-guile-bootstrap-2.0.drv -
  1023. @ build-started /tmp/guix-tests/store/hwqvffm35c4xp24yvmamy8p5bg3j33rl-sleep-then-succeed.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/hw//qvffm35c4xp24yvmamy8p5bg3j33rl-sleep-then-succeed.drv.bz2
  1024. @ build-succeeded /tmp/guix-tests/store/hwqvffm35c4xp24yvmamy8p5bg3j33rl-sleep-then-succeed.drv -
  1025. @ build-started /tmp/guix-tests/store/nzs8yyjwcl3b3pw7yrwvshq7km0slqqg-bar.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/nz//s8yyjwcl3b3pw7yrwvshq7km0slqqg-bar.drv.bz2
  1026. @ build-succeeded /tmp/guix-tests/store/nzs8yyjwcl3b3pw7yrwvshq7km0slqqg-bar.drv -
  1027. @ build-started /tmp/guix-tests/store/7amfgi1b8y64ckydz2w6sl125ajdzh6w-foo.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/7a//mfgi1b8y64ckydz2w6sl125ajdzh6w-foo.drv.bz2
  1028. @ build-succeeded /tmp/guix-tests/store/7amfgi1b8y64ckydz2w6sl125ajdzh6w-foo.drv -
  1029. (search-path %load-path "ice-9/boot-9.scm"))
  1030. +          (input*
  1031. +            (add-to-store
  1032. +              %store
  1033. +              (basename input)
  1034. +              #t
  1035. +              "sha256"
  1036. +              input))
  1037. +          (drv (derivation
  1038. +                 %store
  1039. +                 "derivation-with-input-file"
  1040. +                 %bash
  1041. +                 `(,builder)
  1042. +                 #:env-vars
  1043. +                 `(("in" unquote input*))
  1044. +                 #:inputs
  1045. +                 `((,%bash) (,builder) (,input)))))
  1046. +     (and (build-derivations %store (list drv))
  1047. +          (valid-path?
  1048. +            %store
  1049. +            (derivation->output-path drv)))))
  1050. actual-value: #t
  1051. result: PASS
  1052.  
  1053. test-name: derivation fails but keep going
  1054. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:165
  1055. source:
  1056. + (test-assert
  1057. +   "derivation fails but keep going"
  1058. +   (with-store
  1059. +     store
  1060. +     (let* ((d1 (derivation
  1061. +                  %store
  1062. +                  "fails"
  1063. +                  %bash
  1064. +                  `("-c" "false")
  1065. +                  #:inputs
  1066. +                  `((,%bash))))
  1067. +            (d2 (build-expression->derivation
  1068. +                  %store
  1069. +                  "sleep-then-succeed"
  1070. +                  `(begin ,(random-text) (sleep 2) (mkdir %output)))))
  1071. +       (set-build-options
  1072. +         %store
  1073. +         #:use-substitutes?
  1074. +         #f
  1075. +         #:keep-going?
  1076. +         #t)
  1077. +       (guard (c ((nix-protocol-error? c)
  1078. +                  (and (= 100 (nix-protocol-error-status c))
  1079. +                       (string-contains
  1080. +                         (nix-protocol-error-message c)
  1081. +                         (derivation-file-name d1))
  1082. +                       (not (valid-path? %store (derivation->output-path d1)))
  1083. +                       (valid-path? %store (derivation->output-path d2)))))
  1084. +              (build-derivations %store (list d1 d2))
  1085. +              #f))))
  1086. actual-value: #t
  1087. result: PASS
  1088.  
  1089. test-name: identical files are deduplicated
  1090. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:192
  1091. source:
  1092. + (test-assert
  1093. +   "identical files are deduplicated"
  1094. +   (let* ((build1
  1095. +            (add-text-to-store
  1096. +              %store
  1097. +              "one.sh"
  1098. +              "echo hello, world > \"$out\"\n"
  1099. +              '()))
  1100. +          (build2
  1101. +            (add-text-to-store
  1102. +              %store
  1103. +              "two.sh"
  1104. +              "# Hey!\necho hello, world > \"$out\"\n"
  1105. +              '()))
  1106. +          (drv1 (derivation
  1107. +                  %store
  1108. +                  "foo"
  1109. +                  %bash
  1110. +                  `(,build1)
  1111. +                  #:inputs
  1112. +                  `((,%bash) (,build1))))
  1113. +          (drv2 (derivation
  1114. +                  %store
  1115. +                  "bar"
  1116. +                  %bash
  1117. +                  `(,build2)
  1118. +                  #:inputs
  1119. +                  `((,%bash) (,build2)))))
  1120. +     (and (build-derivations %store (list drv1 drv2))
  1121. +          (let ((file1 (derivation->output-path drv1))
  1122. +                (file2 (derivation->output-path drv2)))
  1123. +            (and (valid-path? %store file1)
  1124. +                 (valid-path? %store file2)
  1125. +                 (string=?
  1126. +                   (call-with-input-file file1 get-string-all)
  1127. +                   "hello, world\n")
  1128. +                 (= (stat:ino (lstat file1))
  1129. +                    (stat:ino (lstat file2))))))))
  1130. actual-value: #t
  1131. result: PASS
  1132.  
  1133. test-name: built-in-builders
  1134. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:214
  1135. source:
  1136. + (test-equal
  1137. +   "built-in-builders"
  1138. +   '("download")
  1139. +   (built-in-builders %store))
  1140. expected-value: ("download")
  1141. actual-value: ("download")
  1142. result: PASS
  1143.  
  1144. test-name: unknown built-in builder
  1145. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:218
  1146. source:
  1147. + (test-assert
  1148. +   "unknown built-in builder"
  1149. +   (let ((drv (derivation
  1150. +                %store
  1151. +                "ohoh"
  1152. +                "builtin:does-not-exist"
  1153. +                '())))
  1154. +     (guard (c ((nix-protocol-error? c)
  1155. +                (string-contains
  1156. +                  (nix-protocol-error-message c)
  1157. + @ build-started /tmp/guix-tests/store/96bncx0a55ryyvb2i6z8i6rycxwlpwhg-ohoh.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/96//bncx0a55ryyvb2i6z8i6rycxwlpwhg-ohoh.drv.bz2
  1158. error: unsupported builtin function 'does-not-exist'
  1159. builder for `/tmp/guix-tests/store/96bncx0a55ryyvb2i6z8i6rycxwlpwhg-ohoh.drv' failed with exit code 1
  1160. @ build-failed /tmp/guix-tests/store/96bncx0a55ryyvb2i6z8i6rycxwlpwhg-ohoh.drv - 1 builder for `/tmp/guix-tests/store/96bncx0a55ryyvb2i6z8i6rycxwlpwhg-ohoh.drv' failed with exit code 1
  1161. @ build-started /tmp/guix-tests/store/smca5zf1p63b4gwk8al9x7pjjca91rd6-world.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/sm//ca5zf1p63b4gwk8al9x7pjjca91rd6-world.drv.bz2
  1162.  
  1163. Starting download of /tmp/guix-tests/store/nzg78pzn9mrwl35wq0lnz925cyjcrn5x-world
  1164. From http://localhost:10500/foo/bar...
  1165.  
  1166.  bar  64B                               0B/s 00:00 [                    ]   0.0%
  1167.  bar  64B                           305KiB/s 00:00 [####################] 100.0%
  1168. @ build-succeeded /tmp/guix-tests/store/smca5zf1p63b4gwk8al9x7pjjca91rd6-world.drv -
  1169. @ build-started /tmp/guix-tests/store/v45bx2cbgz6windf4w2mjs5nlnkf88ag-world.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/v4//5bx2cbgz6windf4w2mjs5nlnkf88ag-world.drv.bz2
  1170.  
  1171. Starting download of /tmp/guix-tests/store/56l4ckplfzx8y1mcrh11h4lg027krwgc-world
  1172. From http://localhost:10500/foo/bar...
  1173.  
  1174.  bar  13B                               0B/s 00:00 [                    ]   0.0%
  1175.  bar  13B                            59KiB/s 00:00 [####################] 100.0%
  1176. output path `/tmp/guix-tests/store/56l4ckplfzx8y1mcrh11h4lg027krwgc-world' should have sha256 hash `0srnayadyaqak1i9a7az1lxpbmgq8qpx6xpmi7v93qwra0nv49x4', instead has `0a7pd3rizm1qb3kz1ad1wzrijrhwsnq3lj7qprc86zp6a6r5drk8'
  1177. @ build-failed /tmp/guix-tests/store/v45bx2cbgz6windf4w2mjs5nlnkf88ag-world.drv - 1 output path `/tmp/guix-tests/store/56l4ckplfzx8y1mcrh11h4lg027krwgc-world' should have sha256 hash `0srnayadyaqak1i9a7az1lxpbmgq8qpx6xpmi7v93qwra0nv49x4', instead has `0a7pd3rizm1qb3kz1ad1wzrijrhwsnq3lj7qprc86zp6a6r5drk8'
  1178. @ build-started /tmp/guix-tests/store/169y82wnbs4qkhccgqfm10i7zxpq1ind-will-never-be-found.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/16//9y82wnbs4qkhccgqfm10i7zxpq1ind-will-never-be-found.drv.bz2
  1179.  
  1180. Starting download of /tmp/guix-tests/store/n98dcliqml18ylfx5a4ll82rvqprwhz0-will-never-be-found
  1181. From http://localhost:10500/foo/bar...
  1182. ERROR: download failed "http://localhost:10500/foo/bar" 404 "Such is life"
  1183. failed to download "/tmp/guix-tests/store/n98dcliqml18ylfx5a4ll82rvqprwhz0-will-never-be-found" from "http://localhost:10500/foo/bar"
  1184. builder for `/tmp/guix-tests/store/169y82wnbs4qkhccgqfm10i7zxpq1ind-will-never-be-found.drv' failed to produce output path `/tmp/guix-tests/store/n98dcliqml18ylfx5a4ll82rvqprwhz0-will-never-be-found'
  1185. @ build-failed /tmp/guix-tests/store/169y82wnbs4qkhccgqfm10i7zxpq1ind-will-never-be-found.drv - 1 builder for `/tmp/guix-tests/store/169y82wnbs4qkhccgqfm10i7zxpq1ind-will-never-be-found.drv' failed to produce output path `/tmp/guix-tests/store/n98dcliqml18ylfx5a4ll82rvqprwhz0-will-never-be-found'
  1186. @ build-started /tmp/guix-tests/store/5hqvbsh3kc0mgh41rda902fk0vqjcq01-world.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/5h//qvbsh3kc0mgh41rda902fk0vqjcq01-world.drv.bz2
  1187. guix perform-download: error: /tmp/guix-tests/store/5hqvbsh3kc0mgh41rda902fk0vqjcq01-world.drv is not a fixed-output derivation
  1188. builder for `/tmp/guix-tests/store/5hqvbsh3kc0mgh41rda902fk0vqjcq01-world.drv' failed with exit code 1
  1189. @ build-failed /tmp/guix-tests/store/5hqvbsh3kc0mgh41rda902fk0vqjcq01-world.drv - 1 builder for `/tmp/guix-tests/store/5hqvbsh3kc0mgh41rda902fk0vqjcq01-world.drv' failed with exit code 1
  1190.                  "failed")))
  1191. +            (build-derivations %store (list drv))
  1192. +            #f)))
  1193. actual-value: 75
  1194. result: PASS
  1195.  
  1196. test-name: 'download' built-in builder
  1197. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:227
  1198. source:
  1199. + (test-assert
  1200. +   "'download' built-in builder"
  1201. +   (let ((text (random-text)))
  1202. +     (with-http-server
  1203. +       200
  1204. +       text
  1205. +       (let* ((drv (derivation
  1206. +                     %store
  1207. +                     "world"
  1208. +                     "builtin:download"
  1209. +                     '()
  1210. +                     #:env-vars
  1211. +                     `(("url" unquote (object->string (%local-url))))
  1212. +                     #:hash-algo
  1213. +                     'sha256
  1214. +                     #:hash
  1215. +                     (sha256 (string->utf8 text)))))
  1216. +         (and (build-derivations %store (list drv))
  1217. +              (string=?
  1218. +                (call-with-input-file
  1219. +                  (derivation->output-path drv)
  1220. +                  get-string-all)
  1221. +                text))))))
  1222. actual-value: #t
  1223. result: PASS
  1224.  
  1225. test-name: 'download' built-in builder, invalid hash
  1226. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:243
  1227. source:
  1228. + (test-assert
  1229. +   "'download' built-in builder, invalid hash"
  1230. +   (with-http-server
  1231. +     200
  1232. +     "hello, world!"
  1233. +     (let* ((drv (derivation
  1234. +                   %store
  1235. +                   "world"
  1236. +                   "builtin:download"
  1237. +                   '()
  1238. +                   #:env-vars
  1239. +                   `(("url" unquote (object->string (%local-url))))
  1240. +                   #:hash-algo
  1241. +                   'sha256
  1242. +                   #:hash
  1243. +                   (sha256 (random-bytevector 100)))))
  1244. +       (guard (c ((nix-protocol-error? c)
  1245. +                  (string-contains
  1246. +                    (nix-protocol-error-message c)
  1247. +                    "failed")))
  1248. +              (build-derivations %store (list drv))
  1249. +              #f))))
  1250. actual-value: 76
  1251. result: PASS
  1252.  
  1253. test-name: 'download' built-in builder, not found
  1254. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:258
  1255. source:
  1256. + (test-assert
  1257. +   "'download' built-in builder, not found"
  1258. +   (with-http-server
  1259. +     404
  1260. +     "not found"
  1261. +     (let* ((drv (derivation
  1262. +                   %store
  1263. +                   "will-never-be-found"
  1264. +                   "builtin:download"
  1265. +                   '()
  1266. +                   #:env-vars
  1267. +                   `(("url" unquote (object->string (%local-url))))
  1268. +                   #:hash-algo
  1269. +                   'sha256
  1270. +                   #:hash
  1271. +                   (sha256 (random-bytevector 100)))))
  1272. +       (guard (c ((nix-protocol-error? c)
  1273. +                  (string-contains
  1274. +                    (nix-protocol-error-message (pk c))
  1275. +                    "failed")))
  1276. +              (build-derivations %store (list drv))
  1277. +              #f))))
  1278.  
  1279. ;;; (#<condition &nix-protocol-error [message: "build of `/tmp/guix-tests/store/169y82wnbs4qkhccgqfm10i7zxpq1ind-will-never-be-found.drv' failed" status: 1] 1b94000>)
  1280. actual-value: 90
  1281. result: PASS
  1282.  
  1283. test-name: 'download' built-in builder, not fixed-output
  1284. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:271
  1285. source:
  1286. + (test-assert
  1287. +   "'download' built-in builder, not fixed-output"
  1288. +   (let* ((source (add-text-to-store %store "hello" "hi!"))
  1289. +          (url (string-append "file://" source))
  1290. +          (drv (derivation
  1291. +                 %store
  1292. +                 "world"
  1293. +                 "builtin:download"
  1294. +                 '()
  1295. +                 #:env-vars
  1296. +                 `(("url" unquote (object->string url))))))
  1297. +     (guard (c ((nix-protocol-error? c)
  1298. +                (string-contains
  1299. +                  (nix-protocol-error-message c)
  1300. +                  "failed")))
  1301. +            (build-derivations %store (list drv))
  1302. +            #f)))
  1303. actual-value: 76
  1304. result: PASS
  1305.  
  1306. test-name: 'download' built-in builder, check mode
  1307. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:284
  1308. source:
  1309. + (test-assert
  1310. +   "'download' built-in builder, check mode"
  1311. +   (let* ((text (random-text))
  1312. @ build-started /tmp/guix-tests/store/4qa12ysg1cfvj6z8ldlnsk48c73jyndg-world.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/4q//a12ysg1cfvj6z8ldlnsk48c73jyndg-world.drv.bz2
  1313.  
  1314. Starting download of /tmp/guix-tests/store/6fjrvl6qgrfmk4j891vjj2srnm5s1993-world
  1315. From http://localhost:10500/foo/bar...
  1316.  
  1317.  bar  64B                               0B/s 00:00 [                    ]   0.0%
  1318.  bar  64B                           293KiB/s 00:00 [####################] 100.0%
  1319. @ build-succeeded /tmp/guix-tests/store/4qa12ysg1cfvj6z8ldlnsk48c73jyndg-world.drv -
  1320. @ build-started /tmp/guix-tests/store/4qa12ysg1cfvj6z8ldlnsk48c73jyndg-world.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/4q//a12ysg1cfvj6z8ldlnsk48c73jyndg-world.drv.bz2
  1321.  
  1322. Starting download of /tmp/guix-tests/store/0ki5sxlqh77r1x4n9ra7qqiqzdl194r9-world
  1323. From http://localhost:10500/foo/bar...
  1324.  
  1325.  bar  64B                               0B/s 00:00 [                    ]   0.0%
  1326.  bar  64B                           298KiB/s 00:00 [####################] 100.0%
  1327. warning: rewriting hashes in `/tmp/guix-tests/store/6fjrvl6qgrfmk4j891vjj2srnm5s1993-world'; cross fingers
  1328. span class="sy0"> +         (drv (derivation
  1329. +                 %store
  1330. +                 "world"
  1331. +                 "builtin:download"
  1332. +                 '()
  1333. +                 #:env-vars
  1334. +                 `(("url" unquote (object->string (%local-url))))
  1335. +                 #:hash-algo
  1336. +                 'sha256
  1337. +                 #:hash
  1338. +                 (sha256 (string->utf8 text)))))
  1339. +     (and (with-http-server
  1340. +            200
  1341. +            text
  1342. +            (build-derivations %store (list drv)))
  1343. +          (with-http-server
  1344. +            200
  1345. +            text
  1346. +            (build-derivations
  1347. +              %store
  1348. +              (list drv)
  1349. +              (build-mode check)))
  1350. +          (string=?
  1351. +            (call-with-input-file
  1352. +              (derivation->output-path drv)
  1353. +              get-string-all)
  1354. +            text))))
  1355. actual-value: #t
  1356. result: PASS
  1357.  
  1358. test-name: derivation-name
  1359. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:303
  1360. source:
  1361. + (test-equal
  1362. +   "derivation-name"
  1363. +   "foo-0.0"
  1364. +   (let ((drv (derivation %store "foo-0.0" %bash '())))
  1365. +     (derivation-name drv)))
  1366. expected-value: "foo-0.0"
  1367. actual-value: "foo-0.0"
  1368. result: PASS
  1369.  
  1370. test-name: derivation-output-names
  1371. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:308
  1372. source:
  1373. + (test-equal
  1374. +   "derivation-output-names"
  1375. +   '(("out") ("bar" "chbouib"))
  1376. +   (let ((drv1 (derivation %store "foo-0.0" %bash '()))
  1377. +         (drv2 (derivation
  1378. +                 %store
  1379. +                 "foo-0.0"
  1380. +                 %bash
  1381. +                 '()
  1382. +                 #:outputs
  1383. +                 '("bar" "chbouib"))))
  1384. +     (list (derivation-output-names drv1)
  1385. +           (derivation-output-names drv2))))
  1386. expected-value: (("out") ("bar" "chbouib"))
  1387. actual-value: (("out") ("bar" "chbouib"))
  1388. result: PASS
  1389.  
  1390. test-name: offloadable-derivation?
  1391. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:316
  1392. source:
  1393. + (test-assert
  1394. +   "offloadable-derivation?"
  1395. +   (and (offloadable-derivation?
  1396. +          (derivation %store "foo" %bash '()))
  1397. +        (offloadable-derivation?
  1398. +          (derivation
  1399. +            %store
  1400. +            "foo"
  1401. +            %bash
  1402. +            '()
  1403. +            #:substitutable?
  1404. +            #f))
  1405. +        (not (offloadable-derivation?
  1406. +               (derivation
  1407. +                 %store
  1408. +                 "foo"
  1409. +                 %bash
  1410. +                 '()
  1411. +                 #:local-build?
  1412. +                 #t)))))
  1413. actual-value: #t
  1414. result: PASS
  1415.  
  1416. test-name: substitutable-derivation?
  1417. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:325
  1418. source:
  1419. + (test-assert
  1420. +   "substitutable-derivation?"
  1421. +   (and (substitutable-derivation?
  1422. +          (derivation %store "foo" %bash '()))
  1423. +        (substitutable-derivation?
  1424. +          (derivation
  1425. +            %store
  1426. +            "foo"
  1427. +            %bash
  1428. +            '()
  1429. +            #:local-build?
  1430. +            #t))
  1431. +        (not (substitutable-derivation?
  1432. +               (derivation
  1433. +                 %store
  1434. +                 "foo"
  1435. +                 %bash
  1436. +                 '()
  1437. +                 #:substitutable?
  1438. +                 #f)))))
  1439. actual-value: #t
  1440. result: PASS
  1441.  
  1442. test-name: fixed-output-derivation?
  1443. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:334
  1444. source:
  1445. + (test-assert
  1446. +   "fixed-output-derivation?"
  1447. +   (let* ((builder
  1448. +            (add-text-to-store
  1449. +              %store
  1450. +              "my-fixed-builder.sh"
  1451. +              "echo -n hello > $out"
  1452. +              '()))
  1453. +          (hash (sha256 (string->utf8 "hello")))
  1454. +          (drv (derivation
  1455. +                 %store
  1456. +                 "fixed"
  1457. +                 %bash
  1458. +                 `(,builder)
  1459. +                 #:inputs
  1460. +                 `((,builder))
  1461. +                 #:hash
  1462. +                 hash
  1463. +                 #:hash-algo
  1464. +                 'sha256)))
  1465. +     (fixed-output-derivation? drv)))
  1466. actual-value: #t
  1467. result: PASS
  1468.  
  1469. test-name: fixed-output derivation
  1470. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:344
  1471. source:
  1472. + (test-assert
  1473. +   "fixed-output derivation"
  1474. +   (let* @ build-started /tmp/guix-tests/store/k4nhzjjfk1acbcpsvm2yhxkj5jvqm59l-fixed.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/k4//nhzjjfk1acbcpsvm2yhxkj5jvqm59l-fixed.drv.bz2
  1475. @ build-succeeded /tmp/guix-tests/store/k4nhzjjfk1acbcpsvm2yhxkj5jvqm59l-fixed.drv -
  1476. @ build-started /tmp/guix-tests/store/b85qz6zrg22iilj4wcvja2w69vvzp9hy-fixed-rec.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/b8//5qz6zrg22iilj4wcvja2w69vvzp9hy-fixed-rec.drv.bz2
  1477. @ build-succeeded /tmp/guix-tests/store/b85qz6zrg22iilj4wcvja2w69vvzp9hy-fixed-rec.drv -
  1478. ((builder
  1479. +            (add-text-to-store
  1480. +              %store
  1481. +              "my-fixed-builder.sh"
  1482. +              "echo -n hello > $out"
  1483. +              '()))
  1484. +          (hash (sha256 (string->utf8 "hello")))
  1485. +          (drv (derivation
  1486. +                 %store
  1487. +                 "fixed"
  1488. +                 %bash
  1489. +                 `(,builder)
  1490. +                 #:inputs
  1491. +                 `((,builder))
  1492. +                 #:hash
  1493. +                 hash
  1494. +                 #:hash-algo
  1495. +                 'sha256))
  1496. +          (succeeded?
  1497. +            (build-derivations %store (list drv))))
  1498. +     (and succeeded?
  1499. +          (let ((p (derivation->output-path drv)))
  1500. +            (and (equal?
  1501. +                   (string->utf8 "hello")
  1502. +                   (call-with-input-file p get-bytevector-all))
  1503. +                 (bytevector? (query-path-hash %store p)))))))
  1504. actual-value: #t
  1505. result: PASS
  1506.  
  1507. test-name: fixed-output derivation: output paths are equal
  1508. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:359
  1509. source:
  1510. + (test-assert
  1511. +   "fixed-output derivation: output paths are equal"
  1512. +   (let* ((builder1
  1513. +            (add-text-to-store
  1514. +              %store
  1515. +              "fixed-builder1.sh"
  1516. +              "echo -n hello > $out"
  1517. +              '()))
  1518. +          (builder2
  1519. +            (add-text-to-store
  1520. +              %store
  1521. +              "fixed-builder2.sh"
  1522. +              "echo hey; echo -n hello > $out"
  1523. +              '()))
  1524. +          (hash (sha256 (string->utf8 "hello")))
  1525. +          (drv1 (derivation
  1526. +                  %store
  1527. +                  "fixed"
  1528. +                  %bash
  1529. +                  `(,builder1)
  1530. +                  #:hash
  1531. +                  hash
  1532. +                  #:hash-algo
  1533. +                  'sha256))
  1534. +          (drv2 (derivation
  1535. +                  %store
  1536. +                  "fixed"
  1537. +                  %bash
  1538. +                  `(,builder2)
  1539. +                  #:hash
  1540. +                  hash
  1541. +                  #:hash-algo
  1542. +                  'sha256))
  1543. +          (succeeded?
  1544. +            (build-derivations %store (list drv1 drv2))))
  1545. +     (and succeeded?
  1546. +          (equal?
  1547. +            (derivation->output-path drv1)
  1548. +            (derivation->output-path drv2)))))
  1549. actual-value: #t
  1550. result: PASS
  1551.  
  1552. test-name: fixed-output derivation, recursive
  1553. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:376
  1554. source:
  1555. + (test-assert
  1556. +   "fixed-output derivation, recursive"
  1557. +   (let* ((builder
  1558. +            (add-text-to-store
  1559. +              %store
  1560. +              "my-fixed-builder.sh"
  1561. +              "echo -n hello > $out"
  1562. +              '()))
  1563. +          (hash (sha256 (string->utf8 "hello")))
  1564. +          (drv (derivation
  1565. +                 %store
  1566. +                 "fixed-rec"
  1567. +                 %bash
  1568. +                 `(,builder)
  1569. +                 #:inputs
  1570. +                 `((,builder))
  1571. +                 #:hash
  1572. +                 (base32
  1573. +                   "0sg9f58l1jj88w6pdrfdpj5x9b1zrwszk84j81zvby36q9whhhqa")
  1574. +                 #:hash-algo
  1575. +                 'sha256
  1576. +                 #:recursive?
  1577. +                 #t))
  1578. +          (succeeded?
  1579. +            (build-derivations %store (list drv))))
  1580. +     (and succeeded?
  1581. +          (let ((p (derivation->output-path drv)))
  1582. +            (and (equal?
  1583. +                   (string->utf8 "hello")
  1584. +                   (call-with-input-file p get-bytevector-all))
  1585. +                 (bytevector? (query-path-hash %store p)))))))
  1586. actual-value: #t
  1587. result: PASS
  1588.  
  1589. test-name: derivation with a fixed-output input
  1590. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:393
  1591. source:
  1592. + (test-assert
  1593. +   "derivation with a fixed-output input"
  1594. +   (let* ((builder1
  1595. +            (add-text-to-store
  1596. +              %store
  1597. +              "fixed-builder1.sh"
  1598. +              "echo -n hello > $out"
  1599. +              '()))
  1600. +          (builder2
  1601. +            (add-text-to-store
  1602. +              %store
  1603. +              "fixed-builder2.sh"
  1604. +              "echo hey; echo -n hello > $out"
  1605. +              '()))
  1606. +          (hash (sha256 (string->utf8 "hello")))
  1607. +          (fixed1
  1608. +            (derivation
  1609. + @ build-started /tmp/guix-tests/store/2q3q6qs3wvi5d5v807lgn76ab0q4341v-final.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/2q//3q6qs3wvi5d5v807lgn76ab0q4341v-final.drv.bz2
  1610. /tmp/guix-tests/store/7bdcga4xc915pgzf524xhjk677521whr-fixed
  1611. @ build-succeeded /tmp/guix-tests/store/2q3q6qs3wvi5d5v807lgn76ab0q4341v-final.drv -
  1612. @ build-started /tmp/guix-tests/store/jgsbqbf10dnfyjmyjsphx715znbn8rhv-fixed.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/jg//sbqbf10dnfyjmyjsphx715znbn8rhv-fixed.drv.bz2
  1613. @ build-succeeded /tmp/guix-tests/store/jgsbqbf10dnfyjmyjsphx715znbn8rhv-fixed.drv -
  1614. @ build-started /tmp/guix-tests/store/1s96ljyrlllvp5b91s56i5hdy2chhyw2-fixed.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/1s//96ljyrlllvp5b91s56i5hdy2chhyw2-fixed.drv.bz2
  1615. @ build-succeeded /tmp/guix-tests/store/1s96ljyrlllvp5b91s56i5hdy2chhyw2-fixed.drv -
  1616.              %store
  1617. +              "fixed"
  1618. +              %bash
  1619. +              `(,builder1)
  1620. +              #:hash
  1621. +              hash
  1622. +              #:hash-algo
  1623. +              'sha256))
  1624. +          (fixed2
  1625. +            (derivation
  1626. +              %store
  1627. +              "fixed"
  1628. +              %bash
  1629. +              `(,builder2)
  1630. +              #:hash
  1631. +              hash
  1632. +              #:hash-algo
  1633. +              'sha256))
  1634. +          (fixed-out (derivation->output-path fixed1))
  1635. +          (builder3
  1636. +            (add-text-to-store
  1637. +              %store
  1638. +              "final-builder.sh"
  1639. +              "echo $in ; (read -u 3 c; echo $c) 3< $in > $out"
  1640. +              '()))
  1641. +          (final1
  1642. +            (derivation
  1643. +              %store
  1644. +              "final"
  1645. +              %bash
  1646. +              `(,builder3)
  1647. +              #:env-vars
  1648. +              `(("in" unquote fixed-out))
  1649. +              #:inputs
  1650. +              `((,%bash) (,builder3) (,fixed1))))
  1651. +          (final2
  1652. +            (derivation
  1653. +              %store
  1654. +              "final"
  1655. +              %bash
  1656. +              `(,builder3)
  1657. +              #:env-vars
  1658. +              `(("in" unquote fixed-out))
  1659. +              #:inputs
  1660. +              `((,%bash) (,builder3) (,fixed2))))
  1661. +          (succeeded?
  1662. +            (build-derivations %store (list final1 final2))))
  1663. +     (and succeeded?
  1664. +          (equal?
  1665. +            (derivation->output-path final1)
  1666. +            (derivation->output-path final2)))))
  1667. actual-value: #t
  1668. result: PASS
  1669.  
  1670. test-name: multiple-output derivation
  1671. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:427
  1672. source:
  1673. + (test-assert
  1674. +   "multiple-output derivation"
  1675. +   (let* ((builder
  1676. +            (add-text-to-store
  1677. +              %store
  1678. +              "my-fixed-builder.sh"
  1679. +              "echo one > $out ; echo two > $second"
  1680. +              '()))
  1681. +          (drv (derivation
  1682. +                 %store
  1683. +                 "fixed"
  1684. +                 %bash
  1685. +                 `(,builder)
  1686. +                 #:env-vars
  1687. +                 '(("HOME" . "/homeless")
  1688. +                   ("zzz" . "Z!")
  1689. +                   ("AAA" . "A!"))
  1690. +                 #:inputs
  1691. +                 `((,%bash) (,builder))
  1692. +                 #:outputs
  1693. +                 '("out" "second")))
  1694. +          (succeeded?
  1695. +            (build-derivations %store (list drv))))
  1696. +     (and succeeded?
  1697. +          (let ((one (derivation->output-path drv "out"))
  1698. +                (two (derivation->output-path drv "second")))
  1699. +            (and (lset= equal?
  1700. +                        (derivation->output-paths drv)
  1701. +                        `(("out" unquote one) ("second" unquote two)))
  1702. +                 (eq? 'one (call-with-input-file one read))
  1703. +                 (eq? 'two (call-with-input-file two read)))))))
  1704. actual-value: #t
  1705. result: PASS
  1706.  
  1707. test-name: multiple-output derivation, non-alphabetic order
  1708. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:448
  1709. source:
  1710. + (test-assert
  1711. +   "multiple-output derivation, non-alphabetic order"
  1712. +   (let* ((builder
  1713. +            (add-text-to-store
  1714. +              %store
  1715. +              "my-fixed-builder.sh"
  1716. +              "echo one > $out ; echo two > $AAA"
  1717. +              '()))
  1718. +          (drv (derivation
  1719. +                 %store
  1720. +                 "fixed"
  1721. +                 %bash
  1722. +                 `(,builder)
  1723. +                 #:inputs
  1724. +                 `((,%bash) (,builder))
  1725. +                 #:outputs
  1726. +                 '("out" "AAA")))
  1727. +          (succeeded?
  1728. +            (build-derivations %store (list drv))))
  1729. +     (and succeeded?
  1730. +          (let ((one (derivation->output-path drv "out"))
  1731. +                (two (derivation->output-path drv "AAA")))
  1732. +            (and (eq? 'one (call-with-input-file one read))
  1733. +                 (eq? 'two (call-with-input-file two read)))))))
  1734. actual-value: #t
  1735. result: PASS
  1736.  
  1737. test-name: read-derivation vs. derivation
  1738. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:465
  1739. source:
  1740. + (test-assert
  1741. +   "read-derivation vs. derivation"
  1742. +   (let* ((sources
  1743. +            (unfold
  1744. +              (cut >= <> 10)
  1745. +              (lambda (n)
  1746. +                (add-text-to-store
  1747. +                  %store
  1748. +                  (format #f "input~a" n)
  1749. +                  (random-text)))
  1750. +              #{1+}#
  1751. +              0))
  1752. +          (inputs
  1753. +            (map (lambda (file)
  1754. +                   (derivation
  1755. +                     %store
  1756. +                     "derivation-input"
  1757. +                     %bash
  1758. +                     '()
  1759. +                     #:inputs
  1760. +                     `((,%bash) (,file))))
  1761. +                 sources))
  1762. +          (builder
  1763. +            (add-text-to-store
  1764. +              %store
  1765. +              "builder.sh"
  1766. +              "echo one > $one ; echo two > $two"
  1767. +              '()))
  1768. +          (drv (derivation
  1769. +                 %store
  1770. +                 "derivation"
  1771. +                 %bash
  1772. +                 `(,builder)
  1773. +                 #:inputs
  1774. +                 `((,%bash)
  1775. +                   (,builder)
  1776. +                   ,@(map list (append sources inputs)))
  1777. +                 #:outputs
  1778. +                 '("two" "one")))
  1779. +          (drv* (call-with-input-file
  1780. +                  (derivation-file-name drv)
  1781. +                  read-derivation)))
  1782. +     (equal? drv* drv)))
  1783. actual-value: #t
  1784. result: PASS
  1785.  
  1786. test-name: multiple-output derivation, derivation-path->output-path
  1787. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:492
  1788. source:
  1789. + (test-assert
  1790. +   "multiple-output derivation, derivation-path->output-path"
  1791. +   (let* ((builder
  1792. +            (add-text-to-store
  1793. +              %store
  1794. +              "builder.sh"
  1795. +              "echo one > $out ; echo two > $second"
  1796. +              '()))
  1797. +          (drv (derivation
  1798. +                 %store
  1799. +                 "multiple"
  1800. +                 %bash
  1801. +                 `(,builder)
  1802. +                 #:outputs
  1803. +                 '("out" "second")))
  1804. +          (drv-file (derivation-file-name drv))
  1805. +          (one (derivation->output-path drv "out"))
  1806. +          (two (derivation->output-path drv "second"))
  1807. +          (first (derivation-path->output-path drv-file "out"))
  1808. +          (second
  1809. +            (derivation-path->output-path drv-file "second")))
  1810. +     (and (not (string=? one two))
  1811. +          (string-suffix? "-second" two)
  1812. +          (string=? first one)
  1813. +          (string=? second two))))
  1814. actual-value: #t
  1815. result: PASS
  1816.  
  1817. test-name: user of multiple-output derivation
  1818. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:509
  1819. source:
  1820. + (test-assert
  1821. +   "user of multiple-output derivation"
  1822. +   (let* ((builder1
  1823. +            (add-text-to-store
  1824. +              %store
  1825. +              "my-mo-builder.sh"
  1826. +              "echo one > $out ; echo two > $two"
  1827. +              '()))
  1828. +          (mdrv (derivation
  1829. +                  %store
  1830. +                  "multiple-output"
  1831. +                  %bash
  1832. +                  `(,builder1)
  1833. +                  #:inputs
  1834. +                  `((,%bash) (,builder1))
  1835. +                  #:outputs
  1836. +                  '("out" "two")))
  1837. +          (builder2
  1838. +            (add-text-to-store
  1839. +              %store
  1840. +              "my-mo-user-builder.sh"
  1841. +              "read x < $one;\n                                         read y < $two;\n                                         echo \"($x $y)\" > $out"
  1842. +              '()))
  1843. +          (udrv (derivation
  1844. +                  %store
  1845. +                  "multiple-output-user"
  1846. +                  %bash
  1847. +                  `(,builder2)
  1848. +                  #:env-vars
  1849. +                  `(("one"
  1850. +                     unquote
  1851. +                     (derivation->output-path mdrv "out"))
  1852. +                    ("two"
  1853. +                     unquote
  1854. +                     (derivation->output-path mdrv "two")))
  1855. +                  #:inputs
  1856. +                  `((,%bash) (,builder2) (,mdrv) (,mdrv "two")))))
  1857. +     (and (build-derivations %store (list (pk 'udrv udrv)))
  1858. +          (let ((p (derivation->output-path udrv)))
  1859. +            (and (valid-path? %store p)
  1860. +                 (equal? '(one two) (call-with-input-file p read)))))))
  1861.  
  1862. ;;; (udrv #<derivation /tmp/guix-tests/store/d1iq16cxzglxwmv478pk9viic0vm0ca2-multiple-output-user.drv => @ build-started /tmp/guix-tests/store/iryf8h5akyy02qd3dd9ps1ka026cyanz-multiple-output.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/ir//yf8h5akyy02qd3dd9ps1ka026cyanz-multiple-output.drv.bz2
  1863. @ build-succeeded /tmp/guix-tests/store/iryf8h5akyy02qd3dd9ps1ka026cyanz-multiple-output.drv -
  1864. @ build-started /tmp/guix-tests/store/d1iq16cxzglxwmv478pk9viic0vm0ca2-multiple-output-user.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/d1//iq16cxzglxwmv478pk9viic0vm0ca2-multiple-output-user.drv.bz2
  1865. @ build-succeeded /tmp/guix-tests/store/d1iq16cxzglxwmv478pk9viic0vm0ca2-multiple-output-user.drv -
  1866. @ build-started /tmp/guix-tests/store/mbi7gj0nlckkz5xchza6rl5vwsnybh73-closure-graphs.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/mb//i7gj0nlckkz5xchza6rl5vwsnybh73-closure-graphs.drv.bz2
  1867. @ build-succeeded /tmp/guix-tests/store/mbi7gj0nlckkz5xchza6rl5vwsnybh73-closure-graphs.drv -
  1868. @ build-started /tmp/guix-tests/store/q4wh93j1i84snrx51al231wnj4g5i99b-allowed.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/q4//wh93j1i84snrx51al231wnj4g5i99b-allowed.drv.bz2
  1869. @ build-succeeded /tmp/guix-tests/store/q4wh93j1i84snrx51al231wnj4g5i99b-allowed.drv -
  1870. @ build-started /tmp/guix-tests/store/nxjmh1ipl69ak2x01igkqr2m0qg312bs-disallowed.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/nx//jmh1ipl69ak2x01igkqr2m0qg312bs-disallowed.drv.bz2
  1871. output (`/tmp/guix-tests/store/sjsz32mf9z3nwz33v72l68x0l3m4gdy0-disallowed') is not allowed to refer to path `/tmp/guix-tests/store/bdx3lhq3793i8lz6fvldrp917ba52v1v-foo'
  1872. @ build-failed /tmp/guix-tests/store/nxjmh1ipl69ak2x01igkqr2m0qg312bs-disallowed.drv - 1 output (`/tmp/guix-tests/store/sjsz32mf9z3nwz33v72l68x0l3m4gdy0-disallowed') is not allowed to refer to path `/tmp/guix-tests/store/bdx3lhq3793i8lz6fvldrp917ba52v1v-foo'
  1873. /tmp/guix-tests/store/01sib6yydjyifqm8is82l8q4xr6g84lx-multiple-output-user 1d7c8c0>)
  1874. actual-value: #t
  1875. result: PASS
  1876.  
  1877. test-name: derivation with #:references-graphs
  1878. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:542
  1879. source:
  1880. + (test-assert
  1881. +   "derivation with #:references-graphs"
  1882. +   (let* ((input1
  1883. +            (add-text-to-store
  1884. +              %store
  1885. +              "foo"
  1886. +              "hello"
  1887. +              (list %bash)))
  1888. +          (input2
  1889. +            (add-text-to-store
  1890. +              %store
  1891. +              "bar"
  1892. +              (number->string (random 7777))
  1893. +              (list input1)))
  1894. +          (builder
  1895. +            (add-text-to-store
  1896. +              %store
  1897. +              "build-graph"
  1898. +              (format
  1899. +                #f
  1900. +                "\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"
  1901. +                %mkdir)
  1902. +              (list %mkdir)))
  1903. +          (drv (derivation
  1904. +                 %store
  1905. +                 "closure-graphs"
  1906. +                 %bash
  1907. +                 `(,builder)
  1908. +                 #:references-graphs
  1909. +                 `(("bash" unquote %bash)
  1910. +                   ("input1" unquote input1)
  1911. +                   ("input2" unquote input2))
  1912. +                 #:inputs
  1913. +                 `((,%bash) (,builder))))
  1914. +          (out (derivation->output-path drv)))
  1915. +     (define (deps path . deps)
  1916. +       (let ((count (length deps)))
  1917. +         (string-append
  1918. +           path
  1919. +           "\n\n"
  1920. +           (number->string count)
  1921. +           "\n"
  1922. +           (string-join (sort deps string<?) "\n")
  1923. +           (if (zero? count) "" "\n"))))
  1924. +     (and (build-derivations %store (list drv))
  1925. +          (equal?
  1926. +            (directory-contents out get-string-all)
  1927. +            `(("/bash" unquote (string-append %bash "\n\n0\n"))
  1928. +              ("/input1"
  1929. +               unquote
  1930. +               (if (string>? input1 %bash)
  1931. +                 (string-append (deps %bash) (deps input1 %bash))
  1932. +                 (string-append (deps input1 %bash) (deps %bash))))
  1933. +              ("/input2"
  1934. +               unquote
  1935. +               (string-concatenate
  1936. +                 (map cdr
  1937. +                      (sort (map (lambda (p d) (cons p (apply deps p d)))
  1938. +                                 (list %bash input1 input2)
  1939. +                                 (list '() (list %bash) (list input1)))
  1940. +                            (lambda (x y)
  1941. +                              (match x
  1942. +                                     ((p1 . _)
  1943. +                                      (match y
  1944. +                                             ((p2 . _)
  1945. +                                              (string<? p1 p2)))))))))))))))
  1946. actual-value: #t
  1947. result: PASS
  1948.  
  1949. test-name: derivation #:allowed-references, ok
  1950. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:592
  1951. source:
  1952. + (test-assert
  1953. +   "derivation #:allowed-references, ok"
  1954. +   (let ((drv (derivation
  1955. +                %store
  1956. +                "allowed"
  1957. +                %bash
  1958. +                '("-c" "echo hello > $out")
  1959. +                #:inputs
  1960. +                `((,%bash))
  1961. +                #:allowed-references
  1962. +                '())))
  1963. +     (build-derivations %store (list drv))))
  1964. actual-value: #t
  1965. result: PASS
  1966.  
  1967. test-name: derivation #:allowed-references, not allowed
  1968. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:599
  1969. source:
  1970. + (test-assert
  1971. +   "derivation #:allowed-references, not allowed"
  1972. +   (let* ((txt (add-text-to-store %store "foo" "Hello, world."))
  1973. +          (drv (derivation
  1974. +                 %store
  1975. +                 "disallowed"
  1976. +                 %bash
  1977. +                 `("-c" ,(string-append "echo " txt "> $out"))
  1978. +                 #:inputs
  1979. +                 `((,%bash) (,txt))
  1980. +                 #:allowed-references
  1981. +                 '())))
  1982. +     (guard (c ((nix-protocol-error? c) #t))
  1983. +            (build-derivations %store (list drv))
  1984. +            #f)))
  1985. actual-value: #t
  1986. result: PASS
  1987.  
  1988. test-name: @ build-started /tmp/guix-tests/store/gn8l3dbhnpjd4xnaq16jnigicb2yqv68-allowed.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/gn//8l3dbhnpjd4xnaq16jnigicb2yqv68-allowed.drv.bz2
  1989. @ build-succeeded /tmp/guix-tests/store/gn8l3dbhnpjd4xnaq16jnigicb2yqv68-allowed.drv -
  1990. @ build-started /tmp/guix-tests/store/wi2xv7yipw4nx5xls95bygbj7dl62ml8-disallowed.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/wi//2xv7yipw4nx5xls95bygbj7dl62ml8-disallowed.drv.bz2
  1991. output (`/tmp/guix-tests/store/x16606f0yf78viwdwhzcgvqcm8p8m1zf-disallowed') is not allowed to refer to path `/tmp/guix-tests/store/x16606f0yf78viwdwhzcgvqcm8p8m1zf-disallowed'
  1992. @ build-failed /tmp/guix-tests/store/wi2xv7yipw4nx5xls95bygbj7dl62ml8-disallowed.drv - 1 output (`/tmp/guix-tests/store/x16606f0yf78viwdwhzcgvqcm8p8m1zf-disallowed') is not allowed to refer to path `/tmp/guix-tests/store/x16606f0yf78viwdwhzcgvqcm8p8m1zf-disallowed'
  1993. @ build-started /tmp/guix-tests/store/vbnwanpq295lszpzd9x5rw8gyvzdai6f-disallowed.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/vb//nwanpq295lszpzd9x5rw8gyvzdai6f-disallowed.drv.bz2
  1994. @ build-succeeded /tmp/guix-tests/store/vbnwanpq295lszpzd9x5rw8gyvzdai6f-disallowed.drv -
  1995. @ build-started /tmp/guix-tests/store/cbw7ax1vdz8i453gibbky564xs1iggmr-disdisallowed.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/cb//w7ax1vdz8i453gibbky564xs1iggmr-disdisallowed.drv.bz2
  1996. output (`/tmp/guix-tests/store/lnay1n74vhpqndqwd4r7k439xw98kd2a-disdisallowed') is not allowed to refer to path `/tmp/guix-tests/store/bdx3lhq3793i8lz6fvldrp917ba52v1v-foo'
  1997. @ build-failed /tmp/guix-tests/store/cbw7ax1vdz8i453gibbky564xs1iggmr-disdisallowed.drv - 1 output (`/tmp/guix-tests/store/lnay1n74vhpqndqwd4r7k439xw98kd2a-disdisallowed') is not allowed to refer to path `/tmp/guix-tests/store/bdx3lhq3793i8lz6fvldrp917ba52v1v-foo'
  1998. @ build-started /tmp/guix-tests/store/h9mpwgprl6b5b966ravblk34ffy4qaq0-leaked-env-vars.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/h9//mpwgprl6b5b966ravblk34ffy4qaq0-leaked-env-vars.drv.bz2
  1999. @ build-succeeded /tmp/guix-tests/store/h9mpwgprl6b5b966ravblk34ffy4qaq0-leaked-env-vars.drv -
  2000. derivation #:allowed-references, self allowed
  2001. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:611
  2002. source:
  2003. + (test-assert
  2004. +   "derivation #:allowed-references, self allowed"
  2005. +   (let ((drv (derivation
  2006. +                %store
  2007. +                "allowed"
  2008. +                %bash
  2009. +                '("-c" "echo $out > $out")
  2010. +                #:inputs
  2011. +                `((,%bash))
  2012. +                #:allowed-references
  2013. +                '("out"))))
  2014. +     (build-derivations %store (list drv))))
  2015. actual-value: #t
  2016. result: PASS
  2017.  
  2018. test-name: derivation #:allowed-references, self not allowed
  2019. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:618
  2020. source:
  2021. + (test-assert
  2022. +   "derivation #:allowed-references, self not allowed"
  2023. +   (let ((drv (derivation
  2024. +                %store
  2025. +                "disallowed"
  2026. +                %bash
  2027. +                `("-c" ,"echo $out > $out")
  2028. +                #:inputs
  2029. +                `((,%bash))
  2030. +                #:allowed-references
  2031. +                '())))
  2032. +     (guard (c ((nix-protocol-error? c) #t))
  2033. +            (build-derivations %store (list drv))
  2034. +            #f)))
  2035. actual-value: #t
  2036. result: PASS
  2037.  
  2038. test-name: derivation #:disallowed-references, ok
  2039. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:629
  2040. source:
  2041. + (test-assert
  2042. +   "derivation #:disallowed-references, ok"
  2043. +   (let ((drv (derivation
  2044. +                %store
  2045. +                "disallowed"
  2046. +                %bash
  2047. +                '("-c" "echo hello > $out")
  2048. +                #:inputs
  2049. +                `((,%bash))
  2050. +                #:disallowed-references
  2051. +                '("out"))))
  2052. +     (build-derivations %store (list drv))))
  2053. actual-value: #t
  2054. result: PASS
  2055.  
  2056. test-name: derivation #:disallowed-references, not ok
  2057. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:636
  2058. source:
  2059. + (test-assert
  2060. +   "derivation #:disallowed-references, not ok"
  2061. +   (let* ((txt (add-text-to-store %store "foo" "Hello, world."))
  2062. +          (drv (derivation
  2063. +                 %store
  2064. +                 "disdisallowed"
  2065. +                 %bash
  2066. +                 `("-c" ,(string-append "echo " txt "> $out"))
  2067. +                 #:inputs
  2068. +                 `((,%bash) (,txt))
  2069. +                 #:disallowed-references
  2070. +                 (list txt))))
  2071. +     (guard (c ((nix-protocol-error? c) #t))
  2072. +            (build-derivations %store (list drv))
  2073. +            #f)))
  2074. actual-value: #t
  2075. result: PASS
  2076.  
  2077. test-name: derivation #:leaked-env-vars
  2078. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:651
  2079. source:
  2080. + (test-equal
  2081. +   "derivation #:leaked-env-vars"
  2082. +   (getenv "NIX_STATE_DIR")
  2083. +   (let* ((value (getenv "NIX_STATE_DIR"))
  2084. +          (drv (derivation
  2085. +                 %store
  2086. +                 "leaked-env-vars"
  2087. +                 %bash
  2088. +                 '("-c" "echo -n $NIX_STATE_DIR > $out")
  2089. +                 #:hash
  2090. +                 (sha256 (string->utf8 value))
  2091. +                 #:hash-algo
  2092. +                 'sha256
  2093. +                 #:inputs
  2094. +                 `((,%bash))
  2095. +                 #:leaked-env-vars
  2096. +                 '("NIX_STATE_DIR"))))
  2097. +     (and (build-derivations %store (list drv))
  2098. +          (call-with-input-file
  2099. +            (derivation->output-path drv)
  2100. +            get-string-all))))
  2101. expected-value: "/tmp/guix-tests/var/11678"
  2102. actual-value: "/tmp/guix-tests/var/11678"
  2103. result: PASS
  2104.  
  2105. test-name: build derivation with coreutils
  2106. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:672
  2107. source:
  2108. + (test-assert
  2109. +   "build derivation with coreutils"
  2110. +   (let* ((builder
  2111. +            (add-text-to-store
  2112. +              %store
  2113. +              "build-with-coreutils.sh"
  2114. +              "echo $PATH ; mkdir --version ; mkdir $out ; touch $out/good"
  2115. +              '()))
  2116. +          (drv (derivation
  2117. +                 %store
  2118. +                 "foo"
  2119. +                 %bash
  2120. +                 `(,builder)
  2121. +                 #:env-vars
  2122. +                 `(("PATH"
  2123. +                    unquote
  2124. +                    (string-append
  2125. +                      (derivation->output-path %coreutils)
  2126. + @ build-started /tmp/guix-tests/store/9d7mw11w6hmhnzq7ns8fl91plvyyimpj-a.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/9d//7mw11w6hmhnzq7ns8fl91plvyyimpj-a.drv.bz2
  2127. @ build-succeeded /tmp/guix-tests/store/9d7mw11w6hmhnzq7ns8fl91plvyyimpj-a.drv -
  2128.                      "/bin")))
  2129. +                 #:inputs
  2130. +                 `((,builder) (,%coreutils))))
  2131. +          (succeeded?
  2132. +            (build-derivations %store (list drv))))
  2133. +     (and succeeded?
  2134. +          (let ((p (derivation->output-path drv)))
  2135. +            (and (valid-path? %store p)
  2136. +                 (file-exists? (string-append p "/good")))))))
  2137. result: SKIP
  2138.  
  2139. test-name: build-expression->derivation and invalid module name
  2140. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:695
  2141. source:
  2142. + (test-equal
  2143. +   "build-expression->derivation and invalid module name"
  2144. +   '(file-search-error
  2145. +      "guix/module/that/does/not/exist.scm")
  2146. +   (guard (c ((file-search-error? c)
  2147. +              (list 'file-search-error
  2148. +                    (file-search-error-file-name c))))
  2149. +          (build-expression->derivation
  2150. +            %store
  2151. +            "foo"
  2152. +            #t
  2153. +            #:modules
  2154. +            '((guix module that does not exist)))))
  2155. expected-value: (file-search-error "guix/module/that/does/not/exist.scm")
  2156. actual-value: (file-search-error "guix/module/that/does/not/exist.scm")
  2157. result: PASS
  2158.  
  2159. test-name: build-expression->derivation and builder encoding
  2160. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:704
  2161. source:
  2162. + (test-equal
  2163. +   "build-expression->derivation and builder encoding"
  2164. +   '("UTF-8" #t)
  2165. +   (let* ((exp '(λ (α) (+ α 1)))
  2166. +          (drv (build-expression->derivation %store "foo" exp)))
  2167. +     (match (derivation-builder-arguments drv)
  2168. +            ((... builder)
  2169. +             (with-fluids
  2170. +               ((%default-port-encoding "UTF-8"))
  2171. +               (call-with-input-file
  2172. +                 builder
  2173. +                 (lambda (port)
  2174. +                   (list (port-encoding port)
  2175. +                         (->bool
  2176. +                           (string-contains
  2177. +                             (get-string-all port)
  2178. +                             "(λ (α) (+ α 1))"))))))))))
  2179. expected-value: ("UTF-8" #t)
  2180. actual-value: ("UTF-8" #t)
  2181. result: PASS
  2182.  
  2183. test-name: build-expression->derivation and derivation-prerequisites
  2184. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:718
  2185. source:
  2186. + (test-assert
  2187. +   "build-expression->derivation and derivation-prerequisites"
  2188. +   (let ((drv (build-expression->derivation %store "fail" #f)))
  2189. +     (any (match-lambda
  2190. +            (($ <derivation-input> path)
  2191. +             (string=?
  2192. +               path
  2193. +               (derivation-file-name (%guile-for-build)))))
  2194. +          (derivation-prerequisites drv))))
  2195. actual-value: #t
  2196. result: PASS
  2197.  
  2198. test-name: derivation-prerequisites and valid-derivation-input?
  2199. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:725
  2200. source:
  2201. + (test-assert
  2202. +   "derivation-prerequisites and valid-derivation-input?"
  2203. +   (let* ((a (build-expression->derivation
  2204. +               %store
  2205. +               "a"
  2206. +               '(mkdir %output)))
  2207. +          (b (build-expression->derivation
  2208. +               %store
  2209. +               "b"
  2210. +               `(list ,(random-text))))
  2211. +          (c (build-expression->derivation
  2212. +               %store
  2213. +               "c"
  2214. +               `(mkdir %output)
  2215. +               #:inputs
  2216. +               `(("a" ,a) ("b" ,b)))))
  2217. +     (build-derivations
  2218. +       %store
  2219. +       (list a
  2220. +             (package-derivation %store %bootstrap-guile)))
  2221. +     (match (derivation-prerequisites
  2222. +              c
  2223. +              (cut valid-derivation-input? %store <>))
  2224. +            ((($ <derivation-input> file ("out")))
  2225. +             (string=? file (derivation-file-name b)))
  2226. +            (x (pk 'fail x #f)))))
  2227. actual-value: #t
  2228. result: PASS
  2229.  
  2230. test-name: build-expression->derivation without inputs
  2231. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:743
  2232. source:
  2233. + (test-assert
  2234. +   "build-expression->derivation without inputs"
  2235. +   (let* ((builder
  2236. +            '(begin
  2237. +               (mkdir %output)
  2238. +               (call-with-output-file
  2239. +                 (string-append %output "/test")
  2240. +                 (lambda (p) (display '(hello guix) p)))))
  2241. +          (drv (@ build-started /tmp/guix-tests/store/siz27i7vk0g1xngsx049p9vrvss9c712-goo.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/si//z27i7vk0g1xngsx049p9vrvss9c712-goo.drv.bz2
  2242. @ build-succeeded /tmp/guix-tests/store/siz27i7vk0g1xngsx049p9vrvss9c712-goo.drv -
  2243. substitute: warning: authentication and authorization of substitutes disabled!
  2244. substitute: guix substitute: warning: ACL for archive imports seems to be uninitialized, substitutes may be unavailable
  2245. @ build-started /tmp/guix-tests/store/qfl2559affw2jnz43j8c6dx0rjngqns3-silent.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/qf//l2559affw2jnz43j8c6dx0rjngqns3-silent.drv.bz2
  2246. building of `/tmp/guix-tests/store/qfl2559affw2jnz43j8c6dx0rjngqns3-silent.drv' timed out after 1 seconds of silence
  2247. @ build-failed /tmp/guix-tests/store/qfl2559affw2jnz43j8c6dx0rjngqns3-silent.drv - timeout
  2248. killing process 11945
  2249. substitute: warning: authentication and authorization of substitutes disabled!
  2250. substitute: guix substitute: warning: ACL for archive imports seems to be uninitialized, substitutes may be unavailable
  2251. @ build-started /tmp/guix-tests/store/6d3dbcj98inv78d5abwp41fbis15kvy6-slow.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/6d//3dbcj98inv78d5abwp41fbis15kvy6-slow.drv.bz2
  2252. building of `/tmp/guix-tests/store/6d3dbcj98inv78d5abwp41fbis15kvy6-slow.drv' timed out after 1 seconds
  2253. @ build-failed /tmp/guix-tests/store/6d3dbcj98inv78d5abwp41fbis15kvy6-slow.drv - timeout
  2254. killing process 11959
  2255. @ build-started /tmp/guix-tests/store/cbc4v7vanc01h71qnngr0k35kvvvik9v-input.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/cb//c4v7vanc01h71qnngr0k35kvvvik9v-input.drv.bz2
  2256. @ build-succeeded /tmp/guix-tests/store/cbc4v7vanc01h71qnngr0k35kvvvik9v-input.drv -
  2257. @ build-started /tmp/guix-tests/store/5ykgrvz6nsm8rz51hww0wfb7kj83s5x7-something.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/5y//kgrvz6nsm8rz51hww0wfb7kj83s5x7-something.drv.bz2
  2258. @ build-succeeded /tmp/guix-tests/store/5ykgrvz6nsm8rz51hww0wfb7kj83s5x7-something.drv -
  2259. finding garbage collector roots...
  2260. removing stale temporary roots file `/tmp/guix-tests/var/11678/temproots/11696'
  2261. deleting unused links...
  2262. build-expression->derivation
  2263. +                 %store
  2264. +                 "goo"
  2265. +                 builder))
  2266. +          (succeeded?
  2267. +            (build-derivations %store (list drv))))
  2268. +     (and succeeded?
  2269. +          (let ((p (derivation->output-path drv)))
  2270. +            (equal?
  2271. +              '(hello guix)
  2272. +              (call-with-input-file
  2273. +                (string-append p "/test")
  2274. +                read))))))
  2275. actual-value: #t
  2276. result: PASS
  2277.  
  2278. test-name: build-expression->derivation and max-silent-time
  2279. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:756
  2280. source:
  2281. + (test-assert
  2282. +   "build-expression->derivation and max-silent-time"
  2283. +   (let* ((store (let ((s (open-connection)))
  2284. +                   (set-build-options s #:max-silent-time 1)
  2285. +                   s))
  2286. +          (builder '(begin (sleep 100) (mkdir %output) #t))
  2287. +          (drv (build-expression->derivation
  2288. +                 store
  2289. +                 "silent"
  2290. +                 builder))
  2291. +          (out-path (derivation->output-path drv)))
  2292. +     (guard (c ((nix-protocol-error? c)
  2293. +                (and (string-contains
  2294. +                       (nix-protocol-error-message c)
  2295. +                       "failed")
  2296. +                     (not (valid-path? store out-path)))))
  2297. +            (build-derivations store (list drv))
  2298. +            #f)))
  2299. actual-value: #t
  2300. result: PASS
  2301.  
  2302. test-name: build-expression->derivation and timeout
  2303. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:770
  2304. source:
  2305. + (test-assert
  2306. +   "build-expression->derivation and timeout"
  2307. +   (let* ((store (let ((s (open-connection)))
  2308. +                   (set-build-options s #:timeout 1)
  2309. +                   s))
  2310. +          (builder '(begin (sleep 100) (mkdir %output) #t))
  2311. +          (drv (build-expression->derivation
  2312. +                 store
  2313. +                 "slow"
  2314. +                 builder))
  2315. +          (out-path (derivation->output-path drv)))
  2316. +     (guard (c ((nix-protocol-error? c)
  2317. +                (and (string-contains
  2318. +                       (nix-protocol-error-message c)
  2319. +                       "failed")
  2320. +                     (not (valid-path? store out-path)))))
  2321. +            (build-derivations store (list drv))
  2322. +            #f)))
  2323. actual-value: #t
  2324. result: PASS
  2325.  
  2326. test-name: build-expression->derivation and derivation-prerequisites-to-build
  2327. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:784
  2328. source:
  2329. + (test-assert
  2330. +   "build-expression->derivation and derivation-prerequisites-to-build"
  2331. +   (let ((drv (build-expression->derivation %store "fail" #f)))
  2332. +     (null? (derivation-prerequisites-to-build %store drv))))
  2333. actual-value: #t
  2334. result: PASS
  2335.  
  2336. test-name: derivation-prerequisites-to-build when outputs already present
  2337. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:790
  2338. source:
  2339. + (test-assert
  2340. +   "derivation-prerequisites-to-build when outputs already present"
  2341. +   (let* ((builder '(begin (mkdir %output) #t))
  2342. +          (input-drv
  2343. +            (build-expression->derivation
  2344. +              %store
  2345. +              "input"
  2346. +              builder))
  2347. +          (input-path
  2348. +            (derivation-output-path
  2349. +              (assoc-ref (derivation-outputs input-drv) "out")))
  2350. +          (drv (build-expression->derivation
  2351. +                 %store
  2352. +                 "something"
  2353. +                 builder
  2354. +                 #:inputs
  2355. +                 `(("i" ,input-drv))))
  2356. +          (output (derivation->output-path drv)))
  2357. +     (when (valid-path? %store input-path)
  2358. +           (delete-paths %store (list input-path)))
  2359. +     (when (valid-path? %store output)
  2360. +           (delete-paths %store (list output)))
  2361. +     (and (equal?
  2362. +            (map derivation-input-path
  2363. +                 (derivation-prerequisites-to-build %store drv))
  2364. +            (list (derivation-file-name input-drv)))
  2365. +          (build-derivations %store (list drv))
  2366. +          (delete-paths %store (list input-path))
  2367. +          (not (valid-path? %store input-path))
  2368. +          (null? (derivation-prerequisites-to-build %store drv)))))
  2369. actual-value: #t
  2370. result: PASS
  2371.  
  2372. test-name: substitute: warning: authentication and authorization of substitutes disabled!
  2373. substitute: guix substitute: warning: ACL for archive imports seems to be uninitialized, substitutes may be unavailable
  2374. substitute: warning: authentication and authorization of substitutes disabled!
  2375. substitute: guix substitute: warning: ACL for archive imports seems to be uninitialized, substitutes may be unavailable
  2376. derivation-prerequisites-to-build and substitutes
  2377. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:819
  2378. source:
  2379. + (test-assert
  2380. +   "derivation-prerequisites-to-build and substitutes"
  2381. +   (let* ((store (open-connection))
  2382. +          (drv (build-expression->derivation
  2383. +                 store
  2384. +                 "prereq-subst"
  2385. +                 (random 1000)))
  2386. +          (output (derivation->output-path drv)))
  2387. +     (set-build-options
  2388. +       store
  2389. +       #:use-substitutes?
  2390. +       #t
  2391. +       #:substitute-urls
  2392. +       (%test-substitute-urls))
  2393. +     (with-derivation-narinfo
  2394. +       drv
  2395. +       (let-values
  2396. +         (((build download)
  2397. +           (derivation-prerequisites-to-build store drv))
  2398. +          ((build* download*)
  2399. +           (derivation-prerequisites-to-build
  2400. +             store
  2401. +             drv
  2402. +             #:substitutable?
  2403. +             (const #f))))
  2404. +         (and (null? build)
  2405. +              (equal? download (list output))
  2406. +              (null? download*)
  2407. +              (null? build*))))))
  2408. actual-value: #t
  2409. result: PASS
  2410.  
  2411. test-name: derivation-prerequisites-to-build and substitutes, non-substitutable build
  2412. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:841
  2413. source:
  2414. + (test-assert
  2415. +   "derivation-prerequisites-to-build and substitutes, non-substitutable build"
  2416. +   (let* ((store (open-connection))
  2417. +          (drv (build-expression->derivation
  2418. +                 store
  2419. +                 "prereq-no-subst"
  2420. +                 (random 1000)
  2421. +                 #:substitutable?
  2422. +                 #f))
  2423. +          (output (derivation->output-path drv)))
  2424. +     (set-build-options
  2425. +       store
  2426. +       #:use-substitutes?
  2427. +       #t
  2428. +       #:substitute-urls
  2429. +       (%test-substitute-urls))
  2430. +     (with-derivation-narinfo
  2431. +       drv
  2432. +       (let-values
  2433. +         (((build download)
  2434. +           (derivation-prerequisites-to-build store drv)))
  2435. +         (and (null? download)
  2436. +              (match build
  2437. +                     (((? derivation-input? input))
  2438. +                      (string=?
  2439. +                        (derivation-input-path input)
  2440. +                        (derivation-file-name drv)))))))))
  2441. actual-value: #t
  2442. result: PASS
  2443.  
  2444. test-name: derivation-prerequisites-to-build and substitutes, local build
  2445. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:863
  2446. source:
  2447. + (test-assert
  2448. +   "derivation-prerequisites-to-build and substitutes, local build"
  2449. +   (with-store
  2450. +     store
  2451. +     (let* ((drv (build-expression->derivation
  2452. +                   store
  2453. +                   "prereq-subst-local"
  2454. +                   (random 1000)
  2455. +                   #:local-build?
  2456. +                   #t))
  2457. +            (output (derivation->output-path drv)))
  2458. +       (set-build-options
  2459. +         store
  2460. +         #:use-substitutes?
  2461. +         #t
  2462. +         #:substitute-urls
  2463. +         (%test-substitute-urls))
  2464. +       (with-derivation-narinfo
  2465. +         drv
  2466. +         (let-values
  2467. +           (((build download)
  2468. +             (derivation-prerequisites-to-build store drv)))
  2469. +           (and (null? build)
  2470. +                (match download
  2471. +                       (((? string? item))
  2472. +                        (string=? item (derivation->output-path drv))))))))))
  2473. actual-value: #t
  2474. result: PASS
  2475.  
  2476. test-name: derivation-prerequisites-to-build in 'check' mode
  2477. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:885
  2478. source:
  2479. + (test-assert
  2480. +   "derivation-prerequisites-to-build in 'check' mode"
  2481. +   (with-store
  2482. +     store
  2483. +     (let* ((dep (build-expression->derivation
  2484. +                   store
  2485. +                   "dep"
  2486. +                   `(begin ,(random-text) (mkdir %output))))
  2487. +            (drv (build-expression->derivation
  2488. +                   store
  2489. +                   "to-check"
  2490. +                   '(mkdir %output)
  2491. +                   #:inputs
  2492. +                   `(("dep" ,dep)))))
  2493. +       (build-derivations store (list drv))
  2494. +       (delete-paths
  2495. +         store
  2496. +         (list (derivation->output-path dep)))
  2497. +       (and (null? (derivation-prerequisites-to-build store drv))
  2498. +            (match (substitute: warning: authentication and authorization of substitutes disabled!
  2499. substitute: guix substitute: warning: ACL for archive imports seems to be uninitialized, substitutes may be unavailable
  2500. building path(s) `/tmp/guix-tests/store/0qkhy40mh59all8jx9v72ywpjlivjjwj-dep'
  2501. building path(s) `/tmp/guix-tests/store/nak33yc70xvmanh7yy1swx9hv5n119l4-to-check'
  2502. finding garbage collector roots...
  2503. removing stale temporary roots file `/tmp/guix-tests/var/11678/temproots/11989'
  2504. removing stale temporary roots file `/tmp/guix-tests/var/11678/temproots/.fuse_hidden0000f99a0000237f'
  2505. deleting `/tmp/guix-tests/store/0qkhy40mh59all8jx9v72ywpjlivjjwj-dep'
  2506. deleting `/tmp/guix-tests/store/trash'
  2507. deleting unused links...
  2508. note: currently hard linking saves 0.14 MiB
  2509. @ build-started /tmp/guix-tests/store/kvz3csrwpha43pk3mvhwsrzw2yz5qviv-fail.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/kv//z3csrwpha43pk3mvhwsrzw2yz5qviv-fail.drv.bz2
  2510. builder for `/tmp/guix-tests/store/kvz3csrwpha43pk3mvhwsrzw2yz5qviv-fail.drv' failed with exit code 1
  2511. @ build-failed /tmp/guix-tests/store/kvz3csrwpha43pk3mvhwsrzw2yz5qviv-fail.drv - 1 builder for `/tmp/guix-tests/store/kvz3csrwpha43pk3mvhwsrzw2yz5qviv-fail.drv' failed with exit code 1
  2512. @ build-started /tmp/guix-tests/store/v3d6ak4h46illn6yqkid6fsid3i749yy-double.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/v3//d6ak4h46illn6yqkid6fsid3i749yy-double.drv.bz2
  2513. @ build-succeeded /tmp/guix-tests/store/v3d6ak4h46illn6yqkid6fsid3i749yy-double.drv -
  2514. derivation-prerequisites-to-build
  2515. +                     store
  2516. +                     drv
  2517. +                     #:mode
  2518. +                     (build-mode check))
  2519. +                   ((input)
  2520. +                    (string=?
  2521. +                      (derivation-input-path input)
  2522. +                      (derivation-file-name dep))))))))
  2523. actual-value: #t
  2524. result: PASS
  2525.  
  2526. test-name: substitution-oracle and #:substitute? #f
  2527. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:905
  2528. source:
  2529. + (test-assert
  2530. +   "substitution-oracle and #:substitute? #f"
  2531. +   (with-store
  2532. +     store
  2533. +     (let* ((dep (build-expression->derivation
  2534. +                   store
  2535. +                   "dep"
  2536. +                   `(begin ,(random-text) (mkdir %output))))
  2537. +            (drv (build-expression->derivation
  2538. +                   store
  2539. +                   "not-subst"
  2540. +                   `(begin ,(random-text) (mkdir %output))
  2541. +                   #:substitutable?
  2542. +                   #f
  2543. +                   #:inputs
  2544. +                   `(("dep" ,dep))))
  2545. +            (query #f))
  2546. +       (define (record-substitutable-path-query store paths)
  2547. +         (when query (error "already called!" query))
  2548. +         (set! query paths)
  2549. +         '())
  2550. +       (mock ((guix store)
  2551. +              substitutable-paths
  2552. +              record-substitutable-path-query)
  2553. +             (let ((pred (substitution-oracle store (list drv))))
  2554. +               (pred (derivation->output-path drv))))
  2555. +       (equal?
  2556. +         (pk 'query query)
  2557. +         (list (derivation->output-path dep))))))
  2558.  
  2559. ;;; (query ("/tmp/guix-tests/store/93m3pmns6b2f5pmvkmrbcz3wjf8mncpg-dep"))
  2560. actual-value: #t
  2561. result: PASS
  2562.  
  2563. test-name: build-expression->derivation with expression returning #f
  2564. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:934
  2565. source:
  2566. + (test-assert
  2567. +   "build-expression->derivation with expression returning #f"
  2568. +   (let* ((builder '(begin (mkdir %output) #f))
  2569. +          (drv (build-expression->derivation
  2570. +                 %store
  2571. +                 "fail"
  2572. +                 builder))
  2573. +          (out-path (derivation->output-path drv)))
  2574. +     (guard (c ((nix-protocol-error? c)
  2575. +                (and (string-match
  2576. +                       "build .* failed"
  2577. +                       (nix-protocol-error-message c))
  2578. +                     (not (valid-path? %store out-path)))))
  2579. +            (build-derivations %store (list drv))
  2580. +            #f)))
  2581. actual-value: #t
  2582. result: PASS
  2583.  
  2584. test-name: build-expression->derivation with two outputs
  2585. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:949
  2586. source:
  2587. + (test-assert
  2588. +   "build-expression->derivation with two outputs"
  2589. +   (let* ((builder
  2590. +            '(begin
  2591. +               (call-with-output-file
  2592. +                 (assoc-ref %outputs "out")
  2593. +                 (lambda (p) (display '(hello) p)))
  2594. +               (call-with-output-file
  2595. +                 (assoc-ref %outputs "second")
  2596. +                 (lambda (p) (display '(world) p)))))
  2597. +          (drv (build-expression->derivation
  2598. +                 %store
  2599. +                 "double"
  2600. +                 builder
  2601. +                 #:outputs
  2602. +                 '("out" "second")))
  2603. +          (succeeded?
  2604. +            (build-derivations %store (list drv))))
  2605. +     (and succeeded?
  2606. +          (let ((one (derivation->output-path drv))
  2607. +                (two (derivation->output-path drv "second")))
  2608. +            (and (equal? '(hello) (call-with-input-file one read))
  2609. +                 (equal? '(world) (call-with-input-file two read)))))))
  2610. actual-value: #t
  2611. result: PASS
  2612.  
  2613. test-name: build-expression->derivation with one input
  2614. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:968
  2615. source:
  2616. + (test-assert
  2617. +   "build-expression->derivation with one input"
  2618. +   (let* ((builder
  2619. +            '(call-with-output-file
  2620. +               %output
  2621. +               (lambda (p)
  2622. +                 (let ((cu (assoc-ref %build-inputs "cu")))
  2623. +                   (close 1)
  2624. +                   (dup2 (port->fdes p) 1)
  2625. +                   (execl (string-append cu "/bin/uname")
  2626. +                 @ build-started /tmp/guix-tests/store/vs63w833h9dn987d6j80x9nggmjhjj6n-module-import.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/vs//63w833h9dn987d6j80x9nggmjhjj6n-module-import.drv.bz2
  2627. @ build-succeeded /tmp/guix-tests/store/vs63w833h9dn987d6j80x9nggmjhjj6n-module-import.drv -
  2628. @ build-started /tmp/guix-tests/store/9xp57zkgn9n85i77xd2975k2lh6hlxrl-module-import-compiled.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/9x//p57zkgn9n85i77xd2975k2lh6hlxrl-module-import-compiled.drv.bz2
  2629. @ build-succeeded /tmp/guix-tests/store/9xp57zkgn9n85i77xd2975k2lh6hlxrl-module-import-compiled.drv -
  2630. @ build-started /tmp/guix-tests/store/yz1m0dxzg68vryd8yra1fiaxlni4ppfp-test-with-modules.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/yz//1m0dxzg68vryd8yra1fiaxlni4ppfp-test-with-modules.drv.bz2
  2631. @ build-succeeded /tmp/guix-tests/store/yz1m0dxzg68vryd8yra1fiaxlni4ppfp-test-with-modules.drv -
  2632.          "uname"
  2633. +                          "-a")))))
  2634. +          (drv (build-expression->derivation
  2635. +                 %store
  2636. +                 "uname"
  2637. +                 builder
  2638. +                 #:inputs
  2639. +                 `(("cu" ,%coreutils))))
  2640. +          (succeeded?
  2641. +            (build-derivations %store (list drv))))
  2642. +     (and succeeded?
  2643. +          (let ((p (derivation->output-path drv)))
  2644. +            (string-contains
  2645. +              (call-with-input-file p read-line)
  2646. +              "GNU")))))
  2647. result: SKIP
  2648.  
  2649. test-name: build-expression->derivation with modules
  2650. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:984
  2651. source:
  2652. + (test-assert
  2653. +   "build-expression->derivation with modules"
  2654. +   (let* ((builder
  2655. +            `(begin
  2656. +               (use-modules (guix build utils))
  2657. +               (let ((out (assoc-ref %outputs "out")))
  2658. +                 (mkdir-p (string-append out "/guile/guix/nix"))
  2659. +                 #t)))
  2660. +          (drv (build-expression->derivation
  2661. +                 %store
  2662. +                 "test-with-modules"
  2663. +                 builder
  2664. +                 #:modules
  2665. +                 '((guix build utils)))))
  2666. +     (and (build-derivations %store (list drv))
  2667. +          (let* ((p (derivation->output-path drv))
  2668. +                 (s (stat (string-append p "/guile/guix/nix"))))
  2669. +            (eq? (stat:type s) 'directory)))))
  2670. actual-value: #t
  2671. result: PASS
  2672.  
  2673. test-name: build-expression->derivation: same fixed-output path
  2674. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:999
  2675. source:
  2676. + (test-assert
  2677. +   "build-expression->derivation: same fixed-output path"
  2678. +   (let* ((builder1
  2679. +            '(call-with-output-file
  2680. +               %output
  2681. +               (lambda (p) (write "hello" p))))
  2682. +          (builder2
  2683. +            '(call-with-output-file
  2684. +               (pk 'difference-here! %output)
  2685. +               (lambda (p) (write "hello" p))))
  2686. +          (hash (sha256 (string->utf8 "hello")))
  2687. +          (input1
  2688. +            (build-expression->derivation
  2689. +              %store
  2690. +              "fixed"
  2691. +              builder1
  2692. +              #:hash
  2693. +              hash
  2694. +              #:hash-algo
  2695. +              'sha256))
  2696. +          (input2
  2697. +            (build-expression->derivation
  2698. +              %store
  2699. +              "fixed"
  2700. +              builder2
  2701. +              #:hash
  2702. +              hash
  2703. +              #:hash-algo
  2704. +              'sha256))
  2705. +          (succeeded?
  2706. +            (build-derivations %store (list input1 input2))))
  2707. +     (and succeeded?
  2708. +          (not (string=?
  2709. +                 (derivation-file-name input1)
  2710. +                 (derivation-file-name input2)))
  2711. +          (string=?
  2712. +            (derivation->output-path input1)
  2713. +            (derivation->output-path input2)))))
  2714. actual-value: #t
  2715. result: PASS
  2716.  
  2717. test-name: build-expression->derivation with a fixed-output input
  2718. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:1020
  2719. source:
  2720. + (test-assert
  2721. +   "build-expression->derivation with a fixed-output input"
  2722. +   (let* ((builder1
  2723. +            '(call-with-output-file
  2724. +               %output
  2725. +               (lambda (p) (write "hello" p))))
  2726. +          (builder2
  2727. +            '(call-with-output-file
  2728. +               (pk 'difference-here! %output)
  2729. +               (lambda (p) (write "hello" p))))
  2730. +          (hash (sha256 (string->utf8 "hello")))
  2731. +          (input1
  2732. +            (build-expression->derivation
  2733. +              %store
  2734. +              "fixed"
  2735. +              builder1
  2736. +              #:hash
  2737. +              hash
  2738. +              #:hash-algo
  2739. +              'sha256))
  2740. +          (input2
  2741. +            (build-expression->derivation
  2742. +              %store
  2743. +              "fixed"
  2744. +              builder2
  2745. +              #:hash
  2746. +              hash
  2747. +              #:hash-algo
  2748. +              'sha256))
  2749. +          (builder3
  2750. +            '(let ((input (assoc-ref %build-inputs "input")))
  2751. +               (call-with-output-file
  2752. +                 %output
  2753. +                 (lambda (out)
  2754. +                   (format #f "My input is ~a.~%" input)))))
  2755. +          (final1
  2756. +            (@ build-started /tmp/guix-tests/store/8dkhnfprkjn6p5hh6abjbvhcypif1djn-final.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/8d//khnfprkjn6p5hh6abjbvhcypif1djn-final.drv.bz2
  2757. @ build-succeeded /tmp/guix-tests/store/8dkhnfprkjn6p5hh6abjbvhcypif1djn-final.drv -
  2758. @ build-started /tmp/guix-tests/store/q9ml6iwz4b8jffgd6l3jkllm0lm9g7aw-fixed-rec.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/q9//ml6iwz4b8jffgd6l3jkllm0lm9g7aw-fixed-rec.drv.bz2
  2759. @ build-succeeded /tmp/guix-tests/store/q9ml6iwz4b8jffgd6l3jkllm0lm9g7aw-fixed-rec.drv -
  2760. @ build-started /tmp/guix-tests/store/9a2z4zz7sraa065z4fa12g9sg6mlhkj5-small-fixed-rec.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/9a//2z4zz7sraa065z4fa12g9sg6mlhkj5-small-fixed-rec.drv.bz2
  2761. @ build-succeeded /tmp/guix-tests/store/9a2z4zz7sraa065z4fa12g9sg6mlhkj5-small-fixed-rec.drv -
  2762. @ build-started /tmp/guix-tests/store/aakag457jih22azd1mkhcvnlnv9115ky-fixed-rec-user.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/aa//kag457jih22azd1mkhcvnlnv9115ky-fixed-rec-user.drv.bz2
  2763. @ build-succeeded /tmp/guix-tests/store/aakag457jih22azd1mkhcvnlnv9115ky-fixed-rec-user.drv -
  2764. build-expression->derivation
  2765. +              %store
  2766. +              "final"
  2767. +              builder3
  2768. +              #:inputs
  2769. +              `(("input" ,input1))))
  2770. +          (final2
  2771. +            (build-expression->derivation
  2772. +              %store
  2773. +              "final"
  2774. +              builder3
  2775. +              #:inputs
  2776. +              `(("input" ,input2)))))
  2777. +     (and (string=?
  2778. +            (derivation->output-path final1)
  2779. +            (derivation->output-path final2))
  2780. +          (string=?
  2781. +            (derivation->output-path final1)
  2782. +            (derivation-path->output-path
  2783. +              (derivation-file-name final1)))
  2784. +          (build-derivations %store (list final1 final2)))))
  2785. actual-value: #t
  2786. result: PASS
  2787.  
  2788. test-name: build-expression->derivation produces recursive fixed-output
  2789. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:1051
  2790. source:
  2791. + (test-assert
  2792. +   "build-expression->derivation produces recursive fixed-output"
  2793. +   (let* ((builder
  2794. +            '(begin
  2795. +               (use-modules (srfi srfi-26))
  2796. +               (mkdir %output)
  2797. +               (chdir %output)
  2798. +               (call-with-output-file
  2799. +                 "exe"
  2800. +                 (cut display "executable" <>))
  2801. +               (chmod "exe" 511)
  2802. +               (symlink "exe" "symlink")
  2803. +               (mkdir "subdir")))
  2804. +          (drv (build-expression->derivation
  2805. +                 %store
  2806. +                 "fixed-rec"
  2807. +                 builder
  2808. +                 #:hash-algo
  2809. +                 'sha256
  2810. +                 #:hash
  2811. +                 (base32
  2812. +                   "10k1lw41wyrjf9mxydi0is5nkpynlsvgslinics4ppir13g7d74p")
  2813. +                 #:recursive?
  2814. +                 #t)))
  2815. +     (and (build-derivations %store (list drv))
  2816. +          (let* ((dir (derivation->output-path drv))
  2817. +                 (exe (string-append dir "/exe"))
  2818. +                 (link (string-append dir "/symlink"))
  2819. +                 (subdir (string-append dir "/subdir")))
  2820. +            (and (executable-file? exe)
  2821. +                 (string=?
  2822. +                   "executable"
  2823. +                   (call-with-input-file exe get-string-all))
  2824. +                 (string=? "exe" (readlink link))
  2825. +                 (file-is-directory? subdir))))))
  2826. actual-value: #t
  2827. result: PASS
  2828.  
  2829. test-name: build-expression->derivation uses recursive fixed-output
  2830. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:1077
  2831. source:
  2832. + (test-assert
  2833. +   "build-expression->derivation uses recursive fixed-output"
  2834. +   (let* ((builder
  2835. +            '(call-with-output-file
  2836. +               %output
  2837. +               (lambda (port) (display "hello" port))))
  2838. +          (fixed (build-expression->derivation
  2839. +                   %store
  2840. +                   "small-fixed-rec"
  2841. +                   builder
  2842. +                   #:hash-algo
  2843. +                   'sha256
  2844. +                   #:hash
  2845. +                   (base32
  2846. +                     "0sg9f58l1jj88w6pdrfdpj5x9b1zrwszk84j81zvby36q9whhhqa")
  2847. +                   #:recursive?
  2848. +                   #t))
  2849. +          (in (derivation->output-path fixed))
  2850. +          (builder
  2851. +            `(begin
  2852. +               (mkdir %output)
  2853. +               (chdir %output)
  2854. +               (symlink ,in "symlink")))
  2855. +          (drv (build-expression->derivation
  2856. +                 %store
  2857. +                 "fixed-rec-user"
  2858. +                 builder
  2859. +                 #:inputs
  2860. +                 `(("fixed" ,fixed)))))
  2861. +     (and (build-derivations %store (list drv))
  2862. +          (let ((out (derivation->output-path drv)))
  2863. +            (string=?
  2864. +              (readlink (string-append out "/symlink"))
  2865. +              in)))))
  2866. actual-value: #t
  2867. result: PASS
  2868.  
  2869. test-name: build-expression->derivation with #:references-graphs
  2870. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:1099
  2871. source:
  2872. + (test-assert
  2873. +   "build-expression->derivation with #:references-graphs"
  2874. +   (let* ((input (add-text-to-store
  2875. +                   %store
  2876. +                   "foo"
  2877. +                   "hello"
  2878. +                   (list %bash %mkdir)))
  2879. +          (builder '(copy-file "input" %output))
  2880. + @ build-started /tmp/guix-tests/store/33xr95dfil5qna3dxlzlzyvrlw9nycn0-references-graphs.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/33//xr95dfil5qna3dxlzlzyvrlw9nycn0-references-graphs.drv.bz2
  2881. @ build-succeeded /tmp/guix-tests/store/33xr95dfil5qna3dxlzlzyvrlw9nycn0-references-graphs.drv -
  2882. @ build-started /tmp/guix-tests/store/ajqc0l1rbgd83hdid7ain2wr0wiwvvh4-original-drv2.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/aj//qc0l1rbgd83hdid7ain2wr0wiwvvh4-original-drv2.drv.bz2
  2883. @ build-succeeded /tmp/guix-tests/store/ajqc0l1rbgd83hdid7ain2wr0wiwvvh4-original-drv2.drv -
  2884. @ build-started /tmp/guix-tests/store/vks5g20fjlmi5daip35rrd34869fnql9-drv-to-remap.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/vk//s5g20fjlmi5daip35rrd34869fnql9-drv-to-remap.drv.bz2
  2885. @ build-succeeded /tmp/guix-tests/store/vks5g20fjlmi5daip35rrd34869fnql9-drv-to-remap.drv -
  2886.          (drv (build-expression->derivation
  2887. +                 %store
  2888. +                 "references-graphs"
  2889. +                 builder
  2890. +                 #:references-graphs
  2891. +                 `(("input" unquote input))))
  2892. +          (out (derivation->output-path drv)))
  2893. +     (define (deps path . deps)
  2894. +       (let ((count (length deps)))
  2895. +         (string-append
  2896. +           path
  2897. +           "\n\n"
  2898. +           (number->string count)
  2899. +           "\n"
  2900. +           (string-join (sort deps string<?) "\n")
  2901. +           (if (zero? count) "" "\n"))))
  2902. +     (and (build-derivations %store (list drv))
  2903. +          (equal?
  2904. +            (call-with-input-file out get-string-all)
  2905. +            (string-concatenate
  2906. +              (map cdr
  2907. +                   (sort (map (lambda (p d) (cons p (apply deps p d)))
  2908. +                              (list input %bash %mkdir)
  2909. +                              (list (list %bash %mkdir) '() '()))
  2910. +                         (lambda (x y)
  2911. +                           (match x
  2912. +                                  ((p1 . _)
  2913. +                                   (match y
  2914. +                                          ((p2 . _)
  2915. +                                           (string<? p1 p2)))))))))))))
  2916. actual-value: #t
  2917. result: PASS
  2918.  
  2919. test-name: map-derivation
  2920. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:1130
  2921. source:
  2922. + (test-equal
  2923. +   "map-derivation"
  2924. +   "hello"
  2925. +   (let* ((joke (package-derivation %store guile-1.8))
  2926. +          (good (package-derivation %store %bootstrap-guile))
  2927. +          (drv1 (build-expression->derivation
  2928. +                  %store
  2929. +                  "original-drv1"
  2930. +                  #f
  2931. +                  #:guile-for-build
  2932. +                  joke))
  2933. +          (drv2 (build-expression->derivation
  2934. +                  %store
  2935. +                  "original-drv2"
  2936. +                  '(call-with-output-file
  2937. +                     %output
  2938. +                     (lambda (p) (display "hello" p)))))
  2939. +          (drv3 (build-expression->derivation
  2940. +                  %store
  2941. +                  "drv-to-remap"
  2942. +                  '(let ((in (assoc-ref %build-inputs "in")))
  2943. +                     (copy-file in %output))
  2944. +                  #:inputs
  2945. +                  `(("in" ,drv1))
  2946. +                  #:guile-for-build
  2947. +                  joke))
  2948. +          (drv4 (map-derivation
  2949. +                  %store
  2950. +                  drv3
  2951. +                  `((,drv1 unquote drv2) (,joke unquote good))))
  2952. +          (out (derivation->output-path drv4)))
  2953. +     (and (build-derivations
  2954. +            %store
  2955. +            (list (pk 'remapped drv4)))
  2956. +          (call-with-input-file out get-string-all))))
  2957.  
  2958. ;;; (remapped #<derivation /tmp/guix-tests/store/vks5g20fjlmi5daip35rrd34869fnql9-drv-to-remap.drv => /tmp/guix-tests/store/f8prvykpaplzl0gw9qykipviq3vil9ws-drv-to-remap 223ff00>)
  2959. expected-value: "hello"
  2960. actual-value: "hello"
  2961. result: PASS
  2962.  
  2963. test-name: map-derivation, sources
  2964. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/derivations.scm:1153
  2965. source:
  2966. + (test-equal
  2967. +   "map-derivation, sources"
  2968. +   "hello"
  2969. +   (let* ((script1
  2970. +            (add-text-to-store %store "fail.sh" "exit 1"))
  2971. +          (script2
  2972. +            (add-text-to-store
  2973. +              %store
  2974. +              "hi.sh"
  2975. +              "echo -n hello > $out"))
  2976. +          (bash-full
  2977. +            (package-derivation
  2978. +              %store
  2979. +              (@ (gnu packages bash) bash)))
  2980. +          (drv1 (derivation
  2981. +                  %store
  2982. +                  "drv-to-remap"
  2983. +                  (derivation->output-path bash-full)
  2984. +                  `("-e" ,script1)
  2985. +                  #:inputs
  2986. +                  `((,bash-full) (,script1))))
  2987. +          (drv2 (map-derivation
  2988. +                  %store
  2989. +                  drv1
  2990. +                  `((,bash-full unquote %bash)
  2991. +                    (,script1 unquote script2))))
  2992. +          (out (derivation->output-path drv2)))
  2993. +     (and (build-derivations
  2994. +            %store
  2995. +            (list (pk 'remapped* drv2)))
  2996. +          (call-with-input-file out get-string-all))))
  2997.  
  2998. ;;; (remapped* #<derivation @ build-started /tmp/guix-tests/store/3b1r9qvgpcami02g66iqgnbfm3xxsx95-drv-to-remap.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/3b//1r9qvgpcami02g66iqgnbfm3xxsx95-drv-to-remap.drv.bz2
  2999. @ build-succeeded /tmp/guix-tests/store/3b1r9qvgpcami02g66iqgnbfm3xxsx95-drv-to-remap.drv -
  3000. /tmp/guix-tests/store/3b1r9qvgpcami02g66iqgnbfm3xxsx95-drv-to-remap.drv => /tmp/guix-tests/store/d16rf6zch2w23cn1v1gm8r3w12pc7y2m-drv-to-remap 23b6190>)
  3001. expected-value: "hello"
  3002. actual-value: "hello"
  3003. result: PASS
  3004.  
  3005.  
  3006. SKIP: tests/packages
  3007. ====================
  3008.  
  3009. test-name: printer with location
  3010. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:69
  3011. source:
  3012. + (test-assert
  3013. +   "printer with location"
  3014. +   (string-match
  3015. +     "^#<package foo@0 foo.scm:42 [[:xdigit:]]+>$"
  3016. +     (with-output-to-string
  3017. +       (lambda ()
  3018. +         (write (dummy-package
  3019. +                  "foo"
  3020. +                  (location (make-location "foo.scm" 42 7))))))))
  3021. actual-value: #("#<package foo@0 foo.scm:42 1938000>" (0 . 35))
  3022. result: PASS
  3023.  
  3024. test-name: printer without location
  3025. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:77
  3026. source:
  3027. + (test-assert
  3028. +   "printer without location"
  3029. +   (string-match
  3030. +     "^#<package foo@0 [[:xdigit:]]+>$"
  3031. +     (with-output-to-string
  3032. +       (lambda ()
  3033. +         (write (dummy-package "foo" (location #f)))))))
  3034. actual-value: #("#<package foo@0 1a2ce40>" (0 . 24))
  3035. result: PASS
  3036.  
  3037. test-name: hidden-package
  3038. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:84
  3039. source:
  3040. + (test-assert
  3041. +   "hidden-package"
  3042. +   (and (hidden-package?
  3043. +          (hidden-package (dummy-package "foo")))
  3044. +        (not (hidden-package? (dummy-package "foo")))))
  3045. actual-value: #t
  3046. result: PASS
  3047.  
  3048. test-name: package-superseded
  3049. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:88
  3050. source:
  3051. + (test-assert
  3052. +   "package-superseded"
  3053. +   (let* ((new (dummy-package "bar"))
  3054. +          (old (deprecated-package "foo" new)))
  3055. +     (and (eq? (package-superseded old) new)
  3056. +          (mock ((gnu packages)
  3057. +                 find-best-packages-by-name
  3058. +                 (const (list old)))
  3059. +                (specification->package "foo")
  3060. +                (and (eq? new (specification->package "foo"))
  3061. +                     (eq? new (specification->package+output "foo")))))))
  3062. actual-value: #t
  3063. result: PASS
  3064.  
  3065. test-name: transaction-upgrade-entry, zero upgrades
  3066. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:97
  3067. source:
  3068. + (test-assert
  3069. +   "transaction-upgrade-entry, zero upgrades"
  3070. +   (let* ((old (dummy-package "foo" (version "1")))
  3071. +          (tx (mock ((gnu packages)
  3072. +                     find-newest-available-packages
  3073. +                     (const vlist-null))
  3074. +                    ((@@ (guix scripts package)
  3075. +                         transaction-upgrade-entry)
  3076. +                     (manifest-entry
  3077. +                       (inherit (package->manifest-entry old))
  3078. +                       (item (string-append
  3079. +                               (%store-prefix)
  3080. +                               "/"
  3081. +                               (make-string 32 #\e)
  3082. +                               "-foo-1")))
  3083. +                     (manifest-transaction)))))
  3084. +     (manifest-transaction-null? tx)))
  3085. actual-value: #t
  3086. result: PASS
  3087.  
  3088. test-name: transaction-upgrade-entry, one upgrade
  3089. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:109
  3090. source:
  3091. + (test-assert
  3092. +   "transaction-upgrade-entry, one upgrade"
  3093. +   (let* ((old (dummy-package "foo" (version "1")))
  3094. +          (new (dummy-package "foo" (version "2")))
  3095. +          (tx (mock ((gnu packages)
  3096. +                     find-newest-available-packages
  3097. +                     (const (vhash-cons "foo" (list "2" new) vlist-null)))
  3098. +                    ((@@ (guix scripts package)
  3099. +                         transaction-upgrade-entry)
  3100. +                     (manifest-entry
  3101. +                       (inherit (package->manifest-entry old))
  3102. +                       (item (string-append
  3103. +                               (%store-prefix)
  3104. +                               "/"
  3105. +                               (make-string 32 #\e)
  3106. +                               "-foo-1")))
  3107. +                     (manifest-transaction)))))
  3108. +     (and (match (manifest-transaction-install tx)
  3109. +                 ((($ <manifest-entry> "foo" "2" "out" item))
  3110. +                  (eq? item new)))
  3111. +          (null? (manifest-transaction-remove tx)))))
  3112. actual-value: #t
  3113. result: PASS
  3114.  
  3115. test-name: transaction-upgrade-entry, superseded package
  3116. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:125
  3117. source:
  3118. + (test-assert
  3119. +   "transaction-upgrade-entry, superseded package"
  3120. +   (let* ((old (dummy-package "foo" (version "1")))
  3121. +          (new (dummy-package "bar" (version "2")))
  3122. +          (dep (deprecated-package "foo" new))
  3123. +          (tx (mock ((gnu packages)
  3124. +                     find-newest-available-packages
  3125. +                     (const (vhash-cons "foo" (list "2" dep) vlist-null)))
  3126. +                    ((@@ (guix scripts package)
  3127. +                         transaction-upgrade-entry)
  3128. +                     (manifest-entry
  3129. +                       (inherit (package->manifest-entry old))
  3130. +                       (item (string-append
  3131. +                               (%store-prefix)
  3132. +                               "/"
  3133. +                               (make-string 32 #\e)
  3134. +                               "-foo-1")))
  3135. +                     (manifest-transaction)))))
  3136. +     (and (match (manifest-transaction-install tx)
  3137. +                 ((($ <manifest-entry> "bar" "2" "out" item))
  3138. +                  (eq? item new)))
  3139. +          (match (manifest-transaction-remove tx)
  3140. +                 (((? manifest-pattern? pattern))
  3141. +                  (and (string=? (manifest-pattern-name pattern) "foo")
  3142. +                       (string=? (manifest-pattern-version pattern) "1")
  3143. +                       (string=?
  3144. +                         (manifest-pattern-output pattern)
  3145. +                         "out")))))))
  3146. actual-value: #t
  3147. result: PASS
  3148.  
  3149. test-name: package-field-location
  3150. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:146
  3151. source:
  3152. + (test-assert
  3153. +   "package-field-location"
  3154. +   (let ()
  3155. +     (define (goto port line column)
  3156. +       (unless
  3157. +         (and (= (port-column port) (- column 1))
  3158. +              (= (port-line port) (- line 1)))
  3159. +         (unless
  3160. +           (eof-object? (get-char port))
  3161. +           (goto port line column))))
  3162. +     (define read-at
  3163. +       (match-lambda
  3164. +         (($ <location> file line column)
  3165. +          (call-with-input-file
  3166. +            (search-path %load-path file)
  3167. +            (lambda (port)
  3168. +              (goto port line column)
  3169. +              (read port))))))
  3170. +     (and (member
  3171. +            (read-at
  3172. +              (package-field-location %bootstrap-guile 'name))
  3173. +            (let ((name (package-name %bootstrap-guile)))
  3174. +              (list name `(name ,name))))
  3175. +          (member
  3176. +            (read-at
  3177. +              (package-field-location
  3178. +                %bootstrap-guile
  3179. +                'version))
  3180. +            (let ((version (package-version %bootstrap-guile)))
  3181. +              (list version `(version ,version))))
  3182. +          (not (package-field-location
  3183. +                 %bootstrap-guile
  3184. +                 'does-not-exist)))))
  3185. actual-value: #t
  3186. result: PASS
  3187.  
  3188. test-name: package-field-location, relative file name
  3189. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:173
  3190. source:
  3191. + (test-equal
  3192. +   "package-field-location, relative file name"
  3193. +   (location-file
  3194. +     (package-location %bootstrap-guile))
  3195. +   (with-fluids
  3196. +     ((%file-port-name-canonicalization 'absolute))
  3197. +     (location-file
  3198. +       (package-field-location
  3199. +         %bootstrap-guile
  3200. +         'version))))
  3201. expected-value: "gnu/packages/bootstrap.scm"
  3202. actual-value: "gnu/packages/bootstrap.scm"
  3203. result: PASS
  3204.  
  3205. test-name: package-transitive-inputs
  3206. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:178
  3207. source:
  3208. + (test-assert
  3209. +   "package-transitive-inputs"
  3210. +   (let* ((a (dummy-package "a"))
  3211. +          (b (dummy-package
  3212. +               "b"
  3213. +               (propagated-inputs `(("a" ,a)))))
  3214. +          (c (dummy-package "c" (inputs `(("a" ,a)))))
  3215. +          (d (dummy-package
  3216. +               "d"
  3217. +               (propagated-inputs `(("x" "something.drv")))))
  3218. +          (e (dummy-package
  3219. +               "e"
  3220. +               (inputs `(("b" ,b) ("c" ,c) ("d" ,d))))))
  3221. +     (and (null? (package-transitive-inputs a))
  3222. +          (equal?
  3223. +            `(("a" ,a))
  3224. +            (package-transitive-inputs b))
  3225. +          (equal?
  3226. +            `(("a" ,a))
  3227. +            (package-transitive-inputs c))
  3228. +          (equal?
  3229. +            (package-propagated-inputs d)
  3230. +            (package-transitive-inputs d))
  3231. +          (equal?
  3232. +            `(("b" ,b)
  3233. +              ("c" ,c)
  3234. +              ("d" ,d)
  3235. +              ("a" ,a)
  3236. +              ("x" "something.drv"))
  3237. +            (pk 'x (package-transitive-inputs e))))))
  3238.  
  3239. ;;; (x (("b" #<package b@0 /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:180 10eaa80>) ("c" #<package c@0 /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:182 10ea900>) ("d" #<package d@0 /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:184 10ea780>) ("a" #<package a@0 /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:179 10eac00>) ("x" "something.drv")))
  3240. actual-value: #t
  3241. result: PASS
  3242.  
  3243. test-name: package-transitive-inputs, no duplicates
  3244. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:197
  3245. source:
  3246. + (test-assert
  3247. +   "package-transitive-inputs, no duplicates"
  3248. +   (let* ((a (dummy-package "a"))
  3249. +          (b (dummy-package
  3250. +               "b"
  3251. +               (inputs `(("a+" ,a)))
  3252. +               (native-inputs `(("a*" ,a)))
  3253. +               (propagated-inputs `(("a" ,a)))))
  3254. +          (c (dummy-package
  3255. +               "c"
  3256. +               (propagated-inputs `(("b" ,b)))))
  3257. +          (d (dummy-package "d" (inputs `(("a" ,a) ("c" ,c)))))
  3258. +          (e (dummy-package "e" (inputs `(("b" ,b) ("c" ,c))))))
  3259. +     (and (null? (package-transitive-inputs a))
  3260. +          (equal?
  3261. +            `(("a*" ,a) ("a+" ,a) ("a" ,a))
  3262. +            (package-transitive-inputs b))
  3263. +          (equal?
  3264. +            `(("b" ,b) ("a" ,a))
  3265. +            (package-transitive-inputs c))
  3266. +          (equal?
  3267. +            `(("a" ,a) ("c" ,c) ("b" ,b))
  3268. +            (package-transitive-inputs d))
  3269. +          (equal?
  3270. +            `(("b" ,b) ("c" ,c) ("a" ,a))
  3271. +            (package-transitive-inputs e)))))
  3272. actual-value: #t
  3273. result: PASS
  3274.  
  3275. test-name: package-transitive-supported-systems
  3276. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:219
  3277. source:
  3278. + (test-equal
  3279. +   "package-transitive-supported-systems"
  3280. +   '(("x" "y" "z") ("x" "y") ("y") ("y") ("y"))
  3281. +   (let* ((a (dummy-package
  3282. +               "a"
  3283. +               (build-system trivial-build-system)
  3284. +               (supported-systems '("x" "y" "z"))))
  3285. +          (b (dummy-package
  3286. +               "b"
  3287. +               (build-system trivial-build-system)
  3288. +               (supported-systems '("x" "y"))
  3289. +               (inputs `(("a" ,a)))))
  3290. +          (c (dummy-package
  3291. +               "c"
  3292. +               (build-system trivial-build-system)
  3293. +               (supported-systems '("y" "z"))
  3294. +               (inputs `(("b" ,b)))))
  3295. +          (d (dummy-package
  3296. +               "d"
  3297. +               (build-system trivial-build-system)
  3298. +               (supported-systems '("x" "y" "z"))
  3299. +               (inputs `(("b" ,b) ("c" ,c)))))
  3300. +          (e (dummy-package
  3301. +               "e"
  3302. +               (build-system trivial-build-system)
  3303. +               (supported-systems '("x" "y" "z"))
  3304. +               (inputs `(("d" ,d))))))
  3305. +     (list (package-transitive-supported-systems a)
  3306. +           (package-transitive-supported-systems b)
  3307. +           (package-transitive-supported-systems c)
  3308. +           (package-transitive-supported-systems d)
  3309. +           (package-transitive-supported-systems e))))
  3310. expected-value: (("x" "y" "z") ("x" "y") ("y") ("y") ("y"))
  3311. actual-value: (("x" "y" "z") ("x" "y") ("y") ("y") ("y"))
  3312. result: PASS
  3313.  
  3314. test-name: origin-actual-file-name
  3315. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:252
  3316. source:
  3317. + (test-equal
  3318. +   "origin-actual-file-name"
  3319. +   "foo-1.tar.gz"
  3320. +   (let ((o (dummy-origin
  3321. +              (uri "http://www.example.com/foo-1.tar.gz"))))
  3322. +     (origin-actual-file-name o)))
  3323. expected-value: "foo-1.tar.gz"
  3324. actual-value: "foo-1.tar.gz"
  3325. result: PASS
  3326.  
  3327. test-name: origin-actual-file-name, file-name
  3328. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:257
  3329. source:
  3330. + (test-equal
  3331. +   "origin-actual-file-name, file-name"
  3332. +   "foo-1.tar.gz"
  3333. +   (let ((o (dummy-origin
  3334. +              (uri "http://www.example.com/tarball")
  3335. +              (file-name "foo-1.tar.gz"))))
  3336. +     (origin-actual-file-name o)))
  3337. expected-value: "foo-1.tar.gz"
  3338. actual-value: "foo-1.tar.gz"
  3339. result: PASS
  3340.  
  3341. test-name: package-direct-sources, no source
  3342. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:274
  3343. source:
  3344. + (test-assert
  3345. +   "package-direct-sources, no source"
  3346. +   (null? (package-direct-sources a)))
  3347. actual-value: #t
  3348. result: PASS
  3349.  
  3350. test-name: package-direct-sources, #f source
  3351. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:276
  3352. source:
  3353. + (test-equal
  3354. +   "package-direct-sources, #f source"
  3355. +   (list i)
  3356. +   (package-direct-sources b))
  3357. expected-value: (#<origin "http://www.example.com" xx35467pxx35467pxx35467pxx35467pxx35467pxx35467pxx3q () 18a7360>)
  3358. actual-value: (#<origin "http://www.example.com" xx35467pxx35467pxx35467pxx35467pxx35467pxx35467pxx3q () 18a7360>)
  3359. result: PASS
  3360.  
  3361. test-name: package-direct-sources, not input source
  3362. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:279
  3363. source:
  3364. + (test-equal
  3365. +   "package-direct-sources, not input source"
  3366. +   (list u)
  3367. +   (package-direct-sources d))
  3368. expected-value: (#<origin "http://www.example.com" xx35467pxx35467pxx35467pxx35467pxx35467pxx35467pxx3q () 18a7420>)
  3369. actual-value: (#<origin "http://www.example.com" xx35467pxx35467pxx35467pxx35467pxx35467pxx35467pxx3q () 18a7420>)
  3370. result: PASS
  3371.  
  3372. test-name: package-direct-sources
  3373. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:282
  3374. source:
  3375. + (test-assert
  3376. +   "package-direct-sources"
  3377. +   (let ((s (package-direct-sources c)))
  3378. +     (and (= (length (pk 's-sources s)) 2)
  3379. +          (member o s)
  3380. +          (member i s))))
  3381.  
  3382. ;;; (s-sources (#<origin "http://www.example.com" xx35467pxx35467pxx35467pxx35467pxx35467pxx35467pxx3q () 18a74e0> #<origin "http://www.example.com" xx35467pxx35467pxx35467pxx35467pxx35467pxx35467pxx3q () 18a7360>))
  3383. actual-value: (#<origin "http://www.example.com" xx35467pxx35467pxx35467pxx35467pxx35467pxx35467pxx3q () 18a7360>)
  3384. result: PASS
  3385.  
  3386. test-name: package-transitive-sources
  3387. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:287
  3388. source:
  3389. + (test-assert
  3390. +   "package-transitive-sources"
  3391. +   (let ((s (package-transitive-sources d)))
  3392. +     (and (= (length (pk 'd-sources s)) 3)
  3393. +          (member o s)
  3394. +          (member i s)
  3395. +          (member u s))))
  3396.  
  3397. ;;; (d-sources (#<origin "http://www.example.com" xx35467pxx35467pxx35467pxx35467pxx35467pxx35467pxx3q () 18a7420> #<origin "http://www.example.com" xx35467pxx35467pxx35467pxx35467pxx35467pxx35467pxx3q () 18a74e0> #<origin "http://www.example.com" xx35467pxx35467pxx35467pxx35467pxx35467pxx35467pxx3q () 18a7360>))
  3398. actual-value: (#<origin "http://www.example.com" xx35467pxx35467pxx35467pxx35467pxx35467pxx35467pxx3q () 18a7420> #<origin "http://www.example.com" xx35467pxx35467pxx35467pxx35467pxx35467pxx35467pxx3q () 18a74e0> #<origin "http://www.example.com" xx35467pxx35467pxx35467pxx35467pxx35467pxx35467pxx3q () 18a7360>)
  3399. result: PASS
  3400.  
  3401. test-name: transitive-input-references
  3402. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:294
  3403. source:
  3404. + (test-assert
  3405. +   "transitive-input-references"
  3406. +   (let* ((a (dummy-package "a"))
  3407. +          (b (dummy-package "b"))
  3408. +          (c (dummy-package
  3409. +               "c"
  3410. +               (inputs `(("a" ,a)))
  3411. +               (propagated-inputs `(("boo" ,b)))))
  3412. +          (d (dummy-package "d" (inputs `(("c*" ,c)))))
  3413. +          (keys (map (match-lambda (('assoc-ref 'l key) key))
  3414. +                     (pk 'refs
  3415. +                         (transitive-input-references
  3416. +                           'l
  3417. +                           (package-inputs d))))))
  3418. +     (and (= (length keys) 2)
  3419. +          (member "c*" keys)
  3420. +          (member "boo" keys))))
  3421.  
  3422. ;;; (refs ((assoc-ref l "c*") (assoc-ref l "boo")))
  3423. actual-value: ("boo")
  3424. result: PASS
  3425.  
  3426. test-name: package-transitive-supported-systems, implicit inputs
  3427. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:311
  3428. source:
  3429. + (test-equal
  3430. +   "package-transitive-supported-systems, implicit inputs"
  3431. +   %supported-systems
  3432. +   (let ((p (dummy-package
  3433. +              "foo"
  3434. +              (build-system gnu-build-system)
  3435. +              (supported-systems
  3436. +                `("does-not-exist" "foobar" ,@%supported-systems)))))
  3437. +     (package-transitive-supported-systems p)))
  3438. expected-value: ("x86_64-linux" "i686-linux" "armhf-linux" "mips64el-linux")
  3439. actual-value: ("x86_64-linux" "i686-linux" "armhf-linux" "mips64el-linux")
  3440. result: PASS
  3441.  
  3442. test-name: supported-package?
  3443. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:322
  3444. source:
  3445. + (test-assert
  3446. +   "supported-package?"
  3447. +   (let ((p (dummy-package
  3448. +              "foo"
  3449. +              (build-system gnu-build-system)
  3450. +              (supported-systems
  3451. +                '("x86_64-linux" "does-not-exist")))))
  3452. +     (and (supported-package? p "x86_64-linux")
  3453. +          (not (supported-package? p "does-not-exist"))
  3454. +          (not (supported-package? p "i686-linux")))))
  3455. actual-value: #t
  3456. result: PASS
  3457.  
  3458. test-name: package-source-derivation, file
  3459. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:332
  3460. source:
  3461. + (test-assert
  3462. +   "package-source-derivation, file"
  3463. +   (let* ((file (search-path %load-path "guix.scm"))
  3464. +          (package
  3465. +            (package
  3466. +              (inherit (dummy-package "p"))
  3467. +              (source file)))
  3468. +          (source
  3469. +            (package-source-derivation
  3470. +              %store
  3471. +              (package-source package))))
  3472. +     (and (store-path? source)
  3473. +          (valid-path? %store source)
  3474. +          (equal?
  3475. +            (call-with-input-file source get-bytevector-all)
  3476. +            (call-with-input-file file get-bytevector-all)))))
  3477. actual-value: #t
  3478. result: PASS
  3479.  
  3480. test-name: package-source-derivation, store path
  3481. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:343
  3482. source:
  3483. + (test-assert
  3484. +   "package-source-derivation, store path"
  3485. +   (let* ((file (add-to-store
  3486. +                  %store
  3487. +                  "guix.scm"
  3488. +                  #t
  3489. +                  "sha256"
  3490. +                  (search-path %load-path "guix.scm")))
  3491. +          (package
  3492. +            (package
  3493. +              (inherit (dummy-package "p"))
  3494. +              (source file)))
  3495. +          (source
  3496. +            (package-source-derivation
  3497. +              %store
  3498. +              (package-source package))))
  3499. +     (string=? file source)))
  3500. actual-value: #t
  3501. result: PASS
  3502.  
  3503. test-name: package-source-derivation, indirect store path
  3504. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:352
  3505. source:
  3506. + (test-assert
  3507. +   "package-source-derivation, indirect store path"
  3508. +   (let* ((dir (add-to-store
  3509. +                 %store
  3510. +                 "guix-build"
  3511. +                 #t
  3512. +                 "sha256"
  3513. +                 (dirname
  3514. +                   (search-path %load-path "guix/build/utils.scm"))))
  3515. +          (package
  3516. +            (package
  3517. +              (inherit (dummy-package "p"))
  3518. +              (source (string-append dir "/utils.scm"))))
  3519. +          (source
  3520. +            (package-source-derivation
  3521. +              %store
  3522. +              (package-source package))))
  3523. +     (and (direct-store-path? source)
  3524. +          (string-suffix? "utils.scm" source))))
  3525. actual-value: #t
  3526. result: PASS
  3527.  
  3528. test-name: package-source-derivation, local-file
  3529. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:363
  3530. source:
  3531. + (test-assert
  3532. +   "package-source-derivation, local-file"
  3533. +   (let* ((file (local-file "../guix/base32.scm"))
  3534. +          (package
  3535. +            (package
  3536. +              (inherit (dummy-package "p"))
  3537. +              (source file)))
  3538. +          (source
  3539. +            (package-source-derivation
  3540. +              %store
  3541. +              (package-source package))))
  3542. +     (and (store-path? source)
  3543. +          (string-suffix? "base32.scm" source)
  3544. +          (valid-path? %store source)
  3545. +          (equal?
  3546. +            (call-with-input-file source get-bytevector-all)
  3547. +            (call-with-input-file
  3548. +              (search-path %load-path "guix/base32.scm")
  3549. +              get-bytevector-all)))))
  3550. actual-value: #t
  3551. result: PASS
  3552.  
  3553. test-name: package-source-derivation, snippet
  3554. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:378
  3555. source:
  3556. + (test-equal
  3557. +   "package-source-derivation, snippet"
  3558. +   "OK"
  3559. +   (let* ((file (search-bootstrap-binary
  3560. +                  (match (%current-system)
  3561. +                         ("armhf-linux" "guile-2.0.11.tar.xz")
  3562. +                         ("aarch64-linux" "guile-2.0.14.tar.xz")
  3563. +                         (_ "guile-2.0.9.tar.xz"))
  3564. +                  (%current-system)))
  3565. +          (sha256 (call-with-input-file file port-sha256))
  3566. +          (fetch (lambda* (url hash-algo hash #:optional name #:key system)
  3567. +                   (pk 'fetch url hash-algo hash name system)
  3568. +                   (interned-file url)))
  3569. +          (source
  3570. +            (bootstrap-origin
  3571. +              (origin
  3572. +                (method fetch)
  3573. +                (uri file)
  3574. +                (sha256 sha256)
  3575. +                (patch-inputs
  3576. +                  `(("tar" ,%bootstrap-coreutils&co)
  3577. +                    ("xz" ,%bootstrap-coreutils&co)
  3578. +                    ("patch" ,%bootstrap-coreutils&co)))
  3579. +                (patch-guile %bootstrap-guile)
  3580. +                (modules '((guix build utils)))
  3581. +                (snippet
  3582. +                  '(begin
  3583. +                     (chmod "." 511)
  3584. +                     (symlink "guile" "guile-rocks")
  3585. +                     (copy-recursively
  3586. +                       "../share/guile/2.0/scripts"
  3587. +                       "scripts")
  3588. +                     (chmod ".." 511))))))
  3589. +          (package
  3590. +            (package
  3591. +              (inherit (dummy-package "with-snippet"))
  3592. +              (source source)
  3593. +              (build-system trivial-build-system)
  3594. +              (inputs
  3595. +                `(("tar"
  3596. +                   ,(search-bootstrap-binary "tar" (%current-system)))
  3597. +                  ("xz"
  3598. +                   ,(search-bootstrap-binary "xz" (%current-system)))))
  3599. +              (arguments
  3600. +                `(#:guile
  3601. +                  ,%bootstrap-guile
  3602. +                  #:builder
  3603. +                  (let ((tar (assoc-ref %build-inputs "tar"))
  3604. +                        (xz (assoc-ref %build-inputs "xz"))
  3605. +                        (source (assoc-ref %build-inputs "source")))
  3606. +                    (and (zero? (system*
  3607. +                                  tar
  3608. +                                  "xvf"
  3609. +                                  source
  3610. +                                  "--use-compress-program"
  3611. +                                  xz))
  3612. +                         (string=? "guile" (readlink "bin/guile-rocks"))
  3613. +                         (file-exists? "bin/scripts/compile.scm")
  3614. +                         (let ((out (assoc-ref %outputs "out")))
  3615. +                           (call-with-output-file
  3616. +                             out
  3617. +                             (lambda (p) (display "OK" p))))))))))
  3618. +          (drv (package-derivation %store package))
  3619. +          (out (derivation->output-path drv)))
  3620. +     (and (build-derivations
  3621. +            %store
  3622. +            (list (pk 'snippet-drv drv)))
  3623. +          (call-with-input-file out get-string-all))))
  3624. result: SKIP
  3625.  
  3626. test-name: return value
  3627. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:442
  3628. source:
  3629. + (test-assert
  3630. +   "return value"
  3631. +   (let ((drv (package-derivation %store (dummy-package "p"))))
  3632. +     (and (derivation? drv)
  3633. +          (file-exists? (derivation-file-name drv)))))
  3634. actual-value: #t
  3635. result: PASS
  3636.  
  3637. test-name: package-output
  3638. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:447
  3639. source:
  3640. + (test-assert
  3641. +   "package-output"
  3642. +   (let* ((package (dummy-package "p"))
  3643. +          (drv (package-derivation %store package)))
  3644. +     (and (derivation? drv)
  3645. +          (string=?
  3646. +            (derivation->output-path drv)
  3647. +            (package-output %store package "out")))))
  3648. actual-value: #t
  3649. result: PASS
  3650.  
  3651. test-name: patch not found yields a run-time error
  3652. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:454
  3653. source:
  3654. + (test-assert
  3655. +   "patch not found yields a run-time error"
  3656. +   (guard (c ((condition-has-type? c &message)
  3657. +              (and (string-contains
  3658. +         random seed for tests: 1495495375
  3659. package 'foo' has been superseded by 'bar'
  3660. package 'foo' has been superseded by 'bar'
  3661. package 'foo' has been superseded by 'bar'
  3662. package 'foo' has been superseded by 'bar'
  3663. @ build-started /tmp/guix-tests/store/hvyvgjygf729vfvbpl2k3dqvsiwx59cw-trivial-0.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/hv//yvgjygf729vfvbpl2k3dqvsiwx59cw-trivial-0.drv.bz2
  3664. @ build-succeeded /tmp/guix-tests/store/hvyvgjygf729vfvbpl2k3dqvsiwx59cw-trivial-0.drv -
  3665.             (condition-message c)
  3666. +                     "does-not-exist.patch")
  3667. +                   (string-contains
  3668. +                     (condition-message c)
  3669. +                     "not found"))))
  3670. +          (let ((p (package
  3671. +                     (inherit (dummy-package "p"))
  3672. +                     (source
  3673. +                       (origin
  3674. +                         (method (const #f))
  3675. +                         (uri "http://whatever")
  3676. +                         (patches
  3677. +                           (list (search-patch "does-not-exist.patch")))
  3678. +                         (sha256
  3679. +                           (base32
  3680. +                             "0amn0bbwqvsvvsh6drfwz20ydc2czk374lzw5kksbh6bf78k4ks4")))))))
  3681. +            (package-derivation %store p)
  3682. +            #f)))
  3683. actual-value: 28
  3684. result: PASS
  3685.  
  3686. test-name: &package-input-error
  3687. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:474
  3688. source:
  3689. + (test-equal
  3690. +   "&package-input-error"
  3691. +   (list dummy (current-module))
  3692. +   (guard (c ((package-input-error? c)
  3693. +              (list (package-error-package c)
  3694. +                    (package-error-invalid-input c))))
  3695. +          (package-derivation %store dummy)))
  3696. expected-value: (#<package foo@0 /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:473 20f7900> #<directory (test-packages) 801320>)
  3697. actual-value: (#<package foo@0 /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:473 20f7900> #<directory (test-packages) 801320>)
  3698. result: PASS
  3699.  
  3700. test-name: reference to non-existent output
  3701. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:481
  3702. source:
  3703. + (test-assert
  3704. +   "reference to non-existent output"
  3705. +   (parameterize
  3706. +     ((%graft? #f))
  3707. +     (let* ((dep (dummy-package "dep"))
  3708. +            (p (dummy-package
  3709. +                 "p"
  3710. +                 (inputs `(("dep" ,dep "non-existent"))))))
  3711. +       (guard (c ((derivation-missing-output-error? c)
  3712. +                  (and (string=?
  3713. +                         (derivation-missing-output c)
  3714. +                         "non-existent")
  3715. +                       (equal?
  3716. +                         (package-derivation %store dep)
  3717. +                         (derivation-error-derivation c)))))
  3718. +              (package-derivation %store p)))))
  3719. actual-value: #t
  3720. result: PASS
  3721.  
  3722. test-name: trivial
  3723. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:493
  3724. source:
  3725. + (test-assert
  3726. +   "trivial"
  3727. +   (let* ((p (package
  3728. +               (inherit (dummy-package "trivial"))
  3729. +               (build-system trivial-build-system)
  3730. +               (source #f)
  3731. +               (arguments
  3732. +                 `(#:guile
  3733. +                   ,%bootstrap-guile
  3734. +                   #:builder
  3735. +                   (begin
  3736. +                     (mkdir %output)
  3737. +                     (call-with-output-file
  3738. +                       (string-append %output "/test")
  3739. +                       (lambda (p) (display '(hello guix) p))))))))
  3740. +          (d (package-derivation %store p)))
  3741. +     (and (build-derivations %store (list d))
  3742. +          (let ((p (pk 'drv d (derivation->output-path d))))
  3743. +            (equal?
  3744. +              '(hello guix)
  3745. +              (call-with-input-file
  3746. +                (string-append p "/test")
  3747. +                read))))))
  3748.  
  3749. ;;; (drv #<derivation /tmp/guix-tests/store/hvyvgjygf729vfvbpl2k3dqvsiwx59cw-trivial-0.drv => /tmp/guix-tests/store/3pp7cs8ycxg16yldqd62lrk306ck1g72-trivial-0 1ab4f00> "/tmp/guix-tests/store/3pp7cs8ycxg16yldqd62lrk306ck1g72-trivial-0")
  3750. actual-value: #t
  3751. result: PASS
  3752.  
  3753. test-name: trivial with local file as input
  3754. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:511
  3755. source:
  3756. + (test-assert
  3757. +   "trivial with local file as input"
  3758. +   (let* ((i (search-path %load-path "ice-9/boot-9.scm"))
  3759. +          (p (package
  3760. +               (inherit
  3761. +                 (dummy-package "trivial-with-input-file"))
  3762. +               (build-system trivial-build-system)
  3763. +               (source #f)
  3764. +               (arguments
  3765. +                 `(#:guile
  3766. +                   ,%bootstrap-guile
  3767. +                   #:builder
  3768. +                   (copy-file
  3769. +         @ build-started /tmp/guix-tests/store/a6yjh360wy274bw6v69b7i4ybgznhc72-trivial-with-input-file-0.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/a6//yjh360wy274bw6v69b7i4ybgznhc72-trivial-with-input-file-0.drv.bz2
  3770. @ build-succeeded /tmp/guix-tests/store/a6yjh360wy274bw6v69b7i4ybgznhc72-trivial-with-input-file-0.drv -
  3771. @ build-started /tmp/guix-tests/store/62hvlyvzl8zdm919i5f51clhvy5a5yab-trivial-with-source-0.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/62//hvlyvzl8zdm919i5f51clhvy5a5yab-trivial-with-source-0.drv.bz2
  3772. @ build-succeeded /tmp/guix-tests/store/62hvlyvzl8zdm919i5f51clhvy5a5yab-trivial-with-source-0.drv -
  3773. @ build-started /tmp/guix-tests/store/jmw8n1jv0clislyswj0gnc7mm52q0kjv-trivial-system-dependent-input-0.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/jm//w8n1jv0clislyswj0gnc7mm52q0kjv-trivial-system-dependent-input-0.drv.bz2
  3774. @ build-succeeded /tmp/guix-tests/store/jmw8n1jv0clislyswj0gnc7mm52q0kjv-trivial-system-dependent-input-0.drv -
  3775.             (assoc-ref %build-inputs "input")
  3776. +                     %output)))
  3777. +               (inputs `(("input" ,i)))))
  3778. +          (d (package-derivation %store p)))
  3779. +     (and (build-derivations %store (list d))
  3780. +          (let ((p (pk 'drv d (derivation->output-path d))))
  3781. +            (equal?
  3782. +              (call-with-input-file p get-bytevector-all)
  3783. +              (call-with-input-file i get-bytevector-all))))))
  3784.  
  3785. ;;; (drv #<derivation /tmp/guix-tests/store/a6yjh360wy274bw6v69b7i4ybgznhc72-trivial-with-input-file-0.drv => /tmp/guix-tests/store/ig6yxsjih7q2g4zmlplm1psjz5yprqad-trivial-with-input-file-0 1ab4dc0> "/tmp/guix-tests/store/ig6yxsjih7q2g4zmlplm1psjz5yprqad-trivial-with-input-file-0")
  3786. actual-value: #t
  3787. result: PASS
  3788.  
  3789. test-name: trivial with source
  3790. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:527
  3791. source:
  3792. + (test-assert
  3793. +   "trivial with source"
  3794. +   (let* ((i (search-path %load-path "ice-9/boot-9.scm"))
  3795. +          (p (package
  3796. +               (inherit (dummy-package "trivial-with-source"))
  3797. +               (build-system trivial-build-system)
  3798. +               (source i)
  3799. +               (arguments
  3800. +                 `(#:guile
  3801. +                   ,%bootstrap-guile
  3802. +                   #:builder
  3803. +                   (copy-file
  3804. +                     (assoc-ref %build-inputs "source")
  3805. +                     %output)))))
  3806. +          (d (package-derivation %store p)))
  3807. +     (and (build-derivations %store (list d))
  3808. +          (let ((p (derivation->output-path d)))
  3809. +            (equal?
  3810. +              (call-with-input-file p get-bytevector-all)
  3811. +              (call-with-input-file i get-bytevector-all))))))
  3812. actual-value: #t
  3813. result: PASS
  3814.  
  3815. test-name: trivial with system-dependent input
  3816. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:542
  3817. source:
  3818. + (test-assert
  3819. +   "trivial with system-dependent input"
  3820. +   (let* ((p (package
  3821. +               (inherit
  3822. +                 (dummy-package "trivial-system-dependent-input"))
  3823. +               (build-system trivial-build-system)
  3824. +               (source #f)
  3825. +               (arguments
  3826. +                 `(#:guile
  3827. +                   ,%bootstrap-guile
  3828. +                   #:builder
  3829. +                   (let ((out (assoc-ref %outputs "out"))
  3830. +                         (bash (assoc-ref %build-inputs "bash")))
  3831. +                     (zero? (system*
  3832. +                              bash
  3833. +                              "-c"
  3834. +                              (format #f "echo hello > ~a" out))))))
  3835. +               (inputs
  3836. +                 `(("bash"
  3837. +                    ,(search-bootstrap-binary
  3838. +                       "bash"
  3839. +                       (%current-system)))))))
  3840. +          (d (package-derivation %store p)))
  3841. +     (and (build-derivations %store (list d))
  3842. +          (let ((p (pk 'drv d (derivation->output-path d))))
  3843. +            (eq? 'hello (call-with-input-file p read))))))
  3844.  
  3845. ;;; (drv #<derivation /tmp/guix-tests/store/jmw8n1jv0clislyswj0gnc7mm52q0kjv-trivial-system-dependent-input-0.drv => /tmp/guix-tests/store/8pqmam9mmnpd071ya49hv33dnp8p24f5-trivial-system-dependent-input-0 1ab4960> "/tmp/guix-tests/store/8pqmam9mmnpd071ya49hv33dnp8p24f5-trivial-system-dependent-input-0")
  3846. actual-value: #t
  3847. result: PASS
  3848.  
  3849. test-name: search paths
  3850. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:560
  3851. source:
  3852. + (test-assert
  3853. +   "search paths"
  3854. +   (let* ((p (make-prompt-tag "return-search-paths"))
  3855. +          (s (build-system
  3856. +               (name 'raw)
  3857. +               (description
  3858. +                 "Raw build system with direct store access")
  3859. +               (lower (lambda* (name
  3860. +                                #:key
  3861. +                                source
  3862. +                                inputs
  3863. +                                system
  3864. +                                target
  3865. +                                #:allow-other-keys)
  3866. +                        (bag (name name)
  3867. +                             (system system)
  3868. +                             (target target)
  3869. +                             (build-inputs inputs)
  3870. +                             (build (lambda* (store
  3871. +                                              name
  3872. +                                              inputs
  3873. +                                              #:key
  3874. +                                              outputs
  3875. +                                              system
  3876. +                                              search-paths)
  3877. +                                      search-paths)))))))
  3878. +          (x (list (search-path-specification
  3879. +                     (variable "GUILE_LOAD_PATH")
  3880. +                     (files '("share/guile/site/2.0")))
  3881. +                   (search-path-specification
  3882. +                     (variable "GUILE_LOAD_COMPILED_PATH")
  3883. +                     (files '("share/guile/site/2.0")))))
  3884. +          (a (package
  3885. +               (inherit (dummy-package "guile"))
  3886. +               (build-system s)
  3887. +               (native-search-paths x)))
  3888. +          (b (package
  3889. +               (inherit (dummy-package "guile-foo"))
  3890. +               (build-system s)
  3891. +               (inputs `(("guile" ,a)))))
  3892. +          (c (package
  3893. +               (inherit (dummy-package "guile-bar"))
  3894. +               (build-system s)
  3895. +               (inputs `(("guile" ,a) ("guile-foo" ,b))))))
  3896. +     (let-syntax ((collect
  3897. +                    (syntax-rules ()
  3898. +                      ((_ body ...)
  3899. +                       (call-with-prompt
  3900. +                         p
  3901. +                         (lambda () body ...)
  3902. +                         (lambda (k search-paths) search-paths))))))
  3903. +       (and (null? (collect (package-derivation %store a)))
  3904. +            (equal?
  3905. +              x
  3906. +              (collect (package-derivation %store b)))
  3907. +            (equal?
  3908. +              x
  3909. +              (collect (package-derivation %store c)))))))
  3910. actual-value: #t
  3911. result: PASS
  3912.  
  3913. test-name: package-transitive-native-search-paths
  3914. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:602
  3915. source:
  3916. + (test-assert
  3917. +   "package-transitive-native-search-paths"
  3918. +   (let* ((sp (lambda (name)
  3919. +                (list (search-path-specification
  3920. +                        (variable name)
  3921. +                        (files '("foo/bar"))))))
  3922. +          (p0 (dummy-package
  3923. +                "p0"
  3924. +                (native-search-paths (sp "PATH0"))))
  3925. +          (p1 (dummy-package
  3926. +                "p1"
  3927. +                (native-search-paths (sp "PATH1"))))
  3928. +          (p2 (dummy-package
  3929. +                "p2"
  3930. +                (native-search-paths (sp "PATH2"))
  3931. +                (inputs `(("p0" ,p0)))
  3932. +                (propagated-inputs `(("p1" ,p1)))))
  3933. +          (p3 (dummy-package
  3934. +                "p3"
  3935. +                (native-search-paths (sp "PATH3"))
  3936. +                (native-inputs `(("p0" ,p0)))
  3937. +                (propagated-inputs `(("p2" ,p2))))))
  3938. +     (lset= string=?
  3939. +            '("PATH1" "PATH2" "PATH3")
  3940. +            (map search-path-specification-variable
  3941. +                 (package-transitive-native-search-paths p3)))))
  3942. actual-value: #t
  3943. result: PASS
  3944.  
  3945. test-name: package-cross-derivation
  3946. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:622
  3947. source:
  3948. + (test-assert
  3949. +   "package-cross-derivation"
  3950. +   (let ((drv (package-cross-derivation
  3951. +                %store
  3952. +                (dummy-package "p")
  3953. +                "mips64el-linux-gnu")))
  3954. +     (and (derivation? drv)
  3955. +          (file-exists? (derivation-file-name drv)))))
  3956. actual-value: #t
  3957. result: PASS
  3958.  
  3959. test-name: package-cross-derivation, trivial-build-system
  3960. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:628
  3961. source:
  3962. + (test-assert
  3963. +   "package-cross-derivation, trivial-build-system"
  3964. +   (let ((p (package
  3965. +              (inherit (dummy-package "p"))
  3966. +              (build-system trivial-build-system)
  3967. +              (arguments '(#:builder (exit 1))))))
  3968. +     (let ((drv (package-cross-derivation
  3969. +                  %store
  3970. +                  p
  3971. +                  "mips64el-linux-gnu")))
  3972. +       (derivation? drv))))
  3973. actual-value: #t
  3974. result: PASS
  3975.  
  3976. test-name: package-cross-derivation, no cross builder
  3977. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:635
  3978. source:
  3979. + (test-assert
  3980. +   "package-cross-derivation, no cross builder"
  3981. +   (let* ((b (build-system
  3982. +               (inherit trivial-build-system)
  3983. +               (lower (const #f))))
  3984. +          (p (package
  3985. +               (inherit (dummy-package "p"))
  3986. +               (build-system b))))
  3987. +     (guard (c ((package-cross-build-system-error? c)
  3988. +                (eq? (package-error-package c) p)))
  3989. +            (package-cross-derivation
  3990. +              %store
  3991. +              p
  3992. +              "mips64el-linux-gnu")
  3993. +            #f)))
  3994. actual-value: #t
  3995. result: PASS
  3996.  
  3997. test-name: package-grafts, indirect grafts
  3998. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:663
  3999. source:
  4000. + (test-assert
  4001. +   "package-grafts, indirect grafts"
  4002. +   (let* ((new (dummy-package
  4003. +                 "dep"
  4004. +                 (arguments '(#:implicit-inputs? #f))))
  4005. +          (dep (package (inherit new) (version "0.0")))
  4006. +          (dep* (package (inherit dep) (replacement new)))
  4007. +          (dummy (dummy-package
  4008. +                   "dummy"
  4009. +                   (arguments '(#:implicit-inputs? #f))
  4010. +                   (inputs `(("dep" ,dep*))))))
  4011. +     (equal?
  4012. +       (package-grafts %store dummy)
  4013. +       (list (graft (origin (package-derivation %store dep))
  4014. +                    (replacement (package-derivation %store new)))))))
  4015. actual-value: #t
  4016. result: PASS
  4017.  
  4018. test-name: package-grafts, indirect grafts, propagated inputs
  4019. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:696
  4020. source:
  4021. + (test-assert
  4022. +   "package-grafts, indirect grafts, propagated inputs"
  4023. +   (let* ((new (dummy-package
  4024. +                 "dep"
  4025. +                 (arguments '(#:implicit-inputs? #f))))
  4026. +          (dep (package (inherit new) (version "0.0")))
  4027. +          (dep* (package (inherit dep) (replacement new)))
  4028. +          (prop (dummy-package
  4029. +                  "propagated"
  4030. +                  (propagated-inputs `(("dep" ,dep*)))
  4031. +                  (arguments '(#:implicit-inputs? #f))))
  4032. +          (dummy (dummy-package
  4033. +                   "dummy"
  4034. +                   (arguments '(#:implicit-inputs? #f))
  4035. +                   (inputs `(("prop" ,prop))))))
  4036. +     (equal?
  4037. +       (package-grafts %store dummy)
  4038. +       (list (graft (origin (package-derivation %store dep))
  4039. +                    (replacement (package-derivation %store new)))))))
  4040. actual-value: #t
  4041. result: PASS
  4042.  
  4043. test-name: package-grafts, same replacement twice
  4044. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:712
  4045. source:
  4046. + (test-assert
  4047. +   "package-grafts, same replacement twice"
  4048. +   (let* ((new (dummy-package
  4049. +                 "dep"
  4050. +                 (version "1")
  4051. +                 (arguments '(#:implicit-inputs? #f))))
  4052. +          (dep (package
  4053. +                 (inherit new)
  4054. +                 (version "0")
  4055. +                 (replacement new)))
  4056. +          (p1 (dummy-package
  4057. +                "intermediate1"
  4058. +                (arguments '(#:implicit-inputs? #f))
  4059. +                (inputs `(("dep" ,dep)))))
  4060. +          (p2 (dummy-package
  4061. +                "intermediate2"
  4062. +                (arguments '(#:implicit-inputs? #f))
  4063. +                (inputs `(("dep" ,(package (inherit dep)))))))
  4064. +          (p3 (dummy-package
  4065. +                "final"
  4066. +                (arguments '(#:implicit-inputs? #f))
  4067. +                (inputs `(("p1" ,p1) ("p2" ,p2))))))
  4068. +     (equal?
  4069. +       (package-grafts %store p3)
  4070. +       (list (graft (origin
  4071. +                      (package-derivation
  4072. +                        %store
  4073. +                        (package (inherit dep) (replacement #f))))
  4074. +                    (replacement (package-derivation %store new)))))))
  4075. actual-value: #t
  4076. result: PASS
  4077.  
  4078. test-name: replacement also grafted
  4079. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:736
  4080. source:
  4081. + (test-assert
  4082. +   "replacement also grafted"
  4083. +   (let* ((p1r (dummy-package
  4084. +                 "P1"
  4085. +                 (build-system trivial-build-system)
  4086. +                 (arguments
  4087. +                   `(#:guile
  4088. +                     ,%bootstrap-guile
  4089. +                     #:builder
  4090. +                     (let ((out (assoc-ref %outputs "out")))
  4091. + @ build-started /tmp/guix-tests/store/4fy6qbf23zv784brzwpkkrmwpnmbp2gr-p1-0.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/4f//y6qbf23zv784brzwpkkrmwpnmbp2gr-p1-0.drv.bz2
  4092. @ build-succeeded /tmp/guix-tests/store/4fy6qbf23zv784brzwpkkrmwpnmbp2gr-p1-0.drv -
  4093. @ build-started /tmp/guix-tests/store/107g7qq7946g9vvbp8vqcpx98xjb79df-P2-0.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/10//7g7qq7946g9vvbp8vqcpx98xjb79df-P2-0.drv.bz2
  4094. @ build-succeeded /tmp/guix-tests/store/107g7qq7946g9vvbp8vqcpx98xjb79df-P2-0.drv -
  4095.                       (mkdir out)
  4096. +                       (call-with-output-file
  4097. +                         (string-append out "/replacement")
  4098. +                         (const #t)))))))
  4099. +          (p1 (package
  4100. +                (inherit p1r)
  4101. +                (name "p1")
  4102. +                (replacement p1r)
  4103. +                (arguments
  4104. +                  `(#:guile
  4105. +                    ,%bootstrap-guile
  4106. +                    #:builder
  4107. +                    (mkdir (assoc-ref %outputs "out"))))))
  4108. +          (p2r (dummy-package
  4109. +                 "P2"
  4110. +                 (build-system trivial-build-system)
  4111. +                 (inputs `(("p1" ,p1)))
  4112. +                 (arguments
  4113. +                   `(#:guile
  4114. +                     ,%bootstrap-guile
  4115. +                     #:builder
  4116. +                     (let ((out (assoc-ref %outputs "out")))
  4117. +                       (mkdir out)
  4118. +                       (chdir out)
  4119. +                       (symlink (assoc-ref %build-inputs "p1") "p1")
  4120. +                       (call-with-output-file
  4121. +                         (string-append out "/replacement")
  4122. +                         (const #t)))))))
  4123. +          (p2 (package
  4124. +                (inherit p2r)
  4125. +                (name "p2")
  4126. +                (replacement p2r)
  4127. +                (arguments
  4128. +                  `(#:guile
  4129. +                    ,%bootstrap-guile
  4130. +                    #:builder
  4131. +                    (let ((out (assoc-ref %outputs "out")))
  4132. +                      (mkdir out)
  4133. +                      (chdir out)
  4134. +                      (symlink (assoc-ref %build-inputs "p1") "p1"))))))
  4135. +          (p3 (dummy-package
  4136. +                "p3"
  4137. +                (build-system trivial-build-system)
  4138. +                (inputs `(("p2" ,p2)))
  4139. +                (arguments
  4140. +                  `(#:guile
  4141. +                    ,%bootstrap-guile
  4142. +                    #:builder
  4143. +                    (let ((out (assoc-ref %outputs "out")))
  4144. +                      (mkdir out)
  4145. +                      (chdir out)
  4146. +                      (symlink (assoc-ref %build-inputs "p2") "p2")))))))
  4147. +     (lset= equal?
  4148. +            (package-grafts %store p3)
  4149. +            (list (graft (origin
  4150. +                           (package-derivation %store p1 #:graft? #f))
  4151. +                         (replacement (package-derivation %store p1r)))
  4152. +                  (graft (origin
  4153. +                           (package-derivation %store p2 #:graft? #f))
  4154. +                         (replacement
  4155. +                           (package-derivation %store p2r #:graft? #t)))))))
  4156. actual-value: #t
  4157. result: PASS
  4158.  
  4159. test-name: package->bag
  4160. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:829
  4161. source:
  4162. + (test-equal
  4163. +   "package->bag"
  4164. +   `("foo86-hurd"
  4165. +     #f
  4166. +     (,(package-source gnu-make))
  4167. +     (,(canonical-package glibc))
  4168. +     (,(canonical-package coreutils)))
  4169. +   (let ((bag (package->bag gnu-make "foo86-hurd")))
  4170. +     (list (bag-system bag)
  4171. +           (bag-target bag)
  4172. +           (assoc-ref (bag-build-inputs bag) "source")
  4173. +           (assoc-ref (bag-build-inputs bag) "libc")
  4174. +           (assoc-ref (bag-build-inputs bag) "coreutils"))))
  4175. expected-value: ("foo86-hurd" #f (#<origin "mirror://gnu/make/make-4.2.1.tar.bz2" 23rgfpzwag2c2ky6j34dcabj4hopeaedyvcgws32uzyid7p7yweq ("/tmp/guix-build-guix-0.13.0.drv-0/source/gnu/packages/patches/make-impure-dirs.patch") 192d420>) (#<package glibc@2.25 gnu/packages/commencement.scm:643 1c0b240>) (#<package coreutils@8.26 gnu/packages/bootstrap.scm:147 1c0d180>))
  4176. actual-value: ("foo86-hurd" #f (#<origin "mirror://gnu/make/make-4.2.1.tar.bz2" 23rgfpzwag2c2ky6j34dcabj4hopeaedyvcgws32uzyid7p7yweq ("/tmp/guix-build-guix-0.13.0.drv-0/source/gnu/packages/patches/make-impure-dirs.patch") 192d420>) (#<package glibc@2.25 gnu/packages/commencement.scm:643 1c0b240>) (#<package coreutils@8.26 gnu/packages/bootstrap.scm:147 1c0d180>))
  4177. result: PASS
  4178.  
  4179. test-name: package->bag, cross-compilation
  4180. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:838
  4181. source:
  4182. + (test-equal
  4183. +   "package->bag, cross-compilation"
  4184. +   `(,(%current-system)
  4185. +     "foo86-hurd"
  4186. +     (,(package-source gnu-make))
  4187. +     (,(canonical-package glibc))
  4188. +     (,(canonical-package coreutils)))
  4189. +   (let ((bag (package->bag
  4190. +                gnu-make
  4191. +                (%current-system)
  4192. +                "foo86-hurd")))
  4193. +     (list (bag-system bag)
  4194. +           (bag-target bag)
  4195. +           (assoc-ref (bag-build-inputs bag) "source")
  4196. +           (assoc-ref (bag-build-inputs bag) "libc")
  4197. +           (assoc-ref (bag-build-inputs bag) "coreutils"))))
  4198. expected-value: ("x86_64-linux" "foo86-hurd" (#<origin "mirror://gnu/make/make-4.2.1.tar.bz2" 23rgfpzwag2c2ky6j34dcabj4hopeaedyvcgws32uzyid7p7yweq ("/tmp/guix-build-guix-0.13.0.drv-0/source/gnu/packages/patches/make-impure-dirs.patch") 192d420>) (#<package glibc@2.25 gnu/packages/commencement.scm:643 1c0b240>) (#<package coreutils@8.26 gnu/packages/bootstrap.scm:147 1c0d180>))
  4199. actual-value: ("x86_64-linux" "foo86-hurd" (#<origin "mirror://gnu/make/make-4.2.1.tar.bz2" 23rgfpzwag2c2ky6j34dcabj4hopeaedyvcgws32uzyid7p7yweq ("/tmp/guix-build-guix-0.13.0.drv-0/source/gnu/packages/patches/make-impure-dirs.patch") 192d420>) (#<package glibc@2.25 gnu/packages/commencement.scm:643 1c0b240>) (#<package coreutils@8.26 gnu/packages/bootstrap.scm:147 1c0d180>))
  4200. result: PASS
  4201.  
  4202. test-name: package->bag, propagated inputs
  4203. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:848
  4204. source:
  4205. + (test-assert
  4206. +   "package->bag, propagated inputs"
  4207. +   (let* ((dep (dummy-package "dep"))
  4208. +          (prop (dummy-package
  4209. +                  "prop"
  4210. +                  (propagated-inputs `(("dep" ,dep)))))
  4211. +          (dummy (dummy-package
  4212. +                   "dummy"
  4213. +                   (inputs `(("prop" ,prop)))))
  4214. +          (inputs
  4215. +            (bag-transitive-inputs
  4216. +              (package->bag dummy #:graft? #f))))
  4217. +     (match (assoc "dep" inputs)
  4218. +            (("dep" package) (eq? package dep)))))
  4219. actual-value: #t
  4220. result: PASS
  4221.  
  4222. test-name: bag->derivation
  4223. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:859
  4224. source:
  4225. + (test-assert
  4226. +   "bag->derivation"
  4227. +   (parameterize
  4228. +     ((%graft? #f))
  4229. +     (let ((bag (package->bag gnu-make))
  4230. +           (drv (package-derivation %store gnu-make)))
  4231. +       (parameterize
  4232. +         ((%current-system "foox86-hurd"))
  4233. +         (equal? drv (bag->derivation %store bag))))))
  4234. actual-value: #t
  4235. result: PASS
  4236.  
  4237. test-name: bag->derivation, cross-compilation
  4238. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:866
  4239. source:
  4240. + (test-assert
  4241. +   "bag->derivation, cross-compilation"
  4242. +   (parameterize
  4243. +     ((%graft? #f))
  4244. +     (let* ((target "mips64el-linux-gnu")
  4245. +            (bag (package->bag gnu-make (%current-system) target))
  4246. +            (drv (package-cross-derivation %store gnu-make target)))
  4247. +       (parameterize
  4248. +         ((%current-system "foox86-hurd")
  4249. +          (%current-target-system "foo64-linux-gnu"))
  4250. +         (equal? drv (bag->derivation %store bag))))))
  4251. actual-value: #t
  4252. result: PASS
  4253.  
  4254. test-name: GNU Make, bootstrap
  4255. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:877
  4256. source:
  4257. + (test-assert
  4258. +   "GNU Make, bootstrap"
  4259. +   (let ((gnu-make
  4260. +           (@@ (gnu packages commencement) gnu-make-boot0)))
  4261. +     (and (package? gnu-make)
  4262. +          (or (location? (package-location gnu-make))
  4263. +              (not (package-location gnu-make)))
  4264. +          (let* ((drv (package-derivation %store gnu-make))
  4265. +                 (out (derivation->output-path drv)))
  4266. +            (and (build-derivations %store (list drv))
  4267. +                 (file-exists? (string-append out "/bin/make")))))))
  4268. result: SKIP
  4269.  
  4270. test-name: package-mapping
  4271. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:889
  4272. source:
  4273. + (test-equal
  4274. +   "package-mapping"
  4275. +   42
  4276. +   (let* ((dep (dummy-package
  4277. +                 "chbouib"
  4278. +                 (native-inputs `(("x" ,grep)))))
  4279. +          (p0 (dummy-package
  4280. +                "example"
  4281. +                (inputs
  4282. +                  `(("foo" ,coreutils) ("bar" ,grep) ("baz" ,dep)))))
  4283. +          (transform
  4284. +            (lambda (p) (package (inherit p) (source 42))))
  4285. +          (rewrite (package-mapping transform))
  4286. +          (p1 (rewrite p0)))
  4287. +     (and (eq? p1 (rewrite p0))
  4288. +          (eqv? 42 (package-source p1))
  4289. +          (match (package-inputs p1)
  4290. +                 ((("foo" dep1) ("bar" dep2) ("baz" dep3))
  4291. +                  (and (eq? dep1 (rewrite coreutils))
  4292. +                       (eq? dep2 (rewrite grep))
  4293. +                       (eq? dep3 (rewrite dep))
  4294. +                       (eqv? 42
  4295. +                             (package-source dep1)
  4296. +                             (package-source dep2)
  4297. +                             (package-source dep3))
  4298. +                       (match (package-native-inputs dep3)
  4299. +                              ((("x" dep))
  4300. +                               (and (eq? dep (rewrite grep))
  4301. +                                    (package-source dep))))))))))
  4302. expected-value: 42
  4303. actual-value: 42
  4304. result: PASS
  4305.  
  4306. test-name: package-input-rewriting
  4307. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:916
  4308. source:
  4309. + (test-assert
  4310. +   "package-input-rewriting"
  4311. +   (let* ((dep (dummy-package
  4312. +                 "chbouib"
  4313. +                 (native-inputs `(("x" ,grep)))))
  4314. +          (p0 (dummy-package
  4315. +                "example"
  4316. +                (inputs
  4317. +                  `(("foo" ,coreutils) ("bar" ,grep) ("baz" ,dep)))))
  4318. +          (rewrite
  4319. +            (package-input-rewriting
  4320. +              `((,coreutils unquote sed)
  4321. +                (,grep unquote findutils))
  4322. +              (cut string-append "r-" <>)))
  4323. +          (p1 (rewrite p0))
  4324. +          (p2 (rewrite p0)))
  4325. +     (and (not (eq? p1 p0))
  4326. +          (eq? p1 p2)
  4327. +          (string=? "r-example" (package-name p1))
  4328. +          (match (package-inputs p1)
  4329. +                 ((("foo" dep1) ("bar" dep2) ("baz" dep3))
  4330. +                  (and (eq? dep1 sed)
  4331. +                       (eq? dep2 findutils)
  4332. +                       (string=? (package-name dep3) "r-chbouib")
  4333. +                       (eq? dep3 (rewrite dep))
  4334. +                       (match (package-native-inputs dep3)
  4335. +                              ((("x" dep)) (eq? dep findutils)))))))))
  4336. actual-value: #t
  4337. result: PASS
  4338.  
  4339. test-name: fold-packages
  4340. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:941
  4341. source:
  4342. + (test-eq
  4343. +   "fold-packages"
  4344. +   hello
  4345. +   (fold-packages
  4346. +     (lambda (p r)
  4347. +       (if (string=? (package-name p) "hello") p r))
  4348. +     #f))
  4349. expected-value: #<package hello@2.10 gnu/packages/base.scm:60 19303c0>
  4350. actual-value: #<package hello@2.10 gnu/packages/base.scm:60 19303c0>
  4351. result: PASS
  4352.  
  4353. test-name: fold-packages, hidden package
  4354. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:948
  4355. source:
  4356. + (test-assert
  4357. +   "fold-packages, hidden package"
  4358. +   (match (fold-packages
  4359. +            (lambda (p r)
  4360. +              (if (and (string=? (package-name p) "guile")
  4361. +                       (string-prefix? "2.0" (package-version p)))
  4362. +                (cons p r)
  4363. +                r))
  4364. +            '())
  4365. +          ((one) (eq? one guile-2.0))))
  4366. actual-value: #t
  4367. result: PASS
  4368.  
  4369. test-name: find-packages-by-name
  4370. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:962
  4371. source:
  4372. + (test-assert
  4373. +   "find-packages-by-name"
  4374. +   (match (find-packages-by-name "hello")
  4375. +          (((? (cut eq? hello <>))) #t)
  4376. +          (wrong (pk 'find-packages-by-name wrong #f))))
  4377. actual-value: #t
  4378. result: PASS
  4379.  
  4380. test-name: find-packages-by-name with version
  4381. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:967
  4382. source:
  4383. + (test-assert
  4384. +   "find-packages-by-name with version"
  4385. +   (match (find-packages-by-name
  4386. +            "hello"
  4387. +            (package-version hello))
  4388. +          (((? (cut eq? hello <>))) #t)
  4389. +          (wrong (pk 'find-packages-by-name wrong #f))))
  4390. actual-value: #t
  4391. result: PASS
  4392.  
  4393. test-name: --search-paths with pattern
  4394. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:972
  4395. source:
  4396. + (test-assert
  4397. +   "--search-paths with pattern"
  4398. +   (let* ((p1 (package
  4399. +                (name "foo")
  4400. +                (version "0")
  4401. +                (source #f)
  4402. +                (build-system trivial-build-system)
  4403. +         @ build-started /tmp/guix-tests/store/776fmfgvl86sycqhwylvbxvj8lampqyr-foo-0.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/77//6fmfgvl86sycqhwylvbxvj8lampqyr-foo-0.drv.bz2
  4404. @ build-succeeded /tmp/guix-tests/store/776fmfgvl86sycqhwylvbxvj8lampqyr-foo-0.drv -
  4405. @ build-started /tmp/guix-tests/store/r2cwc0ymafj3fih71ddlpvv48ibh3r5f-libxml2-0.0.0.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/r2//cwc0ymafj3fih71ddlpvv48ibh3r5f-libxml2-0.0.0.drv.bz2
  4406. @ build-succeeded /tmp/guix-tests/store/r2cwc0ymafj3fih71ddlpvv48ibh3r5f-libxml2-0.0.0.drv -
  4407. @ build-started /tmp/guix-tests/store/2kgydlmck3v1yhapigr0nngwsii3zg09-module-import.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/2k//gydlmck3v1yhapigr0nngwsii3zg09-module-import.drv.bz2
  4408. @ build-succeeded /tmp/guix-tests/store/2kgydlmck3v1yhapigr0nngwsii3zg09-module-import.drv -
  4409. @ build-started /tmp/guix-tests/store/zlmj31wzwc9zr5x2jcjlbcq8v04jfmli-module-import-compiled.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/zl//mj31wzwc9zr5x2jcjlbcq8v04jfmli-module-import-compiled.drv.bz2
  4410. @ build-succeeded /tmp/guix-tests/store/zlmj31wzwc9zr5x2jcjlbcq8v04jfmli-module-import-compiled.drv -
  4411. @ build-started /tmp/guix-tests/store/vpkk5ncdij2jxrq5rzbkanigs8ykfzvb-profile.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/vp//kk5ncdij2jxrq5rzbkanigs8ykfzvb-profile.drv.bz2
  4412. @ build-succeeded /tmp/guix-tests/store/vpkk5ncdij2jxrq5rzbkanigs8ykfzvb-profile.drv -
  4413.        (arguments
  4414. +                  `(#:guile
  4415. +                    ,%bootstrap-guile
  4416. +                    #:modules
  4417. +                    ((guix build utils))
  4418. +                    #:builder
  4419. +                    (begin
  4420. +                      (use-modules (guix build utils))
  4421. +                      (let ((out (assoc-ref %outputs "out")))
  4422. +                        (mkdir-p (string-append out "/xml/bar/baz"))
  4423. +                        (call-with-output-file
  4424. +                          (string-append out "/xml/bar/baz/catalog.xml")
  4425. +                          (lambda (port) (display "xml? wat?!" port)))))))
  4426. +                (synopsis #f)
  4427. +                (description #f)
  4428. +                (home-page #f)
  4429. +                (license #f)))
  4430. +          (p2 (package
  4431. +                (name "libxml2")
  4432. +                (version "0.0.0")
  4433. +                (source #f)
  4434. +                (build-system trivial-build-system)
  4435. +                (arguments
  4436. +                  `(#:guile
  4437. +                    ,%bootstrap-guile
  4438. +                    #:builder
  4439. +                    (mkdir (assoc-ref %outputs "out"))))
  4440. +                (native-search-paths
  4441. +                  (package-native-search-paths libxml2))
  4442. +                (synopsis #f)
  4443. +                (description #f)
  4444. +                (home-page #f)
  4445. +                (license #f)))
  4446. +          (prof (run-with-store
  4447. +                  %store
  4448. +                  (profile-derivation
  4449. +                    (manifest
  4450. +                      (map package->manifest-entry (list p1 p2)))
  4451. +                    #:hooks
  4452. +                    '()
  4453. +                    #:locales?
  4454. +                    #f)
  4455. +                  #:guile-for-build
  4456. +                  (%guile-for-build))))
  4457. +     (build-derivations %store (list prof))
  4458. +     (string-match
  4459. +       (format
  4460. +         #f
  4461. +         "^export XML_CATALOG_FILES=\"~a/xml/+bar/baz/catalog\\.xml\"\n"
  4462. +         (regexp-quote (derivation->output-path prof)))
  4463. +       (with-output-to-string
  4464. +         (lambda ()
  4465. +           (guix-package
  4466. +             "-p"
  4467. +             (derivation->output-path prof)
  4468. +             "--search-paths"))))))
  4469. actual-value: #("export XML_CATALOG_FILES=\"/tmp/guix-tests/store/xfvb2php359331lx0yvs40csll9rag95-profile/xml/bar/baz/catalog.xml\"\n" (0 . 114))
  4470. result: PASS
  4471.  
  4472. test-name: --search-paths with single-item search path
  4473. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:1020
  4474. source:
  4475. + (test-assert
  4476. +   "--search-paths with single-item search path"
  4477. +   (let* ((p1 (dummy-package
  4478. +                "foo"
  4479. +                (build-system trivial-build-system)
  4480. +                (arguments
  4481. +                  `(#:guile
  4482. +                    ,%bootstrap-guile
  4483. +                    #:modules
  4484. +                    ((guix build utils))
  4485. +                    #:builder
  4486. +                    (begin
  4487. +                      (use-modules (guix build utils))
  4488. +                      (let ((out (assoc-ref %outputs "out")))
  4489. +                        (mkdir-p (string-append out "/etc/ssl/certs"))
  4490. +                        (call-with-output-file
  4491. +                          (string-append
  4492. +                            out
  4493. +                            "/etc/ssl/certs/ca-certificates.crt")
  4494. +                          (const #t))))))))
  4495. +          (p2 (package (inherit p1) (name "bar")))
  4496. +          (p3 (dummy-package
  4497. +                "git"
  4498. +                (build-system trivial-build-system)
  4499. +                (arguments
  4500. +                  `(#:guile
  4501. +                    ,%bootstrap-guile
  4502. +                    #:builder
  4503. +                    (mkdir (assoc-ref %outputs "out"))))
  4504. +                (native-search-paths
  4505. +                  (package-native-search-paths git))))
  4506. +          (prof1 (run-with-store
  4507. +                   %store
  4508. +                   (profile-derivation
  4509. +                     (packages->manifest (list p1 p3))
  4510. +                     #:hooks
  4511. +                     '()
  4512. +                     #:locales?
  4513. +                     #f)
  4514. +                   #:guile-for-build
  4515. +                   (%guile-for-build)))
  4516. +          (prof2 (run-with-store
  4517. +                   %store
  4518. +         @ build-started /tmp/guix-tests/store/z037c1pxr6gd46nxgv66r14x3bvmacc6-bar-0.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/z0//37c1pxr6gd46nxgv66r14x3bvmacc6-bar-0.drv.bz2
  4519. @ build-succeeded /tmp/guix-tests/store/z037c1pxr6gd46nxgv66r14x3bvmacc6-bar-0.drv -
  4520. @ build-started /tmp/guix-tests/store/rvhc8kmr5b52q16m0cmhlm321sy7cczb-foo-0.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/rv//hc8kmr5b52q16m0cmhlm321sy7cczb-foo-0.drv.bz2
  4521. @ build-succeeded /tmp/guix-tests/store/rvhc8kmr5b52q16m0cmhlm321sy7cczb-foo-0.drv -
  4522. @ build-started /tmp/guix-tests/store/ilbcggmc6x2s6gffll2k7b1ryyvr0p3j-git-0.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/il//bcggmc6x2s6gffll2k7b1ryyvr0p3j-git-0.drv.bz2
  4523. @ build-succeeded /tmp/guix-tests/store/ilbcggmc6x2s6gffll2k7b1ryyvr0p3j-git-0.drv -
  4524. @ build-started /tmp/guix-tests/store/6dls0qzhbnza3g7f93p1a612dqkr76hz-profile.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/6d//ls0qzhbnza3g7f93p1a612dqkr76hz-profile.drv.bz2
  4525. @ build-succeeded /tmp/guix-tests/store/6dls0qzhbnza3g7f93p1a612dqkr76hz-profile.drv -
  4526. @ build-started /tmp/guix-tests/store/wlbck30fx0hyrvw6w83fn0a3y2rc0gbp-profile.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/wl//bck30fx0hyrvw6w83fn0a3y2rc0gbp-profile.drv.bz2
  4527. @ build-succeeded /tmp/guix-tests/store/wlbck30fx0hyrvw6w83fn0a3y2rc0gbp-profile.drv -
  4528. error: this-package-does-not-exist: unknown package
  4529.           (profile-derivation
  4530. +                     (packages->manifest (list p2 p3))
  4531. +                     #:hooks
  4532. +                     '()
  4533. +                     #:locales?
  4534. +                     #f)
  4535. +                   #:guile-for-build
  4536. +                   (%guile-for-build))))
  4537. +     (build-derivations %store (list prof1 prof2))
  4538. +     (string-match
  4539. +       (format
  4540. +         #f
  4541. +         "^export GIT_SSL_CAINFO=\"~a/etc/ssl/certs/ca-certificates.crt"
  4542. +         (regexp-quote (derivation->output-path prof1)))
  4543. +       (with-output-to-string
  4544. +         (lambda ()
  4545. +           (guix-package
  4546. +             "-p"
  4547. +             (derivation->output-path prof1)
  4548. +             "-p"
  4549. +             (derivation->output-path prof2)
  4550. +             "--search-paths"))))))
  4551. actual-value: #("export GIT_SSL_CAINFO=\"/tmp/guix-tests/store/gvd1ajkzd5yvzqs3z4cdqixk2gll8245-profile/etc/ssl/certs/ca-certificates.crt\"\n" (0 . 119))
  4552. result: PASS
  4553.  
  4554. test-name: specification->package when not found
  4555. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/packages.scm:1066
  4556. source:
  4557. + (test-equal
  4558. +   "specification->package when not found"
  4559. +   'quit
  4560. +   (catch 'quit
  4561. +          (lambda ()
  4562. +            (specification->package
  4563. +              "this-package-does-not-exist"))
  4564. +          (lambda (key . args) key)))
  4565. expected-value: quit
  4566. actual-value: quit
  4567. result: PASS
  4568.  
  4569.  
  4570. SKIP: tests/snix
  4571. ================
  4572.  
  4573. test-name: factorize-uri
  4574. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/snix.scm:36
  4575. source:
  4576. + (test-assert
  4577. +   "factorize-uri"
  4578. +   (every?
  4579. +     (match-lambda
  4580. +       ((uri version '-> expected)
  4581. +        (equal? (factorize-uri uri version) expected)))
  4582. +     '(("http://example.com/foo.tgz"
  4583. +        "1.0"
  4584. +        ->
  4585. +        "http://example.com/foo.tgz")
  4586. +       ("http://example.com/foo-2.8.tgz"
  4587. +        "2.8"
  4588. +        ->
  4589. +        ("http://example.com/foo-" version ".tgz"))
  4590. +       ("http://example.com/2.8/foo-2.8.tgz"
  4591. +        "2.8"
  4592. +        ->
  4593. +        ("http://example.com/"
  4594. +         version
  4595. +         "/foo-"
  4596. +         version
  4597. +         ".tgz")))))
  4598. actual-value: #t
  4599. result: PASS
  4600.  
  4601. test-name: nixpkgs->guix-package
  4602. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/snix.scm:54
  4603. source:
  4604. + (test-assert
  4605. +   "nixpkgs->guix-package"
  4606. +   (match (nixpkgs->guix-package
  4607. +            %nixpkgs-directory
  4608. +            "guile")
  4609. +          (('package
  4610. +            ('name "guile")
  4611. +            ('version (? string?))
  4612. +            ('source ('origin _ ...))
  4613. +            ('build-system _)
  4614. +            ('inputs ('quasiquote (inputs ...)))
  4615. +            ('propagated-inputs ('quasiquote (pinputs ...)))
  4616. +            ('home-page (? string?))
  4617. +            ('synopsis (? string?))
  4618. +            ('description (? string?))
  4619. +            ('license (? symbol?)))
  4620. +           (and (member '("libffi" ,libffi) inputs)
  4621. +                (member '("gmp" ,gmp) pinputs)
  4622. +                #t))
  4623. +          (x (pk 'fail x #f))))
  4624. result: SKIP
  4625.  
  4626.  
  4627. FAIL: tests/store
  4628. =================
  4629.  
  4630. test-name: open-connection with file:// URI
  4631. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:51
  4632. source:
  4633. + (test-assert
  4634. +   "open-connection with file:// URI"
  4635. +   (let ((store (open-connection
  4636. +                  (string-append "file://" (%daemon-socket-uri)))))
  4637. +     (and (add-text-to-store store "foo" "bar")
  4638. +          (begin (close-connection store) #t))))
  4639. actual-value: #t
  4640. result: PASS
  4641.  
  4642. test-name: connection handshake error
  4643. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:59
  4644. source:
  4645. + (test-equal
  4646. +   "connection handshake error"
  4647. +   EPROTO
  4648. +   (let ((port (%make-void-port "rw")))
  4649. +     (guard (c ((nix-connection-error? c)
  4650. +                (and (eq? port (nix-connection-error-file c))
  4651. +                     (nix-connection-error-code c))))
  4652. +            (open-connection #f #:port port)
  4653. +            'broken)))
  4654. expected-value: 71
  4655. actual-value: 71
  4656. result: PASS
  4657.  
  4658. test-name: store-path-hash-part
  4659. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:68
  4660. source:
  4661. + (test-equal
  4662. +   "store-path-hash-part"
  4663. +   "283gqy39v3g9dxjy26rynl0zls82fmcg"
  4664. +   (store-path-hash-part
  4665. +     (string-append
  4666. +       (%store-prefix)
  4667. +       "/283gqy39v3g9dxjy26rynl0zls82fmcg-guile-2.0.7")))
  4668. expected-value: "283gqy39v3g9dxjy26rynl0zls82fmcg"
  4669. actual-value: "283gqy39v3g9dxjy26rynl0zls82fmcg"
  4670. result: PASS
  4671.  
  4672. test-name: store-path-hash-part #f
  4673. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:74
  4674. source:
  4675. + (test-equal
  4676. +   "store-path-hash-part #f"
  4677. +   #f
  4678. +   (store-path-hash-part
  4679. +     (string-append
  4680. +       (%store-prefix)
  4681. +       "/foo/bar/283gqy39v3g9dxjy26rynl0zls82fmcg-guile-2.0.7")))
  4682. expected-value: #f
  4683. actual-value: #f
  4684. result: PASS
  4685.  
  4686. test-name: store-path-package-name
  4687. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:80
  4688. source:
  4689. + (test-equal
  4690. +   "store-path-package-name"
  4691. +   "guile-2.0.7"
  4692. +   (store-path-package-name
  4693. +     (string-append
  4694. +       (%store-prefix)
  4695. +       "/283gqy39v3g9dxjy26rynl0zls82fmcg-guile-2.0.7")))
  4696. expected-value: "guile-2.0.7"
  4697. actual-value: "guile-2.0.7"
  4698. result: PASS
  4699.  
  4700. test-name: store-path-package-name #f
  4701. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:86
  4702. source:
  4703. + (test-equal
  4704. +   "store-path-package-name #f"
  4705. +   #f
  4706. +   (store-path-package-name
  4707. +     "/foo/bar/283gqy39v3g9dxjy26rynl0zls82fmcg-guile-2.0.7"))
  4708. expected-value: #f
  4709. actual-value: #f
  4710. result: PASS
  4711.  
  4712. test-name: direct-store-path?
  4713. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:91
  4714. source:
  4715. + (test-assert
  4716. +   "direct-store-path?"
  4717. +   (and (direct-store-path?
  4718. +          (string-append
  4719. +            (%store-prefix)
  4720. +            "/283gqy39v3g9dxjy26rynl0zls82fmcg-guile-2.0.7"))
  4721. +        (not (direct-store-path?
  4722. +               (string-append
  4723. +                 (%store-prefix)
  4724. +                 "/283gqy39v3g9dxjy26rynl0zls82fmcg-guile-2.0.7/bin/guile")))
  4725. +        (not (direct-store-path? (%store-prefix)))))
  4726. actual-value: #t
  4727. result: PASS
  4728.  
  4729. test-name: add-data-to-store
  4730. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:103
  4731. source:
  4732. + (test-equal
  4733. +   "add-data-to-store"
  4734. +   #vu8(1 2 3 4 5)
  4735. +   (call-with-input-file
  4736. +     (add-data-to-store %store "data" #vu8(1 2 3 4 5))
  4737. +     get-bytevector-all))
  4738. expected-value: #vu8(1 2 3 4 5)
  4739. actual-value: #vu8(1 2 3 4 5)
  4740. result: PASS
  4741.  
  4742. test-name: valid-path? live
  4743. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:108
  4744. source:
  4745. + (test-assert
  4746. +   "valid-path? live"
  4747. +   (let ((p (add-text-to-store %store "hello" "hello, world")))
  4748. +     (valid-path? %store p)))
  4749. actual-value: #t
  4750. result: PASS
  4751.  
  4752. test-name: valid-path? false
  4753. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:112
  4754. source:
  4755. + (test-assert
  4756. +   "valid-path? false"
  4757. +   (not (valid-path?
  4758. +          %store
  4759. +          (string-append
  4760. +            (%store-prefix)
  4761. +            "/"
  4762. +            (make-string 32 #\e)
  4763. +            "-foobar"))))
  4764. actual-value: #t
  4765. result: PASS
  4766.  
  4767. test-name: valid-path? error
  4768. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:117
  4769. source:
  4770. + (test-assert
  4771. +   "valid-path? error"
  4772. +   (with-store
  4773. +     s
  4774. +     (random seed for tests: 1495495557
  4775. finding garbage collector roots...
  4776. removing stale temporary roots file `/tmp/guix-tests/var/12700/temproots/12718'
  4777. determining live/dead paths...
  4778. finding garbage collector roots...
  4779. removing stale temporary roots file `/tmp/guix-tests/var/12700/temproots/.fuse_hidden0001096600002605'
  4780. determining live/dead paths...
  4781. finding garbage collector roots...
  4782. removing stale temporary roots file `/tmp/guix-tests/var/12700/temproots/.fuse_hidden0001096600002607'
  4783. determining live/dead paths...
  4784. finding garbage collector roots...
  4785. removing stale temporary roots file `/tmp/guix-tests/var/12700/temproots/.fuse_hidden0001096600002608'
  4786. deleting unused links...
  4787. finding garbage collector roots...
  4788. removing stale temporary roots file `/tmp/guix-tests/var/12700/temproots/12747'
  4789. removing stale temporary roots file `/tmp/guix-tests/var/12700/temproots/.fuse_hidden000109660000260a'
  4790. deleting `/tmp/guix-tests/store/82kp2v2zf1mr8ay3pm6nnkc1537fz8qr-delete-me'
  4791. deleting `/tmp/guix-tests/store/trash'
  4792. deleting unused links...
  4793. note: currently hard linking saves 0.61 MiB
  4794. finding garbage collector roots...
  4795. removing stale temporary roots file `/tmp/guix-tests/var/12700/temproots/12754'
  4796. removing stale temporary roots file `/tmp/guix-tests/var/12700/temproots/.fuse_hidden000109660000260d'
  4797. deleting `/tmp/guix-tests/store/a27v317kpgsn1k82vnqhn02s9hjqwg5f-delete-me'
  4798. deleting `/tmp/guix-tests/store/trash'
  4799. deleting unused links...
  4800. note: currently hard linking saves 0.61 MiB
  4801. guard (c ((nix-protocol-error? c) #t))
  4802. +            (valid-path? s "foo")
  4803. +            #f)))
  4804. actual-value: #t
  4805. result: PASS
  4806.  
  4807. test-name: valid-path? recovery
  4808. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:123
  4809. source:
  4810. + (test-assert
  4811. +   "valid-path? recovery"
  4812. +   (with-store
  4813. +     s
  4814. +     (let-syntax ((true-if-error
  4815. +                    (syntax-rules ()
  4816. +                      ((_ exp)
  4817. +                       (guard (c ((nix-protocol-error? c) #t)) exp #f)))))
  4818. +       (and (true-if-error (valid-path? s "foo"))
  4819. +            (true-if-error (valid-path? s "bar"))
  4820. +            (true-if-error (valid-path? s "baz"))
  4821. +            (true-if-error (valid-path? s "chbouib"))
  4822. +            (valid-path?
  4823. +              s
  4824. +              (add-text-to-store s "valid" "yeah"))))))
  4825. actual-value: #t
  4826. result: PASS
  4827.  
  4828. test-name: hash-part->path
  4829. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:140
  4830. source:
  4831. + (test-assert
  4832. +   "hash-part->path"
  4833. +   (let ((p (add-text-to-store %store "hello" "hello, world")))
  4834. +     (equal?
  4835. +       (hash-part->path %store (store-path-hash-part p))
  4836. +       p)))
  4837. actual-value: #t
  4838. result: PASS
  4839.  
  4840. test-name: dead-paths
  4841. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:145
  4842. source:
  4843. + (test-assert
  4844. +   "dead-paths"
  4845. +   (let ((p (add-text-to-store
  4846. +              %store
  4847. +              "random-text"
  4848. +              (random-text))))
  4849. +     (->bool (member p (dead-paths %store)))))
  4850. actual-value: #t
  4851. result: PASS
  4852.  
  4853. test-name: permanent root
  4854. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:166
  4855. source:
  4856. + (test-assert
  4857. +   "permanent root"
  4858. +   (let* ((p (with-store
  4859. +               store
  4860. +               (let ((p (add-text-to-store
  4861. +                          store
  4862. +                          "random-text"
  4863. +                          (random-text))))
  4864. +                 (add-permanent-root p)
  4865. +                 (add-permanent-root p)
  4866. +                 p))))
  4867. +     (and (member p (live-paths %store))
  4868. +          (begin
  4869. +            (remove-permanent-root p)
  4870. +            (->bool (member p (dead-paths %store)))))))
  4871. actual-value: #t
  4872. result: PASS
  4873.  
  4874. test-name: dead path can be explicitly collected
  4875. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:178
  4876. source:
  4877. + (test-assert
  4878. +   "dead path can be explicitly collected"
  4879. +   (let ((p (add-text-to-store
  4880. +              %store
  4881. +              "random-text"
  4882. +              (random-text)
  4883. +              '())))
  4884. +     (let-values
  4885. +       (((paths freed) (delete-paths %store (list p))))
  4886. +       (and (equal? paths (list p))
  4887. +            (> freed 0)
  4888. +            (not (file-exists? p))))))
  4889. actual-value: #f
  4890. result: FAIL
  4891.  
  4892. test-name: add-text-to-store vs. delete-paths
  4893. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:186
  4894. source:
  4895. + (test-assert
  4896. +   "add-text-to-store vs. delete-paths"
  4897. +   (with-store
  4898. +     store
  4899. +     (let* ((text (random-text))
  4900. +            (path (add-text-to-store store "delete-me" text))
  4901. +            (deleted (delete-paths store (list path)))
  4902. +            (path2 (add-text-to-store store "delete-me" text)))
  4903. +       (and (string=? path path2)
  4904. +            (equal? deleted (list path))
  4905. +            (valid-path? store path)
  4906. +            (file-exists? path)))))
  4907. actual-value: #t
  4908. result: PASS
  4909.  
  4910. test-name: add-to-store vs. delete-paths
  4911. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:199
  4912. source:
  4913. + (test-assert
  4914. +   "add-to-store vs. delete-paths"
  4915. +   (with-store
  4916. +     store
  4917. +     (let* ((file (search-path %load-path "guix.scm"))
  4918. +            (path (add-to-store store "delete-me" #t "sha256" file))
  4919. +            (deleted (delete-paths store (list path)))
  4920. +            (path2 (add-to-store store "delete-me" #t "sha256" file)))
  4921. +       (and (string=? path path2)
  4922. +            (equal? deleted (list path))
  4923. +            (valid-path? store path)
  4924. +            (file-exists? path)))))
  4925. actual-value: #t
  4926. result: PASS
  4927.  
  4928. test-name: references
  4929. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:211
  4930. source:
  4931. + (test-assert
  4932. +   "references"
  4933. +   (let* ((t1 (add-text-to-store
  4934. +                %store
  4935. +         substitute: warning: authentication and authorization of substitutes disabled!
  4936. substitute: guix substitute: warning: ACL for archive imports seems to be uninitialized, substitutes may be unavailable
  4937.        "random1"
  4938. +                (random-text)))
  4939. +          (t2 (add-text-to-store
  4940. +                %store
  4941. +                "random2"
  4942. +                (random-text)
  4943. +                (list t1))))
  4944. +     (and (equal? (list t1) (references %store t2))
  4945. +          (equal? (list t2) (referrers %store t1))
  4946. +          (null? (references %store t1))
  4947. +          (null? (referrers %store t2)))))
  4948. actual-value: #t
  4949. result: PASS
  4950.  
  4951. test-name: references/substitutes missing reference info
  4952. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:221
  4953. source:
  4954. + (test-assert
  4955. +   "references/substitutes missing reference info"
  4956. +   (with-store
  4957. +     s
  4958. +     (set-build-options s #:use-substitutes? #f)
  4959. +     (guard (c ((nix-protocol-error? c) #t))
  4960. +            (let* ((b (add-to-store
  4961. +                        s
  4962. +                        "bash"
  4963. +                        #t
  4964. +                        "sha256"
  4965. +                        (search-bootstrap-binary
  4966. +                          "bash"
  4967. +                          (%current-system))))
  4968. +                   (d (derivation
  4969. +                        s
  4970. +                        "the-thing"
  4971. +                        b
  4972. +                        '("--help")
  4973. +                        #:inputs
  4974. +                        `((,b)))))
  4975. +              (references/substitutes
  4976. +                s
  4977. +                (list (derivation->output-path d) b))
  4978. +              #f))))
  4979. actual-value: #t
  4980. result: PASS
  4981.  
  4982. test-name: references/substitutes with substitute info
  4983. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:233
  4984. source:
  4985. + (test-assert
  4986. +   "references/substitutes with substitute info"
  4987. +   (with-store
  4988. +     s
  4989. +     (set-build-options s #:use-substitutes? #t)
  4990. +     (let* ((t1 (add-text-to-store s "random1" (random-text)))
  4991. +            (t2 (add-text-to-store
  4992. +                  s
  4993. +                  "random2"
  4994. +                  (random-text)
  4995. +                  (list t1)))
  4996. +            (t3 (add-text-to-store
  4997. +                  s
  4998. +                  "build"
  4999. +                  "echo -n $t2 > $out"))
  5000. +            (b (add-to-store
  5001. +                 s
  5002. +                 "bash"
  5003. +                 #t
  5004. +                 "sha256"
  5005. +                 (search-bootstrap-binary
  5006. +                   "bash"
  5007. +                   (%current-system))))
  5008. +            (d (derivation
  5009. +                 s
  5010. +                 "the-thing"
  5011. +                 b
  5012. +                 `("-e" ,t3)
  5013. +                 #:inputs
  5014. +                 `((,b) (,t3) (,t2))
  5015. +                 #:env-vars
  5016. +                 `(("t2" unquote t2))))
  5017. +            (o (derivation->output-path d)))
  5018. +       (with-derivation-narinfo
  5019. +         d
  5020. +         (sha256 => (sha256 (string->utf8 t2)))
  5021. +         (references => (list t2))
  5022. +         (equal?
  5023. +           (references/substitutes s (list o t3 t2 t1))
  5024. +           `((,t2) () (,t1) ()))))))
  5025. actual-value: #t
  5026. result: PASS
  5027.  
  5028. test-name: substitutable-path-info when substitutes are turned off
  5029. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:257
  5030. source:
  5031. + (test-equal
  5032. +   "substitutable-path-info when substitutes are turned off"
  5033. +   '()
  5034. +   (with-store
  5035. +     s
  5036. +     (set-build-options s #:use-substitutes? #f)
  5037. +     (let* ((b (add-to-store
  5038. +                 s
  5039. +                 "bash"
  5040. +                 #t
  5041. +                 "sha256"
  5042. +                 (search-bootstrap-binary
  5043. +                   "bash"
  5044. +                   (%current-system))))
  5045. +            (d (derivation
  5046. +                 s
  5047. +                 "the-thing"
  5048. +                 b
  5049. +                 '("--version")
  5050. +                 #:inputs
  5051. +                 `((,b))))
  5052. +            (o (derivation->output-path d)))
  5053. +       (with-derivation-narinfo
  5054. +         d
  5055. +         (substitutable-path-info s (list o))))))
  5056. expected-value: ()
  5057. actual-value: ()
  5058. result: PASS
  5059.  
  5060. test-name: substitutable-paths when substitutes are turned off
  5061. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:270
  5062. source:
  5063. + (test-equal
  5064. +   "substitutable-paths when substitutes are turned off"
  5065. +   '()
  5066. +   (with-store
  5067. +     s
  5068. +     (set-build-options s #:use-substitutes? #f)
  5069. +     (let* ((b (@ build-started /tmp/guix-tests/store/s25yp6rixfdjv9z2zpb1wg405qy3yif1-the-thing.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/s2//5yp6rixfdjv9z2zpb1wg405qy3yif1-the-thing.drv.bz2
  5070. @ build-succeeded /tmp/guix-tests/store/s25yp6rixfdjv9z2zpb1wg405qy3yif1-the-thing.drv -
  5071. add-to-store
  5072. +                 s
  5073. +                 "bash"
  5074. +                 #t
  5075. +                 "sha256"
  5076. +                 (search-bootstrap-binary
  5077. +                   "bash"
  5078. +                   (%current-system))))
  5079. +            (d (derivation
  5080. +                 s
  5081. +                 "the-thing"
  5082. +                 b
  5083. +                 '("--version")
  5084. +                 #:inputs
  5085. +                 `((,b))))
  5086. +            (o (derivation->output-path d)))
  5087. +       (with-derivation-narinfo
  5088. +         d
  5089. +         (substitutable-paths s (list o))))))
  5090. expected-value: ()
  5091. actual-value: ()
  5092. result: PASS
  5093.  
  5094. test-name: requisites
  5095. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:283
  5096. source:
  5097. + (test-assert
  5098. +   "requisites"
  5099. +   (let* ((t1 (add-text-to-store
  5100. +                %store
  5101. +                "random1"
  5102. +                (random-text)
  5103. +                '()))
  5104. +          (t2 (add-text-to-store
  5105. +                %store
  5106. +                "random2"
  5107. +                (random-text)
  5108. +                (list t1)))
  5109. +          (t3 (add-text-to-store
  5110. +                %store
  5111. +                "random3"
  5112. +                (random-text)
  5113. +                (list t2)))
  5114. +          (t4 (add-text-to-store
  5115. +                %store
  5116. +                "random4"
  5117. +                (random-text)
  5118. +                (list t1 t3))))
  5119. +     (define (same? x y)
  5120. +       (and (= (length x) (length y))
  5121. +            (lset= equal? x y)))
  5122. +     (and (same? (requisites %store (list t1)) (list t1))
  5123. +          (same? (requisites %store (list t2))
  5124. +                 (list t1 t2))
  5125. +          (same? (requisites %store (list t3))
  5126. +                 (list t1 t2 t3))
  5127. +          (same? (requisites %store (list t4))
  5128. +                 (list t1 t2 t3 t4))
  5129. +          (same? (requisites %store (list t1 t2 t3 t4))
  5130. +                 (list t1 t2 t3 t4)))))
  5131. actual-value: #t
  5132. result: PASS
  5133.  
  5134. test-name: derivers
  5135. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:303
  5136. source:
  5137. + (test-assert
  5138. +   "derivers"
  5139. +   (let* ((b (add-text-to-store
  5140. +               %store
  5141. +               "build"
  5142. +               "echo $foo > $out"
  5143. +               '()))
  5144. +          (s (add-to-store
  5145. +               %store
  5146. +               "bash"
  5147. +               #t
  5148. +               "sha256"
  5149. +               (search-bootstrap-binary
  5150. +                 "bash"
  5151. +                 (%current-system))))
  5152. +          (d (derivation
  5153. +               %store
  5154. +               "the-thing"
  5155. +               s
  5156. +               `("-e" ,b)
  5157. +               #:env-vars
  5158. +               `(("foo" unquote (random-text)))
  5159. +               #:inputs
  5160. +               `((,b) (,s))))
  5161. +          (o (derivation->output-path d)))
  5162. +     (and (build-derivations %store (list d))
  5163. +          (equal?
  5164. +            (query-derivation-outputs
  5165. +              %store
  5166. +              (derivation-file-name d))
  5167. +            (list o))
  5168. +          (equal?
  5169. +            (valid-derivers %store o)
  5170. +            (list (derivation-file-name d))))))
  5171. actual-value: #t
  5172. result: PASS
  5173.  
  5174. test-name: topologically-sorted, one item
  5175. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:319
  5176. source:
  5177. + (test-assert
  5178. +   "topologically-sorted, one item"
  5179. +   (let* ((a (add-text-to-store %store "a" "a"))
  5180. +          (b (add-text-to-store %store "b" "b" (list a)))
  5181. +          (c (add-text-to-store %store "c" "c" (list b)))
  5182. +          (d (add-text-to-store %store "d" "d" (list c)))
  5183. +          (s (topologically-sorted %store (list d))))
  5184. +     (equal? s (list a b c d))))
  5185. actual-value: #t
  5186. result: PASS
  5187.  
  5188. test-name: topologically-sorted, several items
  5189. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:327
  5190. source:
  5191. + (test-assert
  5192. +   "topologically-sorted, several items"
  5193. +   (let* ((a (add-text-to-store %store "a" "a"))
  5194. +          (b (add-text-to-store %store "b" "b" (list a)))
  5195. +          (c (add-text-to-store %store "c" "c" (list b)))
  5196. +          (d (add-text-to-store %store "d" "d" (list c)))
  5197. +          (s1 (topologically-sorted %store (list d a c b)))
  5198. +          (s2 (topologically-sorted %store (list b d c a b d))))
  5199. +     (equal? s1 s2 (list a b c d))))
  5200. actual-value: #t
  5201. result: PASS
  5202.  
  5203. test-name: topologically-sorted, more difficult
  5204. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:336
  5205. source:
  5206. + (test-assert
  5207. +   "topologically-sorted, more difficult"
  5208. +   (let* ((a (add-text-to-store %store "a" "a"))
  5209. +          (b (add-text-to-store %store "b" "b" (list a)))
  5210. +          (c (add-text-to-store %store "c" "c" (list b)))
  5211. +          (d (add-text-to-store %store "d" "d" (list c)))
  5212. +          (w (add-text-to-store %store "w" "w"))
  5213. +          (x (add-text-to-store %store "x" "x" (list w)))
  5214. +          (y (add-text-to-store %store "y" "y" (list x d)))
  5215. +          (s1 (topologically-sorted %store (list y)))
  5216. +          (s2 (topologically-sorted %store (list c y)))
  5217. +          (s3 (topologically-sorted
  5218. +                %store
  5219. +                (cons y (references %store y)))))
  5220. +     (let* ((x-then-d?
  5221. +              (equal? (references %store y) (list x d))))
  5222. +       (and (equal?
  5223. +              s1
  5224. +              (if x-then-d?
  5225. +                (list w x a b c d y)
  5226. +                (list a b c d w x y)))
  5227. +            (equal?
  5228. +              s2
  5229. +              (if x-then-d?
  5230. +                (list a b c w x d y)
  5231. +                (list a b c d w x y)))
  5232. +            (lset= string=? s1 s3)))))
  5233. actual-value: #t
  5234. result: PASS
  5235.  
  5236. test-name: current-build-output-port, UTF-8
  5237. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:360
  5238. source:
  5239. + (test-assert
  5240. +   "current-build-output-port, UTF-8"
  5241. +   (string-contains
  5242. +     (with-fluids
  5243. +       ((%default-port-encoding "UTF-8"))
  5244. +       (call-with-output-string
  5245. +         (lambda (port)
  5246. +           (parameterize
  5247. +             ((current-build-output-port port))
  5248. +             (let* ((s "Here’s a Greek letter: λ.")
  5249. +                    (d (build-expression->derivation
  5250. +                         %store
  5251. +                         "foo"
  5252. +                         `(display ,s)
  5253. +                         #:guile-for-build
  5254. +                         (package-derivation
  5255. +                           s
  5256. +                           %bootstrap-guile
  5257. +                           (%current-system)))))
  5258. +               (guard (c ((nix-protocol-error? c) #t))
  5259. +                      (build-derivations %store (list d))))))))
  5260. +     "Here’s a Greek letter: λ."))
  5261. actual-value: 175
  5262. result: PASS
  5263.  
  5264. test-name: current-build-output-port, UTF-8 + garbage
  5265. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:376
  5266. source:
  5267. + (test-assert
  5268. +   "current-build-output-port, UTF-8 + garbage"
  5269. +   (string-contains
  5270. +     (with-fluids
  5271. +       ((%default-port-encoding "UTF-8"))
  5272. +       (call-with-output-string
  5273. +         (lambda (port)
  5274. +           (parameterize
  5275. +             ((current-build-output-port port))
  5276. +             (let ((d (build-expression->derivation
  5277. +                        %store
  5278. +                        "foo"
  5279. +                        `(begin
  5280. +                           (use-modules (rnrs io ports))
  5281. +                           (display "garbage: ")
  5282. +                           (put-bytevector (current-output-port) #vu8(128))
  5283. +                           (display "lambda: λ\n"))
  5284. +                        #:guile-for-build
  5285. +                        (package-derivation %store %bootstrap-guile))))
  5286. +               (guard (c ((nix-protocol-error? c) #t))
  5287. +                      (build-derivations %store (list d))))))))
  5288. +     (cond-expand
  5289. +       (guile-2.2 "garbage: �lambda: λ")
  5290. +       (else "garbage: ?lambda: λ"))))
  5291. actual-value: 175
  5292. result: PASS
  5293.  
  5294. test-name: log-file, derivation
  5295. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:398
  5296. source:
  5297. + (test-assert
  5298. +   "log-file, derivation"
  5299. +   (let* ((b (add-text-to-store
  5300. +               %store
  5301. +               "build"
  5302. +               "echo $foo > $out"
  5303. +               '()))
  5304. +          (s (add-to-store
  5305. +               %store
  5306. +               "bash"
  5307. +               #t
  5308. +               "sha256"
  5309. +               (search-bootstrap-binary
  5310. +                 "bash"
  5311. +                 (%current-system))))
  5312. +          (d (derivation
  5313. +               %store
  5314. +               "the-thing"
  5315. +               s
  5316. +               `("-e" ,b)
  5317. +               #:env-vars
  5318. + @ build-started /tmp/guix-tests/store/w1yzgwcpadkcrm6k9drqvnzzrpcnzk68-the-thing.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/w1//yzgwcpadkcrm6k9drqvnzzrpcnzk68-the-thing.drv.bz2
  5319. @ build-succeeded /tmp/guix-tests/store/w1yzgwcpadkcrm6k9drqvnzzrpcnzk68-the-thing.drv -
  5320. @ build-started /tmp/guix-tests/store/qnbzlzx0fqiy6cz1si00k6cwl98sy024-the-thing.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/qn//bzlzx0fqiy6cz1si00k6cwl98sy024-the-thing.drv.bz2
  5321. @ build-succeeded /tmp/guix-tests/store/qnbzlzx0fqiy6cz1si00k6cwl98sy024-the-thing.drv -
  5322.               `(("foo" unquote (random-text)))
  5323. +               #:inputs
  5324. +               `((,b) (,s)))))
  5325. +     (and (build-derivations %store (list d))
  5326. +          (file-exists?
  5327. +            (pk (log-file %store (derivation-file-name d)))))))
  5328.  
  5329. ;;; ("/tmp/guix-tests/var/log/guix/drvs/w1/yzgwcpadkcrm6k9drqvnzzrpcnzk68-the-thing.drv.bz2")
  5330. actual-value: #t
  5331. result: PASS
  5332.  
  5333. test-name: log-file, output file name
  5334. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:410
  5335. source:
  5336. + (test-assert
  5337. +   "log-file, output file name"
  5338. +   (let* ((b (add-text-to-store
  5339. +               %store
  5340. +               "build"
  5341. +               "echo $foo > $out"
  5342. +               '()))
  5343. +          (s (add-to-store
  5344. +               %store
  5345. +               "bash"
  5346. +               #t
  5347. +               "sha256"
  5348. +               (search-bootstrap-binary
  5349. +                 "bash"
  5350. +                 (%current-system))))
  5351. +          (d (derivation
  5352. +               %store
  5353. +               "the-thing"
  5354. +               s
  5355. +               `("-e" ,b)
  5356. +               #:env-vars
  5357. +               `(("foo" unquote (random-text)))
  5358. +               #:inputs
  5359. +               `((,b) (,s))))
  5360. +          (o (derivation->output-path d)))
  5361. +     (and (build-derivations %store (list d))
  5362. +          (file-exists? (pk (log-file %store o)))
  5363. +          (string=?
  5364. +            (log-file %store (derivation-file-name d))
  5365. +            (log-file %store o)))))
  5366.  
  5367. ;;; ("/tmp/guix-tests/var/log/guix/drvs/qn/bzlzx0fqiy6cz1si00k6cwl98sy024-the-thing.drv.bz2")
  5368. actual-value: #t
  5369. result: PASS
  5370.  
  5371. test-name: no substitutes
  5372. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:425
  5373. source:
  5374. + (test-assert
  5375. +   "no substitutes"
  5376. +   (with-store
  5377. +     s
  5378. +     (let* ((d1 (package-derivation
  5379. +                  s
  5380. +                  %bootstrap-guile
  5381. +                  (%current-system)))
  5382. +            (d2 (package-derivation
  5383. +                  s
  5384. +                  %bootstrap-glibc
  5385. +                  (%current-system)))
  5386. +            (o (map derivation->output-path (list d1 d2))))
  5387. +       (set-build-options s #:use-substitutes? #f)
  5388. +       (and (not (has-substitutes? s (derivation-file-name d1)))
  5389. +            (not (has-substitutes? s (derivation-file-name d2)))
  5390. +            (null? (substitutable-paths s o))
  5391. +            (null? (substitutable-path-info s o))))))
  5392. actual-value: #t
  5393. result: PASS
  5394.  
  5395. test-name: build-things with output path
  5396. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:436
  5397. source:
  5398. + (test-assert
  5399. +   "build-things with output path"
  5400. +   (with-store
  5401. +     s
  5402. +     (let* ((c (random-text))
  5403. +            (d (build-expression->derivation
  5404. +                 s
  5405. +                 "substitute-me"
  5406. +                 `(call-with-output-file
  5407. +                    %output
  5408. +                    (lambda (p) (display ,c p)))
  5409. +                 #:guile-for-build
  5410. +                 (package-derivation
  5411. +                   s
  5412. +                   %bootstrap-guile
  5413. +                   (%current-system))))
  5414. +            (o (derivation->output-path d)))
  5415. +       (set-build-options s #:use-substitutes? #f)
  5416. +       (build-things s (list o))
  5417. +       (not (valid-path? s o)))))
  5418. actual-value: #t
  5419. result: PASS
  5420.  
  5421. test-name: substitute query
  5422. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:456
  5423. source:
  5424. + (test-assert
  5425. +   "substitute query"
  5426. +   (with-store
  5427. +     s
  5428. +     (let* ((d (package-derivation
  5429. +                 s
  5430. +                 %bootstrap-guile
  5431. +                 (%current-system)))
  5432. +            (o (derivation->output-path d)))
  5433. +       (with-derivation-narinfo
  5434. +         d
  5435. +         (false-if-exception
  5436. +           (delete-file-recursively
  5437. +             (string-append
  5438. +               (getenv "XDG_CACHE_HOME")
  5439. +               "/guix/substitute")))
  5440. +         (set-build-options
  5441. +           s
  5442. +           #:use-substitutes?
  5443. +           #t
  5444. +           #:substitute-urls
  5445. +           (%test-substitute-urls))
  5446. +         (and (has-substitutes? s o)
  5447. +              (equal?
  5448. +                (list o)
  5449. +                (substitutable-paths s (list o)))
  5450. +              (match (pk 'spi (substitutable-path-info s (list o)))
  5451. +         substitute: warning: authentication and authorization of substitutes disabled!
  5452. substitute: guix substitute: warning: ACL for archive imports seems to be uninitialized, substitutes may be unavailable
  5453. substitute: warning: authentication and authorization of substitutes disabled!
  5454. substitute: guix substitute: warning: ACL for archive imports seems to be uninitialized, substitutes may be unavailable
  5455. substitute: warning: authentication and authorization of substitutes disabled!
  5456. substitute: guix substitute: warning: ACL for archive imports seems to be uninitialized, substitutes may be unavailable
  5457. substitute: warning: authentication and authorization of substitutes disabled!
  5458. substitute: guix substitute: warning: ACL for archive imports seems to be uninitialized, substitutes may be unavailable
  5459. substitute: warning: authentication and authorization of substitutes disabled!
  5460. substitute: guix substitute: warning: ACL for archive imports seems to be uninitialized, substitutes may be unavailable
  5461. substitute: warning: authentication and authorization of substitutes disabled!
  5462. substitute: guix substitute: warning: ACL for archive imports seems to be uninitialized, substitutes may be unavailable
  5463. @ substituter-started /tmp/guix-tests/store/zmgkhlq6xzlm0xs9s3ramqlwmd5lrlj0-substitute-me /tmp/guix-build-guix-0.13.0.drv-0/source/nix/scripts/substitute
  5464. warning: authentication and authorization of substitutes disabled!
  5465. guix substitute: warning: ACL for archive imports seems to be uninitialized, substitutes may be unavailable
  5466. Downloading file:/tmp/guix-tests/var/12700/substituter-data/example.nar (1KiB installed)...
  5467.  
  5468.  example.nar  176B                     0B/s 00:00 [####################] 100.0%
  5469.  
  5470. @ substituter-succeeded /tmp/guix-tests/store/zmgkhlq6xzlm0xs9s3ramqlwmd5lrlj0-substitute-me
  5471.             (((? substitutable? s))
  5472. +                      (and (string=?
  5473. +                             (substitutable-deriver s)
  5474. +                             (derivation-file-name d))
  5475. +                           (null? (substitutable-references s))
  5476. +                           (equal? (substitutable-nar-size s) 1234)))))))))
  5477.  
  5478. ;;; (spi (#<<substitutable> path: "/tmp/guix-tests/store/7y0q8n6zv41lr9viybhihlcmhri6939f-guile-bootstrap-2.0" deriver: "/tmp/guix-tests/store/kn0gx5na8k2nilq6c362bmavywnilkhq-guile-bootstrap-2.0.drv" refs: () dl-size: 0 nar-size: 1234>))
  5479. actual-value: #t
  5480. result: PASS
  5481.  
  5482. test-name: substitute query, alternating URLs
  5483. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:480
  5484. source:
  5485. + (test-assert
  5486. +   "substitute query, alternating URLs"
  5487. +   (let* ((d (with-store
  5488. +               s
  5489. +               (package-derivation
  5490. +                 s
  5491. +                 %bootstrap-guile
  5492. +                 (%current-system))))
  5493. +          (o (derivation->output-path d)))
  5494. +     (with-derivation-narinfo
  5495. +       d
  5496. +       (false-if-exception
  5497. +         (delete-file-recursively
  5498. +           (string-append
  5499. +             (getenv "XDG_CACHE_HOME")
  5500. +             "/guix/substitute")))
  5501. +       (and (with-store
  5502. +              s
  5503. +              (set-build-options
  5504. +                s
  5505. +                #:use-substitutes?
  5506. +                #t
  5507. +                #:substitute-urls
  5508. +                (%test-substitute-urls))
  5509. +              (has-substitutes? s o))
  5510. +            (with-store
  5511. +              s
  5512. +              (set-build-options
  5513. +                s
  5514. +                #:use-substitutes?
  5515. +                #t
  5516. +                #:substitute-urls
  5517. +                (list "http://does-not-exist"))
  5518. +              (not (has-substitutes? s o)))
  5519. +            (with-store
  5520. +              s
  5521. +              (set-build-options
  5522. +                s
  5523. +                #:use-substitutes?
  5524. +                #t
  5525. +                #:substitute-urls
  5526. +                (%test-substitute-urls))
  5527. +              (has-substitutes? s o))
  5528. +            (with-store
  5529. +              s
  5530. +              (set-build-options
  5531. +                s
  5532. +                #:use-substitutes?
  5533. +                #t
  5534. +                #:substitute-urls
  5535. +                '())
  5536. +              (not (has-substitutes? s o)))))))
  5537. actual-value: #t
  5538. result: PASS
  5539.  
  5540. test-name: substitute
  5541. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:512
  5542. source:
  5543. + (test-assert
  5544. +   "substitute"
  5545. +   (with-store
  5546. +     s
  5547. +     (let* ((c (random-text))
  5548. +            (d (build-expression->derivation
  5549. +                 s
  5550. +                 "substitute-me"
  5551. +                 `(call-with-output-file
  5552. +                    %output
  5553. +                    (lambda (p) (exit 1) (display ,c p)))
  5554. +                 #:guile-for-build
  5555. +                 (package-derivation
  5556. +                   s
  5557. +                   %bootstrap-guile
  5558. +                   (%current-system))))
  5559. +            (o (derivation->output-path d)))
  5560. +       (with-derivation-substitute
  5561. +         d
  5562. +         c
  5563. +         (set-build-options
  5564. +           s
  5565. +           #:use-substitutes?
  5566. +           #t
  5567. +           #:substitute-urls
  5568. +           (%test-substitute-urls))
  5569. +         (and (has-substitutes? s o)
  5570. +              (build-derivations s (list d))
  5571. +              (equal?
  5572. +                c
  5573. +                (call-with-input-file o get-string-all)))))))
  5574. actual-value: #t
  5575. result: PASS
  5576.  
  5577. test-name: substitute + build-things with output path
  5578. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:531
  5579. source:
  5580. + (test-assert
  5581. +   "substitute + build-things with output path"
  5582. +   (with-store
  5583. +     s
  5584. +     (let* ((c (random-text))
  5585. +            (d (build-expression->derivation
  5586. +                 s
  5587. +                 "substitute-me"
  5588. +                 `(call-with-output-file
  5589. +                    %output
  5590. +                    (lambda (p) (exit 1) (display ,c p)))
  5591. +                 #:guile-for-build
  5592. +                 (package-derivation
  5593. +                   s
  5594. +                   %bootstrap-guile
  5595. +                   (%current-system))))
  5596. +            (o (derivation->output-path d)))
  5597. +       (substitute: warning: authentication and authorization of substitutes disabled!
  5598. substitute: guix substitute: warning: ACL for archive imports seems to be uninitialized, substitutes may be unavailable
  5599. @ substituter-started /tmp/guix-tests/store/57gqm81hrn29k7cf0076x52zmlcax2vr-substitute-me /tmp/guix-build-guix-0.13.0.drv-0/source/nix/scripts/substitute
  5600. warning: authentication and authorization of substitutes disabled!
  5601. guix substitute: warning: ACL for archive imports seems to be uninitialized, substitutes may be unavailable
  5602. Downloading file:/tmp/guix-tests/var/12700/substituter-data/example.nar (1KiB installed)...
  5603.  
  5604.  example.nar  176B                     0B/s 00:00 [####################] 100.0%
  5605.  
  5606. @ substituter-succeeded /tmp/guix-tests/store/57gqm81hrn29k7cf0076x52zmlcax2vr-substitute-me
  5607. substitute: warning: authentication and authorization of substitutes disabled!
  5608. substitute: guix substitute: warning: ACL for archive imports seems to be uninitialized, substitutes may be unavailable
  5609. @ substituter-started /tmp/guix-tests/store/4l2phlryfj24z74xw4jb45zia952rjri-corrupt-substitute /tmp/guix-build-guix-0.13.0.drv-0/source/nix/scripts/substitute
  5610. warning: authentication and authorization of substitutes disabled!
  5611. guix substitute: warning: ACL for archive imports seems to be uninitialized, substitutes may be unavailable
  5612. Downloading file:/tmp/guix-tests/var/12700/substituter-data/example.nar (1KiB installed)...
  5613.  
  5614.  example.nar  128B                     0B/s 00:00 [####################] 100.0%
  5615.  
  5616. @ substituter-failed /tmp/guix-tests/store/4l2phlryfj24z74xw4jb45zia952rjri-corrupt-substitute 0 hash mismatch in downloaded path `/tmp/guix-tests/store/4l2phlryfj24z74xw4jb45zia952rjri-corrupt-substitute': expected 0000000000000000000000000000000000000000000000000000000000000000, got b8f73a6eb280e63169b1de2a5b5e154676fe1ada685f1e5c7183cbb2c1dcd535
  5617. substitute: warning: authentication and authorization of substitutes disabled!
  5618. substitute: guix substitute: warning: ACL for archive imports seems to be uninitialized, substitutes may be unavailable
  5619. @ substituter-started /tmp/guix-tests/store/5idi3iqz8aq2qn6zll308ipxz65b32p2-substitute-me-not /tmp/guix-build-guix-0.13.0.drv-0/source/nix/scripts/substitute
  5620. warning: authentication and authorization of substitutes disabled!
  5621. guix substitute: warning: ACL for archive imports seems to be uninitialized, substitutes may be unavailable
  5622. Downloading file:/tmp/guix-tests/var/12700/substituter-data/example.nar (1KiB installed)...
  5623. guix substitute: error: open-file: No such file or directory: "/tmp/guix-tests/var/12700/substituter-data/example.nar"
  5624. @ substituter-failed /tmp/guix-tests/store/5idi3iqz8aq2qn6zll308ipxz65b32p2-substitute-me-not 256 fetching path `/tmp/guix-tests/store/5idi3iqz8aq2qn6zll308ipxz65b32p2-substitute-me-not' failed with exit code 1
  5625. @ substituter-started /tmp/guix-tests/store/5idi3iqz8aq2qn6zll308ipxz65b32p2-substitute-me-not /tmp/guix-build-guix-0.13.0.drv-0/source/nix/scripts/substitute
  5626. warning: authentication and authorization of substitutes disabled!
  5627. guix substitute: warning: ACL for archive imports seems to be uninitialized, substitutes may be unavailable
  5628. Downloading file:/tmp/guix-tests/var/12700/substituter-data/example.nar (1KiB installed)...
  5629. guix substitute: error: open-file: No such file or directory: "/tmp/guix-tests/var/12700/substituter-data/example.nar"
  5630. @ substituter-failed /tmp/guix-tests/store/5idi3iqz8aq2qn6zll308ipxz65b32p2-substitute-me-not 256 fetching path `/tmp/guix-tests/store/5idi3iqz8aq2qn6zll308ipxz65b32p2-substitute-me-not' failed with exit code 1
  5631. @ build-started /tmp/guix-tests/store/yy8rjfxwqc995kjmnvqzdrpi5xb6s7fp-substitute-me-not.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/yy//8rjfxwqc995kjmnvqzdrpi5xb6s7fp-substitute-me-not.drv.bz2
  5632. @ build-succeeded /tmp/guix-tests/store/yy8rjfxwqc995kjmnvqzdrpi5xb6s7fp-substitute-me-not.drv -
  5633. with-derivation-substitute
  5634. +         d
  5635. +         c
  5636. +         (set-build-options
  5637. +           s
  5638. +           #:use-substitutes?
  5639. +           #t
  5640. +           #:substitute-urls
  5641. +           (%test-substitute-urls))
  5642. +         (and (has-substitutes? s o)
  5643. +              (build-things s (list o))
  5644. +              (valid-path? s o)
  5645. +              (equal?
  5646. +                c
  5647. +                (call-with-input-file o get-string-all)))))))
  5648. actual-value: #t
  5649. result: PASS
  5650.  
  5651. test-name: substitute, corrupt output hash
  5652. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:551
  5653. source:
  5654. + (test-assert
  5655. +   "substitute, corrupt output hash"
  5656. +   (with-store
  5657. +     s
  5658. +     (let* ((c "hello, world")
  5659. +            (d (build-expression->derivation
  5660. +                 s
  5661. +                 "corrupt-substitute"
  5662. +                 `(mkdir %output)
  5663. +                 #:guile-for-build
  5664. +                 (package-derivation
  5665. +                   s
  5666. +                   %bootstrap-guile
  5667. +                   (%current-system))))
  5668. +            (o (derivation->output-path d)))
  5669. +       (with-derivation-substitute
  5670. +         d
  5671. +         c
  5672. +         (sha256 => (make-bytevector 32 0))
  5673. +         (set-build-options
  5674. +           s
  5675. +           #:use-substitutes?
  5676. +           #t
  5677. +           #:fallback?
  5678. +           #f
  5679. +           #:substitute-urls
  5680. +           (%test-substitute-urls))
  5681. +         (and (has-substitutes? s o)
  5682. +              (guard (c ((nix-protocol-error? c)
  5683. +                         (pk 'corrupt c)
  5684. +                         (not (zero? (nix-protocol-error-status c)))))
  5685. +                     (build-derivations s (list d))
  5686. +                     #f))))))
  5687.  
  5688. ;;; (corrupt #<condition &nix-protocol-error [message: "some substitutes for the outputs of derivation `/tmp/guix-tests/store/392j6h3j3jg1srjvzppd9x1g86vlk44n-corrupt-substitute.drv' failed (usually happens due to networking issues); try `--fallback' to build derivation from source " status: 1] 101c690>)
  5689. actual-value: #t
  5690. result: PASS
  5691.  
  5692. test-name: substitute --fallback
  5693. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:581
  5694. source:
  5695. + (test-assert
  5696. +   "substitute --fallback"
  5697. +   (with-store
  5698. +     s
  5699. +     (let* ((t (random-text))
  5700. +            (d (build-expression->derivation
  5701. +                 s
  5702. +                 "substitute-me-not"
  5703. +                 `(call-with-output-file
  5704. +                    %output
  5705. +                    (lambda (p) (display ,t p)))
  5706. +                 #:guile-for-build
  5707. +                 (package-derivation
  5708. +                   s
  5709. +                   %bootstrap-guile
  5710. +                   (%current-system))))
  5711. +            (o (derivation->output-path d)))
  5712. +       (with-derivation-narinfo
  5713. +         d
  5714. +         (set-build-options
  5715. +           s
  5716. +           #:use-substitutes?
  5717. +           #t
  5718. +           #:substitute-urls
  5719. +           (%test-substitute-urls))
  5720. +         (and (has-substitutes? s o)
  5721. +              (guard (c ((nix-protocol-error? c)
  5722. +                         (set-build-options
  5723. +                           s
  5724. +                           #:use-substitutes?
  5725. +                           #t
  5726. +                           #:substitute-urls
  5727. +                           (%test-substitute-urls)
  5728. +                           #:fallback?
  5729. +                           #t)
  5730. +                         (and (build-derivations s (list d))
  5731. +                              (equal?
  5732. +                                t
  5733. +                                (call-with-input-file o get-string-all)))))
  5734. +                     (build-derivations s (list d))
  5735. +                     #f))))))
  5736. actual-value: #t
  5737. result: PASS
  5738.  
  5739. test-name: export/import several paths
  5740. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:613
  5741. source:
  5742. + (test-assert
  5743. +   "export/import several paths"
  5744. +   (let* ((texts (unfold
  5745. +                   (cut >= <> 10)
  5746. +                   (lambda _ (random-text))
  5747. +                   #{1+}#
  5748. +                   0))
  5749. +          (files (map (cut add-text-to-store %store "text" <>)
  5750. +                      texts))
  5751. +          (dump (call-with-bytevector-output-port
  5752. +                  (cut export-paths %store files <>))))
  5753. + finding garbage collector roots...
  5754. removing stale temporary roots file `/tmp/guix-tests/var/12700/temproots/.fuse_hidden0001096600002611'
  5755. deleting unused links...
  5756. finding garbage collector roots...
  5757. removing stale temporary roots file `/tmp/guix-tests/var/12700/temproots/.fuse_hidden000109660000264c'
  5758. deleting unused links...
  5759. finding garbage collector roots...
  5760. removing stale temporary roots file `/tmp/guix-tests/var/12700/temproots/.fuse_hidden000109660000265a'
  5761. deleting unused links...
  5762.     (delete-paths %store files)
  5763. +     (and (every (negate file-exists?) files)
  5764. +          (let* ((source (open-bytevector-input-port dump))
  5765. +                 (imported (import-paths %store source)))
  5766. +            (and (equal? imported files)
  5767. +                 (every file-exists? files)
  5768. +                 (equal?
  5769. +                   texts
  5770. +                   (map (lambda (file)
  5771. +                          (call-with-input-file file get-string-all))
  5772. +                        files)))))))
  5773. actual-value: #t
  5774. result: PASS
  5775.  
  5776. test-name: export/import paths, ensure topological order
  5777. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:633
  5778. source:
  5779. + (test-assert
  5780. +   "export/import paths, ensure topological order"
  5781. +   (let* ((file0 (add-text-to-store %store "baz" (random-text)))
  5782. +          (file1 (add-text-to-store
  5783. +                   %store
  5784. +                   "foo"
  5785. +                   (random-text)
  5786. +                   (list file0)))
  5787. +          (file2 (add-text-to-store
  5788. +                   %store
  5789. +                   "bar"
  5790. +                   (random-text)
  5791. +                   (list file1)))
  5792. +          (files (list file1 file2))
  5793. +          (dump1 (call-with-bytevector-output-port
  5794. +                   (cute export-paths %store (list file1 file2) <>)))
  5795. +          (dump2 (call-with-bytevector-output-port
  5796. +                   (cute export-paths %store (list file2 file1) <>))))
  5797. +     (delete-paths %store files)
  5798. +     (and (every (negate file-exists?) files)
  5799. +          (bytevector=? dump1 dump2)
  5800. +          (let* ((source (open-bytevector-input-port dump1))
  5801. +                 (imported (import-paths %store source)))
  5802. +            (and (equal? imported (list file1 file2))
  5803. +                 (every file-exists? files)
  5804. +                 (equal? (list file0) (references %store file1))
  5805. +                 (equal? (list file1) (references %store file2)))))))
  5806. actual-value: #t
  5807. result: PASS
  5808.  
  5809. test-name: export/import incomplete
  5810. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:655
  5811. source:
  5812. + (test-assert
  5813. +   "export/import incomplete"
  5814. +   (let* ((file0 (add-text-to-store %store "baz" (random-text)))
  5815. +          (file1 (add-text-to-store
  5816. +                   %store
  5817. +                   "foo"
  5818. +                   (random-text)
  5819. +                   (list file0)))
  5820. +          (file2 (add-text-to-store
  5821. +                   %store
  5822. +                   "bar"
  5823. +                   (random-text)
  5824. +                   (list file1)))
  5825. +          (dump (call-with-bytevector-output-port
  5826. +                  (cute export-paths %store (list file2) <>))))
  5827. +     (delete-paths %store (list file0 file1 file2))
  5828. +     (guard (c ((nix-protocol-error? c)
  5829. +                (and (not (zero? (nix-protocol-error-status c)))
  5830. +                     (string-contains
  5831. +                       (nix-protocol-error-message c)
  5832. +                       "not valid"))))
  5833. +            (import-paths
  5834. +              %store
  5835. +              (open-bytevector-input-port dump)))))
  5836. actual-value: 69
  5837. result: PASS
  5838.  
  5839. test-name: export/import recursive
  5840. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:672
  5841. source:
  5842. + (test-assert
  5843. +   "export/import recursive"
  5844. +   (let* ((file0 (add-text-to-store %store "baz" (random-text)))
  5845. +          (file1 (add-text-to-store
  5846. +                   %store
  5847. +                   "foo"
  5848. +                   (random-text)
  5849. +                   (list file0)))
  5850. +          (file2 (add-text-to-store
  5851. +                   %store
  5852. +                   "bar"
  5853. +                   (random-text)
  5854. +                   (list file1)))
  5855. +          (dump (call-with-bytevector-output-port
  5856. +                  (cute export-paths
  5857. +                        %store
  5858. +                        (list file2)
  5859. +                        <>
  5860. +                        #:recursive?
  5861. +                        #t))))
  5862. +     (delete-paths %store (list file0 file1 file2))
  5863. +     (let ((imported
  5864. +             (import-paths
  5865. +               %store
  5866. +               (open-bytevector-input-port dump))))
  5867. +       (and (equal? imported (list file0 file1 file2))
  5868. +            (every file-exists? (list file0 file1 file2))
  5869. +            finding garbage collector roots...
  5870. removing stale temporary roots file `/tmp/guix-tests/var/12700/temproots/.fuse_hidden0001096600002660'
  5871. deleting unused links...
  5872. @ build-started /tmp/guix-tests/store/81dysylmirpp9m0brx7nj5p2a2kj8fbn-bunch.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/81//dysylmirpp9m0brx7nj5p2a2kj8fbn-bunch.drv.bz2
  5873. @ build-succeeded /tmp/guix-tests/store/81dysylmirpp9m0brx7nj5p2a2kj8fbn-bunch.drv -
  5874. finding garbage collector roots...
  5875. removing stale temporary roots file `/tmp/guix-tests/var/12700/temproots/.fuse_hidden0001096600002664'
  5876. deleting unused links...
  5877. (equal? (list file0) (references %store file1))
  5878. +            (equal? (list file1) (references %store file2))))))
  5879. actual-value: #t
  5880. result: PASS
  5881.  
  5882. test-name: write-file & export-path yield the same result
  5883. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:688
  5884. source:
  5885. + (test-assert
  5886. +   "write-file & export-path yield the same result"
  5887. +   (run-with-store
  5888. +     %store
  5889. +     (mlet* %store-monad
  5890. +            ((drv1 (package->derivation %bootstrap-guile))
  5891. +             (out1 -> (derivation->output-path drv1))
  5892. +             (data ->
  5893. +                   (unfold
  5894. +                     (cut >= <> 26)
  5895. +                     (lambda (i) (random-bytevector 128))
  5896. +                     #{1+}#
  5897. +                     0))
  5898. +             (build ->
  5899. +                    (gexp (begin
  5900. +                            (use-modules (rnrs io ports) (srfi srfi-1))
  5901. +                            (let ()
  5902. +                              (define letters
  5903. +                                (map (lambda (i)
  5904. +                                       (string
  5905. +                                         (integer->char
  5906. +                                           (+ i (char->integer #\a)))))
  5907. +                                     (iota 26)))
  5908. +                              (define (touch file data)
  5909. +                                (call-with-output-file
  5910. +                                  file
  5911. +                                  (lambda (port) (put-bytevector port data))))
  5912. +                              (mkdir (ungexp output))
  5913. +                              (chdir (ungexp output))
  5914. +                              (for-each
  5915. +                                touch
  5916. +                                (append (drop letters 10) (take letters 10))
  5917. +                                (list (ungexp-splicing data)))
  5918. +                              #t))))
  5919. +             (drv2 (gexp->derivation "bunch" build))
  5920. +             (out2 -> (derivation->output-path drv2))
  5921. +             (item-info -> (store-lift query-path-info)))
  5922. +            (mbegin
  5923. +              %store-monad
  5924. +              (built-derivations (list drv1 drv2))
  5925. +              (foldm %store-monad
  5926. +                     (lambda (item result)
  5927. +                       (define ref-hash
  5928. +                         (let-values
  5929. +                           (((port get) (open-sha256-port)))
  5930. +                           (write-file item port)
  5931. +                           (close-port port)
  5932. +                           (get)))
  5933. +                       (>>= (item-info item)
  5934. +                            (lambda (info)
  5935. +                              (return
  5936. +                                (and result
  5937. +                                     (bytevector=?
  5938. +                                       (path-info-hash info)
  5939. +                                       ref-hash))))))
  5940. +                     #t
  5941. +                     (list out1 out2))))
  5942. +     #:guile-for-build
  5943. +     (%guile-for-build)))
  5944. actual-value: #t
  5945. result: PASS
  5946.  
  5947. test-name: import corrupt path
  5948. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:754
  5949. source:
  5950. + (test-assert
  5951. +   "import corrupt path"
  5952. +   (let* ((text (random-text))
  5953. +          (file (add-text-to-store %store "text" text))
  5954. +          (dump (call-with-bytevector-output-port
  5955. +                  (cut export-paths %store (list file) <>))))
  5956. +     (delete-paths %store (list file))
  5957. +     (let* ((index 112)
  5958. +            (byte (bytevector-u8-ref dump index)))
  5959. +       (bytevector-u8-set! dump index (logxor 255 byte)))
  5960. +     (and (not (file-exists? file))
  5961. +          (guard (c ((nix-protocol-error? c)
  5962. +                     (pk 'c c)
  5963. +                     (and (not (zero? (nix-protocol-error-status c)))
  5964. +                          (string-contains
  5965. +                            (nix-protocol-error-message c)
  5966. +                            "corrupt"))))
  5967. +                 (let* ((source (open-bytevector-input-port dump))
  5968. +                        (imported (import-paths %store source)))
  5969. +                   (pk 'corrupt-imported imported)
  5970. +                   #f)))))
  5971.  
  5972. ;;; (c #<condition &nix-protocol-error [reading the Nix store...
  5973. reading the Nix store...
  5974. path `/tmp/guix-tests/store/v7hzdqgwg7asavxjlzsmr141dkrf1zwi-foo' disappeared, but it still has valid referrers!
  5975. reading the Nix store...
  5976. substitute: warning: authentication and authorization of substitutes disabled!
  5977. substitute: guix substitute: warning: ACL for archive imports seems to be uninitialized, substitutes may be unavailable
  5978. fetching path `/tmp/guix-tests/store/p5bvlbi87wvs4ssxq40zl9jx9fzbpwwp-corrupt'...
  5979. warning: authentication and authorization of substitutes disabled!
  5980. guix substitute: warning: ACL for archive imports seems to be uninitialized, substitutes may be unavailable
  5981. Downloading file:/tmp/guix-tests/var/12700/substituter-data/example.nar (1KiB installed)...
  5982.  
  5983.  example.nar  176B                      0B/s 00:00 [####################] 100.0%
  5984.  
  5985. reading the Nix store...
  5986. checking path existence...
  5987. checking hashes...
  5988. reading the Nix store...
  5989. checking path existence...
  5990. checking hashes...
  5991. path `/tmp/guix-tests/store/p5bvlbi87wvs4ssxq40zl9jx9fzbpwwp-corrupt' was modified! expected hash `d7f417f7389810a5553536bdba6e7de6e20145ed67b421ef021689df2885b91a', got `e09c480e2e93336cd3c45aa129f81a0d7ba56c410b849d7779a8136074413b3d'
  5992. finding garbage collector roots...
  5993. removing stale temporary roots file `/tmp/guix-tests/var/12700/temproots/13163'
  5994. message: "signed hash doesn't match actual contents of imported archive; archive could be corrupt, or someone is trying to import a Trojan horse" status: 1] ed60c0>)
  5995. actual-value: 80
  5996. result: PASS
  5997.  
  5998. test-name: register-path
  5999. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:778
  6000. source:
  6001. + (test-assert
  6002. +   "register-path"
  6003. +   (let ((file (string-append
  6004. +                 (%store-prefix)
  6005. +                 "/"
  6006. +                 (make-string 32 #\f)
  6007. +                 "-fake")))
  6008. +     (when (valid-path? %store file)
  6009. +           (delete-paths %store (list file)))
  6010. +     (false-if-exception (delete-file file))
  6011. +     (let ((ref (add-text-to-store
  6012. +                  %store
  6013. +                  "ref-of-fake"
  6014. +                  (random-text)))
  6015. +           (drv (string-append file ".drv")))
  6016. +       (call-with-output-file
  6017. +         file
  6018. +         (cut display "This is a fake store item.\n" <>))
  6019. +       (register-path
  6020. +         file
  6021. +         #:references
  6022. +         (list ref)
  6023. +         #:deriver
  6024. +         drv)
  6025. +       (and (valid-path? %store file)
  6026. +            (equal? (references %store file) (list ref))
  6027. +            (null? (valid-derivers %store file))
  6028. +            (null? (referrers %store file))))))
  6029. actual-value: #t
  6030. result: PASS
  6031.  
  6032. test-name: verify-store
  6033. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:798
  6034. source:
  6035. + (test-assert
  6036. +   "verify-store"
  6037. +   (let* ((text (random-text))
  6038. +          (file1 (add-text-to-store %store "foo" text))
  6039. +          (file2 (add-text-to-store
  6040. +                   %store
  6041. +                   "bar"
  6042. +                   (random-text)
  6043. +                   (list file1))))
  6044. +     (and (pk 'verify1 (verify-store %store))
  6045. +          (begin
  6046. +            (delete-file file1)
  6047. +            (not (pk 'verify2 (verify-store %store))))
  6048. +          (begin
  6049. +            (call-with-output-file
  6050. +              file1
  6051. +              (lambda (port) (display text port)))
  6052. +            (pk 'verify3 (verify-store %store))))))
  6053.  
  6054. ;;; (verify1 #t)
  6055.  
  6056. ;;; (verify2 #f)
  6057.  
  6058. ;;; (verify3 #t)
  6059. actual-value: #t
  6060. result: PASS
  6061.  
  6062. test-name: verify-store + check-contents
  6063. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:815
  6064. source:
  6065. + (test-assert
  6066. +   "verify-store + check-contents"
  6067. +   (with-store
  6068. +     s
  6069. +     (let* ((text (random-text))
  6070. +            (drv (build-expression->derivation
  6071. +                   s
  6072. +                   "corrupt"
  6073. +                   `(let ((out (assoc-ref %outputs "out")))
  6074. +                      (call-with-output-file
  6075. +                        out
  6076. +                        (lambda (port) (display ,text port)))
  6077. +                      #t)
  6078. +                   #:guile-for-build
  6079. +                   (package-derivation
  6080. +                     s
  6081. +                     %bootstrap-guile
  6082. +                     (%current-system))))
  6083. +            (file (derivation->output-path drv)))
  6084. +       (with-derivation-substitute
  6085. +         drv
  6086. +         text
  6087. +         (and (build-derivations s (list drv))
  6088. +              (verify-store s #:check-contents? #t)
  6089. +              (begin
  6090. +                (chmod file 420)
  6091. +                (call-with-output-file
  6092. +                  file
  6093. +                  (lambda (port) (display "corrupt!" port)))
  6094. +                #t)
  6095. +              (not (verify-store s #:check-contents? #t))
  6096. +              (delete-paths s (list file)))))))
  6097. actual-value: #f
  6098. actual-error:
  6099. + (srfi-34
  6100. +   #<condition &nix-protocol-error [message: "path `dtmp/guix-tests/store/462z3fnl7bs44vp9s97jyg1z74nsfvly-tar' is not in the Nix store" status: 1] e171e0>)
  6101. result: FAIL
  6102.  
  6103. test-name: build-things, check mode
  6104. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:852
  6105. source:
  6106. + (test-assert
  6107. +   "build-things, check mode"
  6108. +   (with-store
  6109. +     store
  6110. +     (call-with-temporary-output-file
  6111. +       (lambda (entropy entropy-port)
  6112. +         (write (random-text) entropy-port)
  6113. +         (force-output entropy-port)
  6114. +         (let* ((drv (build-expression->derivation
  6115. +                       store
  6116. +                       "non-deterministic"
  6117. +                       `(begin
  6118. +                          substitute: warning: authentication and authorization of substitutes disabled!
  6119. substitute: guix substitute: warning: ACL for archive imports seems to be uninitialized, substitutes may be unavailable
  6120. building path(s) `/tmp/guix-tests/store/yxdrblahz7n571z3mrqcmw9b8yxvdjn9-non-deterministic'
  6121. checking path(s) `/tmp/guix-tests/store/yxdrblahz7n571z3mrqcmw9b8yxvdjn9-non-deterministic'
  6122. warning: rewriting hashes in `/tmp/guix-tests/store/yxdrblahz7n571z3mrqcmw9b8yxvdjn9-non-deterministic'; cross fingers
  6123. @ build-started /tmp/guix-tests/store/wz4x7fy6s0ilrvcvrjp8w2jal0ldmxj2-non-deterministic.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/wz//4x7fy6s0ilrvcvrjp8w2jal0ldmxj2-non-deterministic.drv.bz2
  6124. @ build-started /tmp/guix-tests/store/wz4x7fy6s0ilrvcvrjp8w2jal0ldmxj2-non-deterministic.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/wz//4x7fy6s0ilrvcvrjp8w2jal0ldmxj2-non-deterministic.drv.bz2
  6125. output ‘/tmp/guix-tests/store/qj2ycljwvb81vwmbybmkva32zckyv229-non-deterministic’ of ‘/tmp/guix-tests/store/wz4x7fy6s0ilrvcvrjp8w2jal0ldmxj2-non-deterministic.drv’ differs from previous round
  6126. @ build-failed /tmp/guix-tests/store/wz4x7fy6s0ilrvcvrjp8w2jal0ldmxj2-non-deterministic.drv - 1 output ‘/tmp/guix-tests/store/qj2ycljwvb81vwmbybmkva32zckyv229-non-deterministic’ of ‘/tmp/guix-tests/store/wz4x7fy6s0ilrvcvrjp8w2jal0ldmxj2-non-deterministic.drv’ differs from previous round
  6127. (use-modules (rnrs io ports))
  6128. +                          (let ((out (assoc-ref %outputs "out")))
  6129. +                            (call-with-output-file
  6130. +                              out
  6131. +                              (lambda (port)
  6132. +                                (display
  6133. +                                  (call-with-input-file
  6134. +                                    ,entropy
  6135. +                                    get-string-all)
  6136. +                                  port)))
  6137. +                            #t))
  6138. +                       #:guile-for-build
  6139. +                       (package-derivation
  6140. +                         store
  6141. +                         %bootstrap-guile
  6142. +                         (%current-system))))
  6143. +                (file (derivation->output-path drv)))
  6144. +           (and (build-things
  6145. +                  store
  6146. +                  (list (derivation-file-name drv)))
  6147. +                (begin
  6148. +                  (write (random-text) entropy-port)
  6149. +                  (force-output entropy-port)
  6150. +                  (guard (c ((nix-protocol-error? c)
  6151. +                             (pk 'determinism-exception c)
  6152. +                             (and (not (zero? (nix-protocol-error-status c)))
  6153. +                                  (string-contains
  6154. +                                    (nix-protocol-error-message c)
  6155. +                                    "deterministic"))))
  6156. +                         (build-things
  6157. +                           store
  6158. +                           (list (derivation-file-name drv))
  6159. +                           (build-mode check))
  6160. +                         #f))))))))
  6161.  
  6162. ;;; (determinism-exception #<condition &nix-protocol-error [message: "derivation `/tmp/guix-tests/store/vbbxdzqwydn6c9lqm7yhcpjs6jn15ani-non-deterministic.drv' may not be deterministic: output `/tmp/guix-tests/store/yxdrblahz7n571z3mrqcmw9b8yxvdjn9-non-deterministic' differs" status: 1] eade10>)
  6163. actual-value: 71
  6164. result: PASS
  6165.  
  6166. test-name: build multiple times
  6167. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:889
  6168. source:
  6169. + (test-assert
  6170. +   "build multiple times"
  6171. +   (with-store
  6172. +     store
  6173. +     (set-build-options
  6174. +       store
  6175. +       #:rounds
  6176. +       2
  6177. +       #:use-substitutes?
  6178. +       #f)
  6179. +     (call-with-temporary-output-file
  6180. +       (lambda (entropy entropy-port)
  6181. +         (write (random-text) entropy-port)
  6182. +         (force-output entropy-port)
  6183. +         (let* ((drv (build-expression->derivation
  6184. +                       store
  6185. +                       "non-deterministic"
  6186. +                       `(begin
  6187. +                          (use-modules (rnrs io ports))
  6188. +                          (let ((out (assoc-ref %outputs "out")))
  6189. +                            (call-with-output-file
  6190. +                              out
  6191. +                              (lambda (port)
  6192. +                                (display
  6193. +                                  (call-with-input-file
  6194. +                                    ,entropy
  6195. +                                    get-string-all)
  6196. +                                  port)
  6197. +                                (call-with-output-file
  6198. +                                  ,entropy
  6199. +                                  (lambda (port) (write 'foobar port)))))
  6200. +                            #t))
  6201. +                       #:guile-for-build
  6202. +                       (package-derivation
  6203. +                         store
  6204. +                         %bootstrap-guile
  6205. +                         (%current-system))))
  6206. +                (file (derivation->output-path drv)))
  6207. +           (guard (c ((nix-protocol-error? c)
  6208. +                      (pk 'multiple-build c)
  6209. +                      (and (not (zero? (nix-protocol-error-status c)))
  6210. +                           (string-contains
  6211. +                             (nix-protocol-error-message c)
  6212. +                             "deterministic"))))
  6213. +                  (current-build-output-port (current-error-port))
  6214. +                  (build-things
  6215. +                    store
  6216. +                    (list (derivation-file-name drv)))
  6217. +                  #f))))))
  6218.  
  6219. ;;; (multiple-build #<condition &nix-protocol-error [@ build-started /tmp/guix-tests/store/7bmd63xq675b7v5gvr1wz5p7l6nzq54b-the-thing.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/7b//md63xq675b7v5gvr1wz5p7l6nzq54b-the-thing.drv.bz2
  6220. @ build-succeeded /tmp/guix-tests/store/7bmd63xq675b7v5gvr1wz5p7l6nzq54b-the-thing.drv -
  6221. message: "build of `/tmp/guix-tests/store/wz4x7fy6s0ilrvcvrjp8w2jal0ldmxj2-non-deterministic.drv' failed" status: 1] dce990>)
  6222. actual-value: 69
  6223. result: PASS
  6224.  
  6225. test-name: store-lower
  6226. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:927
  6227. source:
  6228. + (test-equal
  6229. +   "store-lower"
  6230. +   "Lowered."
  6231. +   (let* ((add (store-lower text-file))
  6232. +          (file (add %store "foo" "Lowered.")))
  6233. +     (call-with-input-file file get-string-all)))
  6234. expected-value: "Lowered."
  6235. actual-value: "Lowered."
  6236. result: PASS
  6237.  
  6238. test-name: current-system
  6239. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:933
  6240. source:
  6241. + (test-equal
  6242. +   "current-system"
  6243. +   "bar"
  6244. +   (parameterize
  6245. +     ((%current-system "frob"))
  6246. +     (run-with-store
  6247. +       %store
  6248. +       (mbegin
  6249. +         %store-monad
  6250. +         (set-current-system "bar")
  6251. +         (current-system))
  6252. +       #:system
  6253. +       "foo")))
  6254. expected-value: "bar"
  6255. actual-value: "bar"
  6256. result: PASS
  6257.  
  6258. test-name: query-path-info
  6259. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:942
  6260. source:
  6261. + (test-assert
  6262. +   "query-path-info"
  6263. +   (let* ((ref (add-text-to-store %store "ref" "foo"))
  6264. +          (item (add-text-to-store
  6265. +                  %store
  6266. +                  "item"
  6267. +                  "bar"
  6268. +                  (list ref)))
  6269. +          (info (query-path-info %store item)))
  6270. +     (and (equal? (path-info-references info) (list ref))
  6271. +          (equal?
  6272. +            (path-info-hash info)
  6273. +            (sha256
  6274. +              (string->utf8
  6275. +                (call-with-output-string
  6276. +                  (cut write-file item <>))))))))
  6277. actual-value: #t
  6278. result: PASS
  6279.  
  6280. test-name: path-info-deriver
  6281. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:952
  6282. source:
  6283. + (test-assert
  6284. +   "path-info-deriver"
  6285. +   (let* ((b (add-text-to-store
  6286. +               %store
  6287. +               "build"
  6288. +               "echo $foo > $out"
  6289. +               '()))
  6290. +          (s (add-to-store
  6291. +               %store
  6292. +               "bash"
  6293. +               #t
  6294. +               "sha256"
  6295. +               (search-bootstrap-binary
  6296. +                 "bash"
  6297. +                 (%current-system))))
  6298. +          (d (derivation
  6299. +               %store
  6300. +               "the-thing"
  6301. +               s
  6302. +               `("-e" ,b)
  6303. +               #:env-vars
  6304. +               `(("foo" unquote (random-text)))
  6305. +               #:inputs
  6306. +               `((,b) (,s))))
  6307. +          (o (derivation->output-path d)))
  6308. +     (and (build-derivations %store (list d))
  6309. +          (not (path-info-deriver (query-path-info %store b)))
  6310. +          (string=?
  6311. +            (derivation-file-name d)
  6312. +            (path-info-deriver (query-path-info %store o))))))
  6313. actual-value: #t
  6314. result: PASS
  6315.  
  6316. test-name: build-cores
  6317. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/store.scm:967
  6318. source:
  6319. + (test-equal
  6320. +   "build-cores"
  6321. +   (list 0 42)
  6322. +   (with-store
  6323. +     store
  6324. +     (let* ((build (add-text-to-store
  6325. +                     store
  6326. +                     "build.sh"
  6327. +                     "echo $NIX_BUILD_CORES > $out"))
  6328. +            (bash (add-to-store
  6329. +                    store
  6330. +                    "bash"
  6331. +                    #t
  6332. +                    "sha256"
  6333. +                    (search-bootstrap-binary
  6334. +                      "bash"
  6335. +                      (%current-system))))
  6336. +            (drv1 (derivation
  6337. +                    store
  6338. +                    "the-thing"
  6339. +                    bash
  6340. +                    `("-e" ,build)
  6341. +                    #:inputs
  6342. +                    `((,bash) (,build))
  6343. +                    #:env-vars
  6344. +                    `(("x" unquote (random-text)))))
  6345. +            (drv2 (derivation
  6346. +                    store
  6347. +                    "the-thing"
  6348. +                    bash
  6349. +                    `("-e" ,build)
  6350. +                    #:inputs
  6351. +                    `((,bash) (,build))
  6352. +                    #:env-vars
  6353. +                    `(("x" unquote (random-text))))))
  6354. +       (and (build-derivations store (list drv1))
  6355. +            (begin
  6356. +              (set-build-options store #:build-cores 42)
  6357. +              (build-derivations store (list drv2)))
  6358. + substitute: warning: authentication and authorization of substitutes disabled!
  6359. substitute: guix substitute: warning: ACL for archive imports seems to be uninitialized, substitutes may be unavailable
  6360. building path(s) `/tmp/guix-tests/store/w4sgq113m6c79qnljh5wgvyfzav3yg26-the-thing'
  6361. @ build-started /tmp/guix-tests/store/pavid64p9rfh9gm5l2pqgkclssggx5kg-the-thing.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/pa//vid64p9rfh9gm5l2pqgkclssggx5kg-the-thing.drv.bz2
  6362. @ build-succeeded /tmp/guix-tests/store/pavid64p9rfh9gm5l2pqgkclssggx5kg-the-thing.drv -
  6363.            (list (call-with-input-file
  6364. +                    (derivation->output-path drv1)
  6365. +                    read)
  6366. +                  (call-with-input-file
  6367. +                    (derivation->output-path drv2)
  6368. +                    read))))))
  6369. expected-value: (0 42)
  6370. actual-value: (0 42)
  6371. result: PASS
  6372.  
  6373.  
  6374. SKIP: tests/union
  6375. =================
  6376.  
  6377. random seed for tests: 1495496499
  6378. @ build-started /tmp/guix-tests/store/w5hzafbhxyj68wdlzydkf3gd2rj9xhbs-module-import.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/w5//hzafbhxyj68wdlzydkf3gd2rj9xhbs-module-import.drv.bz2
  6379. @ build-succeeded /tmp/guix-tests/store/w5hzafbhxyj68wdlzydkf3gd2rj9xhbs-module-import.drv -
  6380. @ build-started /tmp/guix-tests/store/bk6y6c5s831m315cn5n8p0r4wvjh5w0c-one.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/bk//6y6c5s831m315cn5n8p0r4wvjh5w0c-one.drv.bz2
  6381. @ build-succeeded /tmp/guix-tests/store/bk6y6c5s831m315cn5n8p0r4wvjh5w0c-one.drv -
  6382. @ build-started /tmp/guix-tests/store/628gfbr4qvj6sp47kb5q54dawrmia3nd-module-import-compiled.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/62//8gfbr4qvj6sp47kb5q54dawrmia3nd-module-import-compiled.drv.bz2
  6383. @ build-succeeded /tmp/guix-tests/store/628gfbr4qvj6sp47kb5q54dawrmia3nd-module-import-compiled.drv -
  6384. @ build-started /tmp/guix-tests/store/65n0cpnsjxrd997061hc1ypyq0k18anq-two.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/65//n0cpnsjxrd997061hc1ypyq0k18anq-two.drv.bz2
  6385. @ build-succeeded /tmp/guix-tests/store/65n0cpnsjxrd997061hc1ypyq0k18anq-two.drv -
  6386. @ build-started /tmp/guix-tests/store/jl6cqbn3pmfskmj6p831c2pvk4d14dvm-union-collision-symlink.drv - x86_64-linux /tmp/guix-tests/var/log/guix/drvs/jl//6cqbn3pmfskmj6p831c2pvk4d14dvm-union-collision-symlink.drv.bz2
  6387. `/tmp/guix-tests/store/frj54nbxjn5nxa4nv5n8mgz6k70ar75k-two/bar' ~> `/tmp/guix-tests/store/5nnaqsyjniaxw2pfjdq5j55mqcyi8lnp-union-collision-symlink/bar'
  6388. `/tmp/guix-tests/store/frj54nbxjn5nxa4nv5n8mgz6k70ar75k-two/foo/two' ~> `/tmp/guix-tests/store/5nnaqsyjniaxw2pfjdq5j55mqcyi8lnp-union-collision-symlink/foo/two'
  6389. `/tmp/guix-tests/store/b2jqczfis8zv2x8y1v1wjhrzzw90ibk0-one/foo/one' ~> `/tmp/guix-tests/store/5nnaqsyjniaxw2pfjdq5j55mqcyi8lnp-union-collision-symlink/foo/one'
  6390. @ build-succeeded /tmp/guix-tests/store/jl6cqbn3pmfskmj6p831c2pvk4d14dvm-union-collision-symlink.drv -
  6391. test-name: union-build with symlink to directory
  6392. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/union.scm:42
  6393. source:
  6394. + (test-assert
  6395. +   "union-build with symlink to directory"
  6396. +   (let* ((one (build-expression->derivation
  6397. +                 %store
  6398. +                 "one"
  6399. +                 '(begin
  6400. +                    (use-modules (guix build utils) (srfi srfi-26))
  6401. +                    (let ((foo (string-append %output "/foo")))
  6402. +                      (mkdir-p foo)
  6403. +                      (call-with-output-file
  6404. +                        (string-append foo "/one")
  6405. +                        (cut display "one" <>))))
  6406. +                 #:modules
  6407. +                 '((guix build utils))))
  6408. +          (two (build-expression->derivation
  6409. +                 %store
  6410. +                 "two"
  6411. +                 '(begin
  6412. +                    (use-modules (guix build utils) (srfi srfi-26))
  6413. +                    (let ((foo (string-append %output "/foo"))
  6414. +                          (bar (string-append %output "/bar")))
  6415. +                      (mkdir-p bar)
  6416. +                      (call-with-output-file
  6417. +                        (string-append bar "/two")
  6418. +                        (cut display "two" <>))
  6419. +                      (symlink "bar" foo)))
  6420. +                 #:modules
  6421. +                 '((guix build utils))))
  6422. +          (builder
  6423. +            '(begin
  6424. +               (use-modules (guix build union))
  6425. +               (union-build
  6426. +                 (assoc-ref %outputs "out")
  6427. +                 (list (assoc-ref %build-inputs "one")
  6428. +                       (assoc-ref %build-inputs "two")))))
  6429. +          (drv (build-expression->derivation
  6430. +                 %store
  6431. +                 "union-collision-symlink"
  6432. +                 builder
  6433. +                 #:inputs
  6434. +                 `(("one" ,one) ("two" ,two))
  6435. +                 #:modules
  6436. +                 '((guix build union)))))
  6437. +     (and (build-derivations %store (list drv))
  6438. +          (with-directory-excursion
  6439. +            (pk (derivation->output-path drv))
  6440. +            (and (string=?
  6441. +                   "one"
  6442. +                   (call-with-input-file "foo/one" get-string-all))
  6443. +                 (string=?
  6444. +                   "two"
  6445. +                   (call-with-input-file "foo/two" get-string-all))
  6446. +                 (string=?
  6447. +                   "two"
  6448. +                   (call-with-input-file "bar/two" get-string-all))
  6449. +                 (not (file-exists? "bar/one")))))))
  6450.  
  6451. ;;; ("/tmp/guix-tests/store/5nnaqsyjniaxw2pfjdq5j55mqcyi8lnp-union-collision-symlink")
  6452. actual-value: #t
  6453. result: PASS
  6454.  
  6455. test-name: union-build
  6456. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/union.scm:91
  6457. source:
  6458. + (test-assert
  6459. +   "union-build"
  6460. +   (let* ((inputs
  6461. +            (map (match-lambda
  6462. +                   ((name package)
  6463. +                    `(,name ,(package-derivation %store package))))
  6464. +                 (append
  6465. +                   %bootstrap-inputs
  6466. +                   (take %bootstrap-inputs 3))))
  6467. +          (builder
  6468. +            `(begin
  6469. +               (use-modules (guix build union))
  6470. +               (union-build
  6471. +                 (assoc-ref %outputs "out")
  6472. +                 (map cdr %build-inputs))))
  6473. +          (drv (build-expression->derivation
  6474. +                 %store
  6475. +                 "union-test"
  6476. +                 builder
  6477. +                 #:inputs
  6478. +                 inputs
  6479. +                 #:modules
  6480. +                 '((guix build union)))))
  6481. +     (and (build-derivations %store (list (pk 'drv drv)))
  6482. +          (with-directory-excursion
  6483. +            (derivation->output-path drv)
  6484. +            (and (file-exists? "bin/touch")
  6485. +                 (file-exists? "bin/gcc")
  6486. +                 (file-exists? "bin/ld")
  6487. +                 (file-exists? "lib/libc.so")
  6488. +                 (directory-exists? "lib/gcc")
  6489. +                 (file-exists? "include/unistd.h")
  6490. +                 (eq? 'symlink (stat:type (lstat "include/c++")))
  6491. +                 (eq? 'directory (stat:type (lstat "bin""union-build #:create-all-directories? #t"
  6492. +   (let* ((build `(begin
  6493. +                    (use-modules (guix build union))
  6494. +                    (union-build
  6495. +                      (assoc-ref %outputs "out")
  6496. +                      (map cdr %build-inputs)
  6497. +                      #:create-all-directories?
  6498. +                      #t)))
  6499. +          (input (package-derivation %store %bootstrap-guile))
  6500. +          (drv (build-expression->derivation
  6501. +                 %store
  6502. +                 "union-test-all-dirs"
  6503. +                 build
  6504. +                 #:modules
  6505. +                 '((guix build union))
  6506. +                 #:inputs
  6507. +                 `(("g" ,input)))))
  6508. +     (and (build-derivations %store (list drv))
  6509. +          (with-directory-excursion
  6510. +            (derivation->output-path drv)
  6511. +            (and (file-exists? "bin/guile")
  6512. +                 (file-is-directory? "bin")
  6513. +                 (eq? 'symlink (stat:type (lstat "bin/guile"))))))))
  6514. actual-value: #t
  6515. result: PASS
  6516.  
  6517.  
  6518. SKIP: tests/syscalls
  6519. ====================
  6520.  
  6521. test-name: mount, ENOENT
  6522. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/syscalls.scm:38
  6523. source:
  6524. + (test-equal
  6525. +   "mount, ENOENT"
  6526. +   ENOENT
  6527. +   (catch 'system-error
  6528. +          (lambda ()
  6529. +            (mount "/dev/null" "/does-not-exist" "ext2")
  6530. +            #f)
  6531. +          (compose system-error-errno list)))
  6532. expected-value: 2
  6533. actual-value: 2
  6534. result: PASS
  6535.  
  6536. test-name: umount, ENOENT/EPERM
  6537. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/syscalls.scm:46
  6538. source:
  6539. + (test-assert
  6540. +   "umount, ENOENT/EPERM"
  6541. +   (catch 'system-error
  6542. +          (lambda () (umount "/does-not-exist") #f)
  6543. +          (lambda args
  6544. +            (memv (system-error-errno args)
  6545. +                  (list EPERM ENOENT)))))
  6546. actual-value: (1 2)
  6547. result: PASS
  6548.  
  6549. test-name: mount-points
  6550. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/syscalls.scm:55
  6551. source:
  6552. + (test-assert
  6553. +   "mount-points"
  6554. +   (any (cute member <> (mount-points))
  6555. +        '("/" "/proc" "/sys" "/dev")))
  6556. actual-value: ("/" "/dev/full" "/dev/kvm" "/dev/null" "/dev/random" "/dev/tty" "/dev/urandom" "/dev/zero" "/gnu/store/02426nwiy32cscm4h83729vn5ws1gs2i-bash-static-4.4.12" "/gnu/store/02a60j2x8i4wdj67krl4z7fc5i7maqrw-nettle-3.3" "/gnu/store/0fzh44zpdw1h2dwpzgfw2lic05y4k6md-libxt-1.1.5" "/gnu/store/0wps368gx0cn3ynrkbhzq5pxf75rng7y-glib-2.50.3" "/gnu/store/0xm7szwymsv87z7y4bi2lgvx2jhniqms-file-5.28" "/gnu/store/16i6p8liwzl2wk10akcqw84l9mqhdyfg-automake-1.15" "/gnu/store/1h0p1lgl5i1dmwa0rzxflv664zwwm6am-glibc-utf8-locales-2.25" "/gnu/store/2rba93k7hlaqgwimwnsi0a4h4f04afag-libxmu-1.1.2" "/gnu/store/2sf5dkanvf3r0mg20yysxig5fgg8yq8d-libxrender-0.9.10" "/gnu/store/2xm70k2vppjw5m4aqnh9ii3hiz667dg2-pkg-config-0.29.1" "/gnu/store/38j1nrzd039sd65zfpbd0i3j9lxvnwpx-fontconfig-2.12.1" "/gnu/store/3lsfrwlp1qa345x71yw5w49i2mpp0vxm-guile-2.0.14" "/gnu/store/4iw4r2majarqlm19adaikqw126jxqf2p-gcc-5.4.0" "/gnu/store/4m58wpsp8xx4b3v5rwnq6ww93dp16z0l-module-import" "/gnu/store/540scmzhxx3avrr760ma7pyzp26k5gbs-libxpm-3.5.12" "/gnu/store/55r4yg5iw9zh2j3zvzc6272k5xn4yxg4-gawk-4.1.4" "/gnu/store/5bh7p754d09wcp64ckxlvwz7lgyk0h59-linux-libre-headers-4.4.47" "/gnu/store/5zx29y44nrqj0s8h3jlvlj82k8hj4dxs-guile-2.2.2" "/gnu/store/6908gy3pws0ccys49ni98idwnicchlr2-coreutils-8.26" "/gnu/store/6rp4sjvp7lxkjh6mya4gg5g37i4qlrk4-gd-2.2.4" "/gnu/store/6z06w9zfnq3zcr50vcv2wvzr5wpzvy7l-util-linux-2.29.2" "/gnu/store/85ss68qvpfb62chf2wapp3b8gfqv5xc6-libffi-3.2.1" "/gnu/store/87sj03j9kwzhl9zr76gs2i8ill86ki95-grep-3.0" "/gnu/store/899421wkg4iff0vvid7c9zvrdnyqd69v-acl-2.2.52" "/gnu/store/8cahzancb8dyh5ciwzclq41m1cvw78cj-ed-1.14.1" "/gnu/store/8nkj1w5whm5gwrhsmqvm1w6im27vz02g-bzip2-1.0.6" "/gnu/store/8wmanahsh0mk1n5xw6i7wpwih95yqzaq-gzip-1.8" "/gnu/store/92nphddbww5b9z4sqdzis5z53lhqf0bd-gts-0.7.6" "/gnu/store/9ahz2yfi9ydchfksdgl96y785kn9453w-zlib-1.2.11" "/gnu/store/9f66pvz4vf1d9k8iir6asdp3l8k58cnn-libatomic-ops-7.4.4" "/gnu/store/9kpc0l7888av969242bswsd0h6vpw8q7-libcap-2.25" "/gnu/store/a3qkf2l3jqnpqibcg2iwbkak4d6scx28-libbsd-0.8.3" "/gnu/store/a42pfdz8w5qxdkp6xz8783ydywmp0p8p-module-import" "/gnu/store/aamm99b0iq42qcxqy6mxi50h93a84af3-m4-1.4.18" "/gnu/store/alg6ani0nnwrxyz15d1j5d0k6qs2m5sk-make-4.2.1" "/gnu/store/ax413995ajhcrk5g48r6w3bwkb3pb1lr-gettext-minimal-0.19.8.1" "/gnu/store/b7w6bjp602qvhbsjs535dfax8v7wy8s8-gmp-6.1.2" "/gnu/store/b837wr8ffw2ppbx1744a2xll70bh8h4c-freetype-2.7.1" "/gnu/store/bji78ysmny9kwy7566g3xzyqbjhvc1fn-libatomic-ops-7.4.4" "/gnu/store/c096s3rxsilbp36y7wnsr29w2hvr3s9x-autoconf-2.69" "/gnu/store/c140q16b1n4x0j2i7wv1awc1c39ipzrr-xz-5.2.2" "/gnu/store/cgnwpa0h824nvffcc3nngks1rv7p80d4-autoconf-wrapper-2.69" "/gnu/store/cz9ci6jdmwfnmk6n697dj98rc4sjs0ql-attr-2.4.47" "/gnu/store/dcc4b6r7npjmhdsah1g6nw1j9wdy635y-sqlite-3.17.0" "/gnu/store/dhc2iy059hi91fk55dcv79z09kp6500y-gcc-5.4.0-lib" "/gnu/store/dj9w9y66ncmn7qpnahz5fhqjjwqrnbjm-ncurses-6.0" "/gnu/store/dr4qfgqmcv8vjfyi5bh6iqxmcnr5psxh-libxau-1.0.8" "/gnu/store/fa6rba5r6m5ad1hy80ngmyc3r391lf9r-guile2.2-gnutls-3.5.9" "/gnu/store/fk20a8bgdd2ld3ik514zpfzj8akwvb30-gmp-6.1.2" "/gnu/store/fpbm0nvl2zi4jksm22kr1mq3hfw79xdn-libxcb-1.12" "/gnu/store/gdgrzf1y15scqwk1yzm51dc40g29vad9-findutils-4.6.0" "/gnu/store/gdx6vk579px16dgv60hgrr1c2k1pwsni-libx11-1.6.5" "/gnu/store/h7mx27bl0wynlz8vjszzykqqldccfwm5-ncurses-6.0" "/gnu/store/hag795ji8p9vqikwp8cibfibpsa39s3n-libgcrypt-1.7.6" "/gnu/store/hgv1xc69vf2cqy21iglppnr2329llxqw-pixman-0.34.0" "/gnu/store/hqim8ih804fbqk7gailh1hlgmkpjzccn-gzip-1.8" "/gnu/store/hqqw3jkqdpy72drq8mnn1kbh4dssw5lc-libxaw-1.0.13" "/gnu/store/hvyk1qyph1hihfmym1w271ygp84adb0v-readline-7.0" "/gnu/store/i0bjwdqvn0wixcwfpw254w0az17iysga-cairo-1.14.8" "/gnu/store/i92s6sqzlps5wasx09wv3lckn2lj3dm7-perl-5.24.0" "/gnu/store/if99vbhh9vk98p61a7l3s9d1vmbmfkk0-expat-2.2.0" "/gnu/store/j4p7cnxb6byf1wra3yz6pk8av4g5mwkl-libgc-7.6.0" "/gnu/store/j92kxc1l8h879cc4ss1gbhsq73ddnbsg-libgpg-error-1.26" "/gnu/store/ja06pq19g0cf2122kimk15z5yn0az73j-libxdmcp-1.1.2" "/gnu/store/jwkcd7siv6fcyl0qsg607bg9c8ap0gqr-zlib-1.2.11" "/gnu/store/k6jkr6p94xlsddgiy8abicm2b36gkdh6-harfbuzz-1.4.3" "/gnu/store/k7029k5va68lkapbzcycdzj7m5bjb4b8-bash-4.4.12" "/gnu/store/k8xbdjbpd83s6i48az9c7l6pkf8za8xj-libidn2-0.16" "/gnu/store/kbs0012il9z63kp0nlq0h66m6zjp4f21-diffutils-3.5" "/gnu/store/kndl3vllk4bdq1xd3p8k67h8jrsq8xbq-readline-7.0" "/gnu/store/l2paa4ka8lglar0b778qzl7a6h2v5dzn-guile-json-0.6.0" "/gnu/store/lcmcm4c0zjv3sa9amdrhaszd7vwwxjh1-libltdl-2.4.6" "/gnu/store/m71kgd1gbx609mqn2m4lm9x1i1pgzz74-help2man-1.47.4" "/gnu/store/mf9aln8affmgaj8vkwv636cgalfqdv8g-libjpeg-9b" "/gnu/store/mfx9ib0cy6mvjfmszplnlh0dvdb0513v-tar-1.29" "/gnu/store/n04pda8i88ry820qwz2f12i99535sy3d-pcre-8.40" "/gnu/store/ng61qpn9qk82nhxarksfnv53ki2j0ld2-module-import-compiled" "/gnu/store/nrrwyb21bn8cdc0k6pis3ggs2vayibin-bash-4.4.12" "/gnu/store/pv2qmb1kjbskzph09yg06vd0wm6iwgbd-graphite2-1.3.9" "/gnu/store/px46g18zg3sjgndwdcsgm6027w7s5gbc-pkg-config-0.29.1" "/gnu/store/q1x4v3x8v2g59d244hl7k0i1n4h83c9a-ncurses-6.0" "/gnu/store/qbngj80kmydl4jsba2cdgwq2y51xlfv0-patch-2.7.5" "/gnu/store/ql5h9hxh5560d42xdirh0yxzrgii6i0m-guile-ssh-0.11.0" "/gnu/store/r1zsyinrpcpfbcym5qrx6zbk6hwzxwnm-pango-1.40.3" "/gnu/store/r4pvx277n8lcfn9xv62sx6ikspwlg3kl-libxext-1.3.3" "/gnu/store/ri56wnmzkgzrajdyl5ydc55lrwy1164k-ld-wrapper-0" "/gnu/store/rmb4nh95s22lnd42sarzj5bswakd3mxx-icu4c-58.2" "/gnu/store/rmjlycdgiq8pfy5hfi42qhw3k7p6kdav-glibc-2.25" "/gnu/store/s3c442d075fc8a0q0nspc9jjsgjq613p-bzip2-1.0.6" "/gnu/store/sjm2c0dymn3mjl7g0jqbjdbibnqh0iaw-readline-7.0" "/gnu/store/v4h4qw8a95479capaq08vs4zdyxdijhv-libunistring-0.9.7" "/gnu/store/vis7x2j2lsmwbl5m5w794c23ysqah8xh-libpng-1.6.28" "/gnu/store/vlc43y485v80sgq7iw60hzy4pw5r52d2-libssh-0.7.4" "/gnu/store/vndw4mh60kap1vwk9mj0rmf4xh9z5ndq-libxft-2.3.2" "/gnu/store/w3ng5infdzn234167kvgc6a01n0j26qc-libltdl-2.4.6" "/gnu/store/w5b3db8y2rq3d73b30m4c5z0ql270r9a-libsm-1.2.2" "/gnu/store/wak3m4kdkgw010qn1ksnqlggvklp4b24-gmp-6.1.2" "/gnu/store/wfy8pwxjbyc9033sqb1snyfla3h8d02p-libice-1.0.9" "/gnu/store/wqx8sxqjvz323vk9xalrhqk5f35yd42f-libffi-3.2.1" "/gnu/store/x8cfigwi2sf7l2aq9csfjaawn1aa4733-graphviz-2.38.0" "/gnu/store/xpldw0hzzn85074zdscjxxp5c64176hv-libtasn1-4.10" "/gnu/store/y7cgyi1syavy17kacn5s2adw20i8mglz-guix-0.13.0-checkout" "/gnu/store/yr7m8ldp3n40mrzjax91cj9hjw1k2a58-libgc-7.6.0" "/gnu/store/z0as6gp6grsqs4a8knbxkcwbyxriqmgc-gs-fonts-8.11" "/gnu/store/z1kihijf9klm5g3rzn4nk034nxhx58mn-libunistring-0.9.7" "/gnu/store/z763jk8lkragpz2qr2wbrz946lgalx2h-sed-4.4" "/gnu/store/zk41gmzbibvpx9dpsm5gs8p0liz8shy0-guile-2.0.14" "/gnu/store/zq65kpvwwxgc3qqbf9apic8gyss2l0zq-binutils-2.27" "/gnu/store/zrk4galrr3cbp4yvkn93hcq6dpkf6k98-texinfo-6.3" "/tmp/guix-build-guix-0.13.0.drv-0" "/proc" "/dev/shm" "/dev/pts")
  6557. result: PASS
  6558.  
  6559. test-name: swapon, ENOENT/EPERM
  6560. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/syscalls.scm:61
  6561. source:
  6562. + (test-assert
  6563. +   "swapon, ENOENT/EPERM"
  6564. +   (catch 'system-error
  6565. +          (lambda () (swapon "/does-not-exist") #f)
  6566. +          (lambda args
  6567. +            (memv (system-error-errno args)
  6568. +                  (list EPERM ENOENT)))))
  6569. actual-value: (1 2)
  6570. result: PASS
  6571.  
  6572. test-name: swapoff, ENOENT/EINVAL/EPERM
  6573. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/syscalls.scm:69
  6574. source:
  6575. + (test-assert
  6576. +   "swapoff, ENOENT/EINVAL/EPERM"
  6577. +   (catch 'system-error
  6578. +          (lambda () (swapoff "/does-not-exist") #f)
  6579. +          (lambda args
  6580. +            (memv (system-error-errno args)
  6581. +                  (list EPERM EINVAL ENOENT)))))
  6582. actual-value: (1 22 2)
  6583. result: PASS
  6584.  
  6585. test-name: mkdtemp!
  6586. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/syscalls.scm:77
  6587. source:
  6588. + (test-assert
  6589. +   "mkdtemp!"
  6590. +   (let* ((tmp (or (getenv "TMPDIR") "/tmp"))
  6591. +          (dir (mkdtemp!
  6592. +                 (string-append tmp "/guix-test-XXXXXX"))))
  6593. +     (and (file-exists? dir) (begin (rmdir dir) #t))))
  6594. actual-value: #t
  6595. result: PASS
  6596.  
  6597. test-name: statfs, ENOENT
  6598. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/syscalls.scm:85
  6599. source:
  6600. + (test-equal
  6601. +   "statfs, ENOENT"
  6602. +   ENOENT
  6603. +   (catch 'system-error
  6604. +          (lambda () (statfs "/does-not-exist"))
  6605. +          (compose system-error-errno list)))
  6606. expected-value: 2
  6607. actual-value: 2
  6608. result: PASS
  6609.  
  6610. test-name: statfs
  6611. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/syscalls.scm:92
  6612. source:
  6613. + (test-assert
  6614. +   "statfs"
  6615. +   (let ((fs (statfs "/")))
  6616. +     (and (file-system? fs)
  6617. +          (> (file-system-block-size fs) 0)
  6618. +          (>= (file-system-blocks-available fs) 0)
  6619. +          (>= (file-system-blocks-free fs)
  6620. +              (file-system-blocks-available fs)))))
  6621. actual-value: #t
  6622. result: PASS
  6623.  
  6624. test-name: clone
  6625. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/syscalls.scm:110
  6626. source:
  6627. + (test-assert
  6628. +   "clone"
  6629. +   (match (clone (logior CLONE_NEWUSER SIGCHLD))
  6630. +          (0 (primitive-exit 42))
  6631. +          (pid (and (not (equal?
  6632. +                           (readlink (user-namespace pid))
  6633. +                           (readlink (user-namespace (getpid)))))
  6634. +                    (match (waitpid pid)
  6635. +                           ((_ . status) (= 42 (status:exit-val status))))))))
  6636. result: SKIP
  6637.  
  6638. test-name: setns
  6639. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/syscalls.scm:124
  6640. source:
  6641. + (test-assert
  6642. +   "setns"
  6643. +   (match (clone (logior CLONE_NEWUSER SIGCHLD))
  6644. +          (0 (primitive-exit 0))
  6645. +          (clone-pid
  6646. +            (match (pipe)
  6647. +                   ((in . out)
  6648. +                    (match (primitive-fork)
  6649. +                           (0
  6650. +                            (close in)
  6651. +                            (call-with-input-file
  6652. +                              (user-namespace clone-pid)
  6653. +                              (lambda (port) (setns (port->fdes port) 0)))
  6654. +                            (write 'done out)
  6655. +                            (close out)
  6656. +                            (primitive-exit 0))
  6657. +                           (fork-pid
  6658. +                             (close out)
  6659. +                             (read in)
  6660. +                             (let ((result
  6661. +                                     (and (equal?
  6662. +                                            (readlink
  6663. +                                              (user-namespace clone-pid))
  6664. +                                            (readlink
  6665. +                                              (user-namespace fork-pid))))))
  6666. +                               (waitpid clone-pid)
  6667. +                               (waitpid fork-pid)
  6668. +                               result))))))))
  6669. result: SKIP
  6670.  
  6671. test-name: pivot-root
  6672. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/syscalls.scm:157
  6673. source:
  6674. + (test-equal
  6675. +   "pivot-root"
  6676. +   #t
  6677. +   (match (pipe)
  6678. +          ((in . out)
  6679. +           (match (clone (logior CLONE_NEWUSER CLONE_NEWNS SIGCHLD))
  6680. +                  (0
  6681. +                   (dynamic-wind
  6682. +                     (const #t)
  6683. +                     (lambda ()
  6684. +                       (close in)
  6685. +                       (call-with-temporary-directory
  6686. +                         (lambda (root)
  6687. +                           (let ((put-old (string-append root "/real-root")))
  6688. +                             (mount "none" root "tmpfs")
  6689. +                             (mkdir put-old)
  6690. +                             (call-with-output-file
  6691. +                               (string-append root "/test")
  6692. +                               (lambda (port) (display "testing\n" port)))
  6693. +                             (pivot-root root put-old)
  6694. +                             (write (file-exists? "/test") out)
  6695. +                             (close out)))))
  6696. +                     (lambda () (primitive-exit 0))))
  6697. +                  (pid (close out)
  6698. +                       (let ((result (read in)))
  6699. +                         (close in)
  6700. +                         (and (zero? (match (waitpid pid)
  6701. +                                            ((_ . status)
  6702. +                                             (status:exit-val status))))
  6703. +                              (eq? #t result))))))))
  6704. result: SKIP
  6705.  
  6706. test-name: fcntl-flock wait
  6707. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/syscalls.scm:191
  6708. source:
  6709. + (test-equal
  6710. +   "fcntl-flock wait"
  6711. +   42
  6712. +   (let ((file (open-file temp-file "w0b")))
  6713. +     (fcntl-flock file 'write-lock)
  6714. +     (match (primitive-fork)
  6715. +            (0
  6716. +             (dynamic-wind
  6717. +               (const #t)
  6718. +               (lambda ()
  6719. +                 (let ((file (open-file temp-file "r0b")))
  6720. +                   (fcntl-flock file 'read-lock)
  6721. +                   (primitive-exit (read file)))
  6722. +                 (primitive-exit 1))
  6723. +               (lambda () (primitive-exit 2))))
  6724. +            (pid (display "hello, world!" file)
  6725. +                 (force-output file)
  6726. +                 (sleep 1)
  6727. +                 (seek file 0 SEEK_SET)
  6728. +                 (truncate-file file 0)
  6729. +                 (write 42 file)
  6730. +                 (force-output file)
  6731. +                 (fcntl-flock file 'unlock)
  6732. +                 (match (waitpid pid)
  6733. +                        ((_ . status)
  6734. +                         (let ((result (status:exit-val status)))
  6735. +                           (close-port file)
  6736. +                           result)))))))
  6737.       (string-append root "/test")
  6738. +                               (lambda (port) (display "testing\n" port)))
  6739. +                             (pivot-root root put-old)
  6740. +                             (write (file-exists? "/test") out)
  6741. +                             (close out)))))
  6742. +                     (lambda () (primitive-exit 0))))
  6743. +                  (pid (close out)
  6744. +                       (let ((result (read in)))
  6745. +                         (close in)
  6746. +                         (and (zero? (match (waitpid pid)
  6747. +                                            ((_ . status)
  6748. +                                             (status:exit-val status))))
  6749. +                              (eq? #t result))))))))
  6750. result: SKIP
  6751.  
  6752. test-name: fcntl-flock wait
  6753. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/syscalls.scm:191
  6754. source:
  6755. + (test-equal
  6756. +   "fcntl-flock wait"
  6757. +   42
  6758. +   (let ((file (open-file temp-file "w0b")))
  6759. +     (fcntl-flock file 'write-lock)
  6760. +     (match (primitive-fork)
  6761. +            (0
  6762. +             (dynamic-wind
  6763. +               (const #t)
  6764. +               (lambda ()
  6765. +                 (let ((file (open-file temp-file "r0b")))
  6766. +                   (fcntl-flock file 'read-lock)
  6767. +                   (primitive-exit (read file)))
  6768. +                 (primitive-exit 1))
  6769. +               (lambda () (primitive-exit 2))))
  6770. +            (pid (display "hello, world!" file)
  6771. +                 (force-output file)
  6772. +                 (sleep 1)
  6773. +                 (seek file 0 SEEK_SET)
  6774. +                 (truncate-file file 0)
  6775. +                 (write 42 file)
  6776. +                 (force-output file)
  6777. +                 (fcntl-flock file 'unlock)
  6778. +                 (match (waitpid pid)
  6779. +                        ((_ . status)
  6780. +                         (let ((result (status:exit-val status)))
  6781. +                           (close-port file)
  6782. +                           result)))))))
  6783. expected-value: 42
  6784. actual-value: 42
  6785. result: PASS
  6786.  
  6787. test-name: fcntl-flock non-blocking
  6788. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/syscalls.scm:230
  6789. source:
  6790. + (test-equal
  6791. +   "fcntl-flock non-blocking"
  6792. +   EAGAIN
  6793. +   (match (pipe)
  6794. +          ((input . output)
  6795. +           (match (primitive-fork)
  6796. +                  (0
  6797. +                   (dynamic-wind
  6798. +                     (const #t)
  6799. +                     (lambda ()
  6800. +                       (close-port output)
  6801. +                       (read-char input)
  6802. +                       (let ((file (open-file temp-file "w0")))
  6803. +                         (catch 'flock-error
  6804. +                                (lambda ()
  6805. +                                  (fcntl-flock file 'write-lock #:wait? #f))
  6806. +                                (lambda (key errno)
  6807. +                                  (primitive-exit (pk 'errno errno)))))
  6808. +                       (primitive-exit -1))
  6809. +                     (lambda () (primitive-exit -2))))
  6810. +                  (pid (close-port input)
  6811. +                       (let ((file (open-file temp-file "w0")))
  6812. +                         (fcntl-flock file 'write-lock)
  6813. +                         (write 'green-light output)
  6814. +                         (force-output output)
  6815. +                         (match (waitpid pid)
  6816. +                                ((_ . status)
  6817. +                                 (let ((result (status:exit-val status)))
  6818. +                                   (fcntl-flock file 'unlock)
  6819. +                                   (close-port file)
  6820. +                                   result)))))))))
  6821.  
  6822. ;;; (errno 11)
  6823.       (string-append root "/test")
  6824. +                               (lambda (port) (display "testing\n" port)))
  6825. +                             (pivot-root root put-old)
  6826. +                             (write (file-exists? "/test") out)
  6827. +                             (close out)))))
  6828. +                     (lambda () (primitive-exit 0))))
  6829. +                  (pid (close out)
  6830. +                       (let ((result (read in)))
  6831. +                         (close in)
  6832. +                         (and (zero? (match (waitpid pid)
  6833. +                                            ((_ . status)
  6834. +                                             (status:exit-val status))))
  6835. +                              (eq? #t result))))))))
  6836. result: SKIP
  6837.  
  6838. test-name: fcntl-flock wait
  6839. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/syscalls.scm:191
  6840. source:
  6841. + (test-equal
  6842. +   "fcntl-flock wait"
  6843. +   42
  6844. +   (let ((file (open-file temp-file "w0b")))
  6845. +     (fcntl-flock file 'write-lock)
  6846. +     (match (primitive-fork)
  6847. +            (0
  6848. +             (dynamic-wind
  6849. +               (const #t)
  6850. +               (lambda ()
  6851. +                 (let ((file (open-file temp-file "r0b")))
  6852. +                   (fcntl-flock file 'read-lock)
  6853. +                   (primitive-exit (read file)))
  6854. +                 (primitive-exit 1))
  6855. +               (lambda () (primitive-exit 2))))
  6856. +            (pid (display "hello, world!" file)
  6857. +                 (force-output file)
  6858. +                 (sleep 1)
  6859. +                 (seek file 0 SEEK_SET)
  6860. +                 (truncate-file file 0)
  6861. +                 (write 42 file)
  6862. +                 (force-output file)
  6863. +                 (fcntl-flock file 'unlock)
  6864. +                 (match (waitpid pid)
  6865. +                        ((_ . status)
  6866. +                         (let ((result (status:exit-val status)))
  6867. +                           (close-port file)
  6868. +                           result)))))))
  6869. expected-value: 42
  6870. actual-value: 42
  6871. result: PASS
  6872.  
  6873. test-name: fcntl-flock non-blocking
  6874. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/syscalls.scm:230
  6875. source:
  6876. + (test-equal
  6877. +   "fcntl-flock non-blocking"
  6878. +   EAGAIN
  6879. +   (match (pipe)
  6880. +          ((input . output)
  6881. +           (match (primitive-fork)
  6882. +                  (0
  6883. +                   (dynamic-wind
  6884. +                     (const #t)
  6885. +                     (lambda ()
  6886. +                       (close-port output)
  6887. +                       (read-char input)
  6888. +                       (let ((file (open-file temp-file "w0")))
  6889. +                         (catch 'flock-error
  6890. +                                (lambda ()
  6891. +                                  (fcntl-flock file 'write-lock #:wait? #f))
  6892. +                                (lambda (key errno)
  6893. +                                  (primitive-exit (pk 'errno errno)))))
  6894. +                       (primitive-exit -1))
  6895. +                     (lambda () (primitive-exit -2))))
  6896. +                  (pid (close-port input)
  6897. +                       (let ((file (open-file temp-file "w0")))
  6898. +                         (fcntl-flock file 'write-lock)
  6899. +                         (write 'green-light output)
  6900. +                         (force-output output)
  6901. +                         (match (waitpid pid)
  6902. +                                ((_ . status)
  6903. +                                 (let ((result (status:exit-val status)))
  6904. +                                   (fcntl-flock file 'unlock)
  6905. +                                   (close-port file)
  6906. +                                   result)))))))))
  6907. expected-value: 11
  6908. actual-value: 11
  6909. result: PASS
  6910.  
  6911. test-name: all-network-interface-names
  6912. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/syscalls.scm:272
  6913. source:
  6914. + (test-assert
  6915. +   "all-network-interface-names"
  6916. +   (match (all-network-interface-names)
  6917. +          (((? string? names) ..1) (member "lo" names))))
  6918. actual-value: ("lo")
  6919. result: PASS
  6920.  
  6921. test-name: network-interface-names
  6922. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/syscalls.scm:277
  6923. source:
  6924. + (test-assert
  6925. +   "network-interface-names"
  6926. +   (match (network-interface-names)
  6927. +          (((? string? names) ..1)
  6928. +           (lset<=
  6929. +             string=?
  6930. +             names
  6931. +             (all-network-interface-names)))))
  6932. actual-value: #t
  6933. result: PASS
  6934.  
  6935. test-name: network-interface-flags
  6936. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/syscalls.scm:282
  6937. source:
  6938. + (test-assert
  6939. +   "network-interface-flags"
  6940. +   (let* ((sock (socket AF_INET SOCK_STREAM 0))
  6941. +          (flags (network-interface-flags sock "lo")))
  6942. +     (close-port sock)
  6943. +     (and (not (zero? (logand flags IFF_LOOPBACK)))
  6944. +          (not (zero? (logand flags IFF_UP))))))
  6945. actual-value: #t
  6946. result: PASS
  6947.  
  6948. test-name: loopback-network-interface?
  6949. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/syscalls.scm:289
  6950. source:
  6951. + (test-equal
  6952. +   "loopback-network-interface?"
  6953. +   ENODEV
  6954. +   (and (loopback-network-interface? "lo")
  6955. +        (catch 'system-error
  6956. +               (lambda ()
  6957. +                 (loopback-network-interface? "nonexistent")
  6958. +                 #f)
  6959. +               (lambda args (system-error-errno args)))))
  6960. expected-value: 19
  6961. actual-value: 19
  6962. result: PASS
  6963.  
  6964. test-name: set-network-interface-flags
  6965. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/syscalls.scm:300
  6966. source:
  6967. + (test-assert
  6968. +   "set-network-interface-flags"
  6969. +   (let ((sock (socket AF_INET SOCK_STREAM 0)))
  6970. +     (catch 'system-error
  6971. +            (lambda ()
  6972. +              (set-network-interface-flags sock "lo" IFF_UP))
  6973. +            (lambda args
  6974. +              (close-port sock)
  6975. +              (memv (system-error-errno args)
  6976. +                    (list EPERM EACCES))))))
  6977. actual-value: (1 13)
  6978. result: PASS
  6979.  
  6980. test-name: network-interface-address lo
  6981. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/syscalls.scm:310
  6982. source:
  6983. + (test-equal
  6984. +   "network-interface-address lo"
  6985. +   (make-socket-address
  6986. +     AF_INET
  6987. +     (inet-pton AF_INET "127.0.0.1")
  6988. +     0)
  6989. +   (let* ((sock (socket AF_INET SOCK_STREAM 0))
  6990. +          (addr (network-interface-address sock "lo")))
  6991. +     (close-port sock)
  6992. +     addr))
  6993. expected-value: #(2 2130706433 0)
  6994. actual-value: #(2 2130706433 0)
  6995. result: PASS
  6996.  
  6997. test-name: set-network-interface-address
  6998. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/syscalls.scm:318
  6999. source:
  7000. + (test-assert
  7001. +   "set-network-interface-address"
  7002. +   (let ((sock (socket AF_INET SOCK_STREAM 0)))
  7003. +     (catch 'system-error
  7004. +            (lambda ()
  7005. +              (set-network-interface-address
  7006. +                sock
  7007. +                "nonexistent"
  7008. +                (make-socket-address
  7009. +                  AF_INET
  7010. +                  (inet-pton AF_INET "127.12.14.15")
  7011. +                  0)))
  7012. +            (lambda args
  7013. +              (close-port sock)
  7014. +              (memv (system-error-errno args)
  7015. +                    (list EPERM EACCES))))))
  7016. actual-value: (1 13)
  7017. result: PASS
  7018.  
  7019. test-name: network-interface-netmask lo
  7020. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/syscalls.scm:332
  7021. source:
  7022. + (test-equal
  7023. +   "network-interface-netmask lo"
  7024. +   (make-socket-address
  7025. +     AF_INET
  7026. +     (inet-pton AF_INET "255.0.0.0")
  7027. +     0)
  7028. +   (let* ((sock (socket AF_INET SOCK_STREAM 0))
  7029. +          (addr (network-interface-netmask sock "lo")))
  7030. +     (close-port sock)
  7031. +     addr))
  7032. expected-value: #(2 4278190080 0)
  7033. actual-value: #(2 4278190080 0)
  7034. result: PASS
  7035.  
  7036. test-name: set-network-interface-netmask
  7037. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/syscalls.scm:340
  7038. source:
  7039. + (test-assert
  7040. +   "set-network-interface-netmask"
  7041. +   (let ((sock (socket AF_INET SOCK_STREAM 0)))
  7042. +     (catch 'system-error
  7043. +            (lambda ()
  7044. +              (set-network-interface-netmask
  7045. +                sock
  7046. +                "nonexistent"
  7047. +                (make-socket-address
  7048. +                  AF_INET
  7049. +                  (inet-pton AF_INET "255.0.0.0")
  7050. +                  0)))
  7051. +            (lambda args
  7052. +              (close-port sock)
  7053. +              (memv (system-error-errno args)
  7054. +                    (list EPERM EACCES))))))
  7055. actual-value: (1 13)
  7056. result: PASS
  7057.  
  7058. test-name: network-interfaces returns one or more interfaces
  7059. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/syscalls.scm:353
  7060. source:
  7061. + (test-equal
  7062. +   "network-interfaces returns one or more interfaces"
  7063. +   '(#t #t #t)
  7064. +   (match (network-interfaces)
  7065. +          ((interfaces ..1)
  7066. +           (list (every interface? interfaces)
  7067. +                 (every string? (map interface-name interfaces))
  7068. +                 (every (lambda (sockaddr)
  7069. +                          (or (vector? sockaddr) (not sockaddr)))
  7070. +                        (map interface-address interfaces))))))
  7071. expected-value: (#t #t #t)
  7072. actual-value: (#t #t #t)
  7073. result: PASS
  7074.  
  7075. test-name: network-interfaces returns "lo"
  7076. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/syscalls.scm:365
  7077. source:
  7078. + (test-equal
  7079. +   "network-interfaces returns \"lo\""
  7080. +   (list #t
  7081. +         (make-socket-address
  7082. +           AF_INET
  7083. +           (inet-pton AF_INET "127.0.0.1")
  7084. +           0))
  7085. +   (match (filter
  7086. +            (lambda (interface)
  7087. +              (string=? "lo" (interface-name interface)))
  7088. +            (network-interfaces))
  7089. +          ((loopbacks ..1)
  7090. +           (list (every (lambda (lo)
  7091. +                          (not (zero? (logand
  7092. +                                        IFF_LOOPBACK
  7093. +                                        (interface-flags lo)))))
  7094. +                        loopbacks)
  7095. +                 (match (find (lambda (lo)
  7096. +                                (= AF_INET
  7097. +                                   (sockaddr:fam (interface-address lo))))
  7098. +                              loopbacks)
  7099. +                        (#f #f)
  7100. +                        (lo (interface-address lo)))))))
  7101. expected-value: (#t #(2 2130706433 0))
  7102. actual-value: (#t #(2 2130706433 0))
  7103. result: PASS
  7104.  
  7105. test-name: add-network-route/gateway
  7106. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/syscalls.scm:381
  7107. source:
  7108. + (test-assert
  7109. +   "add-network-route/gateway"
  7110. +   (let ((sock (socket AF_INET SOCK_STREAM 0))
  7111. +         (gateway
  7112. +           (make-socket-address
  7113. +             AF_INET
  7114. +             (inet-pton AF_INET "192.168.0.1")
  7115. +             0)))
  7116. +     (catch 'system-error
  7117. +            (lambda ()
  7118. +              (add-network-route/gateway sock gateway))
  7119. +            (lambda args
  7120. +              (close-port sock)
  7121. +              (memv (system-error-errno args)
  7122. +                    (list EPERM EACCES))))))
  7123. actual-value: (1 13)
  7124. result: PASS
  7125.  
  7126. test-name: delete-network-route
  7127. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/syscalls.scm:394
  7128. source:
  7129. + (test-assert
  7130. +   "delete-network-route"
  7131. +   (let ((sock (socket AF_INET SOCK_STREAM 0))
  7132. +         (destination
  7133. +           (make-socket-address AF_INET INADDR_ANY 0)))
  7134. +     (catch 'system-error
  7135. +            (lambda ()
  7136. +              (delete-network-route sock destination))
  7137. +            (lambda args
  7138. +              (close-port sock)
  7139. +              (memv (system-error-errno args)
  7140. +                    (list EPERM EACCES))))))
  7141. actual-value: (1 13)
  7142. result: PASS
  7143.  
  7144. test-name: tcgetattr ENOTTY
  7145. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/syscalls.scm:404
  7146. source:
  7147. + (test-equal
  7148. +   "tcgetattr ENOTTY"
  7149. +   ENOTTY
  7150. +   (catch 'system-error
  7151. +          (lambda ()
  7152. +            (call-with-input-file
  7153. +              "/dev/null"
  7154. +              (lambda (port) (tcgetattr (fileno port)))))
  7155. +          (compose system-error-errno list)))
  7156. expected-value: 25
  7157. actual-value: 25
  7158. result: PASS
  7159.  
  7160. test-name: tcgetattr
  7161. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/syscalls.scm:418
  7162. source:
  7163. + (test-assert
  7164. +   "tcgetattr"
  7165. +   (let ((termios (tcgetattr 0)))
  7166. +     (and (termios? termios)
  7167. +          (> (termios-input-speed termios) 0)
  7168. +          (> (termios-output-speed termios) 0))))
  7169. result: SKIP
  7170.  
  7171. test-name: tcsetattr
  7172. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/syscalls.scm:424
  7173. source:
  7174. + (test-assert
  7175. +   "tcsetattr"
  7176. +   (let ((first (tcgetattr 0)))
  7177. +     (tcsetattr 0 (tcsetattr-action TCSANOW) first)
  7178. +     (equal? first (tcgetattr 0))))
  7179. result: SKIP
  7180.  
  7181. test-name: terminal-window-size ENOTTY
  7182. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/syscalls.scm:429
  7183. source:
  7184. + (test-assert
  7185. +   "terminal-window-size ENOTTY"
  7186. +   (call-with-input-file
  7187. +     "/dev/null"
  7188. +     (lambda (port)
  7189. +       (catch 'system-error
  7190. +              (lambda () (terminal-window-size port))
  7191. +              (lambda args
  7192. +                (memv (system-error-errno args)
  7193. +                      (list ENOTTY EINVAL)))))))
  7194. actual-value: (25 22)
  7195. result: PASS
  7196.  
  7197. test-name: terminal-columns
  7198. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/syscalls.scm:440
  7199. source:
  7200. + (test-assert
  7201. +   "terminal-columns"
  7202. +   (> (terminal-columns) 0))
  7203. actual-value: #t
  7204. result: PASS
  7205.  
  7206. test-name: terminal-columns non-file port
  7207. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/syscalls.scm:443
  7208. source:
  7209. + (test-assert
  7210. +   "terminal-columns non-file port"
  7211. +   (> (terminal-columns
  7212. +        (open-input-string
  7213. +          "Join us now, share the software!"))
  7214. +      0))
  7215. actual-value: #t
  7216. result: PASS
  7217.  
  7218. test-name: utmpx-entries
  7219. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/syscalls.scm:447
  7220. source:
  7221. + (test-assert
  7222. +   "utmpx-entries"
  7223. +   (match (utmpx-entries)
  7224. +          (((? utmpx? entries) ...)
  7225. +           (every (lambda (entry)
  7226. +                    (match (utmpx-user entry)
  7227. +                           ((? string?)
  7228. +                            (or (eqv? (login-type BOOT_TIME)
  7229. +                                      (utmpx-login-type entry))
  7230. +                                (> (utmpx-pid entry) 0)))
  7231. +                           (#f #t)))
  7232. +                  entries))))
  7233. actual-value: #t
  7234. result: PASS
  7235.  
  7236. test-name: read-utmpx, EOF
  7237. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/syscalls.scm:459
  7238. source:
  7239. + (test-assert
  7240. +   "read-utmpx, EOF"
  7241. +   (eof-object? (read-utmpx (%make-void-port "r"))))
  7242. actual-value: #t
  7243. result: PASS
  7244.  
  7245. test-name: read-utmpx
  7246. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/syscalls.scm:464
  7247. source:
  7248. + (test-assert
  7249. +   "read-utmpx"
  7250. +   (let ((result
  7251. +           (call-with-input-file
  7252. +             "/var/run/utmpx"
  7253. +             read-utmpx)))
  7254. +     (or (utmpx? result) (eof-object? result))))
  7255. result: SKIP
  7256.  
  7257.  
  7258. SKIP: tests/gremlin
  7259. ===================
  7260.  
  7261. test-name: elf-dynamic-info-needed, executable
  7262. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/gremlin.scm:44
  7263. source:
  7264. + (test-assert
  7265. +   "elf-dynamic-info-needed, executable"
  7266. +   (let* ((elf (call-with-input-file %guile-executable read-elf))
  7267. +          (dyninfo (elf-dynamic-info elf)))
  7268. +     (or (not dyninfo)
  7269. +         (lset<=
  7270. +           string=?
  7271. +           (list (string-append "libguile-" (effective-version))
  7272. +                 "libgc"
  7273. +                 "libunistring"
  7274. +                 "libffi")
  7275. +           (map (lambda (lib)
  7276. +                  (string-take lib (string-contains lib ".so")))
  7277. +                (elf-dynamic-info-needed dyninfo))))))
  7278. result: SKIP
  7279.  
  7280. test-name: expand-origin
  7281. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/gremlin.scm:55
  7282. source:
  7283. + (test-equal
  7284. +   "expand-origin"
  7285. +   '("OOO/../lib"
  7286. +     "OOO"
  7287. +     "../OOO/bar/OOO/baz"
  7288. +     "ORIGIN/foo")
  7289. +   (map (cut expand-origin <> "OOO")
  7290. +        '("$ORIGIN/../lib"
  7291. +          "${ORIGIN}"
  7292. +          "../${ORIGIN}/bar/$ORIGIN/baz"
  7293. +          "ORIGIN/foo")))
  7294. expected-value: ("OOO/../lib" "OOO" "../OOO/bar/OOO/baz" "ORIGIN/foo")
  7295. actual-value: ("OOO/../lib" "OOO" "../OOO/bar/OOO/baz" "ORIGIN/foo")
  7296. result: PASS
  7297.  
  7298.  
  7299. SKIP: tests/containers
  7300. ======================
  7301.  
  7302. test-name: call-with-container, exit with 0 when there is no error
  7303. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/containers.scm:42
  7304. source:
  7305. + (test-assert
  7306. +   "call-with-container, exit with 0 when there is no error"
  7307. +   (zero? (call-with-container
  7308. +            '()
  7309. +            (const #t)
  7310. +            #:namespaces
  7311. +            '(user))))
  7312. result: SKIP
  7313.  
  7314. test-name: call-with-container, user namespace
  7315. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/containers.scm:48
  7316. source:
  7317. + (test-assert
  7318. +   "call-with-container, user namespace"
  7319. +   (zero? (call-with-container
  7320. +            '()
  7321. +            (lambda ()
  7322. +              (assert-exit
  7323. +                (and (zero? (getuid)) (zero? (getgid)))))
  7324. +            #:namespaces
  7325. +            '(user))))
  7326. result: SKIP
  7327.  
  7328. test-name: call-with-container, uts namespace
  7329. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/containers.scm:58
  7330. source:
  7331. + (test-assert
  7332. +   "call-with-container, uts namespace"
  7333. +   (zero? (call-with-container
  7334. +            '()
  7335. +            (lambda ()
  7336. +              (sethostname "test-container")
  7337. +              (primitive-exit 0))
  7338. +            #:namespaces
  7339. +            '(user uts))))
  7340. result: SKIP
  7341.  
  7342. test-name: call-with-container, pid namespace
  7343. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/containers.scm:70
  7344. source:
  7345. + (test-assert
  7346. +   "call-with-container, pid namespace"
  7347. +   (zero? (call-with-container
  7348. +            '()
  7349. +            (lambda ()
  7350. +              (match (primitive-fork)
  7351. +                     (0 (assert-exit (= 2 (getpid))))
  7352. +                     (pid (primitive-exit
  7353. +                            (match (waitpid pid)
  7354. +                                   ((_ . status)
  7355. +                                    (status:exit-val status)))))))
  7356. +            #:namespaces
  7357. +            '(user pid))))
  7358. result: SKIP
  7359.  
  7360. test-name: call-with-container, mnt namespace
  7361. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/containers.scm:87
  7362. source:
  7363. + (test-assert
  7364. +   "call-with-container, mnt namespace"
  7365. +   (zero? (call-with-container
  7366. +            (list (file-system
  7367. +                    (device "none")
  7368. +                    (mount-point "/testing")
  7369. +                    (type "tmpfs")
  7370. +                    (check? #f)))
  7371. +            (lambda ()
  7372. +              (assert-exit (file-exists? "/testing")))
  7373. +            #:namespaces
  7374. +            '(user mnt))))
  7375. result: SKIP
  7376.  
  7377. test-name: call-with-container, mnt namespace, wrong bind mount
  7378. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/containers.scm:100
  7379. source:
  7380. + (test-equal
  7381. +   "call-with-container, mnt namespace, wrong bind mount"
  7382. +   `(system-error ,ENOENT)
  7383. +   (catch 'system-error
  7384. +          (lambda ()
  7385. +            (call-with-container
  7386. +              (list (file-system
  7387. +                      (device "/does-not-exist")
  7388. +                      (mount-point "/foo")
  7389. +                      (type "none")
  7390. +                      (flags '(bind-mount))
  7391. +                      (check? #f)))
  7392. +              (const #t)
  7393. +              #:namespaces
  7394. +              '(user mnt)))
  7395. +          (lambda args
  7396. +            (list 'system-error (system-error-errno args)))))
  7397. result: SKIP
  7398.  
  7399. test-name: call-with-container, all namespaces
  7400. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/containers.scm:118
  7401. source:
  7402. + (test-assert
  7403. +   "call-with-container, all namespaces"
  7404. +   (zero? (call-with-container
  7405. +            '()
  7406. +            (lambda () (primitive-exit 0)))))
  7407. result: SKIP
  7408.  
  7409. test-name: container-excursion
  7410. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/containers.scm:126
  7411. source:
  7412. + (test-assert
  7413. +   "container-excursion"
  7414. +   (call-with-temporary-directory
  7415. +     (lambda (root)
  7416. +       (match (list (pipe) (pipe))
  7417. +              (((start-in . start-out) (end-in . end-out))
  7418. +               (define (container)
  7419. +                 (close end-out)
  7420. +                 (close start-in)
  7421. +                 (write 'ready start-out)
  7422. +                 (close start-out)
  7423. +                 (read end-in)
  7424. +                 (close end-in))
  7425. +               (define (namespaces pid)
  7426. +                 (let ((pid (number->string pid)))
  7427. +                   (map (lambda (ns)
  7428. +                          (readlink (string-append "/proc/" pid "/ns/" ns)))
  7429. +                        '("user" "ipc" "uts" "net" "pid" "mnt"))))
  7430. +               (let* ((pid (run-container root '() %namespaces 1 container))
  7431. +                      (container-namespaces (namespaces pid))
  7432. +                      (result
  7433. +                        (begin
  7434. +                          (close start-out)
  7435. +                          (read start-in)
  7436. +                          (close start-in)
  7437. +                          (container-excursion
  7438. +                            pid
  7439. +                            (lambda ()
  7440. +                              (match (primitive-fork)
  7441. +                                     (0
  7442. +                                      (assert-exit
  7443. +                                        (equal?
  7444. +                                          container-namespaces
  7445. +                                          (namespaces (getpid)))))
  7446. +                                     (fork-pid
  7447. +                                       (match (waitpid fork-pid)
  7448. +                                              ((_ . status)
  7449. +                                               (primitive-exit
  7450. +                                                 (status:exit-val
  7451. +                                                   status)))))))))))
  7452. +                 (close end-in)
  7453. +                 (write 'done end-out)
  7454. +                 (close end-out)
  7455. +                 (waitpid pid)
  7456. +                 (zero? result)))))))
  7457. result: SKIP
  7458.  
  7459. test-name: container-excursion, same namespaces
  7460. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/containers.scm:184
  7461. source:
  7462. + (test-equal
  7463. +   "container-excursion, same namespaces"
  7464. +   42
  7465. +   (container-excursion
  7466. +     (getpid)
  7467. +     (lambda () (primitive-exit 42))))
  7468. result: SKIP
  7469.  
  7470. test-name: container-excursion*
  7471. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/containers.scm:194
  7472. source:
  7473. + (test-assert
  7474. +   "container-excursion*"
  7475. +   (call-with-temporary-directory
  7476. +     (lambda (root)
  7477. +       (define (namespaces pid)
  7478. +         (let ((pid (number->string pid)))
  7479. +           (map (lambda (ns)
  7480. +                  (readlink (string-append "/proc/" pid "/ns/" ns)))
  7481. +                '("user" "ipc" "uts" "net" "pid" "mnt"))))
  7482. +       (let* ((pid (run-container
  7483. +                     root
  7484. +                     '()
  7485. +                     %namespaces
  7486. +                     1
  7487. +                     (lambda () (sleep 100))))
  7488. +              (result
  7489. +                (container-excursion*
  7490. +                  pid
  7491. +                  (lambda () (namespaces 1)))))
  7492. +         (kill pid SIGKILL)
  7493. +         (equal? result (namespaces pid))))))
  7494. result: SKIP
  7495.  
  7496. test-name: container-excursion*, same namespaces
  7497. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/containers.scm:215
  7498. source:
  7499. + (test-equal
  7500. +   "container-excursion*, same namespaces"
  7501. +   42
  7502. +   (container-excursion*
  7503. +     (getpid)
  7504. +     (lambda () (* 6 7))))
  7505. result: SKIP
  7506.  
  7507.  
  7508. SKIP: tests/pack
  7509. ================
  7510.  
  7511. random seed for tests: 1495496074
  7512. test-name: self-contained-tarball
  7513. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/pack.scm:54
  7514. source:
  7515. + (test-assert
  7516. +   "self-contained-tarball"
  7517. +   (run-with-store
  7518. +     %store
  7519. +     (mlet* %store-monad
  7520. +            ((profile
  7521. +               (profile-derivation
  7522. +                 (packages->manifest (list %bootstrap-guile))
  7523. +                 #:hooks
  7524. +                 '()
  7525. +                 #:locales?
  7526. +                 #f))
  7527. +             (tarball
  7528. +               (self-contained-tarball
  7529. +                 "pack"
  7530. +                 profile
  7531. +                 #:symlinks
  7532. +                 '(("/bin/Guile" -> "bin/guile"))
  7533. +                 #:compressor
  7534. +                 %gzip-compressor
  7535. +                 #:tar
  7536. +                 %tar-bootstrap))
  7537. +             (check (gexp->derivation
  7538. +                      "check-tarball"
  7539. +                      (gexp (let ((guile (string-append
  7540. +                                           "."
  7541. +                                           (ungexp profile)
  7542. +                                           "/bin")))
  7543. +                              (setenv
  7544. +                                "PATH"
  7545. +                                (string-append
  7546. +                                  (ungexp %tar-bootstrap)
  7547. +                                  "/bin"))
  7548. +                              (system* "tar" "xvf" (ungexp tarball))
  7549. +                              (mkdir (ungexp output))
  7550. +                              (exit (and (file-exists?
  7551. +                                           (string-append guile "/guile"))
  7552. +                                         (string=?
  7553. +                                           (string-append
  7554. +                                             (ungexp %bootstrap-guile)
  7555. +                                             "/bin")
  7556. +                                           (readlink guile))
  7557. +                                         (string=?
  7558. +                                           (string-append
  7559. +                                             (string-drop guile 1)
  7560. +                                             "/guile")
  7561. +                                           (readlink "bin/Guile")))))))))
  7562. +            (built-derivations (list check)))
  7563. +     #:guile-for-build
  7564. +     (%guile-for-build)))
  7565. result: SKIP
  7566.  
  7567.  
  7568. SKIP: tests/pypi
  7569. ================
  7570.  
  7571. test-name: guix-package->pypi-name, old URL style
  7572. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/pypi.scm:78
  7573. source:
  7574. + (test-equal
  7575. +   "guix-package->pypi-name, old URL style"
  7576. +   "psutil"
  7577. +   (guix-package->pypi-name
  7578. +     (dummy-package
  7579. +       "foo"
  7580. +       (source
  7581. +         (dummy-origin
  7582. +           (uri "https://pypi.io/packages/source/p/psutil/psutil-4.3.0.tar.gz"))))))
  7583. expected-value: "psutil"
  7584. actual-value: "psutil"
  7585. result: PASS
  7586.  
  7587. test-name: guix-package->pypi-name, new URL style
  7588. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/pypi.scm:86
  7589. source:
  7590. + (test-equal
  7591. +   "guix-package->pypi-name, new URL style"
  7592. +   "certbot"
  7593. +   (guix-package->pypi-name
  7594. +     (dummy-package
  7595. +       "foo"
  7596. +       (source
  7597. +         (dummy-origin
  7598. +           (uri "https://pypi.python.org/packages/a2/3b/4756e6a0ceb14e084042a2a65c615d68d25621c6fd446d0fc10d14c4ce7d/certbot-0.8.1.tar.gz"))))))
  7599. expected-value: "certbot"
  7600. actual-value: "certbot"
  7601. result: PASS
  7602.  
  7603. test-name: guix-package->pypi-name, several URLs
  7604. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/pypi.scm:94
  7605. source:
  7606. + (test-equal
  7607. +   "guix-package->pypi-name, several URLs"
  7608. +   "cram"
  7609. +   (guix-package->pypi-name
  7610. +     (dummy-package
  7611. +       "foo"
  7612. +       (source
  7613. +         (dummy-origin
  7614. +           (uri (list "https://bitheap.org/cram/cram-0.7.tar.gz"
  7615. +                      (pypi-uri "cram" "0.7"))))))))
  7616. expected-value: "cram"
  7617. actual-value: "cram"
  7618. result: PASS
  7619.  
  7620. test-name: pypi->guix-package
  7621. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/pypi.scm:103
  7622. source:
  7623. + (test-assert
  7624. +   "pypi->guix-package"
  7625. +   (mock ((guix import utils)
  7626. +          url-fetch
  7627. +          (lambda (url file-name)
  7628. +            (match url
  7629. +                   ("https://example.com/foo-1.0.0.tar.gz"
  7630. +                    (begin
  7631. +                      (mkdir "foo-1.0.0")
  7632. +                      (with-output-to-file
  7633. +                        "foo-1.0.0/requirements.txt"
  7634. +                        (lambda () (display test-requirements)))
  7635. +                      (system* "tar" "czvf" file-name "foo-1.0.0/")
  7636. +                      (delete-file-recursively "foo-1.0.0")
  7637. +                      (set! test-source-hash
  7638. +                        (call-with-input-file file-name port-sha256))))
  7639. +                   ("https://example.com/foo-1.0.0-py2.py3-none-any.whl"
  7640. +                    #f)
  7641. +                   (_ (error "Unexpected URL: " url)))))
  7642. +         (mock ((guix http-client)
  7643. +                http-fetch
  7644. +                (lambda (url . rest)
  7645. +                  (match url
  7646. +                         ("https://pypi.python.org/pypi/foo/json"
  7647. +                          (values
  7648. +                            (open-input-string test-json)
  7649. +                            (string-length test-json)))
  7650. +                         ("https://example.com/foo-1.0.0-py2.py3-none-any.whl"
  7651. +                          #f)
  7652. +                         (_ (error "Unexpected URL: " url)))))
  7653. +               (match (pypi->guix-package "foo")
  7654. +                      (('package
  7655. +                        ('name "python-foo")
  7656. +                        ('version "1.0.0")
  7657. +                        ('source
  7658. +                         ('origin
  7659. +                          ('method 'url-fetch)
  7660. +                          ('uri
  7661. +                           (string-append
  7662. +                             "https://example.com/foo-"
  7663. +                             version
  7664. +                             ".tar.gz"))
  7665. +                          ('sha256 ('base32 (? string? hash)))))
  7666. +                        ('build-system 'python-build-system)
  7667. +                        ('propagated-inputs
  7668. +                         ('quasiquote
  7669. +                          (("python-bar" ('unquote 'python-bar))
  7670. +                           ("python-baz" ('unquote 'python-baz)))))
  7671. +                        ('home-page "http://example.com")
  7672. +                        ('synopsis "summary")
  7673. +                        ('description "summary")
  7674. +                        ('license 'license:lgpl2.0))
  7675. +                       (string=?
  7676. +                         (bytevector->nix-base32-string test-source-hash)foo-1.0.0/
  7677. foo-1.0.0/requirements.txt
  7678. random seed for tests: 1495496117
  7679.  
  7680. +                         hash))
  7681. +                      (x (pk 'fail x #f))))))
  7682. actual-value: #t
  7683. result: PASS
  7684.  
  7685. test-name: pypi->guix-package, wheels
  7686. location: /tmp/guix-build-guix-0.13.0.drv-0/source/tests/pypi.scm:155
  7687. source:
  7688. + (test-assert
  7689. +   "pypi->guix-package, wheels"
  7690. +   (mock ((guix import utils)
  7691. +          url-fetch
  7692. +          (lambda (url file-name)
  7693. +            (match url
  7694. +                   ("https://example.com/foo-1.0.0.tar.gz"
  7695. +                    (begin
  7696. +                      (mkdir "foo-1.0.0")
  7697. +                      (with-output-to-file
  7698. +                        "foo-1.0.0/requirements.txt"
  7699. +                        (lambda () (display test-requirements)))
  7700. +                      (system* "tar" "czvf" file-name "foo-1.0.0/")
  7701. +                      (delete-file-recursively "foo-1.0.0")
  7702. +                      (set! test-source-hash
  7703. +                        (call-with-input-file file-name port-sha256))))
  7704. +                   ("https://example.com/foo-1.0.0-py2.py3-none-any.whl"
  7705. +                    (begin
  7706. +                      (mkdir "foo-1.0.0.dist-info")
  7707. +                      (with-output-to-file
  7708. +                        "foo-1.0.0.dist-info/metadata.json"
  7709. +                        (lambda () (display test-metadata)))
  7710. +                      (let ((zip-file (string-append file-name ".zip")))
  7711. +                        (system*
  7712. +                          "zip"
  7713. +                          zip-file
  7714. +                          "foo-1.0.0.dist-info/metadata.json")
  7715. +                        (rename-file zip-file file-name))
  7716. +                      (delete-file-recursively "foo-1.0.0.dist-info")))
  7717. +                   (_ (error "Unexpected URL: " url)))))
  7718. +         (mock ((guix http-client)
  7719. +                http-fetch
  7720. +                (lambda (url . rest)
  7721. +                  (match url
  7722. +                         ("https://pypi.python.org/pypi/foo/json"
  7723. +                          (values
  7724. +                            (open-input-string test-json)
  7725. +                            (string-length test-json)))
  7726. +                         ("https://example.com/foo-1.0.0-py2.py3-none-any.whl"
  7727. +                          #f)
  7728. +                         (_ (error "Unexpected URL: " url)))))
  7729. +               (match (pypi->guix-package "foo")
  7730. +                      (('package
  7731. +                        ('name "python-foo")
  7732. +                        ('version "1.0.0")
  7733. +                        ('source
  7734. +                         ('origin
  7735. +                          ('method 'url-fetch)
  7736. +                          ('uri
  7737. +                           (string-append
  7738. +                             "https://example.com/foo-"
  7739. +                             version
  7740. +                             ".tar.gz"))
  7741. +                          ('sha256 ('base32 (? string? hash)))))
  7742. +                        ('build-system 'python-build-system)
  7743. +                        ('propagated-inputs
  7744. +                         ('quasiquote
  7745. +                          (("python-bar" ('unquote 'python-bar))
  7746. +                           ("python-baz" ('unquote 'python-baz)))))
  7747. +                        ('home-page "http://example.com")
  7748. +                        ('synopsis "summary")
  7749. +                        ('description "summary")
  7750. +                        ('license 'license:lgpl2.0))
  7751. +                       (string=?
  7752. +                         (bytevector->nix-base32-string test-source-hash)
  7753. +                         hash))
  7754. +                      (x (pk 'fail x #f))))))
  7755. result: SKIP
  7756.  
  7757.  
  7758. SKIP: tests/guix-package-net
  7759. ============================
  7760.  
  7761. + guix package --version
  7762. guix package (GNU Guix)
  7763. Copyright (C) 2017 the Guix authors
  7764. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  7765. This is free software: you are free to change and redistribute it.
  7766. There is NO WARRANTY, to the extent permitted by law.
  7767. + guile -c '(getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)'
  7768. + exit 77
  7769. ./test-env: line 1: 15642 Terminated              "/tmp/guix-build-guix-0.13.0.drv-0/source/pre-inst-env" "/tmp/guix-build-guix-0.13.0.drv-0/source/guix-daemon" --disable-chroot --substitute-urls="$GUIX_BINARY_SUBSTITUTE_URL"
  7770. SKIP tests/guix-package-net.sh (exit status: 77)
  7771.  
  7772. SKIP: tests/guix-environment-container
  7773. ======================================
  7774.  
  7775. + set -e
  7776. + exit 77
  7777. ./test-env: line 1: 16255 Terminated              "/tmp/guix-build-guix-0.13.0.drv-0/source/pre-inst-env" "/tmp/guix-build-guix-0.13.0.drv-0/source/guix-daemon" --disable-chroot --substitute-urls="$GUIX_BINARY_SUBSTITUTE_URL"
  7778. SKIP tests/guix-environment-container.sh (exit status: 77)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement