Subject: Re: [PATCH 2/5] t/perf: use configured PERL_PATH

From: Patrick Steinhardt <[email-masked]>
Date: Mon, 14 Apr 2025 08:50:20 +0200

On Thu, Apr 10, 2025 at 01:43:44PM +0200, Toon Claes wrote:
> Patrick Steinhardt <[email-masked]> writes:
> 
> > Our benchmarks use a couple of Perl scripts to compute results. These
> > Perl scripts get executed directly, and as the shebang is hardcoded to
> > "/usr/bin/perl" this will fail on any system where the Perl interpreter
> > is located in a different path.
> >
> > Our build infrastructure already lets users configure the location of
> > Perl, which ultimately gets written into the GIT-BUILD-OPTIONS file.
> > This file is being sourced by "test-lib.sh", and consequently we already
> > have the "PERL_PATH" variable available that contains its configured
> > location.
> >
> > Use "PERL_PATH" to execute Perl scripts, which makes them work on more
> > esoteric systems like NixOS.
> 
> I see in `t/perf/README` there's a mention of running `./aggregate.perl`
> directly? Shall we inform the user to run that through their Perl as
> well?
> 
> -    $ ./aggregate.perl . /path/to/other/git ./p0001-rev-list.sh
> +    $ perl ./aggregate.perl . /path/to/other/git ./p0001-rev-list.sh
> 
> Or do we expect users to know what they are doing when they don't have
> Perl installed at /usr/bin/perl?

Another solution could be to switch the shebang to `#!/usr/bin/env
perl`. We also do this for "t/chainlint.pl".

Patrick