Message ID | 6cefcfecf409ffdd5fe856c23fbbc7b9cae7161d.1693924596.git.zimon.toutoune@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 935E627BBE2; Tue, 5 Sep 2023 15:38:22 +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,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 0850427BBE9 for <patchwork@mira.cbaines.net>; Tue, 5 Sep 2023 15:38:22 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <guix-patches-bounces@gnu.org>) id 1qdXBt-0000qi-E1; Tue, 05 Sep 2023 10:38:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) 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 1qdXBq-0000qT-Ux for guix-patches@gnu.org; Tue, 05 Sep 2023 10:38:03 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) 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 1qdXBq-0002S3-87 for guix-patches@gnu.org; Tue, 05 Sep 2023 10:38:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1qdXBq-0002cj-7p; Tue, 05 Sep 2023 10:38:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#65757] [PATCH] guix: packages: Support package/inherit by package-field-location. Resent-From: Simon Tournier <zimon.toutoune@gmail.com> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org> Resent-CC: maxim.cournoyer@gmail.com, guix-patches@gnu.org Resent-Date: Tue, 05 Sep 2023 14:38:02 +0000 Resent-Message-ID: <handler.65757.B.169392467610068@debbugs.gnu.org> Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 65757 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 65757@debbugs.gnu.org Cc: Simon Tournier <zimon.toutoune@gmail.com>, <maxim.cournoyer@gmail.com> X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: <maxim.cournoyer@gmail.com> Received: via spool by submit@debbugs.gnu.org id=B.169392467610068 (code B ref -1); Tue, 05 Sep 2023 14:38:02 +0000 Received: (at submit) by debbugs.gnu.org; 5 Sep 2023 14:37:56 +0000 Received: from localhost ([127.0.0.1]:57563 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>) id 1qdXBk-0002cK-2O for submit@debbugs.gnu.org; Tue, 05 Sep 2023 10:37:56 -0400 Received: from lists.gnu.org ([2001:470:142::17]:48948) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <zimon.toutoune@gmail.com>) id 1qdXBg-0002c3-3n for submit@debbugs.gnu.org; Tue, 05 Sep 2023 10:37:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <zimon.toutoune@gmail.com>) id 1qdXBZ-0000mj-2E for guix-patches@gnu.org; Tue, 05 Sep 2023 10:37:45 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <zimon.toutoune@gmail.com>) id 1qdXBW-0002PQ-GH for guix-patches@gnu.org; Tue, 05 Sep 2023 10:37:44 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-401e6ce2d9fso7549725e9.1 for <guix-patches@gnu.org>; Tue, 05 Sep 2023 07:37:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693924660; x=1694529460; darn=gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=QJ3qVnMK4ZwoNiwvps6KbQ7N6MkdETeCuLS9k1DEonI=; b=PSv+tZzmvhS+4cdAn53Fg1kNM8Iuug4TMtRpwGESDC5+1oi0bKZ0Ntm3isD4pUcDee g+a/2YnRAR4sQ/pgSetUbsD8kwr4JvvQ015dJABSIm3ufbeCCJeOwrxGpGYekEd1twzF fsfHN9lHGDxoJHjgHGfB5/SrLFJ/mrni1Lip0cjkbNcBqeCAWMJn7Lqf6bFkej28LeTG qmCKsrs0733HbAVip1Z1kA7WEYj+q41mgFrAa3BBVaNE9SF40hznkoUwIkmx6NIWqQiE I+LfScOP7WFPVGE5iLelocrda85WDiivyNoaeQKLc30RZOc29NtFqQmN/uXxQlyqe04x 26Ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693924660; x=1694529460; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=QJ3qVnMK4ZwoNiwvps6KbQ7N6MkdETeCuLS9k1DEonI=; b=hd2eQ6nYIuqTUCwPAcvtNC/E3LSjl9NPQbO2/92mLNnTkuqnyWHezmgeiD9a7Vgwj4 B1lzl7eFjz9+TEPTHPz8Ta8t17jgq9zhv1pqnuHmOnPSjhpPHfTMcjABtxqAdJxL/gYM 4BSrGaSsPfYCpr+/BCaLzch9i6WEwGm2+5WZUxHH+Iny79QcAqS4TtdHQHyozUiQowfo m1KrJRdzV1PPqaTIv6lPtYuVlMO80ne1Q7lI89FCedsbOUAQdLJfvvb/eBEUyOWutMr+ m8i7U6nX+O5KkIYLVBGj5Fb4/efgOCET57TR2Pd5jZDa3nS+GCa7DJqGzP45ITN+vtEx bcXw== X-Gm-Message-State: AOJu0YzfUDdyY1wm1ZhXXsf5kwcOUKwsO86/u08Sf4q3IyXpAMWUfC8G JCn8CI8EG5F5SLTNeQckLIkqE7o1T0Y= X-Google-Smtp-Source: AGHT+IFk8YtTzZaUZBqjCSW1e5/uEx7il3hU3g72FVyrlgnv412Bg0bxaYngX48FrwO4dJR7Unl6wg== X-Received: by 2002:a05:600c:3b83:b0:3ff:c342:f296 with SMTP id n3-20020a05600c3b8300b003ffc342f296mr10518209wms.1.1693924660242; Tue, 05 Sep 2023 07:37:40 -0700 (PDT) Received: from localhost.localdomain ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id 17-20020a05600c021100b003fefca26c72sm17180798wmi.23.2023.09.05.07.37.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Sep 2023 07:37:39 -0700 (PDT) From: Simon Tournier <zimon.toutoune@gmail.com> Date: Tue, 5 Sep 2023 16:37:32 +0200 Message-Id: <6cefcfecf409ffdd5fe856c23fbbc7b9cae7161d.1693924596.git.zimon.toutoune@gmail.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=zimon.toutoune@gmail.com; helo=mail-wm1-x331.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 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-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches |
Series |
[bug#65757] guix: packages: Support package/inherit by package-field-location.
|
|
Commit Message
Simon Tournier
Sept. 5, 2023, 2:37 p.m. UTC
Fixes <https://issues.guix.gnu.org//65236>. Reported by Maxim Cournoyer <maxim.cournoyer@gmail.com>. * guix/packages.scm (package-field-location): Add package/inherit case. --- guix/packages.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) base-commit: bedcdf0fb5ac035f696790827679406c7146396c
Comments
Hi Simon, Simon Tournier <zimon.toutoune@gmail.com> writes: > Fixes <https://issues.guix.gnu.org//65236>. > Reported by Maxim Cournoyer <maxim.cournoyer@gmail.com>. nitpick: 'Reported-by:' is a Git trailing (message tag); it should appear at the bottom of the commit message for Git tools to correctly parse it. > * guix/packages.scm (package-field-location): Add package/inherit case. > --- > guix/packages.scm | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/guix/packages.scm b/guix/packages.scm > index ba98bb0fb484..821eddb72d5d 100644 > --- a/guix/packages.scm > +++ b/guix/packages.scm > @@ -761,7 +761,8 @@ (define (package-field-location package field) > (lambda (port) > (go-to-location port line column) > (match (read port) > - (('package inits ...) > + ((or ('package inits ...) > + ('package/inherit inits ...)) I tested it in 'guix repl' for zxing-cpp-1.2, and something didn't go well: --8<---------------cut here---------------start------------->8--- scheme@(guix-user)> ,use (guix packages) scheme@(guix-user)> ,use (gnu packages aidc) scheme@(guix-user)> zxing-cpp-1.2 $1 = #<package zxing-cpp@1.2.0 gnu/packages/aidc.scm:76 7f4b56450d10> scheme@(guix-user)> (package-field-location $1 'version) ice-9/boot-9.scm:1685:16: In procedure raise-exception: In procedure assoc: Wrong type argument: zxing-cpp Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue. scheme@(guix-user) [1]> ,bt In ice-9/boot-9.scm: 1747:15 4 (with-exception-handler #<procedure 7f4b58de8480 at ice-9/boot-9.scm:1831:7 (exn)> _ # _ # …) In ice-9/ports.scm: 433:17 3 (call-with-input-file _ _ #:binary _ #:encoding _ #:guess-encoding _) In guix/packages.scm: 766:32 2 (_ _) In srfi/srfi-1.scm: 241:2 1 (assoc _ _ _) In ice-9/boot-9.scm: 1685:16 0 (raise-exception _ #:continuable? _) --8<---------------cut here---------------end--------------->8--- I modified it like: --8<---------------cut here---------------start------------->8--- modified guix/packages.scm @@ -762,7 +762,7 @@ (define (package-field-location package field) (go-to-location port line column) (match (read port) ((or ('package inits ...) - ('package/inherit parent inits ...)) + ('package/inherit _ inits ...)) (let ((field (assoc field inits))) (match field ((_ value) --8<---------------cut here---------------end--------------->8--- And it now works; yay! Will install shortly.
Hi Maxim, On Wed, 06 Sep 2023 at 16:41, Maxim Cournoyer <maxim.cournoyer@gmail.com> wrote: > --8<---------------cut here---------------start------------->8--- > modified guix/packages.scm > @@ -762,7 +762,7 @@ (define (package-field-location package field) > (go-to-location port line column) > (match (read port) > ((or ('package inits ...) > - ('package/inherit parent inits ...)) > + ('package/inherit _ inits ...)) > (let ((field (assoc field inits))) > (match field > ((_ value) > --8<---------------cut here---------------end--------------->8--- > > And it now works; yay! Will install shortly. Oops! Indeed, sorry for missing the obvious. Thanks for the fix. Cheers, simon PS: For the record, the change you made is: - ('package/inherit inits ...)) + ('package/inherit _ inits ...)) because the one above would be equivalent :-) – if I understand enough Guile patterning matching.
Hi, Simon Tournier <zimon.toutoune@gmail.com> writes: > Hi Maxim, > > On Wed, 06 Sep 2023 at 16:41, Maxim Cournoyer <maxim.cournoyer@gmail.com> wrote: > >> --8<---------------cut here---------------start------------->8--- >> modified guix/packages.scm >> @@ -762,7 +762,7 @@ (define (package-field-location package field) >> (go-to-location port line column) >> (match (read port) >> ((or ('package inits ...) >> - ('package/inherit parent inits ...)) >> + ('package/inherit _ inits ...)) >> (let ((field (assoc field inits))) >> (match field >> ((_ value) >> --8<---------------cut here---------------end--------------->8--- >> >> And it now works; yay! Will install shortly. > > Oops! Indeed, sorry for missing the obvious. Thanks for the fix. > > Cheers, > simon > > PS: For the record, the change you made is: > > - ('package/inherit inits ...)) > + ('package/inherit _ inits ...)) > > because the one above would be equivalent :-) – if I understand enough > Guile patterning matching. The one with 'parent' was working as well, but because the binding was never used, Guile was emitting a warning, silence by renaming 'parent' to '_' :-).
diff --git a/guix/packages.scm b/guix/packages.scm index ba98bb0fb484..821eddb72d5d 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -761,7 +761,8 @@ (define (package-field-location package field) (lambda (port) (go-to-location port line column) (match (read port) - (('package inits ...) + ((or ('package inits ...) + ('package/inherit inits ...)) (let ((field (assoc field inits))) (match field ((_ value)