Subject: [bug#48630] Acknowledgement ([PATCH] adds `ack' package and it's perl module dependency File::Next)

From: Xinglu Chen <[email-masked]>
Date: Tue, 25 May 2021 23:34:26 +0200

On Tue, May 25 2021, Gabriel Wicki wrote:

> thanks for the advice, i'll update and split the patch into a small
> series soon!

Great! :)

> the tests are deactivated because 3 of 841 fail. they seem to check
> some kind of shebang #! paths. see this excerpt from the build log:
>
> #   Failed test 'Util::sets_match( TEST_TYPE with -t perl )'
> #   at t/ack-type.t line 43.
>
> 	# actual[
> 	#   't/swamp/0:1:#!/gnu/store/8zvc5mvk0xm3ygrxsgpyy5ilxb5rzjry-perl-5.30.2/bin/perl -w',
> ...
> 	# ]
> 	# expected[
> 	#   't/swamp/0:1:#!/usr/bin/perl -w',
> ...
> 	# ]
>
> these lines are being ignored by the patch-generated-file-shebangs
> phase, maybe because the #! aren't at the beginning of the line?
>
> i'm a total novice in Perl, so i'm not sure what exactly is happening
> there or why this is even tested.
>
> should i try and add my own version of a patch-shebang after the
> patch-generated-file-shebangs phase?

Yes, you could add add a phase after the ‘patch-generated-file-shebangs’
phase that replaces #!/usr/bin/perl with #!/gnu/store/...-perl/bin/perl.
Something like this should work (untested):

#+begin_src scheme
(add-after 'patch-generated-file-shebangs 'patch-more-shebangs
  (lambda (#:key inputs #:allow-other-keys)
    (substitute* '("t/ack-type.t" ...)
      (let ((perl (assoc-ref inputs "perl")))
        (("/usr/bin/perl")
         (string-append perl "/bin/perl"))))))
#+end_src