From 0553c4447115f7be208fe3e7e29e365ecb74a564 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 18 Jul 2024 12:19:34 +0200 Subject: guix build: Take ‘--system’ into account together with ‘-S’. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * guix/scripts/build.scm (options->derivations)[compute-derivation]: Pass ‘system’ to ‘package-source-derivation’. * tests/guix-build.sh: Test ‘-S’ together with ‘-s’. Change-Id: If35f116285dd9caaf939221163ad0ba831eea993 --- guix/scripts/build.scm | 4 ++-- tests/guix-build.sh | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm index da4859eeaa..cd6b847a57 100644 --- a/guix/scripts/build.scm +++ b/guix/scripts/build.scm @@ -678,9 +678,9 @@ build." (package-name p)) '()) (s - (list (package-source-derivation store s))))) + (list (package-source-derivation store s system))))) (proc - (map (cut package-source-derivation store <>) + (map (cut package-source-derivation store <> system) (proc p)))))) ((? derivation? drv) (list drv)) diff --git a/tests/guix-build.sh b/tests/guix-build.sh index 4eab0e38b6..36eac2b7e0 100644 --- a/tests/guix-build.sh +++ b/tests/guix-build.sh @@ -1,5 +1,5 @@ # GNU Guix --- Functional package management for GNU -# Copyright © 2012-2014, 2016-2023 Ludovic Courtès +# Copyright © 2012-2014, 2016-2024 Ludovic Courtès # Copyright © 2020 Marius Bakke # Copyright © 2021 Chris Marusich # @@ -161,6 +161,10 @@ export GUIX_PACKAGE_PATH guix build -d -S foo guix build -d -S foo | grep -e 'foo\.tar\.gz' +# Make sure '-s' has an effect together with '-S'. +test "$(guix build -Sd coreutils -s x86_64-linux)" \ + != "$(guix build -Sd coreutils -s aarch64-linux)" + # 'baz' has a replacement so we should be getting the replacement's source. (unset GUIX_BUILD_OPTIONS; test "`guix build -d -S baz`" = "`guix build -d -S foo`") -- cgit v1.2.3