Skip Menu |

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

Report information
The Basics
Id: 56171
Status: resolved
Priority: 0/
Queue: PAR-Packer

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

Bug Information
Severity: Critical
Broken in: 1.002
Fixed in: (no value)



Subject: Can't locate PerlIO.pm
Dear, I am using Activeperl Binary build 1007 [291969]. PAR::PAcker 1.002, PDF::API2 0.73 When I package this script : #!/usr/bin/perl use strict; use warnings; use PDF::API2; => pp -o test.exe test.pl => OK When I execute test.exe, I have this bug : Can't locate PerlIO.pm in @INC (@INC contains: C:\Users\user\AppData\Local\Temp\par-user\cache-31b4270c10dbd27682a5add65c 2321943bd7f61d\inc\lib C:\Users\user\AppData\Local\Temp\par-user\cache-31b4270c10dbd27682a5add65c2321943bd7f61d\inc CODE(0x28cdbec) CODE(0x28cdeec)) at PDF/API2.pm line 212. BEGIN failed--compilation aborted. Best regards, Djibril
On Wed Mar 31 13:45:54 2010, DJIBEL wrote: Show quoted text
> Dear, > > I am using Activeperl Binary build 1007 [291969]. > PAR::PAcker 1.002, PDF::API2 0.73 > > When I package this script : > > #!/usr/bin/perl > use strict; > use warnings; > use PDF::API2; > > Can't locate PerlIO.pm in @INC (@INC contains: > C:\Users\user\AppData\Local\Temp\par-user\cache- > 31b4270c10dbd27682a5add65c > 2321943bd7f61d\inc\lib > C:\Users\user\AppData\Local\Temp\par-user\cache- > 31b4270c10dbd27682a5add65c2321943bd7f61d\inc > CODE(0x28cdbec) CODE(0x28cdeec)) at PDF/API2.pm line 212.
And this line is CORE::open($fh, "+<", \$filestr) ... i.e. prepare to read from string $filestr via $fh (cf. the documentation for PerlIO::scalar). This attempt implicitly require's PerlIO.pm. IMHO it is impossible to detect this usage by static analysis from Module::ScanDeps. (The latter module is used by pp to detect all other modules etc required by your script.) In your case you can work around this by using the option "-x" for pp. In addition to static analysis, this will actually run your script and extract the information which modules were actually loaded during the run. This will work since PDF::API2 does the above already in a BEGIN block. In the general case, it depends on the actual execution path whether we detect PerlIO.pm or not. Hmmm... We had a similar problem with Errno.pm. This will implicitly be require'd whenever someone treats $! as a string. We ended up adding Errno.pm to the list of modules that will always get packed in. Maybe we should do the same with PerlIO.pm? This would add a paltry ~20 KB to every pp'ed executable.
CC: par [...] perl.org
Subject: Re: [rt.cpan.org #56171] Can't locate PerlIO.pm
Date: Thu, 01 Apr 2010 09:09:30 +0200
To: bug-PAR-Packer [...] rt.cpan.org
From: Steffen Mueller <smueller [...] cpan.org>
Hi Roderich, RSCHUPP via RT wrote: Show quoted text
> Hmmm... We had a similar problem with Errno.pm. This will > implicitly be require'd whenever someone treats $! as a string. > We ended up adding Errno.pm to the list of modules that > will always get packed in. Maybe we should do the same with > PerlIO.pm? This would add a paltry ~20 KB to every pp'ed executable.
I agree that this is likely the cleanest solution. It's a problem that's easy to fix for us, easy to fix for users (-M), but very hard to actually track down for curious users and that's precisely the ones we don't want to punish :) Cheers, Steffen
On Thu Apr 01 03:09:47 2010, SMUELLER wrote: Show quoted text
> RSCHUPP via RT wrote:
> > We ended up adding Errno.pm to the list of modules that > > will always get packed in. Maybe we should do the same with > > PerlIO.pm? This would add a paltry ~20 KB to every pp'ed executable.
> > I agree that this is likely the cleanest solution. It's a problem that's
Thanks, Steffen. Committed. Cheers, Roderich
Le Mer 31 Mar 2010 14:47:50, RSCHUPP a écrit : Show quoted text
> On Wed Mar 31 13:45:54 2010, DJIBEL wrote:
> > Dear, > > > > I am using Activeperl Binary build 1007 [291969]. > > PAR::PAcker 1.002, PDF::API2 0.73 > > > > When I package this script : > > > > #!/usr/bin/perl > > use strict; > > use warnings; > > use PDF::API2; > > > > Can't locate PerlIO.pm in @INC (@INC contains: > > C:\Users\user\AppData\Local\Temp\par-user\cache- > > 31b4270c10dbd27682a5add65c > > 2321943bd7f61d\inc\lib > > C:\Users\user\AppData\Local\Temp\par-user\cache- > > 31b4270c10dbd27682a5add65c2321943bd7f61d\inc > > CODE(0x28cdbec) CODE(0x28cdeec)) at PDF/API2.pm line 212.
> > And this line is > > CORE::open($fh, "+<", \$filestr) ... > > i.e. prepare to read from string $filestr via $fh > (cf. the documentation for PerlIO::scalar). > This attempt implicitly require's PerlIO.pm. > > IMHO it is impossible to detect this usage by static analysis > from Module::ScanDeps. (The latter module is used by pp to detect > all other modules etc required by your script.) > > In your case you can work around this by using the option "-x" for pp. > In addition to static analysis, this will actually run > your script and extract the information which modules were > actually loaded during the run. This will work since > PDF::API2 does the above already in a BEGIN block. In the > general case, it depends on the actual execution path > whether we detect PerlIO.pm or not. > > Hmmm... We had a similar problem with Errno.pm. This will > implicitly be require'd whenever someone treats $! as a string. > We ended up adding Errno.pm to the list of modules that > will always get packed in. Maybe we should do the same with > PerlIO.pm? This would add a paltry ~20 KB to every pp'ed executable. > >
Thank you for your answers. By using this command now, it is work very well : pp -o test.exe test.pl -x -M PDF::API2 Djibril