From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id KMv0JqizG2PmPAEAbAwnHQ (envelope-from ) for ; Fri, 09 Sep 2022 23:44:08 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id gGIKJ6izG2NQnAAA9RJhRA (envelope-from ) for ; Fri, 09 Sep 2022 23:44:08 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 28E5C3DE47 for ; Fri, 9 Sep 2022 23:44:08 +0200 (CEST) Received: from localhost ([::1]:55984 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oWlnC-0004aY-Rc for larch@yhetil.org; Fri, 09 Sep 2022 17:44:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44872) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oWln8-0004aQ-HL for guix-patches@gnu.org; Fri, 09 Sep 2022 17:44:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:47154) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oWln8-0002pa-8V for guix-patches@gnu.org; Fri, 09 Sep 2022 17:44:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oWln7-000601-NB for guix-patches@gnu.org; Fri, 09 Sep 2022 17:44:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57704] [PATCH v2] guix: packages: Remove #f from inputs when sanitizing. References: In-Reply-To: Resent-From: Liliana Marie Prikler Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 09 Sep 2022 21:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57704 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57704@debbugs.gnu.org Cc: Maxime Devos Received: via spool by 57704-submit@debbugs.gnu.org id=B57704.166275981223015 (code B ref 57704); Fri, 09 Sep 2022 21:44:01 +0000 Received: (at 57704) by debbugs.gnu.org; 9 Sep 2022 21:43:32 +0000 Received: from localhost ([127.0.0.1]:35853 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oWlme-0005z8-98 for submit@debbugs.gnu.org; Fri, 09 Sep 2022 17:43:32 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:42600) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oWlmZ-0005yr-Pi for 57704@debbugs.gnu.org; Fri, 09 Sep 2022 17:43:31 -0400 Received: by mail-ed1-f66.google.com with SMTP id q21so4453091edc.9 for <57704@debbugs.gnu.org>; Fri, 09 Sep 2022 14:43:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:content-transfer-encoding:cc:to:subject :date:from:from:to:cc:subject:date; bh=2g0B9wpBwCQIWmq+mHMAxM69ABYApHTbquSBC2cqzZ0=; b=UVCNTSdb9wl6TSb89BXyJBs0u0EFsiJQAADv4E/lY7EwVFgHNb7qPXhelezbzbI1yB ZPXqvVKdFhlz+iukZliiGtymEwfwiQy/btKojl7msRxWzzG984gh3FP9I06gdN+u0Owz 8dThTqYBh9xyXz7pjjibei7eU5jyoP8miuWpS3a7s0T6d9jkEtuzNfGzquHUble+dk1J KnHZa0rHj1zYYoEFdftaffSJLKQ7Uvkre/8zH5MS6KGCE0kMlbW9KtnBQgKNOiVTB9th UDYujwcfBUqGx0S5DUI0AdpW9ACTtdFvhji8RKB3KhLukMhgYLFwsTbB5EszWl1fDRjd o7SQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:content-transfer-encoding:cc:to:subject :date:from:x-gm-message-state:from:to:cc:subject:date; bh=2g0B9wpBwCQIWmq+mHMAxM69ABYApHTbquSBC2cqzZ0=; b=tWAwJAQ7a7Mbp0is0HhfRydKLL8vD1HivyaIvQVzbwt6AajwEckBfIEk2E+CIcCkCy 9xy0h8hAwVKYuGjN2z3m89alFpIhJ7RViss9Il0aO08s4SDmXDlpmNMIL2weYab0e5rN P+vIrFQLgTtdiakmbokhrmBbuH+8cdYrVEuiQdpI004zuZp0vDcbNXXAS64LlcEXn2bT 51xpn2z09hfDEKD/IGiZB4HUwPqFJIt3ssUx/NxKxOFq3dKARok9DLj/E5+T94lHLXtr Dfwahjv0rx6UYKg01Wmg+pa0oYiSIQJ/EZ/TZKeUK2NLvZZX0PdUb+H0bTkNrEGbnXDD UmBQ== X-Gm-Message-State: ACgBeo1D1gJtcg7k8hrIZ3PEC9v7j2WP4Dkrjw9emC7MYaxecnzmwJIB dBWFpXT7AjwAvM6tLr8qROo4TMq61oQ= X-Google-Smtp-Source: AA6agR564hMwwDJhsqKNc1bpq/XkDqWkrDKpG+f9GqoyFF32Ah5u+gTyheUd1TD6d4wYQf652W14dQ== X-Received: by 2002:a05:6402:2b8d:b0:43a:5410:a9fc with SMTP id fj13-20020a0564022b8d00b0043a5410a9fcmr13305955edb.99.1662759801653; Fri, 09 Sep 2022 14:43:21 -0700 (PDT) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id g1-20020a17090604c100b0073da4b623e8sm781292eja.152.2022.09.09.14.43.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Sep 2022 14:43:21 -0700 (PDT) From: Liliana Marie Prikler Date: Fri, 9 Sep 2022 17:56:20 +0200 Content-Transfer-Encoding: 7bit Message-ID: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1662759848; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=2g0B9wpBwCQIWmq+mHMAxM69ABYApHTbquSBC2cqzZ0=; b=NI+SotCEOt2B2kgT/LP6SySEHli708hUijEUT8Qikagbh/l0VE6xu49iQ9qsvOWYHKSQtw PcEfAsT2KI+7LBf5A6WC1Pn6jGIU4XIUpvnGdPH/YjSCBDBGzrkA+gi0ZJycQ2lOV24ajq X6eTUgYucld3wTwMYQuyuwOq8t2c0SMmCXxI3lgX4h73SVLncCeHyOeM0JxWagSr+bVhHb fldoifHXneXqK3PMMfhfYk5ufQRwOms+xTb/lV0GdrjHKAGIynNcNLAk8iYTBsGCR3JfRS Hov2dtv2qLFkTBTbhRHPah77J9T540KNiAC1k+CMqZQlBrycX0jXmGLvPmozJQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1662759848; a=rsa-sha256; cv=none; b=AiSFcul42HeIZxo8T6utsB6CeQtqZJ/qquiSYqDk9wM43pf06LTvnLv7W6x1DHjPDhgk81 eDt3YKkbqpjcElWGIY5IZSUWlYh2CtlVj2K+d52SmKvXaiT9HSdYXqtKyOrttMMafWh0xV eXFjkkKS5/Xm768ySqNlOPCbkfXXCWUr9eLs7CAJUvsCCreq+6p4tA000ejpGhwVL3BfQR PWJXSP4MAop04OEbRD/HXTpH14tNmFOSw5ATyjP/LaMCxEI2kynyuweO+h7Oxo78lsVArF zAxllSlS9DBmk440d4kqaXiFxexP0CctS6AvZbNCpBB224r4anGlMU0EzznSHg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=UVCNTSdb; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 7.71 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=UVCNTSdb; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 28E5C3DE47 X-Spam-Score: 7.71 X-Migadu-Scanner: scn1.migadu.com X-TUID: L5G+TgIQb8+8 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. --- As noted by Maxime, this doesn't seem to be cause any rebuilds, so retargeting master. Also added missing documentation. guix/packages.scm | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/guix/packages.scm b/guix/packages.scm index 94e464cd01..7569380610 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -428,13 +428,14 @@ (define %cuirass-supported-systems (fold delete %supported-systems '("mips64el-linux" "powerpc-linux" "riscv64-linux"))) (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)))) + "Sanitize INPUTS by removing falsy elements and turning it into a list of +name/package tuples if it's not already the case." + (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