mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 07:26:13 -05:00
gexp: 'computed-file' always uses a native Guile.
Fixes a regression whereby, when cross-compiling, 'computed-file' would
use a cross-compiled Guile as its builder, which would fail to run.
Regression introduced in af57d1bf6c
(the
problem had always been there but was hidden before behind the (not guile)
condition.)
* guix/gexp.scm (computed-file-compiler): For 'guile', pass #:target #f.
* tests/gexp.scm ("lower-object, computed-file, #:target"): New test.
This commit is contained in:
parent
7d580f1c2c
commit
7f6dd3be3d
2 changed files with 23 additions and 1 deletions
|
@ -598,7 +598,7 @@ (define-gexp-compiler (computed-file-compiler (file <computed-file>)
|
|||
(match file
|
||||
(($ <computed-file> name gexp guile options)
|
||||
(mlet %store-monad ((guile (lower-object (or guile (default-guile))
|
||||
system #:target target)))
|
||||
system #:target #f)))
|
||||
(apply gexp->derivation name gexp #:guile-for-build guile
|
||||
#:system system #:target target options)))))
|
||||
|
||||
|
|
|
@ -1539,6 +1539,28 @@ (define (contents=? file str)
|
|||
(cons (derivation-file-name drv)
|
||||
refs))))))))
|
||||
|
||||
(test-assertm "lower-object, computed-file, #:target"
|
||||
(let* ((target "i586-pc-gnu")
|
||||
(computed (computed-file "computed-cross"
|
||||
#~(symlink #$coreutils output)
|
||||
#:guile (default-guile))))
|
||||
;; When lowered to TARGET, the derivation of COMPUTED should run natively,
|
||||
;; using a native Guile, but it should refer to the target COREUTILS.
|
||||
(mlet* %store-monad ((drv (lower-object computed (%current-system)
|
||||
#:target target))
|
||||
(refs (references* (derivation-file-name drv)))
|
||||
(guile (lower-object (default-guile)
|
||||
(%current-system)
|
||||
#:target #f))
|
||||
(cross (lower-object coreutils #:target target))
|
||||
(native (lower-object coreutils #:target #f)))
|
||||
(return (and (string=? (derivation-system (pk 'drv drv)) (%current-system))
|
||||
(string=? (derivation-builder drv)
|
||||
(string-append (derivation->output-path guile)
|
||||
"/bin/guile"))
|
||||
(not (member (derivation-file-name native) refs))
|
||||
(member (derivation-file-name cross) refs))))))
|
||||
|
||||
(test-assert "lower-object & gexp-input-error?"
|
||||
(guard (c ((gexp-input-error? c)
|
||||
(gexp-error-invalid-input c)))
|
||||
|
|
Loading…
Reference in a new issue