Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Dist-Zilla-Util-EmulatePhase CPAN distribution.

Report information
The Basics
Id: 89828
Status: open
Priority: 0/
Queue: Dist-Zilla-Util-EmulatePhase

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

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



Subject: _build_share_dir_block needs whitelist
I took one of the documentation examples and made this small file: package inc::CheckJavaMakeMaker; use Moose; #writes a simple check that the computer has Java available # most of this is from DZP:MakeMaker::Awesome documentation extends 'Dist::Zilla::Plugin::MakeMaker::Awesome'; around _build_MakeFile_PL_template => sub { my $orig = shift; my $self = shift; my $NEW_CONTENT = <<'END'; #Jing requires Java 4 or higher #Java outputs to STDERR on Windows, STDOUT on others my $java_version = `java -version 2>&1`; $java_version =~ m/java version "(.\..)[^"]+"/; print $java_version; return 0 unless $1 >= 1.6; END # insert new content near the beginning of the file, preserving the # preamble header my $string = $self->$orig(@_); $string =~ m/use warnings;\n\n/g; return substr($string, 0, pos($string)) . $NEW_CONTENT . substr($string, pos($string)); }; __PACKAGE__->meta->make_immutable; However, with [=inc::CheckJavaMakeMaker] added to my dist.ini, dzil build now dies with the following message: [Dist::Zilla::Util::EmulatePhase] Call to self->zilla->_share_dir_map should be avoided ... and your package/sub ( Dist::Zilla::Plugin::MakeMaker::Awesome :: Dist::Zilla::Plugin::MakeMaker::Awesome::register_prereqs ) is not listed in the WhiteList ... Please try eliminate this call to a private method or request it being whitelisted at C:/strawberry/perl/site/lib/Dist/Zilla/Plugin/MakeMaker/Awesome.pm line 267.
Subject: Re: [rt.cpan.org #89828] _build_share_dir_block needs whitelist
Date: Mon, 28 Oct 2013 17:37:56 -0700
To: Nathan Gary Glenn via RT <bug-Dist-Zilla-Plugin-MakeMaker-Awesome [...] rt.cpan.org>
From: Karen Etheridge <ether [...] cpan.org>
On Mon, Oct 28, 2013 at 08:23:15PM -0400, Nathan Gary Glenn via RT wrote: Show quoted text
> However, with [=inc::CheckJavaMakeMaker] added to my dist.ini, dzil build now dies with the following message: > > [Dist::Zilla::Util::EmulatePhase] Call to self->zilla->_share_dir_map should be avoided > ... and your package/sub ( Dist::Zilla::Plugin::MakeMaker::Awesome :: Dist::Zilla::Plugin::MakeMaker::Awesome::register_prereqs ) is not listed in the WhiteList > ... Please try eliminate this call to a private method or request it being whitelisted > at C:/strawberry/perl/site/lib/Dist/Zilla/Plugin/MakeMaker/Awesome.pm line 267.
That error is not coming from the plugin nor from Dist::Zilla - neither of them have any sort of concept as a sub whitelist. Is this a development tool you have in strawberry perl? Can you include a full stacktrace (which you can get by adding a 'use Carp::Always;' to your code)?
On 2013-10-28 17:38:13, ETHER wrote: Show quoted text
> On Mon, Oct 28, 2013 at 08:23:15PM -0400, Nathan Gary Glenn via RT > wrote:
> > However, with [=inc::CheckJavaMakeMaker] added to my dist.ini, dzil > > build now dies with the following message: > > > > [Dist::Zilla::Util::EmulatePhase] Call to self->zilla->_share_dir_map > > should be avoided > > ... and your package/sub ( Dist::Zilla::Plugin::MakeMaker::Awesome > > :: Dist::Zilla::Plugin::MakeMaker::Awesome::register_prereqs ) is not > > listed in the WhiteList > > ... Please try eliminate this call to a private method or request > > it being whitelisted > > at > > C:/strawberry/perl/site/lib/Dist/Zilla/Plugin/MakeMaker/Awesome.pm > > line 267.
> > That error is not coming from the plugin nor from Dist::Zilla - > neither of > them have any sort of concept as a sub whitelist. Is this a > development > tool you have in strawberry perl?
http://grep.cpan.me/?q=is+not+listed+in+the+WhiteList Transferring this ticket to the Dist-Zilla-Util-EmulatePhase queue. But if you remove that plugin from your dist.ini and test with a real build, everything should be fine.

the clearer explanation is that:

 

https://metacpan.org/source/ETHER/Dist-Zilla-Plugin-MakeMaker-Awesome-0.18/lib/Dist/Zilla/Plugin/MakeMaker/Awesome.pm#L235

Is calling a private method of dzil, which is bad design.

However, I can add it to the whitelist considering how close MMA is to MM

Just no tests in tree, because I don't really get, or understand, or want to understand MMA, so it may not solve the problem.
 

I'm not using any special tools for Strawberry. Adding Carp::Always in my module didn't output any extra messages, and I suppose you meant that I should put that in the special development tool if I had been using one. It looks like Kent's got this, though. On Mon Oct 28 20:38:13 2013, ETHER wrote: Show quoted text
> On Mon, Oct 28, 2013 at 08:23:15PM -0400, Nathan Gary Glenn via RT > wrote:
> > However, with [=inc::CheckJavaMakeMaker] added to my dist.ini, dzil > > build now dies with the following message: > > > > [Dist::Zilla::Util::EmulatePhase] Call to self->zilla->_share_dir_map > > should be avoided > > ... and your package/sub ( Dist::Zilla::Plugin::MakeMaker::Awesome > > :: Dist::Zilla::Plugin::MakeMaker::Awesome::register_prereqs ) is not > > listed in the WhiteList > > ... Please try eliminate this call to a private method or request > > it being whitelisted > > at > > C:/strawberry/perl/site/lib/Dist/Zilla/Plugin/MakeMaker/Awesome.pm > > line 267.
> > That error is not coming from the plugin nor from Dist::Zilla - > neither of > them have any sort of concept as a sub whitelist. Is this a > development > tool you have in strawberry perl? > > Can you include a full stacktrace (which you can get by adding a 'use > Carp::Always;' to your code)?
Yes, the error was coming from the [EmulatePhase] plugin (which I didn't know existed until this ticket) :)
On 2013-10-30 05:39:41, ETHER wrote:
Show quoted text
> Yes, the error was coming from the [EmulatePhase] plugin (which I
> didn't know existed until this ticket) :)


Well, no, EmulatePhase is not a plugin, just a utility I use in a plugin or two.