GNU bug report logs - #48120
[PATCH]: Teach etc/committer.scm.in some stuff.

Previous Next

Package: guix-patches;

Reported by: Maxime Devos <maximedevos <at> telenet.be>

Date: Fri, 30 Apr 2021 14:37:01 UTC

Severity: normal

Tags: moreinfo, patch

To reply to this bug, email your comments to 48120 AT debbugs.gnu.org.

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

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


Report forwarded to guix-patches <at> gnu.org:
bug#48120; Package guix-patches. (Fri, 30 Apr 2021 14:37:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Maxime Devos <maximedevos <at> telenet.be>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Fri, 30 Apr 2021 14:37:01 GMT) Full text and rfc822 format available.

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

From: Maxime Devos <maximedevos <at> telenet.be>
To: guix-patches <at> gnu.org
Subject: [PATCH]: Teach etc/committer.scm.in some stuff.
Date: Fri, 30 Apr 2021 16:36:05 +0200
[Message part 1 (text/plain, inline)]
Hi Guix,

I snarfed these from my cc-for-target branch.
Examples of generated commit messages, without any massaging:

<start snip>
gnu: ufoai-data: Use 'cc-for-target' and friends.

* gnu/packages/games.scm (ufoai-data)
[arguments]<#:configure-flags>: Use the C cross-compiler, instead of hardcoding "gcc". Use the C++ cross-compiler, instead of hardcoding "g++".

gnu: mlt: Use 'cc-for-target' and friends.

* gnu/packages/video.scm (mlt)
[arguments]<#:make-flags>: Use the C cross-compiler, instead of hardcoding "gcc". Use the C++ cross-compiler, instead of hardcoding "g++".

gnu: theorafile: Use the C cross-compiler.

* gnu/packages/video.scm (theorafile)
[arguments]<#:make-flags>: Use the C cross-compiler, instead of hardcoding "gcc".
[arguments]<#:phases>{check}: Only run tests when not requested.
<end snip>

etc/comitter.scm.in should probably do some line wrapping as well.

WDYT?

Greetings,
Maxime.
[0001-etc-Teach-committer.scm-about-CC-gcc-cc-for-target-a.patch (text/x-patch, attachment)]
[0002-etc-Teach-committer.scm-about-checking-tests-in-the-.patch (text/x-patch, attachment)]
[0003-etc-committer-Only-claim-to-be-updating-a-package-wh.patch (text/x-patch, attachment)]
[0004-etc-committer-Automatically-generate-a-first-line-in.patch (text/x-patch, attachment)]
[0005-etc-committer-Support-list-exp-.-in-make-flags.patch (text/x-patch, attachment)]
[0006-etc-committer-Explain-changes-in-configure-flags.patch (text/x-patch, attachment)]
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#48120; Package guix-patches. (Thu, 06 May 2021 07:52:02 GMT) Full text and rfc822 format available.

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

From: Maxime Devos <maximedevos <at> telenet.be>
To: 48120 <at> debbugs.gnu.org
Subject: Re: [PATCH] Teach etc/committer.scm.in some stuff
Date: Thu, 06 May 2021 09:50:53 +0200
[Message part 1 (text/plain, inline)]
New patch series, handling more edge cases.

It needs some changes in how it wraps lines now there
is a break-string procedure, but I don't have time to
work on this currently so I'll just submit it as-is for now.

