From patchwork Fri Sep 9 15:56:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liliana Marie Prikler X-Patchwork-Id: 42425 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 1397C27BBEA; Fri, 9 Sep 2022 22:44:11 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id D043627BBE9 for ; Fri, 9 Sep 2022 22:44:10 +0100 (BST) Received: from localhost ([::1]:55984 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oWlnG-0004aY-09 for patchwork@mira.cbaines.net; Fri, 09 Sep 2022 17:44:10 -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 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+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches 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)