This queue is for tickets about the Module-Build CPAN distribution.

Report information
The Basics
Id:
20466
Status:
open
Priority:
Low/Low
Queue:

People
Owner:
Nobody in particular
Requestors:
cjm [...] cpan.org
Cc:
AdminCc:

BugTracker
Severity:
Wishlist
Broken in:
0.2801
Fixed in:
(no value)



Subject: Installed scripts break after Perl version upgrade
I'm running Gentoo Linux. It installs Perl as /usr/bin/perl5.8.7 and makes /usr/bin/perl a symlink to perl5.8.7. I think this is a reasonably common setup on Unix systems. If I type "perl -e 'print $^X'", it prints /usr/bin/perl5.8.7. That is also the path that find_perl_interpreter returns. The net result of this is that any scripts that are installed by Module::Build will stop working when you upgrade Perl, because they say #!/usr/bin/perl5.8.7 instead of #!/usr/bin/perl. I think find_perl_interpreter ought to be fixed to avoid that. For my LibA2 distribution, I overrode find_perl_interpreter like this: use Cwd 'abs_path'; sub find_perl_interpreter { my $self = shift @_; my $perl = $self->SUPER::find_perl_interpreter(@_); # Convert /usr/bin/perl5.8.6 to /usr/bin/perl: # (if the latter is a symlink to the former) my $base = $perl; if ($base =~ s/[\d.]+$// and -l $base and abs_path($base) eq $perl) { $perl = $base; } return $perl; } # end find_perl_interpreter I'm not sure that's the best solution, though. I noticed that "perl -MConfig -e 'print $Config{perlpath}'" prints /usr/bin/perl. It may be better to check that instead of just stripping digits off the end. I was using Module::Build 0.2604 when I discovered this, but version 0.2801 still acts the same way.
I vote for this too. In my current environment, the shared mount where I built perl and install scripts is mounted under a different location on different hosts, then a symlink is created to that directory. Why?? Some things have no reason. :-) So, I install on one host, but scripts from bin/ will not run on any other host because the abs_path perl in the shebang line does not exist on those hosts. This is actually a big problem for CPAN libs that install scripts. I can't use ack-grep on any other host, for example. If I invoked perl as some path, that's the path I want to use.


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.