Closed eserte closed 8 years ago
I have looked over the scripts and they all use '#!/usr/bin/env perl' except for one test file (which I will correct)
Are you able to provide any more information about where this problem might exist?
Using #!/usr/bin/env perl
is not correct in the perl and CPAN world.
Let me explain. There are usually three ways of using a perl interpreter:
/usr/bin/perl
or /usr/local/bin/perl
./Configure
installed in a custom path (or a perlbrew-built perl without the perlbrew environment)In the first two cases, /usr/bin/env perl
would work, because the "correct" perl interpreter is in the user's PATH. In the last case, the user may or may not set PATH to the custom path. Because of that, ExtUtils::MakeMaker
and Module::Build
adjust the shebang of scripts to the correct custom perl path. But this happens only if the shebang in the uninstalled script is specified as "#!perl
" or "#!/usr/bin/perl
". It does not work for "#!/usr/bin/env perl
". There's some discussion in https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/issues/58 whether this should be changed.
For testing, where the scripts to be tested are not installed yet, this has the consequence that either these scripts have to be explicitely called with the correct perl interpreter (i.e. using $^X
), or by calling the pre-installed version of the script in blib/script
(where the shebang is already corrected). (But note that the 2nd variant may or may not work on Windows)
While I understand what you are saying, that is not the behaviour I see.
I have:
This is the output I got:
dferguson@queeg:~/gitroot/clusterssh$ ./Build
Building App-ClusterSSH
V=v5.16.3 at bin_PL/_build_docs line 10.
X=/home/dferguson/perl5/perlbrew/perls/perl-5.16.3/bin/perl at bin_PL/_build_docs line 11.
Generating: ccon
Generating: clusterssh_bash_completion.dist
Generating: crsh
Generating: cssh
X=/home/dferguson/perl5/perlbrew/perls/perl-5.16.3/bin/perl at ./cssh line 11.
V=v5.16.3 at ./cssh line 12.
Generating: ctel
This is using this diff:
diff --git a/bin_PL/_build_docs b/bin_PL/_build_docs
index fbad4c0..f9756a9 100755
--- a/bin_PL/_build_docs
+++ b/bin_PL/_build_docs
@@ -7,6 +7,9 @@ use FindBin qw($Bin $Script);
chdir $Bin || die "Unable to chdir into $Bin: $!";
+warn "V=$^V";
+warn "X=$^X";
+
my $bindir="$Bin/../bin";
if(! -d $bindir) {
diff --git a/bin_PL/cssh b/bin_PL/cssh
index 82a9b78..5d47349 100755
--- a/bin_PL/cssh
+++ b/bin_PL/cssh
@@ -7,6 +7,10 @@ use lib $FindBin::Bin. '/../lib';
use lib $FindBin::Bin. '/../lib/perl5';
use App::ClusterSSH;
+
+warn "X=$^X";
+warn "V=$^V";
+
my $app = App::ClusterSSH->new();
$app->options->add_common_ssh_options;
This shows my perlbrew installation is working as expected and is not using the sytem provided perl while having the 'env perl' shebang in place
Duncs
Actually I said that perlbrew works ("In the first two cases ..."). It's the self-compiled perl (without using perlbrew) which does not work.
If you want to see the problematic behaviour you have to compile your own perl (e.g. using ./configure.gnu --prefix=/path/to/customperl
, not change PATH
and then use /path/to/customperl/bin/cpan App::ClusterSSH
to see the test failure.
Note that most CPAN Testers don't use perlbrew, so you will then always get fail reports from them.
I have compiled up my own perl, proven the issue exists, fixed it and committed it, and pushed the change to the repo. This will be in released 4.04_01.
Thanks for the bug report.
While trying to build and test App-ClusterSSH-4.04 with CPAN.pm and a custom perl:
The existence of
/etc/perl
in@INC
suggests that somewhere the system perl (i.e./usr/bin/perl
) is used, not the perl currently used in the build. Usually such a problem may be be fixed by using$^X
.