Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

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

Report information
The Basics
Id: 71072
Status: rejected
Priority: 0/
Queue: Dist-Zilla

People
Owner: Nobody in particular
Requestors: bailey [...] mail.newman.upenn.edu
Cc:
AdminCc:

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



Subject: D::Z::R::Plugin::plugin_from_config fails
Summary: I appear to have tripped over a bug in setting up a plugin via the global config file, which appears to occur in the Dist::Zilla::Role::Plugin::plugin_from_config method. As this seems a fairly central location, I don't at all discount the possibility of pilot error, in which case I apologize for the bother. Details: Given a stanza in config.ini of [PerlTidy] perltidyrc = /home/bailey/.perltidyrc running dzil perltidy yields the user-directed error message (truncated below) Your global configuration file couldn't be loaded. It's a file matching ~/.dzil/config.* but the real problem under the hood appears to be Can't locate object method "zilla" via package "Dist::Zilla::MVP::Assembler::GlobalConfig" at (eval 681)[/home/bailey/Workspace/Hacking/Perl/brewed/perls/perl-5.14.1/lib/5.14.1/perl5db.pl:640] line 2, <GEN0> line 11. which crops up in Dist::Zilla::Role::Plugin::plugin_from_config at 50: my $self = $class->new( 51: $arg->merge({ 52: plugin_name => $name, 53: zilla => $section->sequence->assembler->zilla, 54 }), 55 ); Here $class is "Dist::Zilla::Plugin::PerlTidy", which wants a zilla, but $section->sequence->assembler is a Dist::Zilla::MVP::Assembler::GlobalConfig, and neither it nor its ancestors appears to provide access to the running zilla, since they're pretty direct extensions of Config::MVP. So I'm not sure how best to dig up a zilla instance to pass to the plugin. As a secondary issue, $arg is an unblessed hashref, in this case containing 'perltidyrc' => '/home/bailey/.perltidyrc' so if the zilla problem is solved, I expect we'll blow up at the $arg->merge call with the expected Can't call method "merge" on unblessed reference
Sorry for taking so long to get back to you on this. :( [PerlTidy] is a builder plugin, and must only appear in the dist.ini file in your dist. Putting it in your global configuration is bound to fail, as you saw. -- rjbs