Skip Menu |

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

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

People
Owner: RSCHUPP [...] cpan.org
Requestors: webmaster [...] korten-privat.de
Cc:
AdminCc:

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



Subject: Problems with detecting DateTime::Format::Natural dependencies
Date: Fri, 6 Jan 2017 15:59:03 +0100
To: bug-PAR-Packer [...] rt.cpan.org
From: Till Korten <webmaster [...] korten-privat.de>
Hi, first of all, thanks for providing this great tool that makes my life so much easier! I am trying to use pp to pack a perl program that uses the Music::Tag module which in turn uses the DateTimeX::Easy module. This module then uses DateTime::Format::Natural. The problem is, that DateTime::Format::Natural.pm (~line 13) uses a whole host of packages with 'use base': use base qw( DateTime::Format::Natural::Calc DateTime::Format::Natural::Duration DateTime::Format::Natural::Expand DateTime::Format::Natural::Extract DateTime::Format::Natural::Formatted DateTime::Format::Natural::Helpers DateTime::Format::Natural::Rewrite ); In order for my program to run, I had to manually add all these Modules with the -M flag. I also had to add '-M DateTime/Format/Natural/Lang/EN.pm' Interestingly, in this case the double colon notation did not work. Best Till
On 2017-01-06 09:58:19, webmaster@korten-privat.de wrote: Show quoted text
> The problem is, that > DateTime::Format::Natural.pm (~line 13) uses a whole host of packages > with 'use base': > > use base qw( > DateTime::Format::Natural::Calc > DateTime::Format::Natural::Duration
PAR::Packer uses Module::ScanDeps to scan your program for modules that it uses (recursively). And this is where Module::ScanDeps falls short (quoted from its POD): Chunks that span multiple lines are not handled correctly. For example, this one works: use base 'Foo::Bar'; But this one does not: use base 'Foo::Bar'; Have you tried packing with "pp -x ..." or "pp -c ..."? Anyway, I'm adding an explicit rule for DateTime::Format::Natural to Module::ScanDeps that should make it work "out of the box". Show quoted text
> I also had to add '-M DateTime/Format/Natural/Lang/EN.pm' > > Interestingly, in this case the double colon notation did not work.
What exactly didn't work? I tried the following: pp -o natural.exe -u -M DateTime::Format::Natural:: \ -E 'use DateTime::Format::Natural; my $dt = DateTime::Format::Natural->new->parse_datetime("tomorrow"); say "tomorrow is $dt";' This works, esp. it adds all DateTime/Format/Natural/... modules to natural.exe (use "unzip -l natural.exe" to verify). Note the "-u" option as something requires Unicode support (which can't be auto-detected); without "-u", running natural.exe fails with "Can't locate utf8_heavy.pl ...". Cheers, Roderich
Subject: Re: [rt.cpan.org #119737] Problems with detecting DateTime::Format::Natural dependencies
Date: Mon, 9 Jan 2017 12:20:46 +0100
To: bug-Module-ScanDeps [...] rt.cpan.org
From: Till Korten <webmaster [...] korten-privat.de>
Hi Roderich, thank you very much for the quick fix :) answers to your comments below: On 07.01.2017 15:30, Roderich Schupp via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=119737 > > > On 2017-01-06 09:58:19, webmaster@korten-privat.de wrote:
>> The problem is, that >> DateTime::Format::Natural.pm (~line 13) uses a whole host of packages >> with 'use base': >> >> use base qw( >> DateTime::Format::Natural::Calc >> DateTime::Format::Natural::Duration
> PAR::Packer uses Module::ScanDeps to scan your program for modules that > it uses (recursively). And this is where Module::ScanDeps falls short > (quoted from its POD): > > Chunks that span multiple lines are not handled correctly. For > example, this one works: > > use base 'Foo::Bar'; > > But this one does not: > > use base > 'Foo::Bar';
that explains the issue, thanks for clarifying! Show quoted text
> > Have you tried packing with "pp -x ..." or "pp -c ..."?
no, I'll try that before updating PAR and let you know how it turns out. Show quoted text
> > Anyway, I'm adding an explicit rule for DateTime::Format::Natural to Module::ScanDeps > that should make it work "out of the box".
thanks a lot!, i'll update PAR and test the fix (after testing 'pp -x' and 'pp-c'). Show quoted text
>
>> I also had to add '-M DateTime/Format/Natural/Lang/EN.pm' >> >> Interestingly, in this case the double colon notation did not work.
> What exactly didn't work? I tried the following: > pp -o natural.exe -u -M DateTime::Format::Natural:: \ > -E 'use DateTime::Format::Natural; > my $dt = DateTime::Format::Natural->new->parse_datetime("tomorrow"); > say "tomorrow is $dt";' > > This works,
I am getting an error reported by eval that it cannot find DateTime/Format/Natural/Lang/EN.pm, if I add ' -M DateTime::Format::Natural::Lang::EN.pm'. The error appears in a module I am using (either MP3::Tag or Music::Tag::MP3). Apparently that module uses eval to execute DateTime/Format/Natural/Lang/EN.pm. However, since that is not my code, and there is an easy workaround (adding the aforementioned ' -M DateTime::Format::Natural::Lang::EN.pm' parameter to the pp command), I did not bother to find out what exactly is the issue. Interestingly, the workaround works even under windows when specifying the module with forward slashes (less surprisingly it also works on mac). Cheers and thanks again for your help! Till
Subject: Re: [rt.cpan.org #119737] Problems with detecting DateTime::Format::Natural dependencies
Date: Wed, 11 Jan 2017 22:49:53 +0100
To: bug-Module-ScanDeps [...] rt.cpan.org
From: Till Korten <korten [...] mpi-cbg.de>
Hi Roderich, On 09.01.2017 12:20, Till Korten wrote: Show quoted text
> Hi Roderich, > > thank you very much for the quick fix :) > > answers to your comments below: > > > On 07.01.2017 15:30, Roderich Schupp via RT wrote:
>> <URL: https://rt.cpan.org/Ticket/Display.html?id=119737 > >> >> On 2017-01-06 09:58:19, webmaster@korten-privat.de wrote:
>>> The problem is, that >>> DateTime::Format::Natural.pm (~line 13) uses a whole host of packages >>> with 'use base': >>> >>> use base qw( >>> DateTime::Format::Natural::Calc >>> DateTime::Format::Natural::Duration
>> PAR::Packer uses Module::ScanDeps to scan your program for modules that >> it uses (recursively). And this is where Module::ScanDeps falls short >> (quoted from its POD): >> >> Chunks that span multiple lines are not handled correctly. For >> example, this one works: >> >> use base 'Foo::Bar'; >> >> But this one does not: >> >> use base >> 'Foo::Bar';
> that explains the issue, thanks for clarifying!
>> >> Have you tried packing with "pp -x ..." or "pp -c ..."?
> no, I'll try that before updating PAR and let you know how it turns out.
I just tested the -x and -c flags: -x does not work for my program because it is a service that does not exit by itself and thus the compilation hangs, waiting for the program to exit. -c works perfectly :), thanks for pointing me towards that :) Show quoted text
>> >> Anyway, I'm adding an explicit rule for DateTime::Format::Natural to >> Module::ScanDeps >> that should make it work "out of the box".
> thanks a lot!, i'll update PAR and test the fix (after testing 'pp -x' > and 'pp-c').
I just updated PAR (1.014), PAR::Packer (1.036) and Module::ScanDeps (1.23). However, that did not fix the issue for me. I guess, the fix did not make it into the official cpan repository,yet. Is there a way for me to test the fixed version already now or should I just wait for the next release? (waiting is no problem for me since the -c flag fixed the issue as well :) ) Show quoted text
>>
>>> I also had to add '-M DateTime/Format/Natural/Lang/EN.pm' >>> >>> Interestingly, in this case the double colon notation did not work.
>> What exactly didn't work? I tried the following: >> pp -o natural.exe -u -M DateTime::Format::Natural:: \ >> -E 'use DateTime::Format::Natural; >> my $dt = >> DateTime::Format::Natural->new->parse_datetime("tomorrow"); >> say "tomorrow is $dt";' >> >> This works,
> I am getting an error reported by eval that it cannot find > DateTime/Format/Natural/Lang/EN.pm, if I add ' -M > DateTime::Format::Natural::Lang::EN.pm'. > The error appears in a module I am using (either MP3::Tag or > Music::Tag::MP3). Apparently that module uses eval to execute > DateTime/Format/Natural/Lang/EN.pm. However, since that is not my > code, and there is an easy workaround (adding the aforementioned ' -M > DateTime::Format::Natural::Lang::EN.pm' parameter to the pp command), > I did not bother to find out what exactly is the issue. Interestingly, > the workaround works even under windows when specifying the module > with forward slashes (less surprisingly it also works on mac). > > Cheers and thanks again for your help! > > Till
Cheers Till

