summary refs log tree commit diff
path: root/gnu/packages/linux.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2022-05-26 12:22:59 +0200
committerLudovic Courtès <ludo@gnu.org>2022-05-26 12:22:59 +0200
commit2262ee2c63fd92a17836ff7450623db76ed39d92 (patch)
treeae5d9a475347e1e8783918068471353a3dc0fe99 /gnu/packages/linux.scm
parentd90bd5642a3663cc7d5124068fadbf8fa28b3207 (diff)
downloadguix-2262ee2c63fd92a17836ff7450623db76ed39d92.tar.gz
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.
Diffstat (limited to 'gnu/packages/linux.scm')
-rw-r--r--gnu/packages/linux.scm14
1 files changed, 8 insertions, 6 deletions
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)