Control: forwarded -1 https://rt.cpan.org/Public/Bug/Display.html?id=120705
Control: tag -1 upstream patch

On Sun, Jul 30, 2017 at 11:05:58PM -0700, Steve Langasek wrote:
> Package: libchi-perl
> Version: 0.60-3
> Severity: important
> User: [email protected]
> Usertags: origin-ubuntu artful autopkgtest
> 
> Dear maintainers,
> 
> As shown at
> <https://ci.debian.net/packages/libc/libchi-perl/unstable/amd64/>, the
> autopkgtests of libchi-perl fail since the upload of libcache-fastmmap-perl
> 1.46:
> 
> Test Summary Report
> -------------------
> t/smoke-Driver-FastMmap.t      (Wstat: 256 Tests: 920 Failed: 1)
>   Failed test:  140
>   Non-zero exit status: 1
> Files=24, Tests=6550, 14 wallclock secs ( 0.87 usr  0.10 sys +  7.14 cusr  
> 0.90 csys =  9.01 CPU)
> Result: FAIL

Thanks for the report.

The package would also fail to build from source due to this, but the test
is gated on $ENV{AUTOMATED_TESTING} so it gets skipped. (AUTOMATED_TESTING
is set in the autopkgtest-pkg-perl setup, but not for the build. Possibly
it should be set for both.)

There's a proposed patch in the upstream ticket by Petr Písař, sadly
with no comment from upstream yet. Attaching for convenience.
-- 
Niko Tyni   [email protected]
>From 8513c82bca186a9c724fe9c9b44ccbac062793d8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <[email protected]>
Date: Wed, 3 May 2017 16:57:52 +0200
Subject: [PATCH] Adapt to changes in Cache-FastMmap-1.45
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Cache-FastMmap-1.45 deprecated raw_values constructor argument in
favor of new serializer argument. This changes caused
t/smoke-Driver-CacheCache.t to fail.

This patch uses serializer with Cache::FastMmap >= 1.45, otherwise the old
raw_values.

CPAN RT#120705

Signed-off-by: Petr Písař <[email protected]>
---
 lib/CHI/Driver/FastMmap.pm   | 10 +++++++---
 lib/CHI/t/Driver/FastMmap.pm |  6 +++++-
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/lib/CHI/Driver/FastMmap.pm b/lib/CHI/Driver/FastMmap.pm
index 1b43344..19edcf8 100644
--- a/lib/CHI/Driver/FastMmap.pm
+++ b/lib/CHI/Driver/FastMmap.pm
@@ -21,7 +21,11 @@ sub BUILD {
     mkpath( $self->root_dir, 0, $self->dir_create_mode )
       if !-d $self->root_dir;
     $self->{fm_params} = {
-        raw_values     => 1,
+        (
+            ($Cache::FastMmap::VERSION >= 1.45) ?
+            (serializer     => '') :
+            (raw_values     => 1)
+        ),
         unlink_on_exit => 0,
         share_file     => catfile(
             $self->root_dir,
@@ -108,8 +112,8 @@ though not between hosts.
 To support namespaces, this driver takes a directory parameter rather than a
 file, and creates one Cache::FastMMap file for each namespace.
 
-Because CHI handles serialization automatically, we pass the C<raw_values> flag
-as 1; and to conform to the CHI API, we pass C<unlink_on_exit> as 0, so that
+Because CHI handles serialization automatically, we pass the C<serializer> flag
+as ''; and to conform to the CHI API, we pass C<unlink_on_exit> as 0, so that
 all cache files are permanent.
 
 =head1 CONSTRUCTOR OPTIONS
diff --git a/lib/CHI/t/Driver/FastMmap.pm b/lib/CHI/t/Driver/FastMmap.pm
index 2339c84..8532804 100644
--- a/lib/CHI/t/Driver/FastMmap.pm
+++ b/lib/CHI/t/Driver/FastMmap.pm
@@ -35,7 +35,11 @@ sub test_fm_cache : Tests {
     my %defaults = (
         unlink_on_exit => 0,
         empty_on_exit  => 0,
-        raw_values     => 1,
+        (
+            ($Cache::FastMmap::VERSION >= 1.45) ?
+            (serialize      => 0) :
+            (raw_values     => 1)
+        ),
     );
     while ( my ( $key, $value ) = each(%defaults) ) {
         is( $fm_cache->{$key} || 0, $value, "$key = $value by default" );
-- 
2.7.4

Reply via email to