packages.scm 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
  3. ;;;
  4. ;;; This file is part of GNU Guix.
  5. ;;;
  6. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  7. ;;; under the terms of the GNU General Public License as published by
  8. ;;; the Free Software Foundation; either version 3 of the License, or (at
  9. ;;; your option) any later version.
  10. ;;;
  11. ;;; GNU Guix is distributed in the hope that it will be useful, but
  12. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. ;;; GNU General Public License for more details.
  15. ;;;
  16. ;;; You should have received a copy of the GNU General Public License
  17. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  18. (define-module (test-packages)
  19. #:use-module (guix tests)
  20. #:use-module (guix store)
  21. #:use-module (guix monads)
  22. #:use-module (guix grafts)
  23. #:use-module ((guix gexp) #:select (local-file local-file-file))
  24. #:use-module ((guix utils)
  25. ;; Rename the 'location' binding to allow proper syntax
  26. ;; matching when setting the 'location' field of a package.
  27. #:renamer (lambda (name)
  28. (cond ((eq? name 'location) 'make-location)
  29. (else name))))
  30. #:use-module (guix hash)
  31. #:use-module (guix derivations)
  32. #:use-module (guix packages)
  33. #:use-module (guix grafts)
  34. #:use-module (guix search-paths)
  35. #:use-module (guix build-system)
  36. #:use-module (guix build-system trivial)
  37. #:use-module (guix build-system gnu)
  38. #:use-module (guix profiles)
  39. #:use-module (guix scripts package)
  40. #:use-module (gnu packages)
  41. #:use-module (gnu packages base)
  42. #:use-module (gnu packages guile)
  43. #:use-module (gnu packages bootstrap)
  44. #:use-module (gnu packages version-control)
  45. #:use-module (gnu packages xml)
  46. #:use-module (srfi srfi-1)
  47. #:use-module (srfi srfi-26)
  48. #:use-module (srfi srfi-34)
  49. #:use-module (srfi srfi-35)
  50. #:use-module (srfi srfi-64)
  51. #:use-module (rnrs io ports)
  52. #:use-module (ice-9 vlist)
  53. #:use-module (ice-9 regex)
  54. #:use-module (ice-9 match))
  55. ;; Test the high-level packaging layer.
  56. (define %store
  57. (open-connection-for-tests))
  58. ;; Globally disable grafting to avoid rebuilding the world ('graft-derivation'
  59. ;; can trigger builds early.)
  60. (%graft? #f)
  61. (test-begin "packages")
  62. (test-assert "printer with location"
  63. (string-match "^#<package foo@0 foo.scm:42 [[:xdigit:]]+>$"
  64. (with-output-to-string
  65. (lambda ()
  66. (write
  67. (dummy-package "foo"
  68. (location (make-location "foo.scm" 42 7))))))))
  69. (test-assert "printer without location"
  70. (string-match "^#<package foo@0 [[:xdigit:]]+>$"
  71. (with-output-to-string
  72. (lambda ()
  73. (write
  74. (dummy-package "foo" (location #f)))))))
  75. (test-assert "hidden-package"
  76. (and (hidden-package? (hidden-package (dummy-package "foo")))
  77. (not (hidden-package? (dummy-package "foo")))))
  78. (test-assert "package-superseded"
  79. (let* ((new (dummy-package "bar"))
  80. (old (deprecated-package "foo" new)))
  81. (and (eq? (package-superseded old) new)
  82. (mock ((gnu packages) find-best-packages-by-name (const (list old)))
  83. (specification->package "foo")
  84. (and (eq? new (specification->package "foo"))
  85. (eq? new (specification->package+output "foo")))))))
  86. (test-assert "transaction-upgrade-entry, zero upgrades"
  87. (let* ((old (dummy-package "foo" (version "1")))
  88. (tx (mock ((gnu packages) find-newest-available-packages
  89. (const vlist-null))
  90. ((@@ (guix scripts package) transaction-upgrade-entry)
  91. (manifest-entry
  92. (inherit (package->manifest-entry old))
  93. (item (string-append (%store-prefix) "/"
  94. (make-string 32 #\e) "-foo-1")))
  95. (manifest-transaction)))))
  96. (manifest-transaction-null? tx)))
  97. (test-assert "transaction-upgrade-entry, one upgrade"
  98. (let* ((old (dummy-package "foo" (version "1")))
  99. (new (dummy-package "foo" (version "2")))
  100. (tx (mock ((gnu packages) find-newest-available-packages
  101. (const (vhash-cons "foo" (list "2" new) vlist-null)))
  102. ((@@ (guix scripts package) transaction-upgrade-entry)
  103. (manifest-entry
  104. (inherit (package->manifest-entry old))
  105. (item (string-append (%store-prefix) "/"
  106. (make-string 32 #\e) "-foo-1")))
  107. (manifest-transaction)))))
  108. (and (match (manifest-transaction-install tx)
  109. ((($ <manifest-entry> "foo" "2" "out" item))
  110. (eq? item new)))
  111. (null? (manifest-transaction-remove tx)))))
  112. (test-assert "transaction-upgrade-entry, superseded package"
  113. (let* ((old (dummy-package "foo" (version "1")))
  114. (new (dummy-package "bar" (version "2")))
  115. (dep (deprecated-package "foo" new))
  116. (tx (mock ((gnu packages) find-newest-available-packages
  117. (const (vhash-cons "foo" (list "2" dep) vlist-null)))
  118. ((@@ (guix scripts package) transaction-upgrade-entry)
  119. (manifest-entry
  120. (inherit (package->manifest-entry old))
  121. (item (string-append (%store-prefix) "/"
  122. (make-string 32 #\e) "-foo-1")))
  123. (manifest-transaction)))))
  124. (and (match (manifest-transaction-install tx)
  125. ((($ <manifest-entry> "bar" "2" "out" item))
  126. (eq? item new)))
  127. (match (manifest-transaction-remove tx)
  128. (((? manifest-pattern? pattern))
  129. (and (string=? (manifest-pattern-name pattern) "foo")
  130. (string=? (manifest-pattern-version pattern) "1")
  131. (string=? (manifest-pattern-output pattern) "out")))))))
  132. (test-assert "package-field-location"
  133. (let ()
  134. (define (goto port line column)
  135. (unless (and (= (port-column port) (- column 1))
  136. (= (port-line port) (- line 1)))
  137. (unless (eof-object? (get-char port))
  138. (goto port line column))))
  139. (define read-at
  140. (match-lambda
  141. (($ <location> file line column)
  142. (call-with-input-file (search-path %load-path file)
  143. (lambda (port)
  144. (goto port line column)
  145. (read port))))))
  146. ;; Until Guile 2.0.6 included, source properties were added only to pairs.
  147. ;; Thus, check against both VALUE and (FIELD VALUE).
  148. (and (member (read-at (package-field-location %bootstrap-guile 'name))
  149. (let ((name (package-name %bootstrap-guile)))
  150. (list name `(name ,name))))
  151. (member (read-at (package-field-location %bootstrap-guile 'version))
  152. (let ((version (package-version %bootstrap-guile)))
  153. (list version `(version ,version))))
  154. (not (package-field-location %bootstrap-guile 'does-not-exist)))))
  155. ;; Make sure we don't change the file name to an absolute file name.
  156. (test-equal "package-field-location, relative file name"
  157. (location-file (package-location %bootstrap-guile))
  158. (with-fluids ((%file-port-name-canonicalization 'absolute))
  159. (location-file (package-field-location %bootstrap-guile 'version))))
  160. (test-assert "package-transitive-inputs"
  161. (let* ((a (dummy-package "a"))
  162. (b (dummy-package "b"
  163. (propagated-inputs `(("a" ,a)))))
  164. (c (dummy-package "c"
  165. (inputs `(("a" ,a)))))
  166. (d (dummy-package "d"
  167. (propagated-inputs `(("x" "something.drv")))))
  168. (e (dummy-package "e"
  169. (inputs `(("b" ,b) ("c" ,c) ("d" ,d))))))
  170. (and (null? (package-transitive-inputs a))
  171. (equal? `(("a" ,a)) (package-transitive-inputs b))
  172. (equal? `(("a" ,a)) (package-transitive-inputs c))
  173. (equal? (package-propagated-inputs d)
  174. (package-transitive-inputs d))
  175. (equal? `(("b" ,b) ("c" ,c) ("d" ,d)
  176. ("a" ,a) ("x" "something.drv"))
  177. (pk 'x (package-transitive-inputs e))))))
  178. (test-assert "package-transitive-inputs, no duplicates"
  179. (let* ((a (dummy-package "a"))
  180. (b (dummy-package "b"
  181. (inputs `(("a+" ,a)))
  182. (native-inputs `(("a*" ,a)))
  183. (propagated-inputs `(("a" ,a)))))
  184. (c (dummy-package "c"
  185. (propagated-inputs `(("b" ,b)))))
  186. (d (dummy-package "d"
  187. (inputs `(("a" ,a) ("c" ,c)))))
  188. (e (dummy-package "e"
  189. (inputs `(("b" ,b) ("c" ,c))))))
  190. (and (null? (package-transitive-inputs a))
  191. (equal? `(("a*" ,a) ("a+" ,a) ("a" ,a)) ;here duplicates are kept
  192. (package-transitive-inputs b))
  193. (equal? `(("b" ,b) ("a" ,a))
  194. (package-transitive-inputs c))
  195. (equal? `(("a" ,a) ("c" ,c) ("b" ,b)) ;duplicate A removed
  196. (package-transitive-inputs d))
  197. (equal? `(("b" ,b) ("c" ,c) ("a" ,a))
  198. (package-transitive-inputs e))))) ;ditto
  199. (test-equal "package-transitive-supported-systems"
  200. '(("x" "y" "z") ;a
  201. ("x" "y") ;b
  202. ("y") ;c
  203. ("y") ;d
  204. ("y")) ;e
  205. ;; Use TRIVIAL-BUILD-SYSTEM because it doesn't add implicit inputs and thus
  206. ;; doesn't restrict the set of supported systems.
  207. (let* ((a (dummy-package "a"
  208. (build-system trivial-build-system)
  209. (supported-systems '("x" "y" "z"))))
  210. (b (dummy-package "b"
  211. (build-system trivial-build-system)
  212. (supported-systems '("x" "y"))
  213. (inputs `(("a" ,a)))))
  214. (c (dummy-package "c"
  215. (build-system trivial-build-system)
  216. (supported-systems '("y" "z"))
  217. (inputs `(("b" ,b)))))
  218. (d (dummy-package "d"
  219. (build-system trivial-build-system)
  220. (supported-systems '("x" "y" "z"))
  221. (inputs `(("b" ,b) ("c" ,c)))))
  222. (e (dummy-package "e"
  223. (build-system trivial-build-system)
  224. (supported-systems '("x" "y" "z"))
  225. (inputs `(("d" ,d))))))
  226. (list (package-transitive-supported-systems a)
  227. (package-transitive-supported-systems b)
  228. (package-transitive-supported-systems c)
  229. (package-transitive-supported-systems d)
  230. (package-transitive-supported-systems e))))
  231. (test-equal "origin-actual-file-name"
  232. "foo-1.tar.gz"
  233. (let ((o (dummy-origin (uri "http://www.example.com/foo-1.tar.gz"))))
  234. (origin-actual-file-name o)))
  235. (test-equal "origin-actual-file-name, file-name"
  236. "foo-1.tar.gz"
  237. (let ((o (dummy-origin
  238. (uri "http://www.example.com/tarball")
  239. (file-name "foo-1.tar.gz"))))
  240. (origin-actual-file-name o)))
  241. (let* ((o (dummy-origin))
  242. (u (dummy-origin))
  243. (i (dummy-origin))
  244. (a (dummy-package "a"))
  245. (b (dummy-package "b"
  246. (inputs `(("a" ,a) ("i" ,i)))))
  247. (c (package (inherit b) (source o)))
  248. (d (dummy-package "d"
  249. (build-system trivial-build-system)
  250. (source u) (inputs `(("c" ,c))))))
  251. (test-assert "package-direct-sources, no source"
  252. (null? (package-direct-sources a)))
  253. (test-equal "package-direct-sources, #f source"
  254. (list i)
  255. (package-direct-sources b))
  256. (test-equal "package-direct-sources, not input source"
  257. (list u)
  258. (package-direct-sources d))
  259. (test-assert "package-direct-sources"
  260. (let ((s (package-direct-sources c)))
  261. (and (= (length (pk 's-sources s)) 2)
  262. (member o s)
  263. (member i s))))
  264. (test-assert "package-transitive-sources"
  265. (let ((s (package-transitive-sources d)))
  266. (and (= (length (pk 'd-sources s)) 3)
  267. (member o s)
  268. (member i s)
  269. (member u s)))))
  270. (test-assert "transitive-input-references"
  271. (let* ((a (dummy-package "a"))
  272. (b (dummy-package "b"))
  273. (c (dummy-package "c"
  274. (inputs `(("a" ,a)))
  275. (propagated-inputs `(("boo" ,b)))))
  276. (d (dummy-package "d"
  277. (inputs `(("c*" ,c)))))
  278. (keys (map (match-lambda
  279. (('assoc-ref 'l key)
  280. key))
  281. (pk 'refs (transitive-input-references
  282. 'l (package-inputs d))))))
  283. (and (= (length keys) 2)
  284. (member "c*" keys)
  285. (member "boo" keys))))
  286. (test-equal "package-transitive-supported-systems, implicit inputs"
  287. %supported-systems
  288. ;; Here GNU-BUILD-SYSTEM adds implicit inputs that build only on
  289. ;; %SUPPORTED-SYSTEMS. Thus the others must be ignored.
  290. (let ((p (dummy-package "foo"
  291. (build-system gnu-build-system)
  292. (supported-systems
  293. `("does-not-exist" "foobar" ,@%supported-systems)))))
  294. (package-transitive-supported-systems p)))
  295. (test-assert "supported-package?"
  296. (let ((p (dummy-package "foo"
  297. (build-system gnu-build-system)
  298. (supported-systems '("x86_64-linux" "does-not-exist")))))
  299. (and (supported-package? p "x86_64-linux")
  300. (not (supported-package? p "does-not-exist"))
  301. (not (supported-package? p "i686-linux")))))
  302. (test-skip (if (not %store) 8 0))
  303. (test-assert "package-source-derivation, file"
  304. (let* ((file (search-path %load-path "guix.scm"))
  305. (package (package (inherit (dummy-package "p"))
  306. (source file)))
  307. (source (package-source-derivation %store
  308. (package-source package))))
  309. (and (store-path? source)
  310. (valid-path? %store source)
  311. (equal? (call-with-input-file source get-bytevector-all)
  312. (call-with-input-file file get-bytevector-all)))))
  313. (test-assert "package-source-derivation, store path"
  314. (let* ((file (add-to-store %store "guix.scm" #t "sha256"
  315. (search-path %load-path "guix.scm")))
  316. (package (package (inherit (dummy-package "p"))
  317. (source file)))
  318. (source (package-source-derivation %store
  319. (package-source package))))
  320. (string=? file source)))
  321. (test-assert "package-source-derivation, indirect store path"
  322. (let* ((dir (add-to-store %store "guix-build" #t "sha256"
  323. (dirname (search-path %load-path
  324. "guix/build/utils.scm"))))
  325. (package (package (inherit (dummy-package "p"))
  326. (source (string-append dir "/utils.scm"))))
  327. (source (package-source-derivation %store
  328. (package-source package))))
  329. (and (direct-store-path? source)
  330. (string-suffix? "utils.scm" source))))
  331. (test-assert "package-source-derivation, local-file"
  332. (let* ((file (local-file "../guix/base32.scm"))
  333. (package (package (inherit (dummy-package "p"))
  334. (source file)))
  335. (source (package-source-derivation %store
  336. (package-source package))))
  337. (and (store-path? source)
  338. (string-suffix? "base32.scm" source)
  339. (valid-path? %store source)
  340. (equal? (call-with-input-file source get-bytevector-all)
  341. (call-with-input-file
  342. (search-path %load-path "guix/base32.scm")
  343. get-bytevector-all)))))
  344. (unless (network-reachable?) (test-skip 1))
  345. (test-equal "package-source-derivation, snippet"
  346. "OK"
  347. (let* ((file (search-bootstrap-binary (match (%current-system)
  348. ("armhf-linux"
  349. "guile-2.0.11.tar.xz")
  350. ("aarch64-linux"
  351. "guile-2.0.14.tar.xz")
  352. (_
  353. "guile-2.0.9.tar.xz"))
  354. (%current-system)))
  355. (sha256 (call-with-input-file file port-sha256))
  356. (fetch (lambda* (url hash-algo hash
  357. #:optional name #:key system)
  358. (pk 'fetch url hash-algo hash name system)
  359. (interned-file url)))
  360. (source (bootstrap-origin
  361. (origin
  362. (method fetch)
  363. (uri file)
  364. (sha256 sha256)
  365. (patch-inputs
  366. `(("tar" ,%bootstrap-coreutils&co)
  367. ("xz" ,%bootstrap-coreutils&co)
  368. ("patch" ,%bootstrap-coreutils&co)))
  369. (patch-guile %bootstrap-guile)
  370. (modules '((guix build utils)))
  371. (snippet '(begin
  372. ;; We end up in 'bin', because it's the first
  373. ;; directory, alphabetically. Not a very good
  374. ;; example but hey.
  375. (chmod "." #o777)
  376. (symlink "guile" "guile-rocks")
  377. (copy-recursively "../share/guile/2.0/scripts"
  378. "scripts")
  379. ;; Make sure '.file_list' can be created.
  380. (chmod ".." #o777))))))
  381. (package (package (inherit (dummy-package "with-snippet"))
  382. (source source)
  383. (build-system trivial-build-system)
  384. (inputs
  385. `(("tar" ,(search-bootstrap-binary "tar"
  386. (%current-system)))
  387. ("xz" ,(search-bootstrap-binary "xz"
  388. (%current-system)))))
  389. (arguments
  390. `(#:guile ,%bootstrap-guile
  391. #:builder
  392. (let ((tar (assoc-ref %build-inputs "tar"))
  393. (xz (assoc-ref %build-inputs "xz"))
  394. (source (assoc-ref %build-inputs "source")))
  395. (and (zero? (system* tar "xvf" source
  396. "--use-compress-program" xz))
  397. (string=? "guile" (readlink "bin/guile-rocks"))
  398. (file-exists? "bin/scripts/compile.scm")
  399. (let ((out (assoc-ref %outputs "out")))
  400. (call-with-output-file out
  401. (lambda (p)
  402. (display "OK" p))))))))))
  403. (drv (package-derivation %store package))
  404. (out (derivation->output-path drv)))
  405. (and (build-derivations %store (list (pk 'snippet-drv drv)))
  406. (call-with-input-file out get-string-all))))
  407. (test-assert "return value"
  408. (let ((drv (package-derivation %store (dummy-package "p"))))
  409. (and (derivation? drv)
  410. (file-exists? (derivation-file-name drv)))))
  411. (test-assert "package-output"
  412. (let* ((package (dummy-package "p"))
  413. (drv (package-derivation %store package)))
  414. (and (derivation? drv)
  415. (string=? (derivation->output-path drv)
  416. (package-output %store package "out")))))
  417. (test-assert "patch not found yields a run-time error"
  418. (guard (c ((condition-has-type? c &message)
  419. (and (string-contains (condition-message c)
  420. "does-not-exist.patch")
  421. (string-contains (condition-message c)
  422. "not found"))))
  423. (let ((p (package
  424. (inherit (dummy-package "p"))
  425. (source (origin
  426. (method (const #f))
  427. (uri "http://whatever")
  428. (patches
  429. (list (search-patch "does-not-exist.patch")))
  430. (sha256
  431. (base32
  432. "0amn0bbwqvsvvsh6drfwz20ydc2czk374lzw5kksbh6bf78k4ks4")))))))
  433. (package-derivation %store p)
  434. #f)))
  435. (let ((dummy (dummy-package "foo" (inputs `(("x" ,(current-module)))))))
  436. (test-equal "&package-input-error"
  437. (list dummy (current-module))
  438. (guard (c ((package-input-error? c)
  439. (list (package-error-package c)
  440. (package-error-invalid-input c))))
  441. (package-derivation %store dummy))))
  442. (test-assert "reference to non-existent output"
  443. ;; See <http://bugs.gnu.org/19630>.
  444. (parameterize ((%graft? #f))
  445. (let* ((dep (dummy-package "dep"))
  446. (p (dummy-package "p"
  447. (inputs `(("dep" ,dep "non-existent"))))))
  448. (guard (c ((derivation-missing-output-error? c)
  449. (and (string=? (derivation-missing-output c) "non-existent")
  450. (equal? (package-derivation %store dep)
  451. (derivation-error-derivation c)))))
  452. (package-derivation %store p)))))
  453. (test-assert "trivial"
  454. (let* ((p (package (inherit (dummy-package "trivial"))
  455. (build-system trivial-build-system)
  456. (source #f)
  457. (arguments
  458. `(#:guile ,%bootstrap-guile
  459. #:builder
  460. (begin
  461. (mkdir %output)
  462. (call-with-output-file (string-append %output "/test")
  463. (lambda (p)
  464. (display '(hello guix) p))))))))
  465. (d (package-derivation %store p)))
  466. (and (build-derivations %store (list d))
  467. (let ((p (pk 'drv d (derivation->output-path d))))
  468. (equal? '(hello guix)
  469. (call-with-input-file (string-append p "/test") read))))))
  470. (test-assert "trivial with local file as input"
  471. (let* ((i (search-path %load-path "ice-9/boot-9.scm"))
  472. (p (package (inherit (dummy-package "trivial-with-input-file"))
  473. (build-system trivial-build-system)
  474. (source #f)
  475. (arguments
  476. `(#:guile ,%bootstrap-guile
  477. #:builder (copy-file (assoc-ref %build-inputs "input")
  478. %output)))
  479. (inputs `(("input" ,i)))))
  480. (d (package-derivation %store p)))
  481. (and (build-derivations %store (list d))
  482. (let ((p (pk 'drv d (derivation->output-path d))))
  483. (equal? (call-with-input-file p get-bytevector-all)
  484. (call-with-input-file i get-bytevector-all))))))
  485. (test-assert "trivial with source"
  486. (let* ((i (search-path %load-path "ice-9/boot-9.scm"))
  487. (p (package (inherit (dummy-package "trivial-with-source"))
  488. (build-system trivial-build-system)
  489. (source i)
  490. (arguments
  491. `(#:guile ,%bootstrap-guile
  492. #:builder (copy-file (assoc-ref %build-inputs "source")
  493. %output)))))
  494. (d (package-derivation %store p)))
  495. (and (build-derivations %store (list d))
  496. (let ((p (derivation->output-path d)))
  497. (equal? (call-with-input-file p get-bytevector-all)
  498. (call-with-input-file i get-bytevector-all))))))
  499. (test-assert "trivial with system-dependent input"
  500. (let* ((p (package (inherit (dummy-package "trivial-system-dependent-input"))
  501. (build-system trivial-build-system)
  502. (source #f)
  503. (arguments
  504. `(#:guile ,%bootstrap-guile
  505. #:builder
  506. (let ((out (assoc-ref %outputs "out"))
  507. (bash (assoc-ref %build-inputs "bash")))
  508. (zero? (system* bash "-c"
  509. (format #f "echo hello > ~a" out))))))
  510. (inputs `(("bash" ,(search-bootstrap-binary "bash"
  511. (%current-system)))))))
  512. (d (package-derivation %store p)))
  513. (and (build-derivations %store (list d))
  514. (let ((p (pk 'drv d (derivation->output-path d))))
  515. (eq? 'hello (call-with-input-file p read))))))
  516. (test-assert "search paths"
  517. (let* ((p (make-prompt-tag "return-search-paths"))
  518. (s (build-system
  519. (name 'raw)
  520. (description "Raw build system with direct store access")
  521. (lower (lambda* (name #:key source inputs system target
  522. #:allow-other-keys)
  523. (bag
  524. (name name)
  525. (system system) (target target)
  526. (build-inputs inputs)
  527. (build
  528. (lambda* (store name inputs
  529. #:key outputs system search-paths)
  530. search-paths)))))))
  531. (x (list (search-path-specification
  532. (variable "GUILE_LOAD_PATH")
  533. (files '("share/guile/site/2.0")))
  534. (search-path-specification
  535. (variable "GUILE_LOAD_COMPILED_PATH")
  536. (files '("share/guile/site/2.0")))))
  537. (a (package (inherit (dummy-package "guile"))
  538. (build-system s)
  539. (native-search-paths x)))
  540. (b (package (inherit (dummy-package "guile-foo"))
  541. (build-system s)
  542. (inputs `(("guile" ,a)))))
  543. (c (package (inherit (dummy-package "guile-bar"))
  544. (build-system s)
  545. (inputs `(("guile" ,a)
  546. ("guile-foo" ,b))))))
  547. (let-syntax ((collect (syntax-rules ()
  548. ((_ body ...)
  549. (call-with-prompt p
  550. (lambda ()
  551. body ...)
  552. (lambda (k search-paths)
  553. search-paths))))))
  554. (and (null? (collect (package-derivation %store a)))
  555. (equal? x (collect (package-derivation %store b)))
  556. (equal? x (collect (package-derivation %store c)))))))
  557. (test-assert "package-transitive-native-search-paths"
  558. (let* ((sp (lambda (name)
  559. (list (search-path-specification
  560. (variable name)
  561. (files '("foo/bar"))))))
  562. (p0 (dummy-package "p0" (native-search-paths (sp "PATH0"))))
  563. (p1 (dummy-package "p1" (native-search-paths (sp "PATH1"))))
  564. (p2 (dummy-package "p2"
  565. (native-search-paths (sp "PATH2"))
  566. (inputs `(("p0" ,p0)))
  567. (propagated-inputs `(("p1" ,p1)))))
  568. (p3 (dummy-package "p3"
  569. (native-search-paths (sp "PATH3"))
  570. (native-inputs `(("p0" ,p0)))
  571. (propagated-inputs `(("p2" ,p2))))))
  572. (lset= string=?
  573. '("PATH1" "PATH2" "PATH3")
  574. (map search-path-specification-variable
  575. (package-transitive-native-search-paths p3)))))
  576. (test-assert "package-cross-derivation"
  577. (let ((drv (package-cross-derivation %store (dummy-package "p")
  578. "mips64el-linux-gnu")))
  579. (and (derivation? drv)
  580. (file-exists? (derivation-file-name drv)))))
  581. (test-assert "package-cross-derivation, trivial-build-system"
  582. (let ((p (package (inherit (dummy-package "p"))
  583. (build-system trivial-build-system)
  584. (arguments '(#:builder (exit 1))))))
  585. (let ((drv (package-cross-derivation %store p "mips64el-linux-gnu")))
  586. (derivation? drv))))
  587. (test-assert "package-cross-derivation, no cross builder"
  588. (let* ((b (build-system (inherit trivial-build-system)
  589. (lower (const #f))))
  590. (p (package (inherit (dummy-package "p"))
  591. (build-system b))))
  592. (guard (c ((package-cross-build-system-error? c)
  593. (eq? (package-error-package c) p)))
  594. (package-cross-derivation %store p "mips64el-linux-gnu")
  595. #f)))
  596. ;; XXX: The next two tests can trigger builds when the distro defines
  597. ;; replacements on core packages, so they're disable for lack of a better
  598. ;; solution.
  599. ;; (test-equal "package-derivation, direct graft"
  600. ;; (package-derivation %store gnu-make #:graft? #f)
  601. ;; (let ((p (package (inherit coreutils)
  602. ;; (replacement gnu-make))))
  603. ;; (package-derivation %store p #:graft? #t)))
  604. ;; (test-equal "package-cross-derivation, direct graft"
  605. ;; (package-cross-derivation %store gnu-make "mips64el-linux-gnu"
  606. ;; #:graft? #f)
  607. ;; (let ((p (package (inherit coreutils)
  608. ;; (replacement gnu-make))))
  609. ;; (package-cross-derivation %store p "mips64el-linux-gnu"
  610. ;; #:graft? #t)))
  611. (test-assert "package-grafts, indirect grafts"
  612. (let* ((new (dummy-package "dep"
  613. (arguments '(#:implicit-inputs? #f))))
  614. (dep (package (inherit new) (version "0.0")))
  615. (dep* (package (inherit dep) (replacement new)))
  616. (dummy (dummy-package "dummy"
  617. (arguments '(#:implicit-inputs? #f))
  618. (inputs `(("dep" ,dep*))))))
  619. (equal? (package-grafts %store dummy)
  620. (list (graft
  621. (origin (package-derivation %store dep))
  622. (replacement (package-derivation %store new)))))))
  623. ;; XXX: This test would require building the cross toolchain just to see if it
  624. ;; needs grafting, which is obviously too expensive, and thus disabled.
  625. ;;
  626. ;; (test-assert "package-grafts, indirect grafts, cross"
  627. ;; (let* ((new (dummy-package "dep"
  628. ;; (arguments '(#:implicit-inputs? #f))))
  629. ;; (dep (package (inherit new) (version "0.0")))
  630. ;; (dep* (package (inherit dep) (replacement new)))
  631. ;; (dummy (dummy-package "dummy"
  632. ;; (arguments '(#:implicit-inputs? #f))
  633. ;; (inputs `(("dep" ,dep*)))))
  634. ;; (target "mips64el-linux-gnu"))
  635. ;; ;; XXX: There might be additional grafts, for instance if the distro
  636. ;; ;; defines replacements for core packages like Perl.
  637. ;; (member (graft
  638. ;; (origin (package-cross-derivation %store dep target))
  639. ;; (replacement
  640. ;; (package-cross-derivation %store new target)))
  641. ;; (package-grafts %store dummy #:target target))))
  642. (test-assert "package-grafts, indirect grafts, propagated inputs"
  643. (let* ((new (dummy-package "dep"
  644. (arguments '(#:implicit-inputs? #f))))
  645. (dep (package (inherit new) (version "0.0")))
  646. (dep* (package (inherit dep) (replacement new)))
  647. (prop (dummy-package "propagated"
  648. (propagated-inputs `(("dep" ,dep*)))
  649. (arguments '(#:implicit-inputs? #f))))
  650. (dummy (dummy-package "dummy"
  651. (arguments '(#:implicit-inputs? #f))
  652. (inputs `(("prop" ,prop))))))
  653. (equal? (package-grafts %store dummy)
  654. (list (graft
  655. (origin (package-derivation %store dep))
  656. (replacement (package-derivation %store new)))))))
  657. (test-assert "package-grafts, same replacement twice"
  658. (let* ((new (dummy-package "dep"
  659. (version "1")
  660. (arguments '(#:implicit-inputs? #f))))
  661. (dep (package (inherit new) (version "0") (replacement new)))
  662. (p1 (dummy-package "intermediate1"
  663. (arguments '(#:implicit-inputs? #f))
  664. (inputs `(("dep" ,dep)))))
  665. (p2 (dummy-package "intermediate2"
  666. (arguments '(#:implicit-inputs? #f))
  667. ;; Here we copy DEP to have an equivalent package that is not
  668. ;; 'eq?' to DEP. This is similar to what happens with
  669. ;; 'package-with-explicit-inputs' & co.
  670. (inputs `(("dep" ,(package (inherit dep)))))))
  671. (p3 (dummy-package "final"
  672. (arguments '(#:implicit-inputs? #f))
  673. (inputs `(("p1" ,p1) ("p2" ,p2))))))
  674. (equal? (package-grafts %store p3)
  675. (list (graft
  676. (origin (package-derivation %store
  677. (package (inherit dep)
  678. (replacement #f))))
  679. (replacement (package-derivation %store new)))))))
  680. (test-assert "replacement also grafted"
  681. ;; We build a DAG as below, where dotted arrows represent replacements and
  682. ;; solid arrows represent dependencies:
  683. ;;
  684. ;; P1 ·············> P1R
  685. ;; |\__________________.
  686. ;; v v
  687. ;; P2 ·············> P2R
  688. ;; |
  689. ;; v
  690. ;; P3
  691. ;;
  692. ;; We want to make sure that:
  693. ;; grafts(P3) = (P1,P1R) + (P2, grafted(P2R, (P1,P1R)))
  694. ;; where:
  695. ;; (A,B) is a graft to replace A by B
  696. ;; grafted(DRV,G) denoted DRV with graft G applied
  697. (let* ((p1r (dummy-package "P1"
  698. (build-system trivial-build-system)
  699. (arguments
  700. `(#:guile ,%bootstrap-guile
  701. #:builder (let ((out (assoc-ref %outputs "out")))
  702. (mkdir out)
  703. (call-with-output-file
  704. (string-append out "/replacement")
  705. (const #t)))))))
  706. (p1 (package
  707. (inherit p1r) (name "p1") (replacement p1r)
  708. (arguments
  709. `(#:guile ,%bootstrap-guile
  710. #:builder (mkdir (assoc-ref %outputs "out"))))))
  711. (p2r (dummy-package "P2"
  712. (build-system trivial-build-system)
  713. (inputs `(("p1" ,p1)))
  714. (arguments
  715. `(#:guile ,%bootstrap-guile
  716. #:builder (let ((out (assoc-ref %outputs "out")))
  717. (mkdir out)
  718. (chdir out)
  719. (symlink (assoc-ref %build-inputs "p1") "p1")
  720. (call-with-output-file (string-append out "/replacement")
  721. (const #t)))))))
  722. (p2 (package
  723. (inherit p2r) (name "p2") (replacement p2r)
  724. (arguments
  725. `(#:guile ,%bootstrap-guile
  726. #:builder (let ((out (assoc-ref %outputs "out")))
  727. (mkdir out)
  728. (chdir out)
  729. (symlink (assoc-ref %build-inputs "p1")
  730. "p1"))))))
  731. (p3 (dummy-package "p3"
  732. (build-system trivial-build-system)
  733. (inputs `(("p2" ,p2)))
  734. (arguments
  735. `(#:guile ,%bootstrap-guile
  736. #:builder (let ((out (assoc-ref %outputs "out")))
  737. (mkdir out)
  738. (chdir out)
  739. (symlink (assoc-ref %build-inputs "p2")
  740. "p2")))))))
  741. (lset= equal?
  742. (package-grafts %store p3)
  743. (list (graft
  744. (origin (package-derivation %store p1 #:graft? #f))
  745. (replacement (package-derivation %store p1r)))
  746. (graft
  747. (origin (package-derivation %store p2 #:graft? #f))
  748. (replacement
  749. (package-derivation %store p2r #:graft? #t)))))))
  750. ;;; XXX: Nowadays 'graft-derivation' needs to build derivations beforehand to
  751. ;;; find out about their run-time dependencies, so this test is no longer
  752. ;;; applicable since it would trigger a full rebuild.
  753. ;;
  754. ;; (test-assert "package-derivation, indirect grafts"
  755. ;; (let* ((new (dummy-package "dep"
  756. ;; (arguments '(#:implicit-inputs? #f))))
  757. ;; (dep (package (inherit new) (version "0.0")))
  758. ;; (dep* (package (inherit dep) (replacement new)))
  759. ;; (dummy (dummy-package "dummy"
  760. ;; (arguments '(#:implicit-inputs? #f))
  761. ;; (inputs `(("dep" ,dep*)))))
  762. ;; (guile (package-derivation %store (canonical-package guile-2.0)
  763. ;; #:graft? #f)))
  764. ;; (equal? (package-derivation %store dummy)
  765. ;; (graft-derivation %store
  766. ;; (package-derivation %store dummy #:graft? #f)
  767. ;; (package-grafts %store dummy)
  768. ;; ;; Use the same Guile as 'package-derivation'.
  769. ;; #:guile guile))))
  770. (test-equal "package->bag"
  771. `("foo86-hurd" #f (,(package-source gnu-make))
  772. (,(canonical-package glibc)) (,(canonical-package coreutils)))
  773. (let ((bag (package->bag gnu-make "foo86-hurd")))
  774. (list (bag-system bag) (bag-target bag)
  775. (assoc-ref (bag-build-inputs bag) "source")
  776. (assoc-ref (bag-build-inputs bag) "libc")
  777. (assoc-ref (bag-build-inputs bag) "coreutils"))))
  778. (test-equal "package->bag, cross-compilation"
  779. `(,(%current-system) "foo86-hurd"
  780. (,(package-source gnu-make))
  781. (,(canonical-package glibc)) (,(canonical-package coreutils)))
  782. (let ((bag (package->bag gnu-make (%current-system) "foo86-hurd")))
  783. (list (bag-system bag) (bag-target bag)
  784. (assoc-ref (bag-build-inputs bag) "source")
  785. (assoc-ref (bag-build-inputs bag) "libc")
  786. (assoc-ref (bag-build-inputs bag) "coreutils"))))
  787. (test-assert "package->bag, propagated inputs"
  788. (let* ((dep (dummy-package "dep"))
  789. (prop (dummy-package "prop"
  790. (propagated-inputs `(("dep" ,dep)))))
  791. (dummy (dummy-package "dummy"
  792. (inputs `(("prop" ,prop)))))
  793. (inputs (bag-transitive-inputs (package->bag dummy #:graft? #f))))
  794. (match (assoc "dep" inputs)
  795. (("dep" package)
  796. (eq? package dep)))))
  797. (test-assert "bag->derivation"
  798. (parameterize ((%graft? #f))
  799. (let ((bag (package->bag gnu-make))
  800. (drv (package-derivation %store gnu-make)))
  801. (parameterize ((%current-system "foox86-hurd")) ;should have no effect
  802. (equal? drv (bag->derivation %store bag))))))
  803. (test-assert "bag->derivation, cross-compilation"
  804. (parameterize ((%graft? #f))
  805. (let* ((target "mips64el-linux-gnu")
  806. (bag (package->bag gnu-make (%current-system) target))
  807. (drv (package-cross-derivation %store gnu-make target)))
  808. (parameterize ((%current-system "foox86-hurd") ;should have no effect
  809. (%current-target-system "foo64-linux-gnu"))
  810. (equal? drv (bag->derivation %store bag))))))
  811. (when (or (not (network-reachable?)) (shebang-too-long?))
  812. (test-skip 1))
  813. (test-assert "GNU Make, bootstrap"
  814. ;; GNU Make is the first program built during bootstrap; we choose it
  815. ;; here so that the test doesn't last for too long.
  816. (let ((gnu-make (@@ (gnu packages commencement) gnu-make-boot0)))
  817. (and (package? gnu-make)
  818. (or (location? (package-location gnu-make))
  819. (not (package-location gnu-make)))
  820. (let* ((drv (package-derivation %store gnu-make))
  821. (out (derivation->output-path drv)))
  822. (and (build-derivations %store (list drv))
  823. (file-exists? (string-append out "/bin/make")))))))
  824. (test-equal "package-mapping"
  825. 42
  826. (let* ((dep (dummy-package "chbouib"
  827. (native-inputs `(("x" ,grep)))))
  828. (p0 (dummy-package "example"
  829. (inputs `(("foo" ,coreutils)
  830. ("bar" ,grep)
  831. ("baz" ,dep)))))
  832. (transform (lambda (p)
  833. (package (inherit p) (source 42))))
  834. (rewrite (package-mapping transform))
  835. (p1 (rewrite p0)))
  836. (and (eq? p1 (rewrite p0))
  837. (eqv? 42 (package-source p1))
  838. (match (package-inputs p1)
  839. ((("foo" dep1) ("bar" dep2) ("baz" dep3))
  840. (and (eq? dep1 (rewrite coreutils)) ;memoization
  841. (eq? dep2 (rewrite grep))
  842. (eq? dep3 (rewrite dep))
  843. (eqv? 42
  844. (package-source dep1) (package-source dep2)
  845. (package-source dep3))
  846. (match (package-native-inputs dep3)
  847. ((("x" dep))
  848. (and (eq? dep (rewrite grep))
  849. (package-source dep))))))))))
  850. (test-assert "package-input-rewriting"
  851. (let* ((dep (dummy-package "chbouib"
  852. (native-inputs `(("x" ,grep)))))
  853. (p0 (dummy-package "example"
  854. (inputs `(("foo" ,coreutils)
  855. ("bar" ,grep)
  856. ("baz" ,dep)))))
  857. (rewrite (package-input-rewriting `((,coreutils . ,sed)
  858. (,grep . ,findutils))
  859. (cut string-append "r-" <>)))
  860. (p1 (rewrite p0))
  861. (p2 (rewrite p0)))
  862. (and (not (eq? p1 p0))
  863. (eq? p1 p2) ;memoization
  864. (string=? "r-example" (package-name p1))
  865. (match (package-inputs p1)
  866. ((("foo" dep1) ("bar" dep2) ("baz" dep3))
  867. (and (eq? dep1 sed)
  868. (eq? dep2 findutils)
  869. (string=? (package-name dep3) "r-chbouib")
  870. (eq? dep3 (rewrite dep)) ;memoization
  871. (match (package-native-inputs dep3)
  872. ((("x" dep))
  873. (eq? dep findutils)))))))))
  874. (test-eq "fold-packages" hello
  875. (fold-packages (lambda (p r)
  876. (if (string=? (package-name p) "hello")
  877. p
  878. r))
  879. #f))
  880. (test-assert "fold-packages, hidden package"
  881. ;; There are two public variables providing "guile@2.0" ('guile-final' in
  882. ;; commencement.scm and 'guile-2.0' in guile.scm), but only the latter
  883. ;; should show up.
  884. (match (fold-packages (lambda (p r)
  885. (if (and (string=? (package-name p) "guile")
  886. (string-prefix? "2.0"
  887. (package-version p)))
  888. (cons p r)
  889. r))
  890. '())
  891. ((one)
  892. (eq? one guile-2.0))))
  893. (test-assert "find-packages-by-name"
  894. (match (find-packages-by-name "hello")
  895. (((? (cut eq? hello <>))) #t)
  896. (wrong (pk 'find-packages-by-name wrong #f))))
  897. (test-assert "find-packages-by-name with version"
  898. (match (find-packages-by-name "hello" (package-version hello))
  899. (((? (cut eq? hello <>))) #t)
  900. (wrong (pk 'find-packages-by-name wrong #f))))
  901. (test-assert "--search-paths with pattern"
  902. ;; Make sure 'guix package --search-paths' correctly reports environment
  903. ;; variables when file patterns are used (in particular, it must follow
  904. ;; symlinks when looking for 'catalog.xml'.) To do that, we rely on the
  905. ;; libxml2 package specification, which contains such a definition.
  906. (let* ((p1 (package
  907. (name "foo") (version "0") (source #f)
  908. (build-system trivial-build-system)
  909. (arguments
  910. `(#:guile ,%bootstrap-guile
  911. #:modules ((guix build utils))
  912. #:builder (begin
  913. (use-modules (guix build utils))
  914. (let ((out (assoc-ref %outputs "out")))
  915. (mkdir-p (string-append out "/xml/bar/baz"))
  916. (call-with-output-file
  917. (string-append out "/xml/bar/baz/catalog.xml")
  918. (lambda (port)
  919. (display "xml? wat?!" port)))))))
  920. (synopsis #f) (description #f)
  921. (home-page #f) (license #f)))
  922. (p2 (package
  923. ;; Provide a fake libxml2 to avoid building the real one. This
  924. ;; is OK because 'guix package' gets search path specifications
  925. ;; from the same-named package found in the distro.
  926. (name "libxml2") (version "0.0.0") (source #f)
  927. (build-system trivial-build-system)
  928. (arguments
  929. `(#:guile ,%bootstrap-guile
  930. #:builder (mkdir (assoc-ref %outputs "out"))))
  931. (native-search-paths (package-native-search-paths libxml2))
  932. (synopsis #f) (description #f)
  933. (home-page #f) (license #f)))
  934. (prof (run-with-store %store
  935. (profile-derivation
  936. (manifest (map package->manifest-entry
  937. (list p1 p2)))
  938. #:hooks '()
  939. #:locales? #f)
  940. #:guile-for-build (%guile-for-build))))
  941. (build-derivations %store (list prof))
  942. (string-match (format #f "^export XML_CATALOG_FILES=\"~a/xml/+bar/baz/catalog\\.xml\"\n"
  943. (regexp-quote (derivation->output-path prof)))
  944. (with-output-to-string
  945. (lambda ()
  946. (guix-package "-p" (derivation->output-path prof)
  947. "--search-paths"))))))
  948. (test-assert "--search-paths with single-item search path"
  949. ;; Make sure 'guix package --search-paths' correctly reports environment
  950. ;; variables for things like 'GIT_SSL_CAINFO' that have #f as their
  951. ;; separator, meaning that the first match wins.
  952. (let* ((p1 (dummy-package "foo"
  953. (build-system trivial-build-system)
  954. (arguments
  955. `(#:guile ,%bootstrap-guile
  956. #:modules ((guix build utils))
  957. #:builder (begin
  958. (use-modules (guix build utils))
  959. (let ((out (assoc-ref %outputs "out")))
  960. (mkdir-p (string-append out "/etc/ssl/certs"))
  961. (call-with-output-file
  962. (string-append
  963. out "/etc/ssl/certs/ca-certificates.crt")
  964. (const #t))))))))
  965. (p2 (package (inherit p1) (name "bar")))
  966. (p3 (dummy-package "git"
  967. ;; Provide a fake Git to avoid building the real one.
  968. (build-system trivial-build-system)
  969. (arguments
  970. `(#:guile ,%bootstrap-guile
  971. #:builder (mkdir (assoc-ref %outputs "out"))))
  972. (native-search-paths (package-native-search-paths git))))
  973. (prof1 (run-with-store %store
  974. (profile-derivation
  975. (packages->manifest (list p1 p3))
  976. #:hooks '()
  977. #:locales? #f)
  978. #:guile-for-build (%guile-for-build)))
  979. (prof2 (run-with-store %store
  980. (profile-derivation
  981. (packages->manifest (list p2 p3))
  982. #:hooks '()
  983. #:locales? #f)
  984. #:guile-for-build (%guile-for-build))))
  985. (build-derivations %store (list prof1 prof2))
  986. (string-match (format #f "^export GIT_SSL_CAINFO=\"~a/etc/ssl/certs/ca-certificates.crt"
  987. (regexp-quote (derivation->output-path prof1)))
  988. (with-output-to-string
  989. (lambda ()
  990. (guix-package "-p" (derivation->output-path prof1)
  991. "-p" (derivation->output-path prof2)
  992. "--search-paths"))))))
  993. (test-equal "specification->package when not found"
  994. 'quit
  995. (catch 'quit
  996. (lambda ()
  997. ;; This should call 'leave', producing an error message.
  998. (specification->package "this-package-does-not-exist"))
  999. (lambda (key . args)
  1000. key)))
  1001. (test-end "packages")
  1002. ;;; Local Variables:
  1003. ;;; eval: (put 'dummy-package 'scheme-indent-function 1)
  1004. ;;; End: