Skip Menu |

This queue is for tickets about the Devel-REPL CPAN distribution.

Report information
The Basics
Id: 54579
Status: resolved
Priority: 0/
Queue: Devel-REPL

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

Bug Information
Severity: Normal
Broken in: 1.003007
Fixed in: 1.003010



Subject: Devel::REPL doesn't appear to work with the latest Moose
I just upgraded Moose to 0.98, and Devel::REPL is failing to start with the following error: Can't locate object method "load_plugin" via package "Moose::Meta::Class" at /usr/local/lib/perl5/site_perl/5.10.1/Devel/REPL/Plugin/LexEnv.pm line 9. BEGIN failed--compilation aborted at /usr/local/bin/re.pl line 3. (and occasionally, a segfault). I've upgraded Devel::REPL, and been through all of it's deps and upgraded everything I could see, but it didn't appear to help. I should probably point out that I'm only assuming that the new version of Moose is the problem. Apologies for not being able to provide more useful information, I'm not sure where to start with this one.
It appears that this is limited to Moose-0.98 only, specifically this change: my $class = $obj_meta->create_anon_class( - superclasses => [ blessed($object) ], cache => 1, + superclasses => [ blessed($object) ], + roles => [ $role ], + cache => 1, ); It looks like this is causing the apply() method (that Devel::REPL::Meta::Plugin hooks onto to call BEFORE_PLUGIN) to be called twice - once with the metaclass instance, and once with the object itself. I freely admit I have no idea why. However, the attached patch does seem to fix the problem.
Subject: devel-repl-moose-0.98.patch
--- a/lib/Devel/REPL/Meta/Plugin.pm +++ b/lib/Devel/REPL/Meta/Plugin.pm @@ -6,6 +6,7 @@ extends 'Moose::Meta::Role'; before 'apply' => sub { my ($self, $other) = @_; + return unless $other->isa('Devel::REPL'); if (my $pre = $self->get_method('BEFORE_PLUGIN')) { $pre->body->($other, $self); } @@ -13,6 +14,7 @@ before 'apply' => sub { after 'apply' => sub { my ($self, $other) = @_; + return unless $other->isa('Devel::REPL'); if (my $pre = $self->get_method('AFTER_PLUGIN')) { $pre->body->($other, $self); }
On Fri Feb 12 21:44:31 2010, DAN wrote: Show quoted text
> > I've upgraded Devel::REPL, and been through all of it's deps and > upgraded everything I could see, but it didn't appear to help. I > should probably point out that I'm only assuming that the new > version of Moose is the problem. > > Apologies for not being able to provide more useful information, > I'm not sure where to start with this one.
Yup, at a minimum the bug report needs to include perl and platform information and probably version information for Devel::REPL and its dependencies. At any rate, I have seen no problems with Moose-1.02 and Moose-1.03 on win32 or cygwin. The latest Moose is now at 1.05. Could you please try it out with the new release of Devel::REPL so we can close this out? Thanks, Chris
It looks like it's been fixed for some time. It appears that the patch (or at least something akin to it) in my previous message was applied a few versions back: 1.3.9 - Fix scary Moose 0.98 box, adding a check for ->isa('Devel::REPL') in Meta/Plugin.pm So, yes, you can close this ;) Dan