Discussion:
[rt.cpan.org #119737] Problems with detecting
(too old to reply)
Till Korten via RT
2017-01-06 14:58:20 UTC
Permalink
Fri Jan 06 09:58:19 2017: Request 119737 was acted upon.
Transaction: Ticket created by ***@korten-privat.de
Queue: PAR-Packer
Subject: Problems with detecting DateTime::Format::Natural dependencies
Broken in: (no value)
Severity: (no value)
Owner: Nobody
Requestors: ***@korten-privat.de
Status: new
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=119737 >


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
Roderich Schupp via RT
2017-01-07 14:30:37 UTC
Permalink
Sat Jan 07 09:30:26 2017: Request 119737 was acted upon.
Transaction: Correspondence added by RSCHUPP
Queue: Module-ScanDeps
Subject: Problems with detecting DateTime::Format::Natural dependencies
Broken in: (no value)
Severity: (no value)
Owner: RSCHUPP
Requestors: ***@korten-privat.de
Status: new
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=119737 >
Post by Till Korten via RT
The problem is, that
DateTime::Format::Natural.pm (~line 13) uses a whole host of packages
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".
Post by Till Korten via RT
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
Till Korten via RT
2017-01-09 11:21:10 UTC
Permalink
Mon Jan 09 06:20:59 2017: Request 119737 was acted upon.
Transaction: Correspondence added by ***@korten-privat.de
Queue: Module-ScanDeps
Subject: Re: [rt.cpan.org #119737] Problems with detecting DateTime::Format::Natural dependencies
Broken in: (no value)
Severity: (no value)
Owner: RSCHUPP
Requestors: ***@korten-privat.de
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=119737 >


Hi Roderich,

thank you very much for the quick fix :)
Post by Till Korten via RT
<URL: https://rt.cpan.org/Ticket/Display.html?id=119737 >
Post by Till Korten via RT
The problem is, that
DateTime::Format::Natural.pm (~line 13) uses a whole host of packages
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
Chunks that span multiple lines are not handled correctly. For
use base 'Foo::Bar';
use base
'Foo::Bar';
that explains the issue, thanks for clarifying!
Post by Till Korten via RT
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.
Post by Till Korten via RT
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').
Post by Till Korten via RT
Post by Till Korten via RT
I also had to add '-M DateTime/Format/Natural/Lang/EN.pm'
Interestingly, in this case the double colon notation did not work.
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
Till Korten via RT
2017-01-11 21:51:49 UTC
Permalink
Wed Jan 11 16:51:38 2017: Request 119737 was acted upon.
Transaction: Correspondence added by ***@mpi-cbg.de
Queue: Module-ScanDeps
Subject: Re: [rt.cpan.org #119737] Problems with detecting DateTime::Format::Natural dependencies
Broken in: (no value)
Severity: (no value)
Owner: RSCHUPP
Requestors: ***@korten-privat.de
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=119737 >


Hi Roderich,
Post by Till Korten via RT
Hi Roderich,
thank you very much for the quick fix :)
Post by Till Korten via RT
<URL: https://rt.cpan.org/Ticket/Display.html?id=119737 >
Post by Till Korten via RT
The problem is, that
DateTime::Format::Natural.pm (~line 13) uses a whole host of packages
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
Chunks that span multiple lines are not handled correctly. For
use base 'Foo::Bar';
use base
'Foo::Bar';
that explains the issue, thanks for clarifying!
Post by Till Korten via RT
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 :)
Post by Till Korten via RT
Post by Till Korten via RT
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 :) )
Post by Till Korten via RT
Post by Till Korten via RT
Post by Till Korten via RT
I also had to add '-M DateTime/Format/Natural/Lang/EN.pm'
Interestingly, in this case the double colon notation did not work.
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
Roderich Schupp via RT
2017-01-12 19:26:06 UTC
Permalink
Thu Jan 12 14:26:05 2017: Request 119737 was acted upon.
Transaction: Correspondence added by RSCHUPP
Queue: Module-ScanDeps
Subject: Problems with detecting DateTime::Format::Natural dependencies
Broken in: (no value)
Severity: (no value)
Owner: RSCHUPP
Requestors: ***@korten-privat.de
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=119737 >
Post by Till Korten via RT
Post by Roderich Schupp via RT
Post by Till Korten via RT
Interestingly, in this case the double colon notation did not work.
pp -o natural.exe -u -M DateTime::Format::Natural:: \
-E 'use DateTime::Format::Natural;
my $dt = DateTime::Format::Natural->new-
Post by Till Korten via RT
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
Roderich Schupp via RT
2017-01-12 19:33:39 UTC
Permalink
Thu Jan 12 14:33:31 2017: Request 119737 was acted upon.
Transaction: Correspondence added by RSCHUPP
Queue: Module-ScanDeps
Subject: Problems with detecting DateTime::Format::Natural dependencies
Broken in: (no value)
Severity: (no value)
Owner: RSCHUPP
Requestors: ***@korten-privat.de
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=119737 >
Post by Till Korten via RT
Post by Roderich Schupp via RT
Anyway, I'm adding an explicit rule for DateTime::Format::Natural to
Module::ScanDeps
that should make it work "out of the box".
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 {
Till Korten via RT
2017-01-12 21:10:02 UTC
Permalink
Thu Jan 12 16:10:01 2017: Request 119737 was acted upon.
Transaction: Correspondence added by ***@korten-privat.de
Queue: Module-ScanDeps
Subject: Re: [rt.cpan.org #119737] Problems with detecting DateTime::Format::Natural dependencies
Broken in: (no value)
Severity: (no value)
Owner: RSCHUPP
Requestors: ***@korten-privat.de
Status: resolved
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=119737 >
Post by Till Korten via RT
<URL: https://rt.cpan.org/Ticket/Display.html?id=119737 >
Post by Till Korten via RT
Post by Roderich Schupp via RT
Post by Till Korten via RT
Interestingly, in this case the double colon notation did not work.
pp -o natural.exe -u -M DateTime::Format::Natural:: \
-E 'use DateTime::Format::Natural;
my $dt = DateTime::Format::Natural->new-
Post by Till Korten via RT
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

Loading...