From 2262ee2c63fd92a17836ff7450623db76ed39d92 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 26 May 2022 12:22:59 +0200 Subject: gnu: linux-libre: Do not call 'configuration-file' on non-Linux targets. Starting from commit b55310603f0df7d5ae02d47cb8d4be58bf1d41ca, a command like: guix build linux-libre -s i586-gnu -n would crash on a wrong-type-arg error in 'kernel-config' because it was getting #f as the 'arch' argument. This commit fixes it. * gnu/packages/linux.scm (make-linux-libre*)[inputs]: Check whether 'platform-linux-architecture' returns #f, as is the case for example on i586-gnu, before calling CONFIGURATION-FILE. --- gnu/packages/linux.scm | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'gnu/packages/linux.scm') diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index bd24fce432..18bd229dcf 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -793,12 +793,14 @@ for ARCH and optionally VARIANT, or #f if there is no such configuration." ("mpfr" ,mpfr) ("mpc" ,mpc) - ,@(match (and configuration-file - (configuration-file - (platform-linux-architecture - (lookup-platform-by-target-or-system - (or (%current-target-system) (%current-system)))) - #:variant (version-major+minor version))) + ,@(match (let ((arch (platform-linux-architecture + (lookup-platform-by-target-or-system + (or (%current-target-system) + (%current-system)))))) + (and configuration-file arch + (configuration-file + arch + #:variant (version-major+minor version)))) (#f ;no config for this platform '()) ((? string? config) -- cgit v1.2.3