mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-11 21:59:08 -05:00
monads: 'package-file' uses '%current-system' at '>>=' time.
* guix/monads.scm (package-file): Leave #:system to #f by default. * tests/monads.scm ("package-file, default system"): New test.
This commit is contained in:
parent
4231f05bbc
commit
c90ddc8f81
2 changed files with 15 additions and 2 deletions
|
@ -379,8 +379,7 @@ (define* (interned-file file #:optional name
|
|||
(define* (package-file package
|
||||
#:optional file
|
||||
#:key
|
||||
(system (%current-system))
|
||||
(output "out") target)
|
||||
system (output "out") target)
|
||||
"Return as a monadic value the absolute file name of FILE within the
|
||||
OUTPUT directory of PACKAGE. When FILE is omitted, return the name of the
|
||||
OUTPUT directory of PACKAGE. When TARGET is true, use it as a
|
||||
|
|
|
@ -109,6 +109,20 @@ (define (g x)
|
|||
guile)))
|
||||
#:guile-for-build (package-derivation %store %bootstrap-guile)))
|
||||
|
||||
(test-assert "package-file, default system"
|
||||
;; The default system should be the one at '>>=' time, not the one at
|
||||
;; invocation time. See <http://bugs.gnu.org/18002>.
|
||||
(run-with-store %store
|
||||
(mlet* %store-monad
|
||||
((system -> (%current-system))
|
||||
(file (parameterize ((%current-system "foobar64-linux"))
|
||||
(package-file coreutils "bin/ls")))
|
||||
(cu (package->derivation coreutils)))
|
||||
(return (string=? file
|
||||
(string-append (derivation->output-path cu)
|
||||
"/bin/ls"))))
|
||||
#:guile-for-build (package-derivation %store %bootstrap-guile)))
|
||||
|
||||
(test-assert "package-file + package->cross-derivation"
|
||||
(run-with-store %store
|
||||
(mlet* %store-monad ((file (package-file coreutils "bin/ls"
|
||||
|
|
Loading…
Reference in a new issue