tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: PERL5LIB behaviour in pkgsrc broken



On Thu, Nov 01, 2012 at 09:43:05PM +1300, Steven Drake wrote:
> On Wed, 24 Oct 2012, Thomas Klausner wrote:
> 
> > In usual perl installations, setting PERL5LIB to /path/to/lib/perl5 is
> > sufficient, because the subdirectories for version and architecture
> > are automatically searched. I.e. adding /path/to/lib/perl5
> > automatically searches /path/to/lib/perl5/5.16.1 and
> > /path/to/lib/perl5/5.16.1/x86_64-netbsd-thread-multi.
> > 
> > This breaks for perl modules installed outside of pkgsrc by perl from
> > pkgsrc, since they are installed into /path/to/lib/perl5/5.16.0
> > (previously, 5.14.0) even if the version is 5.16.1 (or 5.14.2,
> > before). For perl-5.16.1 you need to change PERL5LIB to point to
> > /path/to/lib/perl5/5.16.0 manually (the architecture support works;
> > i.e., /path/to/lib/perl5/5.16.0/x86_64-netbsd-thread-multi is added
> > automatically).
> 
> How is this a problem?
> 
> If you build a perl module outside of pkgsrc with pkgsrc's perl the modules
> get install to /path/to/lib/perl5/site_perl/5.16.0 

That's correct.

> and thats where pkgsrc's
> perl looks for modules.

This isn't.

Example:

First, install a random module into a non-default location:

/tmp> tar xzf /archive/distfiles/IMDB-Film-0.52.tar.gz
/tmp> cd IMDB-Film-0.52
/tmp/IMDB-Film-0.52> perl Makefile.PL PREFIX=/home/wiz/test
Do you want to perform online tests during "make test" phase? [no] n
Checking if your kit is complete...
Looks good
Writing Makefile for IMDB::Film
Writing MYMETA.yml and MYMETA.json
/tmp/IMDB-Film-0.52> make PREFIX=/home/wiz/test
cp lib/IMDB/Film.pm blib/lib/IMDB/Film.pm
cp lib/IMDB/BaseClass.pm blib/lib/IMDB/BaseClass.pm
cp lib/IMDB/Persons.pm blib/lib/IMDB/Persons.pm
Manifying blib/man3/IMDB::BaseClass.3
Manifying blib/man3/IMDB::Film.3
Manifying blib/man3/IMDB::Persons.3
/tmp/IMDB-Film-0.52> make -n install PREFIX=/home/wiz/test
true
true
true
true
true
true
/usr/pkg/bin/perl "-MExtUtils::Command::MM" -e pod2man "--" --section=3 
--perm_rw=644  lib/IMDB/BaseClass.pm blib/man3/IMDB::BaseClass.3  
lib/IMDB/Film.pm blib/man3/IMDB::Film.3  lib/IMDB/Persons.pm 
blib/man3/IMDB::Persons.3
true
/usr/pkg/bin/perl -MExtUtils::Install -e 'install([ from_to => {@ARGV}, verbose 
=> '\''0'\'', uninstall_shadows => '\''0'\'', dir_mode => '\''755'\'' ]);' --  
read 
/usr/pkg/lib/perl5/site_perl/5.16.0/x86_64-netbsd-thread-multi/auto/IMDB/Film/.packlist
  write 
/home/wiz/test/lib/perl5/site_perl/5.16.0/x86_64-netbsd-thread-multi/auto/IMDB/Film/.packlist
  blib/lib /home/wiz/test/lib/perl5/site_perl/5.16.0  blib/arch 
/home/wiz/test/lib/perl5/site_perl/5.16.0/x86_64-netbsd-thread-multi  blib/bin 
/home/wiz/test/lib/perl5/site_perl/bin  blib/script 
/home/wiz/test/lib/perl5/site_perl/bin  blib/man1 
/home/wiz/test/lib/perl5/site_perl/man/man1  blib/man3 
/home/wiz/test/lib/perl5/site_perl/man/man3
/usr/pkg/bin/perl -MExtUtils::Command::MM -e 'warn_if_old_packlist' --  
/usr/pkg/lib/perl5/5.16.0/x86_64-netbsd-thread-multi/auto/IMDB/Film
true
echo Appending installation info to 
/home/wiz/test/lib/perl5/5.16.0/x86_64-netbsd-thread-multi/perllocal.pod
/usr/pkg/bin/perl -MExtUtils::Command -e 'mkpath' -- 
/home/wiz/test/lib/perl5/5.16.0/x86_64-netbsd-thread-multi
/usr/pkg/bin/perl -MExtUtils::Command::MM -e 'perllocal_install' --  "Module" 
"IMDB::Film"  "installed into" "/home/wiz/test/lib/perl5/site_perl/5.16.0"  
LINKTYPE "dynamic"  VERSION "0.52"  EXE_FILES ""  >> 
/home/wiz/test/lib/perl5/5.16.0/x86_64-netbsd-thread-multi/perllocal.pod
true
true
/tmp/IMDB-Film-0.52> make install PREFIX=/home/wiz/test
Installing /home/wiz/test/lib/perl5/site_perl/5.16.0/IMDB/Film.pm
Installing /home/wiz/test/lib/perl5/site_perl/5.16.0/IMDB/BaseClass.pm
Installing /home/wiz/test/lib/perl5/site_perl/5.16.0/IMDB/Persons.pm
Installing /home/wiz/test/lib/perl5/site_perl/man/man3/IMDB::BaseClass.3
Installing /home/wiz/test/lib/perl5/site_perl/man/man3/IMDB::Film.3
Installing /home/wiz/test/lib/perl5/site_perl/man/man3/IMDB::Persons.3
Appending installation info to 
/home/wiz/test/lib/perl5/5.16.0/x86_64-netbsd-thread-multi/perllocal.pod

Now try using it:
/tmp/IMDB-Film-0.52> PERL5LIB=/home/wiz/test/lib/perl5/site_perl perl -e 'use 
IMDB::Film;'
Can't locate IMDB/Film.pm in @INC (@INC contains: 
/home/wiz/test/lib/perl5/site_perl 
/usr/pkg/lib/perl5/site_perl/5.16.0/x86_64-netbsd-thread-multi 
/usr/pkg/lib/perl5/site_perl/5.16.0 
/usr/pkg/lib/perl5/vendor_perl/5.16.0/x86_64-netbsd-thread-multi 
/usr/pkg/lib/perl5/vendor_perl/5.16.0 
/usr/pkg/lib/perl5/5.16.0/x86_64-netbsd-thread-multi /usr/pkg/lib/perl5/5.16.0 
.) at -e line 1.
BEGIN failed--compilation aborted at -e line 1.

But if I rename the directory to match the perl version, it does:
/tmp/IMDB-Film-0.52> mv ~/test/lib/perl5/site_perl/5.16.0 
~/test/lib/perl5/site_perl/5.16.1
/tmp/IMDB-Film-0.52> PERL5LIB=/home/wiz/test/lib/perl5/site_perl perl -e 'use 
IMDB::Film;'  
/tmp/IMDB-Film-0.52>

This is what I want fixed.
 Thomas


Home | Main Index | Thread Index | Old Index