GNU bug report logs - #57704
[PATCH core-updates] guix: packages: Remove #f from inputs when sanitizing.

Previous Next

Package: guix-patches;

Reported by: Liliana Marie Prikler <liliana.prikler <at> gmail.com>

Date: Fri, 9 Sep 2022 16:03:02 UTC

Severity: normal

Tags: moreinfo, patch

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
To: guix-patches <at> gnu.org
Subject: [PATCH core-updates] guix: packages: Remove #f from inputs when
 sanitizing.
Date: Fri, 9 Sep 2022 17:56:20 +0200
This makes it so that new-style inputs can be optional using regular Guile
patterns, e.g. (and (target-x86-64?) rust).

* guix/packages.scm (sanitize-inputs): Filter inputs by identity before adding
labels.
---
Note that this patch was prepared using master, but since it affects the
package record, it needs to go to core-updates.  I don' think there should
be a merge conflict here.

 guix/packages.scm | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/guix/packages.scm b/guix/packages.scm
index 94e464cd01..5bb2e81e18 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -430,11 +430,12 @@ (define %cuirass-supported-systems
 (define-inlinable (sanitize-inputs inputs)
   "Sanitize INPUTS by turning it into a list of name/package tuples if it's
 not already the case."
-  (cond ((null? inputs) inputs)
-        ((and (pair? (car inputs))
-              (string? (caar inputs)))
-         inputs)
-        (else (map add-input-label inputs))))
+  (let ((inputs (filter identity inputs)))
+    (cond ((null? inputs) inputs)
+          ((and (pair? (car inputs))
+                (string? (caar inputs)))
+           inputs)
+          (else (map add-input-label inputs)))))
 
 (define-syntax current-location-vector
   (lambda (s)
-- 
2.37.2





This bug report was last modified 1 year and 145 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.