Perl-Toolchain-Gang / module-build-tiny

A tiny replacement for Module::Build
10 stars 17 forks source link

MBTiny doesn't fix shebang upon installation #3

Closed miyagawa closed 11 years ago

miyagawa commented 11 years ago

when you install bin scripts with MakeMaker or Module::Build, the installed scripts have a shebang like:

#!/Users/miyagawa/.plenv/versions/5.16.3/bin/perl5.16.3 

eval 'exec /Users/miyagawa/.plenv/versions/5.16.3/bin/perl5.16.3  -S $0 ${1+"$@"}'
    if 0; # not running under some shell
use strict;
use Plack::Runner;

but with Module::Build::Tiny, you get the original shebang, which can be #!perl or #!/usr/bin/perl, which causes running the script with a wrong perl, and eventually errors loading perl modules.

> perl -V
...
  @INC:
    /Users/miyagawa/.plenv/versions/5.16.3/lib/perl5/site_perl/5.16.3/darwin-2level
    /Users/miyagawa/.plenv/versions/5.16.3/lib/perl5/site_perl/5.16.3
    /Users/miyagawa/.plenv/versions/5.16.3/lib/perl5/5.16.3/darwin-2level
    /Users/miyagawa/.plenv/versions/5.16.3/lib/perl5/5.16.3
    .
> cpanm Starman
> perldoc -l Starman.pm
/Users/miyagawa/.plenv/versions/5.16.3/lib/perl5/site_perl/5.16.3/Starman.pm
> perldoc -l starman   
/Users/miyagawa/.plenv/versions/5.16.3/bin/starman
> starman
Can't locate Plack/Runner.pm in @INC (@INC contains: /Library/Perl/5.12/darwin-thread-multi-2level /Library/Perl/5.12 /Network/Library/Perl/5.12/darwin-thread-multi-2level /Network/Library/Perl/5.12 /Library/Perl/Updates/5.12.3 /System/Library/Perl/5.12/darwin-thread-multi-2level /System/Library/Perl/5.12 /System/Library/Perl/Extras/5.12/darwin-thread-multi-2level /System/Library/Perl/Extras/5.12 .) at /Users/miyagawa/.plenv/versions/5.16.3/bin/starman line 3.
BEGIN failed--compilation aborted at /Users/miyagawa/.plenv/versions/5.16.3/bin/starman line 3.
Leont commented 11 years ago

Issue should be solved with ExtUtils::Helpers 0.019

miyagawa commented 11 years ago

Confirmed.

Is it possible to get a new Module::Build::Tiny with the dep on the latest EU::Helpers, so that downstream don't need to have configure/build requires for EU::Helpers 0.019 manually?

Leont commented 11 years ago

Yeah, I was planning to release that in the near future anyway (put some speed improvements in). Released :-)