perl-carton / carton

Bundler or pip freeze for Perl
http://search.cpan.org/dist/carton
Other
493 stars 96 forks source link

Document, that `carton` requires absolute path to `local/lib/perl5` #283

Closed KES777 closed 1 year ago

KES777 commented 1 year ago
~/b# PERL5LIB=lib:local/lib/perl5 local/bin/carton -n
Installing modules using /root/data/s-bot/repo/cpanfile
Can't locate Parse/PMFile.pm in @INC (you may need to install the Parse::PMFile module) (@INC contains: lib local/lib/perl5/x86_64-linux local/lib/perl5 /root/perl5/perlbrew/perls/perl-5.36.0/lib/site_perl/5.36.0/x86_64-linux /root/perl5/perlbrew/perls/perl-5.36.0/lib/site_perl/5.36.0 /root/perl5/perlbrew/perls/perl-5.36.0/lib/5.36.0/x86_64-linux /root/perl5/perlbrew/perls/perl-5.36.0/lib/5.36.0) at local/lib/perl5/Menlo/CLI/Compat.pm line 2320.
Installing modules failed

~/b# PERL5LIB=lib:$(pwd)/local/lib/perl5 local/bin/carton -n
Installing modules using /root/data/s-bot/repo/cpanfile
/usr/bin/tar: Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.com.apple.quarantine'
Successfully installed Data-Printer-1.001000
Successfully installed Module-Build-0.4232
Successfully installed Module-Runtime-0.016
Successfully installed Dist-CheckConflicts-0.11
...

At this section: https://metacpan.org/pod/Carton#AVAILABILITY stated:

Also, Carton requires you to run your command/application with carton exec command or to include the local/lib/perl5 directory in your Perl library search path (using PERL5LIB, -I, or [lib](https://metacpan.org/pod/lib)).

I suggest to change path to /absolute/path/to/local/lib/perl5 from local/lib/perl5

miyagawa commented 1 year ago

First of all, in a regular setup when you install Carton to site_perl or local::lib path, you won't have this issue. Second, it's not Carton that causes it, but it's how perl evaluates PERL5LIB when you change runtime directory, and that's why tools like local::lib configures PERL5LIB in an absolute path.