GNU bug report logs - #57927
[PATCH] gnu: source-highlight: Fix lesspipe file name and use gexps.

Previous Next

Package: guix-patches;

Reported by: kiasoc5 <kiasoc5 <at> disroot.org>

Date: Mon, 19 Sep 2022 07:00:01 UTC

Severity: normal

Tags: patch

Done: Mathieu Othacehe <othacehe <at> gnu.org>

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 57927 in the body.
You can then email your comments to 57927 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 guix-patches <at> gnu.org:
bug#57927; Package guix-patches. (Mon, 19 Sep 2022 07:00:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to kiasoc5 <kiasoc5 <at> disroot.org>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Mon, 19 Sep 2022 07:00:01 GMT) Full text and rfc822 format available.

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

From: kiasoc5 <kiasoc5 <at> disroot.org>
To: guix-patches <at> gnu.org
Cc: kiasoc5 <kiasoc5 <at> disroot.org>
Subject: [PATCH] gnu: source-highlight: Fix lesspipe file name and use gexps.
Date: Mon, 19 Sep 2022 02:57:30 -0400
This fixes src-hilite-lesspipe.sh so that lesspipe.sh is called instead of lesspipe.

* gnu/packages/pretty-print.scm (source-highlight):
[arguments]: Use gexps, remove trailing #ts.
[phases]: Add phase to make src-highlight-lesspipe.sh work.
---
 gnu/packages/pretty-print.scm | 70 ++++++++++++++++++-----------------
 1 file changed, 36 insertions(+), 34 deletions(-)

