On Tue, Oct 27, 2015 at 06:48:59PM +0100, gregor herrmann wrote:
> Package: libmongodb-perl
> Version: 1.0.2-1
> Severity: serious
> Justification: fails to build from source (but built successfully in the past)
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA512
> 
> Yesterday's 1.0.2-1 upload failed to build on mips, powerpc, and
> s390x (plus hppa and ppc64):
> 
> https://buildd.debian.org/status/package.php?p=libmongodb-perl
> https://buildd.debian.org/status/logs.php?pkg=libmongodb-perl&ver=1.0.2-1
> 
> The failing tests seem to be the same on all architectures, and they
> are new in this release.

It's clearly an endianness issue. All the failing platforms are big
endian and this looks pretty clear:

    #   Failed test 'encode_one( HASH )'
    #   at t/bson_codec/containers.t line 201.
    #          got: 
'\x{10}\x{00}\x{00}\x{00}\x{01}a\x{00}\x{ae}G\x{e1}z\x{14}\x{ae}\x{f3}?\x{00}'
    #     expected: 
'\x{10}\x{00}\x{00}\x{00}\x{01}a\x{00}?\x{f3}\x{ae}\x{14}z\x{e1}G\x{ae}\x{00}'

Adding some diagnostics indicates the actual data encoding is stable
between the platforms, but the test suite expectations depend on the
endianness. The attached patch seems to fix this on at least s390x,
but perhaps we should have a test run with it before pushing it upstream.
-- 
Niko Tyni   nt...@debian.org
>From 6469bf8eb321686c3b38a15b9a8a311a838568cb Mon Sep 17 00:00:00 2001
From: Niko Tyni <nt...@debian.org>
Date: Tue, 27 Oct 2015 20:49:00 +0000
Subject: [PATCH] Expect BSON encoded doubles in little endian order

This fixes bson_codec test failures on big endian platforms.

Bug-Debian: https://bugs.debian.org/803178
---
 t/lib/TestBSON.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/lib/TestBSON.pm b/t/lib/TestBSON.pm
index e400586..b0f5b04 100644
--- a/t/lib/TestBSON.pm
+++ b/t/lib/TestBSON.pm
@@ -82,7 +82,7 @@ sub _doc {
 sub _cstring { return $_[0] . "\x00" }
 BEGIN { *_ename = \&_cstring }
 
-sub _double { return pack( "d", shift ) }
+sub _double { return pack( PERL58 ? "d" : "d<", shift ) }
 
 sub _int32 { return pack( P_INT32, shift ) }
 
-- 
2.1.4

Reply via email to