nayakgi / perl-compiler

Automatically exported from code.google.com/p/perl-compiler
Other
0 stars 0 forks source link

perlcc wrong @INC with yclept #366

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
perlcc compares in yclept() the current @INC against the stored @INC, to pass 
the differences down to the compiler. Effectively to detect -I or -Mblib 
cmdline args.

However those differences are passed as -I, which means they are prepended to 
@INC. But some currrent @INC entries are after the system @INC, so they need to 
be pushed to the end of @INC instead.

This might lead to wrong/older modules being compiled.
E.g. 
pcc -S -v5 t/pg.pl
=> /usr/local/bin/perl5.14.4d-nt -Iblib/arch -Iblib/lib 
-I/usr/local/lib/perl5/site_perl/5.14.3/x86_64-linux-debug 
-I/usr/local/lib/perl5/site_perl -MO=C,-Dsp,-v,-opg.c t/pg.pl

where /usr/local/lib/perl5/site_perl/5.14.3/x86_64-linux-debug is wrong.
%OINC only contains /usr/local/lib/perl5/site_perl/5.14.3/x86_64-linux

and now of course the 5.14.3 modules are being used instead.

Original issue reported on code.google.com by reini.urban on 23 Jul 2014 at 2:51

GoogleCodeExporter commented 9 years ago
rejected. caused by wrong inc_version_list configuration:

  DB<6> x $Config{inc_version_list}
0  '5.14.3/x86_64-linux 5.14.3 5.14.2/x86_64-linux 5.14.2 5.14.1/x86_64-linux 
5.14.1 5.12.5 5.12.4 5.10.1 5.8.9 5.8.8 5.8.7 5.8.6 5.8.5 5.8.4 5.8.3 5.8.2 
5.8.1 5.6.2'
  DB<7> x @INC
0  '/home/rurban/Perl/B-C-work/blib/arch'
1  '/home/rurban/Perl/B-C-work/blib/lib'
2  'blib/arch'
3  'blib/lib'
4  '/usr/local/lib/perl5/site_perl/5.14.4/x86_64-linux-debug'
5  '/usr/local/lib/perl5/site_perl/5.14.4'
6  '/usr/local/lib/perl5/5.14.4/x86_64-linux-debug'
7  '/usr/local/lib/perl5/5.14.4'
8  '/usr/local/lib/perl5/site_perl/5.14.3/x86_64-linux-debug'
9  '/usr/local/lib/perl5/site_perl/5.14.3'
10  '/usr/local/lib/perl5/site_perl/5.14.2/x86_64-linux'
11  '/usr/local/lib/perl5/site_perl/5.14.2'
12  '/usr/local/lib/perl5/site_perl/5.14.1/x86_64-linux'
13  '/usr/local/lib/perl5/site_perl/5.14.1'
14  '/usr/local/lib/perl5/site_perl/5.12.5'
15  '/usr/local/lib/perl5/site_perl/5.12.4'
16  '/usr/local/lib/perl5/site_perl/5.10.1'
17  '/usr/local/lib/perl5/site_perl/5.8.9'
18  '/usr/local/lib/perl5/site_perl/5.8.8'
19  '/usr/local/lib/perl5/site_perl/5.8.7'
20  '/usr/local/lib/perl5/site_perl/5.8.6'
21  '/usr/local/lib/perl5/site_perl/5.8.5'
22  '/usr/local/lib/perl5/site_perl/5.8.4'
23  '/usr/local/lib/perl5/site_perl/5.8.3'
24  '/usr/local/lib/perl5/site_perl/5.8.2'
25  '/usr/local/lib/perl5/site_perl/5.8.1'
26  '/usr/local/lib/perl5/site_perl/5.6.2'
27  '/usr/local/lib/perl5/site_perl'
28  '.'

Original comment by reini.urban on 23 Jul 2014 at 2:53

GoogleCodeExporter commented 9 years ago
Well, there's still a wrong -I/usr/local/lib/perl5/site_perl which is caused by 
an the entry in inc_version_list.

Fixed with commit 22cd327b6a454c063837829e329a1e0c7b40047c
Author: Reini Urban <rurban@cpanel.net>
Date:   Wed Jul 23 10:01:04 2014 -0500

    strip version-less site_perl from perlcc, #366

Original comment by reini.urban on 23 Jul 2014 at 3:01