xslate / p5-Mouse

Lightweight class builder for Perl, as a subset of Moose
https://metacpan.org/release/Mouse
Other
46 stars 32 forks source link

Mouse XS will not load in 5.8.9, bogus version mismatch. #32

Closed schwern closed 9 years ago

schwern commented 9 years ago

$ MOUSE_XS=1 perl -wle 'use Mouse' Mouse object version v2.3.0 does not match bootstrap parameter 2.3.0 at /Users/schwern/perl5/perlbrew/perls/perl-5.8.9/lib/5.8.9/darwin-2level/XSLoader.pm line 97.

The problem started with 2.1.0. XS loading worked in 2.0.0.

I don't see anything obvious in the diff between 2.0.0 and 2.1.0 to have caused this.

gfx commented 9 years ago

Oh, I saw it before in some other modules, caused by Dist::Minilla migration.

syohex commented 9 years ago

I can avoid this issue by prepending v to $VERSION value. Is this fix correct ?

diff --git a/lib/Mouse.pm b/lib/Mouse.pm
index 89997af..8546f82 100644
--- a/lib/Mouse.pm
+++ b/lib/Mouse.pm
@@ -3,7 +3,7 @@ use 5.008_005;

 use Mouse::Exporter; # enables strict and warnings

-our $VERSION = '2.3.0';
+our $VERSION = 'v2.3.0';

 use Carp         ();
 use Scalar::Util ();
diff --git a/lib/Mouse/Role.pm b/lib/Mouse/Role.pm
index 9077d9a..36f9259 100644
--- a/lib/Mouse/Role.pm
+++ b/lib/Mouse/Role.pm
@@ -1,7 +1,7 @@
 package Mouse::Role;
 use Mouse::Exporter; # enables strict and warnings

-our $VERSION = '2.3.0';
+our $VERSION = 'v2.3.0';

 use Carp         ();
 use Scalar::Util ();
diff --git a/lib/Mouse/Spec.pm b/lib/Mouse/Spec.pm
index b8aa4ed..881497a 100644
--- a/lib/Mouse/Spec.pm
+++ b/lib/Mouse/Spec.pm
@@ -2,7 +2,7 @@ package Mouse::Spec;
 use strict;
 use warnings;

-our $VERSION = '2.3.0';
+our $VERSION = 'v2.3.0';

 our $MouseVersion = $VERSION;
 our $MooseVersion = '1.13';
diff --git a/lib/Mouse/Util.pm b/lib/Mouse/Util.pm
index deae96a..d09ddf0 100644
--- a/lib/Mouse/Util.pm
+++ b/lib/Mouse/Util.pm
@@ -50,7 +50,7 @@ BEGIN{
         },
     );

-    our $VERSION = '2.3.0';
+    our $VERSION = 'v2.3.0';

     my $xs = !(defined(&is_valid_class_name) || $ENV{MOUSE_PUREPERL} || $ENV{PERL_ONLY});
schwern commented 9 years ago

Yes, that fixes it.

gfx commented 9 years ago

:+1:

syohex commented 9 years ago

This problem produces again from Mouse XS 2.4.1. Because v prefixs of VERSION package variable were deleted. We should add test about this problem for regression.

pghmcfc commented 9 years ago

Still there in 2.4.2

syohex commented 9 years ago

Fixed at v2.4.3.