miyagawa/cpanminus — Issue #126: Incompatibility with -Duserelocatableinc 
Author: zjt
Created: 2011-11-01 18:57:31+00:00
State: open

This isn't a major bug because it's easy enough to work around, but I think that it is worth reporting.

When I build perl with -Duserelocatableinc, and then move perl to another directory, and then install cpanm (it successfully installs), I am unable to run cpanm directly

> ./Configure \
-Dprefix=/opt \
-des \
-Duserelocatableinc

...

> sudo mv /opt/perl-5.14.2 /opt/perl-somethingelse

> sudo /opt/perl-somethingelse/bin/perl ./cpanm App::cpanminus
Fetching http://search.cpan.org/CPAN/authors/id/M/MI/MIYAGAWA/App-cpanminus-1.5003.tar.gz ... OK
Configuring App-cpanminus-1.5003 ... OK
Building and testing App-cpanminus-1.5003 for App::cpanminus ... OK
Successfully installed App-cpanminus-1.5003

> head /opt/perl-somethingelse/bin/cpanm
#!/opt/perl-5.14.2/bin/perl

eval 'exec /opt/perl-5.14.2/bin/perl -S $0 ${1+"$@"}'
if 0; # not running under some shell

...

> sudo /opt/perl-somethingelse/bin/cpanm
sudo: unable to execute /opt/perl-somethingelse/bin/cpanm: No such file or directory

> ll /opt/perl-somethingelse/bin/cpanm
-r-xr-xr-x 1 root root 318K Nov 1 13:45 /opt/perl-somethingelse/bin/cpanm

> sudo /opt/perl-somethingelse/bin/perl /opt/perl-somethingelse/bin/cpanm Some::Module
(works OK)