From e85d4cecbe253e59a8a2a42b6ce427d96ff10534 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 11 Apr 2020 00:12:09 +0200 Subject: gnu: commencement: Memoize packages as a function of the system. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previous, things like 'ld-wrapper-boot0' would be memoized with (mlambda () …). However, the definition of 'ld-wrapper-boot0' depends on the result of (%boot0-inputs), which is itself a function of (%current-system). Thus, if one first calls: (parameterize ((%current-system "x86_64-linux")) (ld-wrapper-boot0)) then, in all subsequent calls to 'ld-wrapper-boot0', the value of (%current-system) would be ignored because the result is already memoized. Concretely, 'ld-wrapper-boot0' would always have the dependencies it has on x86_64-linux, even though they are different than those on armhf-linux, say ("bash-mesboot" vs. "bootstrap-binaries"). Fixes . Reported by Marius Bakke . * gnu/packages/commencement.scm (define/system-dependent): New macro. (linux-libre-headers-boot0, hurd-core-headers-boot0, ld-wrapper-boot0) (gcc-boot0-intermediate-wrapped, gcc-boot0-wrapped, ld-wrapper-boot3): Define using 'define/system-dependent' instead of 'define' + 'mlambda'. Adjust users so they no longer look like procedure calls. * tests/guix-build.sh: Add test. --- tests/guix-build.sh | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests') diff --git a/tests/guix-build.sh b/tests/guix-build.sh index 1a997de487..6c08857358 100644 --- a/tests/guix-build.sh +++ b/tests/guix-build.sh @@ -65,6 +65,12 @@ test `guix build sed -s x86_64-linux -d | wc -l` = 1 all_systems="-s x86_64-linux -s i686-linux -s armhf-linux -s aarch64-linux" test `guix build sed $all_systems -d | sort -u | wc -l` = 4 +# Check there's no weird memoization effect leading to erroneous results. +# See . +drv1="`guix build sed -s x86_64-linux -s armhf-linux -d | sort`" +drv2="`guix build sed -s armhf-linux -s x86_64-linux -d | sort`" +test "$drv1" = "$drv2" + # Check --sources option with its arguments module_dir="t-guix-build-$$" mkdir "$module_dir" -- cgit 1.4.1