Skip Menu |

This queue is for tickets about the Test-Harness CPAN distribution.

Report information
The Basics
Id: 85036
Status: rejected
Priority: 0/
Queue: Test-Harness

People
Owner: Nobody in particular
Requestors: andrew.pennebaker [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Poor shebang in prove command line script
The shebang in the 'prove' command line script is artificially limiting: http://cpansearch.perl.org/src/OVID/Test-Harness-3.28/bin/prove #!/usr/bin/perl -w is better written as #!/usr/bin/env perl use warnings; This way, the 'prove' script can run in environments where Perl is not installed in /usr/bin, for example Windows (Strawberry Perl) and Haiku OS.
Can you help me understand this a bit better? When you install executables using Perl's tools, the shebang line is rewritten to point to the correct Perl installation. For example, here's the shebang of my prove: #!/Users/ovid/perl5/perlbrew/perls/perl-5.12.4/bin/perl -w Can you tell me the steps I need to take to reproduce getting a bad shebang? Cheers, Ovid
From: andrew.pennebaker [...] gmail.com
On Sun May 05 04:19:04 2013, OVID wrote: Show quoted text
> Can you help me understand this a bit better? When you install > executables using Perl's tools, the shebang line is rewritten to > point to the correct Perl installation. For example, here's the > shebang of my prove: > > #!/Users/ovid/perl5/perlbrew/perls/perl-5.12.4/bin/perl -w > > Can you tell me the steps I need to take to reproduce getting a bad > shebang? > > Cheers, > Ovid
There is the possibility that Git Bash's Perl was detected, when the shebang was rewritten. In any case, shebangs should never be rewritten, they should simply use env in the first place: #!/usr/bin/env perl That way they don't require any rewriting, they just work out of the box on any environment you throw them into.
On Sun May 05 18:32:54 2013, mcandre wrote: Show quoted text
> There is the possibility that Git Bash's Perl was detected, when the > shebang was rewritten. In any case, shebangs should never be > rewritten, they should simply use env in the first place: > > #!/usr/bin/env perl > > That way they don't require any rewriting, they just work out of the > box on any environment you throw them into.
No, it should most definitely not. MakeMaker will rewrite the shebang line iff it points directly to a perl. This ensures prove will run with the same perl that it was installed with; not with some other perl that may for example not have the rest of TAP::Harness installed. This rewriting is vital. If you want your prove to use the environmental perl, feel free to rewrite it yourself. Don't bug upstream if it breaks though. I recommend closing this ticket. Leon
On Tue Oct 01 10:25:25 2013, LEONT wrote: Show quoted text
> No, it should most definitely not. > > MakeMaker will rewrite the shebang line iff it points directly to a > perl. This ensures prove will run with the same perl that it was > installed with; not with some other perl that may for example not have > the rest of TAP::Harness installed. This rewriting is vital. > > If you want your prove to use the environmental perl, feel free to > rewrite it yourself. Don't bug upstream if it breaks though. > > I recommend closing this ticket. > > Leon
In fact, I just did that. If you disagree with this behavior, ExtUtils::MakeMaker is probably the best place to complain. See *https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/issues/37 *https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/issues/38 * https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/issues/58 For some relevant previous discussions. Leon