Skip Menu |
 

This queue is for tickets about the Module-ScanDeps CPAN distribution.

Report information
The Basics
Id: 80276
Status: resolved
Priority: 0/
Queue: Module-ScanDeps

People
Owner: RSCHUPP [...] cpan.org
Requestors: hugues.jonqueres [...] sapimep.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.09
Fixed in: 1.10



Subject: Module DateTime::Format::ISO8601 generates error after being packaged
Download (untitled) / with headers
text/plain 3.1k
Hi, I was trying to create a binary file from a script which used Getopt::Long to enter options and DateTime::Format::ISO8601 to check if a date existed, and after I ran the pp command to create the binary file, I couldn't run the binary file, I always got this error : # ./script The following parameter was passed in the call to DateTime::Format::Builder::Parser::create_single_parser but was not listed in the validation options: params at DateTime/Format/Builder/Parser.pm line 311 DateTime::Format::Builder::Parser::create_single_parser('undef', 'params', 'ARRAY(0x168b0720)', 'length', 8, 'regex', 'Regexp=SCALAR(0x168b06e0)') called at DateTime/Format/Builder/Parser.pm line 501 DateTime::Format::Builder::Parser::sort_parsers('DateTime::Format::Build er::Parser', 'HASH(0x16840ce0)', 'ARRAY(0x1682dd80)') called at DateTime/Format/Builder/Parser.pm line 397 DateTime::Format::Builder::Parser::create_multiple_parsers('DateTime::Fo rmat::Builder::Parser', 'HASH(0x16840ce0)', 'HASH(0x168b0700)', 'HASH(0x168b07e0)', 'HASH(0x168b0890)', 'HASH(0x168b0930)', 'HASH(0x168b09e0)', 'HASH(0x168b0b00)', 'HASH(0x168b0c10)', ...) called at DateTime/Format/Builder/Parser.pm line 600 DateTime::Format::Builder::Parser::create_parser('DateTime::Format::Buil der::Parser', 'ARRAY(0x167d1ad0)', 'HASH(0x168b0700)', 'HASH(0x168b07e0)', 'HASH(0x168b0890)', 'HASH(0x168b0930)', 'HASH(0x168b09e0)', 'HASH(0x168b0b00)', 'HASH(0x168b0c10)', ...) called at DateTime/Format/Builder.pm line 156 DateTime::Format::Builder::create_parser('DateTime::Format::Builder', 'ARRAY(0x168c0050)') called at DateTime/Format/Builder.pm line 174 DateTime::Format::Builder::create_end_parser('DateTime::Format::Builder' , 'ARRAY(0x168c0050)') called at DateTime/Format/Builder.pm line 104 DateTime::Format::Builder::create_class('undef', 'parsers', 'HASH(0x168c35c0)') called at DateTime/Format/ISO8601.pm line 173 require DateTime/Format/ISO8601.pm called at script/script.pl line 8 main::BEGIN() called at DateTime/Format/ISO8601.pm line 0 eval {...} called at DateTime/Format/ISO8601.pm line 0 require main called at /usr/lib/perl5/site_perl/5.8.8/PAR.pm line 636 PAR::_run_member('Archive::Zip::ZipFileMember=HASH(0x1615f7e0)', 1) called at script/main.pl line 26 require main called at /usr/lib/perl5/site_perl/5.8.8/PAR.pm line 636 PAR::_run_member('Archive::Zip::ZipFileMember=HASH(0x1615f610)') called at /usr/lib/perl5/site_perl/5.8.8/PAR.pm line 428 PAR::import('PAR') called at -e line 953 eval {...} called at -e line 209 __par_pl::BEGIN() called at DateTime/Format/ISO8601.pm line 0 eval {...} called at DateTime/Format/ISO8601.pm line 0 Compilation failed in require at script/script.pl line 8. BEGIN failed--compilation aborted at script/script.pl line 8. I'm working on Perl 5.8.8, with PAR::Packer v1.1013, DateTime::Format::ISO8601 v0.08, Getopt::Long v2.38 and my operating system is "Linux XXXXXX.XXXXXXX.XXX 2.6.18-308.el5 #1 SMP Tue Feb 21 20:06:06 EST 2012 x86_64 x86_64 x86_64 GNU/Linux" (CentOS). I've join a script which can be used to reproduce this issue. Best Regards.
Subject: script.pl
Download script.pl
text/x-perl 1.2k
#!/usr/bin/perl # $Id "RFC Call ST03" $ # $Revision: 0 $ # $Source /home/root-hjo/script.pl $ use strict; use warnings; use Getopt::Long; use DateTime::Format::ISO8601; my ($pstart); GetOptions("s=i" => \$pstart); ############################################################################# # MAIN # ############################################################################# check_input($pstart); ############################################################################# # FUNCTIONS # ############################################################################# #################################check_input################################# sub check_input { my ($date) = @_; if (defined($date) == '1') { eval { my $check = DateTime::Format::ISO8601->parse_datetime($date); }; if ( $@ ) { die qq{Error : the date doesn't exist or is not like YYYYMMDD\n} } else { print qq{date OK\n}; } } else { print qq{Error while calling script : script.pl -s [YYYYMMDD]\n}; } } ############################################################################# __END__
Download (untitled) / with headers
text/plain 942b
The problem is actually in Module::ScanDeps which is used by PAR::Packer to detect all modules used (transitively) by your script. Module::ScanDeps misses some DateTime::Format::Builder::Parser::XXX modules that are implicitly loaded by DateTime::Format::Builder::Parser - hence these modules are not packed into the executable. Fixed in http://svn.openfoundry.org/par/Module-ScanDeps/trunk Can you please try this version or simply add the line marked below to your installed .../Module/ScanDeps.pm (near line 278): 'Date/Manip/TZ.pm' => sub { return (_glob_in_inc('Date/Manip/TZ', 1), _glob_in_inc('Date/Manip/Offset', 1)); }, 'DateTime/Format/Builder/Parser.pm' => 'sub', ### <--- 'DateTime/Locale.pm' => 'sub', 'DateTime/TimeZone.pm' => 'sub', 'DBI.pm' => sub { grep !/\bProxy\b/, _glob_in_inc('DBD', 1); }, You must re-pack your script to see any effect. Cheers, Roderich
Fixed in Module::ScanDeps 1.10
From: hugues.jonqueres [...] sapimep.com
Download (untitled) / with headers
text/plain 902b
Show quoted text
> Fixed in Module::ScanDeps 1.10
Hi, I just upgraded the module Module::ScanDeps to the 1.10 version cpan[1]> i Module::ScanDeps Reading '/home/root-hjo/.cpan/Metadata' Database was generated on Mon, 22 Oct 2012 07:31:03 GMT Module id = Module::ScanDeps DESCRIPTION Recursively scan Perl code for dependencies CPAN_USERID AUTRIJUS (Audrey Tang <cpan@audreyt.org>) CPAN_VERSION 1.10 CPAN_FILE R/RS/RSCHUPP/Module-ScanDeps-1.10.tar.gz UPLOAD_DATE 2012-10-20 DSLIP_STATUS Rmphp (released,mailing-list,perl,hybrid,Standard-Perl) MANPAGE Module::ScanDeps - Recursively scan Perl code for dependencies INST_FILE /usr/lib/perl5/site_perl/5.8.8/Module/ScanDeps.pm INST_VERSION 1.10 But I still got the same error as before (even the lines number are the same) after having repackaged the script. Could you please help me out a little more ? Regards
Download (untitled) / with headers
text/plain 432b
On 2012-10-22 04:30:27, Scarfayss wrote: Show quoted text
> I just upgraded the module Module::ScanDeps to the 1.10 version > But I still got the same error as before (even the lines number are the > same) after having repackaged the script.
M:SD 1.10 fixes the problem for me with your sample script.pl. Are you sure you re-ran pp after installing 1.10? Can you run "unzip -l ..." on the resulting executable and post its ouput? Cheers, Roderich
From: hugues.jonqueres [...] sapimep.com
Download (untitled) / with headers
text/plain 330b
Show quoted text
> Are you sure you re-ran pp after installing 1.10?
Yes I am, I'm using the same command as before : pp -o script -M Getopt::Long -M Params::Validate::XS -M Class::Load::XS -M DateTime::Format::ISO8601 -C script.pl Show quoted text
> Can you run "unzip -l ..." on the resulting executable and post > its ouput?
Yes, it's in the joined file.
Subject: unzip.txt
Download unzip.txt
text/plain 99.2k