Greetings,
Maxime.
[0001-etc-Teach-committer.scm-about-CC-gcc-cc-for-target-a.patch (text/x-patch, attachment)]
[0002-etc-Teach-committer.scm-about-checking-tests-in-the-.patch (text/x-patch, attachment)]
[0003-etc-committer-Only-claim-to-be-updating-a-package-wh.patch (text/x-patch, attachment)]
[0004-etc-committer-Automatically-generate-a-first-line-in.patch (text/x-patch, attachment)]
[0005-etc-committer-Support-list-exp-.-in-make-flags.patch (text/x-patch, attachment)]
[0006-etc-committer-Explain-changes-in-configure-flags.patch (text/x-patch, attachment)]
[0007-etc-committer-Read-correctly.patch (text/x-patch, attachment)]
[0008-etc-committer-Perform-line-wrapping.patch (text/x-patch, attachment)]
[0009-etc-committer-Don-t-crash-if-no-keyword-list-is-dete.patch (text/x-patch, attachment)]
[0010-etc-committer-Ignore-let-bindings.patch (text/x-patch, attachment)]
[0011-etc-committer-Handle-substitute-keyword-arguments.patch (text/x-patch, attachment)]
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#48120; Package guix-patches. (Sun, 09 May 2021 18:35:02 GMT) Full text and rfc822 format available.

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

From: Xinglu Chen <public <at> yoctocell.xyz>
To: Maxime Devos <maximedevos <at> telenet.be>, 48120 <at> debbugs.gnu.org
Subject: Re: [bug#48120] [PATCH] Teach etc/committer.scm.in some stuff
Date: Sun, 09 May 2021 20:34:19 +0200
On Thu, May 06 2021, Maxime Devos wrote:

> New patch series, handling more edge cases.
>
> It needs some changes in how it wraps lines now there
> is a break-string procedure, but I don't have time to
> work on this currently so I'll just submit it as-is for now.

I don’t think I am qualified to review all of this, but it seems to work
after I made some minor fixes.  I just used ‘cc-for-target’ instead of
hardcoding ‘gcc’ on a random package, this is what I got.

--8<---------------cut here---------------start------------->8---
  gnu: eigensoft: Use the C cross-compiler.
  
  * gnu/packages/bioinformatics.scm (eigensoft)
  [arguments]<#:make-flags>: Use the C cross-compiler, instead of
  hardcoding "gcc".
--8<---------------cut here---------------end--------------->8---

> +(define (keyword-list->alist kwlist)
> +  (match kwlist
> +    (() '())
> +    (((? keyword? k) object . rest)
> +     `((,k . ,object) . ,(keyword-list->alist rest)))))
> +
> +(define (pairwise-foreach-keyword proc . arguments)
> +  "Apply PROC with each keyword argument and corresponding values
> +in ARGUMENTS.  If a value is not present in a argument, pass #f instead."
> +  (let* ((alists (map keyword-list->alist arguments))
> +         (keywords (delete-duplicates
> +                    (apply append (map (cut map car <>) alists))

‘append-map’ instead of (apply append (map ...) ...) ?

> +                    eq?)))
> +    (for-each (lambda (keyword)
> +                (apply proc keyword
> +                       (map (cut assoc-ref <> keyword) alists)))
> +              keywords)))
> +
>
> [...]
>
> @@ -207,6 +263,14 @@ corresponding to the top-level definition containing the staged changes."
>        (() '())
>        ((first . rest)
>         (map cadadr first))))
> +  ;; Like get-values, but also allow quote and do not treat
> +  ;; the value of the field as an alist.
> +  (define (get-values/list expr field)
> +    (match ((sxpath `(// ,field ,(node-or (sxpath '(quasiquote))
> +                                          (sxpath '(quote))))) expr)
> +      (() '())
> +      ((first . rest)
> +       (second first))))
>    (define (listify items)
>      (match items
>        ((one) one)
> @@ -245,6 +309,34 @@ corresponding to the top-level definition containing the staged changes."
>                                            (listify removed)
>                                            (listify added))))))))))
>              '(inputs propagated-inputs native-inputs)))

I think the parentheses are mismatched here, {M-x check-parens} should complain.

--8<---------------cut here---------------start------------->8---
~/src/guix $ guile etc/committer.scm.in
;;; note: source file /home/yoctocell/src/guix/etc/committer.scm
;;;       newer than compiled /home/yoctocell/.cache/guile/ccache/3.0-LE-8-4.4/home/yoctocell/src/guix/etc/committer.scm.go
;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
;;;       or pass the --no-auto-compile argument to disable.
;;; compiling /home/yoctocell/src/guix/etc/committer.scm
;;; WARNING: compilation of /home/yoctocell/src/guix/etc/committer.scm failed:
;;; In procedure read_inner_expression: etc/committer.scm:465:47: unexpected ")"
Backtrace:
           4 (primitive-load "/home/yoctocell/src/guix/etc/committer.scm")
