tag 588118 - help
clone 588118 -1
reassign -1 perl 5.10.1-14
retitle -1 perl: numeric overloading problem on ia64
severity -1 important
tag 588118 + patch
thanks
On Tue, Aug 10, 2010 at 05:01:05PM +0900, Ansgar Burchardt wrote:
> I am also curious if this only affects 1.06 or if also older version
> (that is 1.05-1 from testing) also FTBFS. Could some DD try to build
> the older version on a IA64 porter machine? (If you are lucky the
> Build-Deps are still installed somewhere.)
1.05-1 passes all tests on merulo.d.o but 1.06-1 and 1.09-1 don't
so it's not a regression in the build dependencies.
It boils down to the attached test, which apparently fails on ia64
but passes everywhere else. I assume this is a bug in perl but I'm not
quite sure yet. Cloning and reassigning against perl, will investigate
more later.
I'm attaching a simple workaround that makes the 1.09-1 test suite pass
for me.
--
Niko Tyni [email protected]
#!/usr/bin/perl -w
use strict;
use Test::Simple tests => 1;
package Foo;
use Scalar::Util q/refaddr/;
use overload '0+' => sub { refaddr(shift) },
fallback => 1;
1;
package main;
my $f1 = bless {}, 'Foo';
my $f2 = bless {}, 'Foo';
my $res1 = ($f1 == $f2);
my $res2 = (0+$f1 == 0+$f2);
ok($res1 eq $res2, "numification works as expected");
>From d6b18c1a4296d6c0c2ac8460a0e6af4560d2a079 Mon Sep 17 00:00:00 2001
From: Niko Tyni <[email protected]>
Date: Fri, 20 Aug 2010 13:32:31 -0600
Subject: [PATCH] Work around a numification problem on ia64
As seen in <http://bugs.debian.org/588118>, the numeric comparison
seems to trigger a bug in perl 5.10.1 on the ia64 architecture.
Explicitly numifying before comparing seems to work around this.
---
lib/Moose/Meta/TypeConstraint.pm | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/Moose/Meta/TypeConstraint.pm b/lib/Moose/Meta/TypeConstraint.pm
index 1c8f3de..700f77f 100644
--- a/lib/Moose/Meta/TypeConstraint.pm
+++ b/lib/Moose/Meta/TypeConstraint.pm
@@ -135,7 +135,7 @@ sub equals {
my $other = Moose::Util::TypeConstraints::find_type_constraint($type_or_name) or return;
- return 1 if $self == $other;
+ return 1 if (0+$self == 0+$other);
if ( $self->has_hand_optimized_type_constraint and $other->has_hand_optimized_type_constraint ) {
return 1 if $self->hand_optimized_type_constraint == $other->hand_optimized_type_constraint;
--
1.7.1