GNU bug report logs - #65757
[PATCH] guix: packages: Support package/inherit by package-field-location.

Previous Next

Package: guix-patches;

Reported by: Simon Tournier <zimon.toutoune <at> gmail.com>

Date: Tue, 5 Sep 2023 14:38:02 UTC

Severity: normal

Tags: patch

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 65757 in the body.
You can then email your comments to 65757 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to maxim.cournoyer <at> gmail.com, guix-patches <at> gnu.org:
bug#65757; Package guix-patches. (Tue, 05 Sep 2023 14:38:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Simon Tournier <zimon.toutoune <at> gmail.com>:
New bug report received and forwarded. Copy sent to maxim.cournoyer <at> gmail.com, guix-patches <at> gnu.org. (Tue, 05 Sep 2023 14:38:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Simon Tournier <zimon.toutoune <at> gmail.com>
To: guix-patches <at> gnu.org
Cc: Simon Tournier <zimon.toutoune <at> gmail.com>
Subject: [PATCH] guix: packages: Support package/inherit by
 package-field-location.
Date: Tue,  5 Sep 2023 16:37:32 +0200
Fixes <https://issues.guix.gnu.org//65236>.
Reported by Maxim Cournoyer <maxim.cournoyer <at> gmail.com>.

* 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 ...))
                    (let ((field (assoc field inits)))
                      (match field
                        ((_ value)

base-commit: bedcdf0fb5ac035f696790827679406c7146396c
-- 
2.38.1





Reply sent to Maxim Cournoyer <maxim.cournoyer <at> gmail.com>:
You have taken responsibility. (Wed, 06 Sep 2023 20:42:02 GMT) Full text and rfc822 format available.

Notification sent to Simon Tournier <zimon.toutoune <at> gmail.com>:
bug acknowledged by developer. (Wed, 06 Sep 2023 20:42:02 GMT) Full text and rfc822 format available.

Message #10 received at 65757-done <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Simon Tournier <zimon.toutoune <at> gmail.com>
Cc: 65757-done <at> debbugs.gnu.org
Subject: Re: [bug#65757] [PATCH] guix: packages: Support package/inherit by
 package-field-location.
Date: Wed, 06 Sep 2023 16:41:31 -0400
Hi Simon,

Simon Tournier <zimon.toutoune <at> gmail.com> writes:

> Fixes <https://issues.guix.gnu.org//65236>.
> Reported by Maxim Cournoyer <maxim.cournoyer <at> 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 <at> 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.

-- 
Thanks,
Maxim




Information forwarded to guix-patches <at> gnu.org:
bug#65757; Package guix-patches. (Wed, 06 Sep 2023 22:04:02 GMT) Full text and rfc822 format available.

Message #13 received at 65757-done <at> debbugs.gnu.org (full text, mbox):

From: Simon Tournier <zimon.toutoune <at> gmail.com>
To: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Cc: 65757-done <at> debbugs.gnu.org
Subject: Re: bug#65757: [PATCH] guix: packages: Support package/inherit by
 package-field-location.
Date: Thu, 07 Sep 2023 00:01:35 +0200
Hi Maxim,

On Wed, 06 Sep 2023 at 16:41, Maxim Cournoyer <maxim.cournoyer <at> 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.




Information forwarded to guix-patches <at> gnu.org:
bug#65757; Package guix-patches. (Thu, 07 Sep 2023 01:57:02 GMT) Full text and rfc822 format available.

Message #16 received at 65757-done <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Simon Tournier <zimon.toutoune <at> gmail.com>
Cc: 65757-done <at> debbugs.gnu.org
Subject: Re: bug#65757: [PATCH] guix: packages: Support package/inherit by
 package-field-location.
Date: Wed, 06 Sep 2023 21:55:59 -0400
Hi,

Simon Tournier <zimon.toutoune <at> gmail.com> writes:

> Hi Maxim,
>
> On Wed, 06 Sep 2023 at 16:41, Maxim Cournoyer <maxim.cournoyer <at> 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 '_' :-).

-- 
Thanks,
Maxim




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 05 Oct 2023 11:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 218 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.