In ice-9/eval.scm:
   298:34  3 (_ #<directory (guile-user) 7efdd29e9c80>)
   196:27  2 (_ #<directory (guile-user) 7efdd29e9c80>)
   223:20  1 (proc #<directory (guile-user) 7efdd29e9c80>)
In unknown file:
           0 (%resolve-variable (7 . get-values/no-unquote) #<directory (guile-user) 7efdd29e9c80>)

ERROR: In procedure %resolve-variable:
Unbound variable: get-values/no-unquote
--8<---------------cut here---------------end--------------->8---

> From 5f0313c01121a0a1e7f39f447425b5a8b70fb8c0 Mon Sep 17 00:00:00 2001
> From: Maxime Devos <maximedevos <at> telenet.be>
> Date: Sat, 1 May 2021 12:19:05 +0200
> Subject: [PATCH 11/11] etc: committer: Handle substitute-keyword-arguments.
>
> * etc/committer.scm.in
>   (keyword-list->alist): Rename to ...
>   (keyword-list->alist/list): ..., and document the input format.
>  
> [...]
>
> -(define (keyword-list->alist kwlist)
> +;; Input: a list of keywords and the corresponding values,
> +;; without an exterior quote, quasiquote or list.
> +(define (keyword-list->alist/list kwlist)
>    (match kwlist
>      (() '())
>      (((? keyword? k) object . rest)
>       `((,k . ,object) . ,(keyword-list->alist rest)))
                             ^^^^^^^^^^^^^^^^^^^
‘keyword-list->alist/list’




Information forwarded to guix-patches <at> gnu.org:
bug#48120; Package guix-patches. (Thu, 17 Jun 2021 13:37:01 GMT) Full text and rfc822 format available.

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

From: Maxime Devos <maximedevos <at> telenet.be>
To: 48120 <at> debbugs.gnu.org
Subject: [PATCH] etc: committer: Read #~, #$ and #+ correctly.
Date: Thu, 17 Jun 2021 15:36:02 +0200
[Message part 1 (text/plain, inline)]
Hi Guix,

I haven't gotten around to making a new revision
of the whole patch series yet, but I want to note
that this individual patch is simple and functions
on its own.

Greetings,
Maxime.
[0001-etc-committer-Read-and-correctly.patch (text/x-patch, inline)]
From 3f6404ab0367d91bb665748a8eab17976e9a2c11 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos <at> telenet.be>
Date: Fri, 30 Apr 2021 22:53:12 +0200
Subject: [PATCH] etc: committer: Read #~, #$ and #+ correctly.

Some package definitions use G-expressions (see, e.g., chez-scheme).
Import (guix gexp) such that Guile knows how to read those.
Otherwise, an exception such as the following might be raised:

ERROR: In procedure read:
In procedure scm_lreadr: gnu/services/networking.scm:480:16: Unknown # object: #\~

* etc/committer.scm.in: Import (guix gexp).
---
 etc/committer.scm.in | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/etc/committer.scm.in b/etc/committer.scm.in
index 1f19ccfd6d..b61121bc4b 100755
--- a/etc/committer.scm.in
+++ b/etc/committer.scm.in
@@ -36,7 +36,8 @@
         (ice-9 popen)
         (ice-9 match)
         (ice-9 rdelim)
-        (ice-9 textual-ports))
+        (ice-9 textual-ports)
+        (guix gexp))
 
 (define (read-excursion port)
   "Read an expression from PORT and reset the port position before returning
-- 
2.32.0

[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#48120; Package guix-patches. (Sat, 07 Aug 2021 12:07:02 GMT) Full text and rfc822 format available.

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

From: Ricardo Wurmus <rekado <at> elephly.net>
To: 48120 <at> debbugs.gnu.org
Subject: [PATCH]: Teach etc/committer.scm.in some stuff.
Date: Sat, 07 Aug 2021 14:06:00 +0200
I pushed that one change with commit 
50c2dcd1c977f98681a4e457b2bcf09d96588eee to the master branch.

Thank you!

-- 
Ricardo




Information forwarded to guix-patches <at> gnu.org:
bug#48120; Package guix-patches. (Mon, 22 Nov 2021 23:09:01 GMT) Full text and rfc822 format available.

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

From: Ricardo Wurmus <rekado <at> elephly.net>
To: 48120 <at> debbugs.gnu.org
Subject: [PATCH]: Teach etc/committer.scm.in some stuff.
Date: Tue, 23 Nov 2021 00:07:10 +0100
Hi Maxime,

are you still interested in adjusting your patches?  Or would you 
prefer I make the suggested changes when applying them?

-- 
Ricardo




Information forwarded to guix-patches <at> gnu.org:
bug#48120; Package guix-patches. (Sun, 22 May 2022 03:34:01 GMT) Full text and rfc822 format available.

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

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: 48120 <at> debbugs.gnu.org
Subject: Re: bug#48120: [PATCH]: Teach etc/committer.scm.in some stuff.
Date: Sat, 21 May 2022 23:33:30 -0400
Hello,

Maxime Devos <maximedevos <at> telenet.be> writes:

> New patch series, handling more edge cases.
>
> It needs some changes in how it wraps lines now there
> is a break-string procedure, but I don't have time to
> work on this currently so I'll just submit it as-is for now.

Gentle ping :-).

Maxim




Added tag(s) moreinfo. Request was from Maxim Cournoyer <maxim.cournoyer <at> gmail.com> to control <at> debbugs.gnu.org. (Sun, 22 May 2022 03:34:02 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#48120; Package guix-patches. (Sun, 22 May 2022 09:06:01 GMT) Full text and rfc822 format available.

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

From: Maxime Devos <maximedevos <at> telenet.be>
To: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Cc: 48120 <at> debbugs.gnu.org
Subject: Re: bug#48120: [PATCH]: Teach etc/committer.scm.in some stuff.
Date: Sun, 22 May 2022 11:04:52 +0200
[Message part 1 (text/plain, inline)]
Maxim Cournoyer schreef op za 21-05-2022 om 23:33 [-0400]:
> Hello,
> 
> Maxime Devos <maximedevos <at> telenet.be> writes:
> 
> > New patch series, handling more edge cases.
> > 
> > It needs some changes in how it wraps lines now there
> > is a break-string procedure, but I don't have time to
> > work on this currently so I'll just submit it as-is for now.
> 
> Gentle ping :-).
> 
> Maxim

Currently working on other things.  Also, IIRC, needs a rebase
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#48120; Package guix-patches. (Sun, 22 May 2022 13:14:01 GMT) Full text and rfc822 format available.

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

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: 48120 <at> debbugs.gnu.org
Subject: Re: bug#48120: [PATCH]: Teach etc/committer.scm.in some stuff.
Date: Sun, 22 May 2022 09:13:29 -0400
Hello,

Maxime Devos <maximedevos <at> telenet.be> writes:

> Maxim Cournoyer schreef op za 21-05-2022 om 23:33 [-0400]:
>> Hello,
>> 
>> Maxime Devos <maximedevos <at> telenet.be> writes:
>> 
>> > New patch series, handling more edge cases.
>> > 
>> > It needs some changes in how it wraps lines now there
>> > is a break-string procedure, but I don't have time to
>> > work on this currently so I'll just submit it as-is for now.
>> 
>> Gentle ping :-).
>> 
>> Maxim
>
> Currently working on other things.  Also, IIRC, needs a rebase

OK, no pressure, thanks for the update.

Maxim




This bug report was last modified 3 years and 22 days ago.

Previous Next


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