Skip Menu |
 

This queue is for tickets about the PAR-Packer CPAN distribution.

Report information
The Basics
Id: 42731
Status: rejected
Priority: 0/
Queue: PAR-Packer

People
Owner: Nobody in particular
Requestors: goneri [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 0.982



Subject: pp Breaks @INC
Download (untitled) / with headers
text/plain 733b
Hi, Thank you for this great tool. Today I got this strange behaviour with @INC content. I can reproduce the problem on Linux and Solaris. solaris$cat test #!/usr/bin/perl use Data::Dumper; print Dumper(@INC); solaris$perl test $VAR1 = '/home2/goneri/tmp/build/opt/ocsinventory-agent/lib/perl5/5.10.0/sun4-solaris'; $VAR2 = '/home2/goneri/tmp/build/opt/ocsinventory-agent/lib/perl5/5.10.0'; $VAR3 = '/home2/goneri/tmp/build/opt/ocsinventory-agent/lib/perl5/site_perl/5.10.0/sun4-solaris'; $VAR4 = '/home2/goneri/tmp/build/opt/ocsinventory-agent/lib/perl5/site_perl/5.10.0'; $VAR5 = '.'; pp -B -p test -vvv -o test.par (...) pp -o test.bin test.par (...) solaris$./test.bin $VAR1 = sub { "DUMMY" }; $VAR2 = sub { "DUMMY" };
Download (untitled) / with headers
text/plain 1.4k
Hi, thanks for the bug report, but the behaviour you describe is on purpose. When you use pp to produce a stand-alone binary executable, it clears the INC paths of your perl. That is on purpose so *if* it breaks, it will break on your development machine already. Otherwise you might be relying on local stuff that is not present on the target machines. If you modify @INC at run-time, the paths will be preserved. This behaviour is documented in the pp help. Quoting the relevant synopsis: % pp -B -p -o out.par file # same as above, but bundles core modules # and removes any local paths from @INC % pp -P -o out.pl file # Creates 'out.pl' from 'file' % pp -B -p -o out.pl file # same as above, but bundles core modules # and removes any local paths from @INC # (-B is assumed when making executables) "Since PAR version 0.953, this also strips any local paths from the list of module search paths C<@INC> before running the contained script." It *is* possible to override this behaviour (modify/replace main.pl in the par file), but I would strongly discourage this. Step back and think about whether you really want your executable to be dependent on the perl it was built with. Either way, this is not a bug but intended so I will close the ticket. For further discussion or assistance, please send any correspondence to the PAR mailing list directly. Thanks and best regards, Steffen
CC: GONERI [...] cpan.org
Subject: Re: [rt.cpan.org #42731] pp Breaks @INC
Date: Sat, 24 Jan 2009 02:43:50 +0100
To: Steffen Mueller via RT <bug-PAR-Packer [...] rt.cpan.org>
From: Gonéri Le Bouder <goneri [...] rulezlan.org>
Download (untitled) / with headers
text/plain 345b
On Fri, Jan 23, 2009 at 06:40:42PM -0500, Steffen Mueller via RT wrote: Show quoted text
Thank you Steffen for the long and answer. I still think it's a minor bug since @INC content is not a scalar or nothing as people expect and this may break stuff. Best regards, Gonéri Le Bouder
Download signature.asc
application/pgp-signature 189b

Message body not shown because it is not plain text.



This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.