Message ID | b1b6504d725df23dc910cb04591a203979cdca7b.camel@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org> X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id AA57327BBEA; Fri, 9 Sep 2022 17:08:38 +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 6AE0727BBE9 for <patchwork@mira.cbaines.net>; Fri, 9 Sep 2022 17:08:38 +0100 (BST) Received: from localhost ([::1]:41342 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org>) id 1oWgYX-0003Zf-Kv for patchwork@mira.cbaines.net; Fri, 09 Sep 2022 12:08:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35978) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1oWgT8-0006yu-Vq for guix-patches@gnu.org; Fri, 09 Sep 2022 12:03:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:46409) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1oWgT8-00026D-LE for guix-patches@gnu.org; Fri, 09 Sep 2022 12:03:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1oWgT8-0006kO-Fx for guix-patches@gnu.org; Fri, 09 Sep 2022 12:03:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57704] [PATCH core-updates] guix: packages: Remove #f from inputs when sanitizing. Resent-From: Liliana Marie Prikler <liliana.prikler@gmail.com> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org> Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 09 Sep 2022 16:03:02 +0000 Resent-Message-ID: <handler.57704.B.166273935525898@debbugs.gnu.org> Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 57704 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57704@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.166273935525898 (code B ref -1); Fri, 09 Sep 2022 16:03:02 +0000 Received: (at submit) by debbugs.gnu.org; 9 Sep 2022 16:02:35 +0000 Received: from localhost ([127.0.0.1]:35108 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>) id 1oWgSh-0006jd-Fu for submit@debbugs.gnu.org; Fri, 09 Sep 2022 12:02:35 -0400 Received: from lists.gnu.org ([209.51.188.17]:36820) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <liliana.prikler@gmail.com>) id 1oWgSd-0006jT-KJ for submit@debbugs.gnu.org; Fri, 09 Sep 2022 12:02:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52312) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <liliana.prikler@gmail.com>) id 1oWgSb-0006Ck-Sc for guix-patches@gnu.org; Fri, 09 Sep 2022 12:02:31 -0400 Received: from mail-ed1-x542.google.com ([2a00:1450:4864:20::542]:41966) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <liliana.prikler@gmail.com>) id 1oWgSa-000224-AU for guix-patches@gnu.org; Fri, 09 Sep 2022 12:02:29 -0400 Received: by mail-ed1-x542.google.com with SMTP id z97so3196574ede.8 for <guix-patches@gnu.org>; Fri, 09 Sep 2022 09:02: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:to:subject:date :from:from:to:cc:subject:date; bh=T7NXtGAp8UgfAsTmf5v9aIVnSAEoUIQua0GG65/nrpk=; b=p7VEEa0FQSOMGgwfSjHY/1vED3OIHFq9psFv6aM99EioY2rcSMr/9iAp3FdUawilsT ienbtzUdjRbY8E9h0u3oc7C8QAXeDQDIiVGG217n9j5B4m6GPtcXKhE52rGDOm1GCpN5 bamJu52Eq76hGDq/OFNTxJDvK6SgKsen0IWLBbuxvWYDMq0Jf1USMTPD/P1IIGXImOo1 wuhMouKqsv0QuQX3eLeR+BIGVzoRyzhHGad8XJFEwI6iAhqO6YcvAVNbQEw9dFap3fdR jJGJ1zBYETV74eLizEBIVGP/y4DT88QMDwLMriqsig9w0MSiZeJAqLD2ulRzXwGrk0yj hxDw== 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:to:subject:date :from:x-gm-message-state:from:to:cc:subject:date; bh=T7NXtGAp8UgfAsTmf5v9aIVnSAEoUIQua0GG65/nrpk=; b=APcERgrg0zB+EEck6y27zyBiG0l9fk0NmLBizsCBuJTDYy69RWcBuj0CP/P0l5iu7R pW1wlITd67it4+au4sF3Rfl3oZrH+paIsOOjuTm9YJIYo9mNZhOp9yg0ciK//VOYC3XU AmmK7ySARu7nRHDudK+kM723JuT+9u1/qR8bXtzkFp9ZXUDjGdBlC0CuUu9myxUMzqpT xQe8lNJA++gtluCeh5guT2qfUqYzJBRHz9r5OpK+A08Mtde3vkL5c1uk+fUYYKTQvhNF 5C3WUXqVV9ZGGJZRYsm3mCtRK8/8q7KeiNIXUkRiJbNfS3FPMl0DZ1a05ePMIVDmLKCb mNKA== X-Gm-Message-State: ACgBeo30uYWf2UUIYE4imGIZC8bwoIM+aW0nhnRK/uIoPEGLjERwHJvF nU/dl2Uo+DpLh+1kv9aHGWheAS69gfs= X-Google-Smtp-Source: AA6agR4i3A7tKxPAXiLI/m0VN3zBSjrO9uyRxdqJp7TjDNkYlUYpZ1hB8C46ojTUnfGKWbv4gFq7IQ== X-Received: by 2002:aa7:d5d0:0:b0:44e:f6cc:7107 with SMTP id d16-20020aa7d5d0000000b0044ef6cc7107mr12149958eds.371.1662739346061; Fri, 09 Sep 2022 09:02:26 -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 s22-20020a17090699d600b0076559407303sm415538ejn.159.2022.09.09.09.02.25 for <guix-patches@gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Sep 2022 09:02:25 -0700 (PDT) From: Liliana Marie Prikler <liliana.prikler@gmail.com> Date: Fri, 9 Sep 2022 17:56:20 +0200 Content-Transfer-Encoding: 7bit Message-ID: <b1b6504d725df23dc910cb04591a203979cdca7b.camel@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::542; envelope-from=liliana.prikler@gmail.com; helo=mail-ed1-x542.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: <guix-patches.gnu.org> List-Unsubscribe: <https://lists.gnu.org/mailman/options/guix-patches>, <mailto:guix-patches-request@gnu.org?subject=unsubscribe> List-Archive: <https://lists.gnu.org/archive/html/guix-patches> List-Post: <mailto:guix-patches@gnu.org> List-Help: <mailto:guix-patches-request@gnu.org?subject=help> List-Subscribe: <https://lists.gnu.org/mailman/listinfo/guix-patches>, <mailto:guix-patches-request@gnu.org?subject=subscribe> Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" <guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org> X-getmail-retrieved-from-mailbox: Patches |
Series |
[bug#57704,core-updates] guix: packages: Remove #f from inputs when sanitizing.
|
|
Commit Message
Liliana Marie Prikler
Sept. 9, 2022, 3:56 p.m. UTC
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(-)
Comments
On 09-09-2022 17:56, Liliana Marie Prikler wrote: > This makes it so that new-style inputs can be optional using regular Guile > patterns, e.g. (and (target-x86-64?) rust). Seems useful. > * guix/packages.scm (sanitize-inputs): Filter inputs by identity before adding > labels. Documentation is missing. > --- > 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. It does affect the package record, but it doesn't cause any rebuilds, so master should be fine: * There aren't any current uses of #false: (use-modules (guix packages) (gnu packages)) (package (inherit (specification->package "hello")) (inputs (list #false))) ;; guix build -f [...] --> package ‘hello@2.12.1’ has an invalid input * In the absence of #false, the behaviour remains unchanged. * guix/packages.scm is not used by any derivation (except for "guix pull" and the guix package) As a test, I applied the patch and did ‘make && ./pre-inst-env guix build -n libreoffice’, and it turned out I already have it installed. Greetings, Maxime.
Hi Liliana, Liliana Marie Prikler <liliana.prikler@gmail.com> skribis: > This makes it so that new-style inputs can be optional using regular Guile > patterns, e.g. (and (target-x86-64?) rust). I’d rather avoid that and make sure input lists are just plain lists, remaining strict, and keeping the sanitize procedure simple (notably so it can be optimized in common cases). That means we have to live with idioms like: (append (list x y z) (if (target-x86-64?) (list rust) '())) The ‘openmpi’ package has sugar to make that more concise. Thoughts? Thanks, Ludo’.
Hi Liliana, Ludovic Courtès <ludo@gnu.org> writes: > Hi Liliana, > > Liliana Marie Prikler <liliana.prikler@gmail.com> skribis: > >> This makes it so that new-style inputs can be optional using regular Guile >> patterns, e.g. (and (target-x86-64?) rust). > > I’d rather avoid that and make sure input lists are just plain lists, > remaining strict, and keeping the sanitize procedure simple (notably so > it can be optimized in common cases). > > That means we have to live with idioms like: > > (append (list x y z) > (if (target-x86-64?) (list rust) '())) > > The ‘openmpi’ package has sugar to make that more concise. > > Thoughts? Any plans to revisit this, or should we close it?
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)