diff --git a/gnu/packages/pretty-print.scm b/gnu/packages/pretty-print.scm
index 9745a9ba10..13108fe7db 100644
--- a/gnu/packages/pretty-print.scm
+++ b/gnu/packages/pretty-print.scm
@@ -32,6 +32,7 @@ (define-module (gnu packages pretty-print)
   #:use-module (guix download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
+  #:use-module (guix gexp)
   #:use-module (guix utils)
   #:use-module (gnu packages)
   #:use-module (gnu packages bison)
@@ -276,40 +277,41 @@ (define-public source-highlight
      (list boost))
     (native-inputs
      (list bison flex))
-    (arguments
-     `(#:configure-flags
-       (list (string-append "--with-boost="
-                            (assoc-ref %build-inputs "boost")))
-       #:parallel-tests? #f             ;There appear to be race conditions
-       #:phases
-       (modify-phases %standard-phases
-         ,@(if (%current-target-system)
-               ;; 'doc/Makefile.am' tries to run stuff even when
-               ;; cross-compiling.  Explicitly skip it.
-               ;; XXX: Inline this on next rebuild cycle.
-               `((add-before 'build 'skip-doc-directory
-                   (lambda _
-                     (substitute* "Makefile"
-                       (("^SUBDIRS = (.*) doc(.*)$" _ before after)
-                        (string-append "SUBDIRS = " before
-                                       " " after "\n")))
-                     #t)))
-               '())
-         (add-before 'check 'patch-test-files
-           (lambda _
-             ;; Unpatch shebangs in test input so that source-highlight
-             ;; is still able to infer input language
-             (substitute* '("tests/test.sh"
-                            "tests/test2.sh"
-                            "tests/test.tcl")
-               (((string-append "#! *" (which "sh"))) "#!/bin/sh"))
-             ;; Initial patching unrecoverably removes whitespace, so
-             ;; remove it also in the comparison output.
-             (substitute* '("tests/test.sh.html"
-                            "tests/test2.sh.html"
-                            "tests/test.tcl.html")
-               (("#! */bin/sh") "#!/bin/sh"))
-             #t)))))
+    (arguments   
+     (list #:configure-flags
+           #~(list (string-append "--with-boost=" (assoc-ref %build-inputs "boost")))
+           #:parallel-tests? #f ;There appear to be race conditions
+           #:phases
+           #~(modify-phases %standard-phases
+               (add-before 'build 'rename-lesspipe-to-lesspipe.sh.in
+                 (lambda _
+                   (substitute* "src/src-hilite-lesspipe.sh.in"
+                     (("lesspipe") "lesspipe.sh"))))
+           #$@(if (%current-target-system)
+                  ;; 'doc/Makefile.am' tries to run stuff even when
+                  ;; cross-compiling.  Explicitly skip it.
+                  ;; XXX: Inline this on next rebuild cycle.
+                  #~((add-before 'build 'skip-doc-directory
+                       (lambda _
+                         (substitute* "Makefile"
+                           (("^SUBDIRS = (.*) doc(.*)$" _ before after)
+                            (string-append "SUBDIRS = " before
+                                           " " after "\n"))))))
+                  '())
+               (add-before 'check 'patch-test-files
+                  (lambda _
+                    ;; Unpatch shebangs in test input so that source-highlight
+                    ;; is still able to infer input language
+                    (substitute* '("tests/test.sh"
+                                   "tests/test2.sh"
+                                   "tests/test.tcl")
+                      (((string-append "#! *" (which "sh"))) "#!/bin/sh"))
+                    ;; Initial patching unrecoverably removes whitespace, so
+                    ;; remove it also in the comparison output.
+                    (substitute* '("tests/test.sh.html"
+                                   "tests/test2.sh.html"
+                                   "tests/test.tcl.html")
+                      (("#! */bin/sh") "#!/bin/sh")))))))
     (home-page "https://www.gnu.org/software/src-highlite/")
     (synopsis "Produce a document with syntax highlighting from a source file")
     (description

base-commit: 25adb336bcb0188a92ecbe6b9c1d9d3e3a8b59e4
-- 
2.37.2





Reply sent to Mathieu Othacehe <othacehe <at> gnu.org>:
You have taken responsibility. (Tue, 27 Sep 2022 09:12:01 GMT) Full text and rfc822 format available.

Notification sent to kiasoc5 <kiasoc5 <at> disroot.org>:
bug acknowledged by developer. (Tue, 27 Sep 2022 09:12:02 GMT) Full text and rfc822 format available.

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

From: Mathieu Othacehe <othacehe <at> gnu.org>
To: kiasoc5 <kiasoc5 <at> disroot.org>
Cc: 57927-done <at> debbugs.gnu.org
Subject: Re: bug#57927: [PATCH] gnu: source-highlight: Fix lesspipe file
 name and use gexps.
Date: Tue, 27 Sep 2022 11:11:42 +0200
> * gnu/packages/pretty-print.scm (source-highlight):
> [arguments]: Use gexps, remove trailing #ts.
> [phases]: Add phase to make src-highlight-lesspipe.sh work.

Applied, thanks!

Mathieu




Information forwarded to guix-patches <at> gnu.org:
bug#57927; Package guix-patches. (Tue, 27 Sep 2022 13:35:00 GMT) Full text and rfc822 format available.

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

From: Tobias Geerinckx-Rice <me <at> tobias.gr>
To: kiasoc5 <kiasoc5 <at> disroot.org>
Cc: 57927 <at> debbugs.gnu.org
Subject: Re: [bug#57927] [PATCH] gnu: source-highlight: Fix lesspipe file
 name and use gexps.
Date: Tue, 27 Sep 2022 15:22:19 +0200
[Message part 1 (text/plain, inline)]
Hi kiasoc5,

kiasoc5 via Guix-patches via 写道:
> This fixes src-hilite-lesspipe.sh so that lesspipe.sh is called 
> instead of lesspipe.

Thanks!  I reverted this change on master.  It caused over 4000 
rebuilds (per architecture), which means it's core-updates 
material.

You can test this yourself by running ‘guix refresh -l 
source-highlight’.  It's not perfect: it can fail to detect some 
paths, especially when inheritance is involved.  But it's a good 
sanity check.

When you notice a rebuild count higher than the thresholds given 
here[0], please add a ‘[PATCH core-updates]’ or ‘[PATCH staging]’ 
warning to your patch subject.  It reduces the chance of these 
slipping through.

> * gnu/packages/pretty-print.scm (source-highlight):
> [arguments]: Use gexps, remove trailing #ts.
> [phases]: Add phase to make src-highlight-lesspipe.sh work.

These unrelated changes should be separated into at least two 
patches next time: one to gexp and remove the #ts, the other to 
make the functional change.

‘At least’, because Gexpification often leaves the output hash 
unchanged, so a separate gexp patch might have been able to go 
straight to master.

> +    (arguments   

This introduced a whitespace error: there are extra trailing 
spaces.  Git should highlight these when showing the diff.  I 
removed them.

Kind regards,

T G-R

[0]: https://guix.gnu.org/manual/en/guix.html#Submitting-Patches
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#57927; Package guix-patches. (Wed, 28 Sep 2022 04:35:02 GMT) Full text and rfc822 format available.

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

From: kiasoc5 <kiasoc5 <at> disroot.org>
To: Tobias Geerinckx-Rice <me <at> tobias.gr>
Cc: 57927 <at> debbugs.gnu.org
Subject: Re: [bug#57927] [PATCH] gnu: source-highlight: Fix lesspipe file
 name and use gexps.
Date: Wed, 28 Sep 2022 04:34:07 +0000
Hi Tobias,

On Tue, Sep 27 2022, 03:22:19 PM +0200
Tobias Geerinckx-Rice <me <at> tobias.gr> wrote:

> Hi kiasoc5,
> 
> kiasoc5 via Guix-patches via 写道:
> > This fixes src-hilite-lesspipe.sh so that lesspipe.sh is called 
> > instead of lesspipe.
> 
> When you notice a rebuild count higher than the thresholds given 
> here[0], please add a ‘[PATCH core-updates]’ or ‘[PATCH staging]’ 
> warning to your patch subject.  It reduces the chance of these 
> slipping through.

I didn't realize source-highlight was used by so many projects, I'll be
more careful next time.

Just so I understand the rebuilds are occuring because the store path
of source-highlight changed, and the result could not be grafted?

> > * gnu/packages/pretty-print.scm (source-highlight):
> > [arguments]: Use gexps, remove trailing #ts.
> > [phases]: Add phase to make src-highlight-lesspipe.sh work.
> 
> These unrelated changes should be separated into at least two 
> patches next time: one to gexp and remove the #ts, the other to 
> make the functional change.
> < to go 
> straight to master.

1. Does trailing #t change the hash?
2. Why might Gexpification change the hash?




Information forwarded to guix-patches <at> gnu.org:
bug#57927; Package guix-patches. (Wed, 28 Sep 2022 21:15:01 GMT) Full text and rfc822 format available.

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

From: Maxime Devos <maximedevos <at> telenet.be>
To: kiasoc5 <kiasoc5 <at> disroot.org>, Tobias Geerinckx-Rice <me <at> tobias.gr>
Cc: 57927 <at> debbugs.gnu.org
Subject: Re: [bug#57927] [PATCH] gnu: source-highlight: Fix lesspipe file name
 and use gexps.
Date: Wed, 28 Sep 2022 23:14:03 +0200
[Message part 1 (text/plain, inline)]

On 28-09-2022 06:34, kiasoc5 via Guix-patches via wrote:
>>> * gnu/packages/pretty-print.scm (source-highlight):
>>> [arguments]: Use gexps, remove trailing #ts.
>>> [phases]: Add phase to make src-highlight-lesspipe.sh work.
>> These unrelated changes should be separated into at least two
>> patches next time: one to gexp and remove the #ts, the other to
>> make the functional change.
>> < to go
>> straight to master.
> 1. Does trailing #t change the hash?

Yes.

> 2. Why might Gexpification change the hash?

When the resulting staged code changes.  This could happen if you were 
to do, say, #$(this-package-input "boost") instead of (assoc-ref 
%build-inputs "boost") for example, though AFAICT you didn't make any 
G-exp-related changes that would change the hash.

Greetings,
Maxime.
[OpenPGP_0x49E3EE22191725EE.asc (application/pgp-keys, attachment)]
[OpenPGP_signature (application/pgp-signature, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#57927; Package guix-patches. (Wed, 28 Sep 2022 21:17:02 GMT) Full text and rfc822 format available.

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

From: Maxime Devos <maximedevos <at> telenet.be>
To: kiasoc5 <kiasoc5 <at> disroot.org>, Tobias Geerinckx-Rice <me <at> tobias.gr>
Cc: 57927 <at> debbugs.gnu.org
Subject: Re: [bug#57927] [PATCH] gnu: source-highlight: Fix lesspipe file name
 and use gexps.
Date: Wed, 28 Sep 2022 23:16:13 +0200
[Message part 1 (text/plain, inline)]
On 28-09-2022 06:34, kiasoc5 via Guix-patches via wrote:
> Just so I understand the rebuilds are occuring because the store path
> of source-highlight changed, and the result could not be grafted?

On the second question:
adding a graft is not done automatically, you need to ask for it by 
_keeping_ the original package and adding the modified package to 
'replacement'.

Greetings,
Maxime.
[OpenPGP_0x49E3EE22191725EE.asc (application/pgp-keys, attachment)]
[OpenPGP_signature (application/pgp-signature, attachment)]

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

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

Previous Next


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