Message body is not shown because it is too large.

Download (untitled) / with headers
text/plain 398b
On 2012-10-22 06:15:10, Scarfayss wrote: Show quoted text
> > Are you sure you re-ran pp after installing 1.10?
> > Yes I am, I'm using the same command as before : > pp -o script -M Getopt::Long -M Params::Validate::XS -M
Class::Load::XS -M Show quoted text
> DateTime::Format::ISO8601 -C script.pl
Oops, "-C" seems to have a problem - can you try without it? BTW, all the "-M" options shouldn't be necessary. Cheers, Roderich
From: hugues.jonqueres [...] sapimep.com
Download (untitled) / with headers
text/plain 311b
Show quoted text
> Oops, "-C" seems to have a problem - can you try without it?
Yes, you were right, it's fine now. Does it mean I have to give up on the -C option ? Show quoted text
> BTW, all the "-M" options shouldn't be necessary.
Without them, DateTime::Format::ISO8601 wouldn't load, but now it's perfectly fine indeed. Best Regards.
Download (untitled) / with headers
text/plain 665b
On 2012-10-22 07:20:21, Scarfayss wrote: Show quoted text
>> Oops, "-C" seems to have a problem - can you try without it?
> Yes, you were right, it's fine now. Does it mean I have to give up on the > -C option ?
At least for now. AFAICT the current implementation of "-C" breaks everything that needs a real file tree, e.g. - looking for all modules Fubar::* by looking at the result of glob("$_/Fubar/*.pm") foreach $_ in @INC (in your case Fubar is DateTime::Format::Builder::Parser) - loading data files with a similar mechanism, e.g. Unicode tables The problem is actually in PAR.pm, I'll probably release a fix tonite, but don't hold your breath. Cheers, Roderich
From: hugues.jonqueres [...] sapimep.com
Download (untitled) / with headers
text/plain 242b
Show quoted text
> The problem is actually in PAR.pm, I'll probably release > a fix tonite, but don't hold your breath.
Well, ok thanks for the answer, just do your best, there's no rush for me so I'll wait the upgrade. Thanks anyway for the help, Regards.
Download (untitled) / with headers
text/plain 234b
On 2012-10-22 09:06:43, Scarfayss wrote: Show quoted text
> > The problem is actually in PAR.pm, I'll probably release > > a fix tonite, but don't hold your breath.
PAR 1.007 is now available on CPAN, you might give it a test drive. Cheers, Roderich
From: hugues.jonqueres [...] sapimep.com
Download (untitled) / with headers
text/plain 268b
Show quoted text
> PAR 1.007 is now available on CPAN, you might give it a test drive.
Module upgraded, script repackaged with -C option, it runs perfectly. Thanks a lot for your quick answers and your excellent work !!! It's been a pleasure talking with you. Best Regards, Hugues.
Thanks for testing. Cheers, Roderich


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.