From 98c075c24e26798ef52ab66641faa7b0aa87726b Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 1 Jul 2021 21:30:46 +0200 Subject: packages: 'package-derivation' honors 'system' again. Fixes a regression introduced in 7d873f194ca69d6096d28d7a224ab78e83e34fe1. Starting from 7d873f194ca69d6096d28d7a224ab78e83e34fe1, running guix build -s aarch64-linux sed on an x86_64-linux machine would return an x86_64-linux machine, whereby only the top derivation of the graph would be aarch64-linux while all its dependencies would be x86_64-linux. * guix/packages.scm (expand-input): Add 'system' parameter and honor it. (bag->derivation, bag->cross-derivation): Pass SYSTEM to 'expand-input'. * tests/packages.scm ("package-derivation, different system"): New test. --- tests/packages.scm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tests/packages.scm') diff --git a/tests/packages.scm b/tests/packages.scm index 47d10af5bc..47fc34d3ce 100644 --- a/tests/packages.scm +++ b/tests/packages.scm @@ -717,6 +717,21 @@ (string=? (derivation-file-name (package-derivation %store p0)) (derivation-file-name (package-derivation %store p1))))) +(test-assert "package-derivation, different system" + ;; Make sure the 'system' argument of 'package-derivation' is respected. + (let* ((system (if (string=? (%current-system) "x86_64-linux") + "aarch64-linux" + "x86_64-linux")) + (drv (package-derivation %store (dummy-package "p") + system #:graft? #f))) + (define right-system? + (mlambdaq (drv) + (and (string=? (derivation-system drv) system) + (every (compose right-system? derivation-input-derivation) + (derivation-inputs drv))))) + + (right-system? drv))) + (test-assert "package-output" (let* ((package (dummy-package "p")) (drv (package-derivation %store package))) -- cgit 1.4.1