Message body is not shown because sender requested not to inline it.

On 2017-01-09 06:20:59, webmaster@korten-privat.de wrote: Show quoted text
> >> Interestingly, in this case the double colon notation did not work.
> > What exactly didn't work? I tried the following: > > pp -o natural.exe -u -M DateTime::Format::Natural:: \ > > -E 'use DateTime::Format::Natural; > > my $dt = DateTime::Format::Natural->new-
> > >parse_datetime("tomorrow");
> > say "tomorrow is $dt";' > > > > This works,
> I am getting an error reported by eval that it cannot find > DateTime/Format/Natural/Lang/EN.pm, if I add ' -M > DateTime::Format::Natural::Lang::EN.pm'.
Hmm, "-M DateTime::Format::Natural::" is supposed to add DateTime/Format/Natural.pm and every *.pm below DateTime/Format/Natural - that should have included DateTime/Format/Natural/Lang/EN.pm. Cheers, Roderich
On 2017-01-11 16:51:38, korten@mpi-cbg.de wrote: Show quoted text
> >> Anyway, I'm adding an explicit rule for DateTime::Format::Natural to > >> Module::ScanDeps > >> that should make it work "out of the box".
Show quoted text
> I just updated PAR (1.014), PAR::Packer (1.036) and Module::ScanDeps > (1.23). However, that did not fix the issue for me. I guess, the fix did > not make it into the official cpan repository,yet. Is there a way for me > to test the fixed version already now or should I just wait for the next
Yes, the fix isn't released yet, but I've pushed it to github... Or just apply the one-line patch below. Cheers, Roderich diff --git a/lib/Module/ScanDeps.pm b/lib/Module/ScanDeps.pm index 86b0c73..afcff46 100644 --- a/lib/Module/ScanDeps.pm +++ b/lib/Module/ScanDeps.pm @@ -281,6 +281,7 @@ my %Preload = ( _glob_in_inc('Date/Manip/Offset', 1)); }, 'DateTime/Format/Builder/Parser.pm' => 'sub', + 'DateTime/Format/Natural.pm' => 'sub', 'DateTime/Locale.pm' => 'sub', 'DateTime/TimeZone.pm' => 'sub', 'DBI.pm' => sub {
Subject: Re: [rt.cpan.org #119737] Problems with detecting DateTime::Format::Natural dependencies
Date: Thu, 12 Jan 2017 22:09:47 +0100
To: bug-Module-ScanDeps [...] rt.cpan.org
From: Till Korten <webmaster [...] korten-privat.de>
On 12.01.2017 20:26, Roderich Schupp via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=119737 > > > On 2017-01-09 06:20:59, webmaster@korten-privat.de wrote:
>>>> Interestingly, in this case the double colon notation did not work.
>>> What exactly didn't work? I tried the following: >>> pp -o natural.exe -u -M DateTime::Format::Natural:: \ >>> -E 'use DateTime::Format::Natural; >>> my $dt = DateTime::Format::Natural->new-
>>>> parse_datetime("tomorrow");
>>> say "tomorrow is $dt";' >>> >>> This works,
>> I am getting an error reported by eval that it cannot find >> DateTime/Format/Natural/Lang/EN.pm, if I add ' -M >> DateTime::Format::Natural::Lang::EN.pm'.
> Hmm, "-M DateTime::Format::Natural::" is supposed to add DateTime/Format/Natural.pm > and every *.pm below DateTime/Format/Natural - that should have included > DateTime/Format/Natural/Lang/EN.pm. > > Cheers, Roderich
I thought the same thing. The only explanation I have is that no file in DateTime/Format/Natural has use .*EN in it. EN.pm is somehow imported in a different way which I have not had the time to figure out yet. However when I use pp -c, it works without any -M parameters so I am going to use that in the future. Cheers and thanks a ton for the help and the fix! Till