From 9fc4e94986e68e0e33b260e2389765e2d3b7dd07 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 3 Mar 2021 12:27:18 +0100 Subject: gexp: #:references-graphs refers to non-native derivations. Fixes a regression introduced in c6d6aee6659acb293eb33f498fdac3b47a19a48, where #:reference-graphs would end up referring to native inputs. This would notably break the compilation of systems using a childhurd, because they would attempt to build the 'hurd' package natively. * guix/gexp.scm (lower-reference-graphs)[tuple->gexp-input]: Honor TARGET. * tests/gexp.scm ("gexp->derivation #:references-graphs cross-compilation"): New test. --- tests/gexp.scm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tests/gexp.scm') diff --git a/tests/gexp.scm b/tests/gexp.scm index a30d0ff6b4..834e78b9a0 100644 --- a/tests/gexp.scm +++ b/tests/gexp.scm @@ -1095,6 +1095,22 @@ (define (matching-input drv output) (call-with-input-file g-guile read) (list (derivation->output-path guile-drv) bash)))))) +(test-assertm "gexp->derivation #:references-graphs cross-compilation" + ;; The objects passed in #:references-graphs implicitly refer to + ;; cross-compiled derivations. Make sure this is the case. + (mlet* %store-monad ((drv1 (lower-object coreutils (%current-system) + #:target "i586-pc-gnu")) + (drv2 (lower-object coreutils (%current-system) + #:target #f)) + (drv3 (gexp->derivation "three" + #~(symlink #$coreutils #$output) + #:target "i586-pc-gnu" + #:references-graphs + `(("coreutils" ,coreutils)))) + (refs (references* (derivation-file-name drv3)))) + (return (and (member (derivation-file-name drv1) refs) + (not (member (derivation-file-name drv2) refs)))))) + (test-assertm "gexp->derivation #:allowed-references" (mlet %store-monad ((drv (gexp->derivation "allowed-refs" #~(begin -- cgit v1.2.3