From patchwork Thu Mar 3 14:21:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: M X-Patchwork-Id: 37590 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 6DEFD27BBEA; Thu, 3 Mar 2022 14:22:21 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,URIBL_BLOCKED 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 C016C27BBE9 for ; Thu, 3 Mar 2022 14:22:20 +0000 (GMT) Received: from localhost ([::1]:41228 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nPmLT-0004EE-It for patchwork@mira.cbaines.net; Thu, 03 Mar 2022 09:22:19 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57426) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nPmLC-0004CZ-PP for guix-patches@gnu.org; Thu, 03 Mar 2022 09:22:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:48029) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nPmLC-0002v2-EX for guix-patches@gnu.org; Thu, 03 Mar 2022 09:22:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nPmLB-0007SR-Sy for guix-patches@gnu.org; Thu, 03 Mar 2022 09:22:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#54236] [PATCH] Two fixes for 'gexp->approximate-sexp', addressing some linter problems. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 03 Mar 2022 14:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 54236 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54236@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.164631731828649 (code B ref -1); Thu, 03 Mar 2022 14:22:01 +0000 Received: (at submit) by debbugs.gnu.org; 3 Mar 2022 14:21:58 +0000 Received: from localhost ([127.0.0.1]:41924 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nPmL8-0007Rw-5D for submit@debbugs.gnu.org; Thu, 03 Mar 2022 09:21:58 -0500 Received: from lists.gnu.org ([209.51.188.17]:59918) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nPmL6-0007Rm-Qz for submit@debbugs.gnu.org; Thu, 03 Mar 2022 09:21:57 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57416) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nPmL6-00047R-M2 for guix-patches@gnu.org; Thu, 03 Mar 2022 09:21:56 -0500 Received: from [2a02:1800:110:4::f00:19] (port=58114 helo=laurent.telenet-ops.be) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nPmL4-0002uH-0H for guix-patches@gnu.org; Thu, 03 Mar 2022 09:21:56 -0500 Received: from ptr-bvsjgyhxw7psv60dyze.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by laurent.telenet-ops.be with bizsmtp id 1qMo2700A4UW6Th01qMolz; Thu, 03 Mar 2022 15:21:48 +0100 Message-ID: From: Maxime Devos Date: Thu, 03 Mar 2022 15:21:44 +0100 User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1646317308; bh=Z14EGUeWRGVVQfeTHP+TEGI0rHux/OMzqFXL8C1/EC8=; h=Subject:From:To:Date; b=BLf+YUNVN3Ygm95Hsw3oInr2wMEYcQ2nOzx7nvMvZt0tVjGjEoXPB2nryQaGgRCYJ xOxCKr1x9JeaswDwHRuU3K6nWNrj2OQ3Fi+bPAQxrELzCRPSK1VAZ8gyxUG9prsCRj ZAMrrY8SlbebEVxAu6myFjkb4QkvvqOD/qMnNaUxco8qO2Wfjrwlqglw3L69cq08kk myJDuBedHHMA4iAFNB3/CGWGQRF0uXylVpXPxfq7s0otn5bdIN0PIByqjrM+KHBRz8 TlXhdSy5HgWEIco+TMq4u387lR4O4xTZ+6r2a0sW4taNTWRxz4FsvvdL4kIUO2OaKe pUZ3gEHad9DHg== X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a02:1800:110:4::f00:19 (failed) Received-SPF: pass client-ip=2a02:1800:110:4::f00:19; envelope-from=maximedevos@telenet.be; helo=laurent.telenet-ops.be X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 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_LOW=-0.7, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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: 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 Hi guix, Try "guix lint -c wrapper-inputs libaio". You'll see a false positive. The first patch fixes it. This fix exposes another issue, causing "guix lint -c wrapper-inputs hostapd" to backtrace. The second patches fixes that. Greetings, Maxime. From a34cb77369a6108e65be20ef36ab35bdf398daf1 Mon Sep 17 00:00:00 2001 From: Maxime Devos Date: Thu, 3 Mar 2022 14:14:22 +0000 Subject: [PATCH 2/2] gexp: Correctly handle #$output in 'gexp->approximate-sexp'. This addresses the following backtrace from "guix lint -c wrapper-inputs hostapd": Backtrace:ostapd@2.10 [wrapper-inputs]... [...] 174:9 3 (gexp->approximate-sexp #) In srfi/srfi-1.scm: 586:17 2 (map1 (# #)) In guix/gexp.scm: 175:16 1 (_ _) In ice-9/boot-9.scm: 1685:16 0 (raise-exception _ #:continuable? _) ice-9/boot-9.scm:1685:16: In procedure raise-exception: Throw to key `match-error' with args `("match" "no matching pattern" #)'. * guix/gexp.scm (gexp->approximate-sexp): Handle the case where 'reference' is a ,, by returning (*approximate*). * tests/gexp.scm ("gexp->approximate-sexp, outputs"): Test it. --- guix/gexp.scm | 3 ++- tests/gexp.scm | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/guix/gexp.scm b/guix/gexp.scm index c358662799..22a6c6ab71 100644 --- a/guix/gexp.scm +++ b/guix/gexp.scm @@ -181,7 +181,8 @@ As a result, the S-expression will be approximate if GEXP has references." (#true ;; Simply returning 'thing' won't work in some ;; situations; see 'write-gexp' below. - '(*approximate*)))))) + '(*approximate*)))) + (($ ) '(*approximate*)))) (gexp-references gexp)))) (define (write-gexp gexp port) diff --git a/tests/gexp.scm b/tests/gexp.scm index 5ac8a1c8ab..5d98f836a7 100644 --- a/tests/gexp.scm +++ b/tests/gexp.scm @@ -147,6 +147,11 @@ (null? (gexp-inputs exp)) (gexp->sexp* exp)))) +(test-equal "gexp->approximate-sexp, outputs" + '(list 'out:foo (*approximate*) 'out:bar (*approximate*)) + (gexp->approximate-sexp + #~(list 'out:foo #$output:foo 'out:bar #$output:bar))) + (test-equal "unquote" '(display `(foo ,(+ 2 3))) (let ((exp (gexp (display `(foo ,(+ 2 3)))))) -- 2.30.2