Skip Menu |
 

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

Report information
The Basics
Id: 75677
Status: resolved
Priority: 0/
Queue: Module-Build

People
Owner: Nobody in particular
Requestors: leonerd-cpan [...] leonerd.org.uk
Cc: marcgreen [...] cpan.org
AdminCc:

Bug Information
Severity: Important
Broken in:
  • 0.39_01
  • 0.39_02
  • 0.40
Fixed in: (no value)



Subject: Fails to create {MY,}META.{json,yml}
Using Module::Build 0.38: $ ./Build dist Creating Makefile.PL Creating README using Pod::Text Creating LICENSE file Created META.yml and META.json Creating IO-Socket-IP-0.09 Creating IO-Socket-IP-0.09.tar.gz Using Module::Build 0.39_01, 0.39_02 or 0.40: $ ./Build dist Creating Makefile.PL Creating README using Pod::Readme Creating LICENSE file Creating IO-Socket-IP-0.09 Can't copy('META.yml', 'IO-Socket-IP-0.09/META.yml'): No such file or directory at /home/leo/lib/perl5/Module/Build/Base.pm line 5603. If I delete META.yml and META.json from the MANIFEST file, then no error occurs but the generated tarball just doesn't contain these files. Workaround currently is just to downgrade to 0.38. debian/testing now ships Module::Build 0.40, so I have to install 0.38 manually over the top. For reference, this is using the directory of files as contained in http://search.cpan.org/~pevans/IO-Socket-IP-0.09/ but as this is a simple one-.pm file, no XS, pure-perl distribution I don't believe it's doing anything odd. -- Paul Evans
Download (untitled) / with headers
text/plain 175b
Most confusingly, I can't see anything on this diff that might be responsible: http://search.cpan.org/diff?from=Module-Build-0.3800&to=Module-Build-0.39_01 -- Paul Evans
Download (untitled) / with headers
text/plain 319b
By careful manual diff'ing between 0.38 and 0.39_01, I have determined it's the change to Module/Build/PodParser.pm, somehow. I don't fully understand what the change in PodParser actually does, or whether it can be split apart in more pieces, so I'm not sure quite how else I can look at this. Hrm... -- Paul Evans
CC: markgreen [...] wpi.edu
Subject: Re: [rt.cpan.org #75677] Fails to create {MY,}META.{json,yml}
Date: Sun, 11 Mar 2012 20:41:29 -0400
To: bug-Module-Build [...] rt.cpan.org
From: David Golden <dagolden [...] cpan.org>
Download (untitled) / with headers
text/plain 1.1k
On Sun, Mar 11, 2012 at 3:45 PM, Paul Evans via RT <bug-Module-Build@rt.cpan.org> wrote: Show quoted text
> I don't fully understand what the change in PodParser actually does, or > whether it can be split apart in more pieces, so I'm not sure quite how > else I can look at this. Hrm...
The "problem" is that your "NAME" section wraps IO::Socket::IP with C<>. The regular expression that attempts to extract an abstract from the NAME section can't deal with it. If you remove C<> then all works fine. As to the why, in 0.40 no longer subclasses Pod::Parser due to various issues with it. Thus, the pod parsing is left up to Module::Build's apparently more naive parsing. [cc'ing Marc Green who made that change] I don't know whether the "answer" is to beef up the regular expression or whether to add a dependency on some other core parser. It's also not great that warnings are silenced on META.yml creation or the failure to find an abstract would have been obvious. Possibly the call to _get_meta_object in Module::Build::Base::do_create_meta should not have 'quiet => 1'. I'm not sure why that was done originally. (git blames me and I plead ignorance) -- David
Subject: Silently fails to create {MY,}META.{json,yml} if POD parsing fails
Download (untitled) / with headers
text/plain 1.3k
On Sun Mar 11 20:42:10 2012, DAGOLDEN wrote: Show quoted text
> The "problem" is that your "NAME" section wraps IO::Socket::IP with > C<>. The regular expression that attempts to extract an abstract from > the NAME section can't deal with it. If you remove C<> then all works > fine.
OK that sounds plausible; I know it also breaks whatever tool EU::MM uses by default as well. For my one (inherited) EU::MM-using module, I manually set the abstract in Makefile.PL directly. Show quoted text
> As to the why, in 0.40 no longer subclasses Pod::Parser due to various > issues with it. Thus, the pod parsing is left up to Module::Build's > apparently more naive parsing. [cc'ing Marc Green who made that > change] > > I don't know whether the "answer" is to beef up the regular expression > or whether to add a dependency on some other core parser.
Well I can take it up with the parsing module in question, and see if they'll accept a patch or something. Show quoted text
> It's also not great that warnings are silenced on META.yml creation or > the failure to find an abstract would have been obvious. Possibly the > call to _get_meta_object in Module::Build::Base::do_create_meta should > not have 'quiet => 1'. I'm not sure why that was done originally. > (git blames me and I plead ignorance)
That's unfortunate as well. I'll rename the subject of this bug more appropriately to that problem. -- Paul Evans
Subject: RE: [rt.cpan.org #75677] Silently fails to create {MY,}META.{json,yml} if POD parsing fails
Date: Mon, 12 Mar 2012 15:01:14 -0400
To: "bug-Module-Build [...] rt.cpan.org" <bug-Module-Build [...] rt.cpan.org>
From: "Green, Marc Evan" <marcgreen [...] WPI.EDU>
Download (untitled) / with headers
text/plain 922b
Show quoted text
>> As to the why, in 0.40 no longer subclasses Pod::Parser due to various >> issues with it. Thus, the pod parsing is left up to Module::Build's >> apparently more naive parsing. [cc'ing Marc Green who made that >> change] >> >> I don't know whether the "answer" is to beef up the regular expression >> or whether to add a dependency on some other core parser.
> >Well I can take it up with the parsing module in question, and see if they'll >accept a patch or something.
The dependency on Pod::Parser was removed from Module::Build in order to be able to remove Pod::Parser from the core. There is discussion on why this is being done, but that is irrelevant to this situation. I apologize for letting this bug slip in while doing so. I believe subclassing Pod::Simple (similarly to how Pod::Parser was subclassed) would be the best course of action, although beefing up the regex would work just as well (for now).
Download (untitled) / with headers
text/plain 321b
On Mon Mar 12 15:01:19 2012, marcgreen@WPI.EDU wrote: Show quoted text
> although beefing up > the regex would work just as well (for now).
Find attached a quick hack of a patch that makes it accept a few more cases; it'll also now accept B<Name> - abstract C<Name> - abstract I<Name> - abstract F<Name> - abstract -- Paul Evans
Subject: rt75677.patch
Download rt75677.patch
text/x-diff 1.5k
=== modified file 'lib/Module/Build/PodParser.pm' --- lib/Module/Build/PodParser.pm 2012-03-13 14:48:29 +0000 +++ lib/Module/Build/PodParser.pm 2012-03-13 14:57:11 +0000 @@ -28,7 +28,8 @@ local $_; while (<$fh>) { next unless /^=(?!cut)/ .. /^=cut/; # in POD - last if ($self->{abstract}) = /^ (?: [a-z0-9:]+ \s+ - \s+ ) (.*\S) /ix; + # Accept Name - abstract or C<Name> - abstract + last if ($self->{abstract}) = /^ (?: [a-z0-9:]+ | [BCIF] < [a-z0-9:]+ > ) \s+ - \s+ (.*\S) /ix; } my @author; === modified file 't/pod_parser.t' --- t/pod_parser.t 2012-03-13 14:48:29 +0000 +++ t/pod_parser.t 2012-03-13 14:57:11 +0000 @@ -2,7 +2,7 @@ use strict; use lib 't/lib'; -use MBTest tests => 9; +use MBTest tests => 12; blib_load('Module::Build::PodParser'); @@ -88,3 +88,28 @@ is $pp->get_author->[0], 'C<Foo::Bar> was written by Engelbert Humperdinck I<E<lt>eh@example.comE<gt>> in 2004.', 'author'; is $pp->get_abstract, 'Perl extension for blah blah blah', 'abstract'; } + + +{ + # Now with C<Module::Name> + untie *FH; + tie *FH, 'IO::StringBased', <<'EOF'; +=head1 Name + +C<Foo::Bar> - Perl extension for blah blah blah + +=head1 Author + +C<Foo::Bar> was written by Engelbert Humperdinck I<E<lt>eh@example.comE<gt>> in 2004. + +Home page: http://example.com/~eh/ + +=cut +EOF + + my $pp = Module::Build::PodParser->new(fh => \*FH); + ok $pp, 'object created'; + + is $pp->get_author->[0], 'C<Foo::Bar> was written by Engelbert Humperdinck I<E<lt>eh@example.comE<gt>> in 2004.', 'author'; + is $pp->get_abstract, 'Perl extension for blah blah blah', 'abstract'; +}
Download (untitled) / with headers
text/plain 155b
Ping Any update on this? It's currently preventing me from being able to release any of my modules, so I'm running 0.38 instead for now. -- Paul Evans
Subject: Re: [rt.cpan.org #75677] Fails to create {MY,}META.{json,yml}
Date: Mon, 26 Mar 2012 08:37:27 -0400
To: bug-Module-Build [...] rt.cpan.org
From: David Golden <dagolden [...] cpan.org>
Download (untitled) / with headers
text/plain 427b
You can almost certainly fix your pod faster than a new MB will be released. On Mar 26, 2012 8:07 AM, "Paul Evans via RT" <bug-Module-Build@rt.cpan.org> wrote: Show quoted text
> Queue: Module-Build > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=75677 > > > Ping > > Any update on this? It's currently preventing me from being able to > release any of my modules, so I'm running 0.38 instead for now. > > -- > > Paul Evans >
Download (untitled) / with headers
text/plain 262b
On Mon Mar 26 08:07:29 2012, PEVANS wrote: Show quoted text
> Ping > > Any update on this? It's currently preventing me from being able to > release any of my modules, so I'm running 0.38 instead for now.
I just applied it. No idea yet when 0.42 will be released though. Leon


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.