Bug#808826: libkavorka-perl: FTBFS: Can't locate object method "_set_declared_name" via package "Kavorka::Sub::Fun"

2015-12-26 Thread Niko Tyni
Control: tag -1 patch
Control: forwarded -1 https://rt.cpan.org/Public/Bug/Display.html?id=110623

On Fri, Dec 25, 2015 at 11:00:18AM +0200, Niko Tyni wrote:

>   use Devel::CallParser;
>   
>   sub f {
> my $arg = shift;
>   
> { my $arg; } # ???
> print $arg ? "ok\n" : "not ok\n";
>   }
>   
>   f(1);
>  
> which gives "ok" on 5.20 and "not ok" on 5.22.

Patch attached, sent upstream in
 https://rt.cpan.org/Public/Bug/Display.html?id=110623

Will upload shortly.
-- 
Niko Tyni   nt...@debian.org
>From ba92f4cba247c91d100e05f2b83dd093055e462b Mon Sep 17 00:00:00 2001
From: Niko Tyni 
Date: Fri, 25 Dec 2015 18:53:08 +0200
Subject: [PATCH] Fix a pad problem with Perl >= 5.21.4 on threaded builds

This broke at least the Kavorka and Moops distributions.

Bug-Debian: https://bugs.debian.org/808826
Bug: https://rt.cpan.org/Public/Bug/Display.html?id=110623
---
 lib/Devel/CallParser.xs | 10 +++---
 t/pad2.t| 15 +++
 2 files changed, 22 insertions(+), 3 deletions(-)
 create mode 100644 t/pad2.t

diff --git a/lib/Devel/CallParser.xs b/lib/Devel/CallParser.xs
index 6643739..847742c 100644
--- a/lib/Devel/CallParser.xs
+++ b/lib/Devel/CallParser.xs
@@ -323,10 +323,14 @@ static int my_keyword_plugin(pTHX_
 	 * The core bug was supposedly fixed in Perl 5.19.4, but actually
 	 * that version exhibits a different bug also apparently related
 	 * to padrange.  Restoring the pad's fill pointer works around
-	 * this bug too.  So for now this workaround is used with no
-	 * upper bound on the Perl version.
+	 * this bug too.
+	 *
+	 * The other padrange bug was fixed in Perl 5.19.5 (commit aa033da),
+	 * so the workaround is no longer needed after that, but it remains
+	 * harmless until v5.21.4 (commit c9859fb)  where it starts breaking
+	 * (see t/pad2.t.)
 	 */
-#define MUST_RESTORE_PAD_FILL PERL_VERSION_GE(5,17,6)
+#define MUST_RESTORE_PAD_FILL PERL_VERSION_GE(5,17,6) && ! PERL_VERSION_GE(5,19,5)
 #if MUST_RESTORE_PAD_FILL
 	I32 padfill = av_len(PL_comppad);
 #endif /* MUST_RESTORE_PAD_FILL */
diff --git a/t/pad2.t b/t/pad2.t
new file mode 100644
index 000..92c6dab
--- /dev/null
+++ b/t/pad2.t
@@ -0,0 +1,15 @@
+use warnings;
+use strict;
+
+use Test::More tests => 1;
+
+use Devel::CallParser;
+
+sub f {
+  my $arg = shift;
+
+  { my $arg; } # ???
+  ok($arg, '$arg stays set after a "my $arg" block');
+}
+
+f(1);
-- 
2.6.4



Bug#808826: libkavorka-perl: FTBFS: Can't locate object method "_set_declared_name" via package "Kavorka::Sub::Fun"

2015-12-25 Thread Niko Tyni
retitle 808826 libdevel-callparser-perl: breaks parsing with 5.22?
reassign 808826 libdevel-callparser-perl 0.002-1
affects 808826 + libparse-keyword-perl
thanks

> > It's indeed a regression caused by the perl 5.20 -> 5.22 upgrade.
> > Not sure why our rebuilds didn't catch it.
> 
> Evidence seems to be pointing at Parse::Keyword.

... and further to one of its reverse dependencies, Devel::CallParser.
I've got it down to this:

  #!/usr/bin/perl -w
  
  use Devel::CallParser;
  
  sub f {
my $arg = shift;
  
{ my $arg; } # ???
print $arg ? "ok\n" : "not ok\n";
  }
  
  f(1);
 
which gives "ok" on 5.20 and "not ok" on 5.22.
-- 
Niko Tyni   nt...@debian.org



Bug#808826: libkavorka-perl: FTBFS: Can't locate object method "_set_declared_name" via package "Kavorka::Sub::Fun"

2015-12-23 Thread Niko Tyni
Package: libkavorka-perl
Version: 0.036-1
Severity: serious
Forwarded: https://rt.cpan.org/Ticket/Display.html?id=109841

This package fails to build on current sid.

It's not clear if this is a Perl 5.22 regression or something else,
but it fails reliably here.

  t/01basic.t  
  ok 1 - use Kavorka;
  1..1
  ok
  Can't locate object method "_set_declared_name" via package 
"Kavorka::Sub::Fun" at /<>/blib/lib/Kavorka/Sub.pm line 182.
  t/02named-functions.t .. 
  Dubious, test returned 255 (wstat 65280, 0xff00)
  No subtests run 
  [...]
  Files=43, Tests=1, 16 wallclock secs ( 0.22 usr  0.06 sys + 15.33 cusr  0.68 
csys = 16.29 CPU)
  Result: FAIL
  Failed 41/43 test programs. 0/1 subtests failed.

-- 
Niko Tyni   nt...@debian.org



Bug#808826: libkavorka-perl: FTBFS: Can't locate object method "_set_declared_name" via package "Kavorka::Sub::Fun"

2015-12-23 Thread Niko Tyni
Control: block 796345 with -1

On Wed, Dec 23, 2015 at 04:05:27PM +0200, Niko Tyni wrote:
> Package: libkavorka-perl
> Version: 0.036-1
> Severity: serious
> Forwarded: https://rt.cpan.org/Ticket/Display.html?id=109841
> 
> This package fails to build on current sid.

>   Can't locate object method "_set_declared_name" via package 
> "Kavorka::Sub::Fun" at /<>/blib/lib/Kavorka/Sub.pm line 182.
>   t/02named-functions.t .. 
>   Dubious, test returned 255 (wstat 65280, 0xff00)

It's indeed a regression caused by the perl 5.20 -> 5.22 upgrade.
Not sure why our rebuilds didn't catch it.

It works on stretch, then 'apt-get install perl' breaks it. I see
no source versions changed except perl. Log of the upgrade:

  Preparing to unpack .../libparams-classify-perl_0.013-5+b1_amd64.deb ...
  Unpacking libparams-classify-perl (0.013-5+b1) over (0.013-5) ...
  Preparing to unpack .../libsub-name-perl_0.14-1+b1_amd64.deb ...
  Unpacking libsub-name-perl (0.14-1+b1) over (0.14-1) ...
  Preparing to unpack .../libpadwalker-perl_2.2-1+b1_amd64.deb ...
  Unpacking libpadwalker-perl (2.2-1+b1) over (2.2-1) ...
  Processing triggers for man-db (2.7.5-1) ...
  dpkg: perl-modules: dependency problems, but removing anyway as you requested:
   perl depends on perl-modules (>= 5.20.2-6).
  
  (Reading database ... 19995 files and directories currently installed.)
  Removing perl-modules (5.20.2-6) ...
  (Reading database ... 19270 files and directories currently installed.)
  Preparing to unpack /perl_5.22.1-2_amd64.deb ...
  Unpacking perl (5.22.1-2) over (5.20.2-6) ...
  Selecting previously unselected package perl-modules-5.22.
  Preparing to unpack .../perl-modules-5.22_5.22.1-2_all.deb ...
  Unpacking perl-modules-5.22 (5.22.1-2) ...
  Selecting previously unselected package libperl5.22:amd64.
  Preparing to unpack .../libperl5.22_5.22.1-2_amd64.deb ...
  Unpacking libperl5.22:amd64 (5.22.1-2) ...
  Preparing to unpack /perl-base_5.22.1-2_amd64.deb ...
  Unpacking perl-base (5.22.1-2) over (5.20.2-6) ...
  Processing triggers for man-db (2.7.5-1) ...
  Setting up perl-base (5.22.1-2) ...
  (Reading database ... 20572 files and directories currently installed.)
  Preparing to unpack .../liblocale-gettext-perl_1.07-1+b1_amd64.deb ...
  Unpacking liblocale-gettext-perl (1.07-1+b1) over (1.07-1) ...
  Preparing to unpack .../libscope-upper-perl_0.28-1+b1_amd64.deb ...
  Unpacking libscope-upper-perl (0.28-1+b1) over (0.28-1) ...
  Preparing to unpack .../libmouse-perl_2.4.5-1+b1_amd64.deb ...
  Unpacking libmouse-perl (2.4.5-1+b1) over (2.4.5-1) ...
  Preparing to unpack .../libclass-load-xs-perl_0.09-1+b1_amd64.deb ...
  Unpacking libclass-load-xs-perl (0.09-1+b1) over (0.09-1) ...
  Preparing to unpack .../libscalar-list-utils-perl_1%3a1.42-1+b1_amd64.deb ...
  Unpacking libscalar-list-utils-perl (1:1.42-1+b1) over (1:1.42-1) ...
  Preparing to unpack .../libparams-validate-perl_1.21-1+b1_amd64.deb ...
  Unpacking libparams-validate-perl (1.21-1+b1) over (1.21-1) ...
  Preparing to unpack .../libsub-identify-perl_0.12-1+b1_amd64.deb ...
  Unpacking libsub-identify-perl (0.12-1+b1) over (0.12-1) ...
  Preparing to unpack .../libdevel-callparser-perl_0.002-1+b2_amd64.deb ...
  Unpacking libdevel-callparser-perl (0.002-1+b2) over (0.002-1+b1) ...
  Preparing to unpack .../libmoose-perl_2.1604-1+b1_amd64.deb ...
  Unpacking libmoose-perl (2.1604-1+b1) over (2.1604-1) ...
  Preparing to unpack .../libdata-alias-perl_1.20-1+b1_amd64.deb ...
  Unpacking libdata-alias-perl (1.20-1+b1) over (1.20-1) ...
  Preparing to unpack .../libdevel-callchecker-perl_0.007-1+b1_amd64.deb ...
  Unpacking libdevel-callchecker-perl (0.007-1+b1) over (0.007-1) ...
  Preparing to unpack .../libvariable-magic-perl_0.59-1+b1_amd64.deb ...
  Unpacking libvariable-magic-perl (0.59-1+b1) over (0.59-1) ...
  Preparing to unpack .../libdatetime-perl_2%3a1.21-1+b1_amd64.deb ...
  Unpacking libdatetime-perl (2:1.21-1+b1) over (2:1.21-1) ...
  Preparing to unpack .../libparse-keyword-perl_0.08-2+b1_amd64.deb ...
  Unpacking libparse-keyword-perl (0.08-2+b1) over (0.08-2) ...
  Preparing to unpack .../liblist-moreutils-perl_0.413-1+b1_amd64.deb ...
  Unpacking liblist-moreutils-perl (0.413-1+b1) over (0.413-1) ...
  Preparing to unpack .../libparams-util-perl_1.07-2+b2_amd64.deb ...
  Unpacking libparams-util-perl (1.07-2+b2) over (1.07-2+b1) ...
  Preparing to unpack .../libtext-charwidth-perl_0.04-7+b4_amd64.deb ...
  Unpacking libtext-charwidth-perl (0.04-7+b4) over (0.04-7+b3) ...
  Preparing to unpack .../libtext-iconv-perl_1.7-5+b3_amd64.deb ...
  Unpacking libtext-iconv-perl (1.7-5+b3) over (1.7-5+b2) ...
  Preparing to unpack .../libpackage-stash-xs-perl_0.28-2+b2_amd64.deb ...
  Unpacking libpackage-stash-xs-perl (0.28-2+b2) over (0.28-2+b1) ...
  Preparing to unpack .../libb-hooks-op-check-perl_0.19-2+b2_amd64.deb ...
  Unpacking libb-hooks-op-check-perl (0.19-2+b2) over (0.19-2+b1) ...
  Processing triggers for man-db (2.7.5-1) ...
  Setting 

Bug#808826: libkavorka-perl: FTBFS: Can't locate object method "_set_declared_name" via package "Kavorka::Sub::Fun"

2015-12-23 Thread Niko Tyni
retitle 808826 libparse-keyword-perl: breaks Moo::Role on Perl 5.22?
reassign 808826 libparse-keyword-perl 0.08-2
affects 808826 libmoops-perl libkavorka-perl
thanks

On Wed, Dec 23, 2015 at 08:03:33PM +0200, Niko Tyni wrote:
> On Wed, Dec 23, 2015 at 04:05:27PM +0200, Niko Tyni wrote:
> > Package: libkavorka-perl
> > Version: 0.036-1
> > Severity: serious
> > Forwarded: https://rt.cpan.org/Ticket/Display.html?id=109841
> > 
> > This package fails to build on current sid.
> 
> >   Can't locate object method "_set_declared_name" via package 
> > "Kavorka::Sub::Fun" at /<>/blib/lib/Kavorka/Sub.pm line 182.
> >   t/02named-functions.t .. 
> >   Dubious, test returned 255 (wstat 65280, 0xff00)
> 
> It's indeed a regression caused by the perl 5.20 -> 5.22 upgrade.
> Not sure why our rebuilds didn't catch it.

Evidence seems to be pointing at Parse::Keyword. This script:

  #!/usr/bin/perl -w
  use strict;
  
  package M;
  use Moo::Role;
  has myattr => (is => 'rwp');
  1;
  
  package main;
  use Parse::Keyword {};
  
  my $m = bless {}, 'M';
  $m->_set_myattr("foo");
  
  print $m->myattr, "\n";
  1;

outputs "foo" on 5.20 as expected, but dies on 5.22 with

  Can't locate object method "_set_myattr" via package "M" at m.pl line 13.

Removing the "use Parse::Keyword {};" line makes it go away.

The only two reverse dependencies (both build and runtime) of 
libparse-keyword-perl,
libkavorka-perl and libmoops-perl, both currently fail to build from source with
similar messages.

I'm therefore tentatively reassigning this to libparse-keyword-perl,
although it would be nice to distill this further down to something that
takes Moo::Role out of the equation.

I note that Parse::Keyword is officially not recommended for use, so
it might not be worth it blocking the Perl 5.22 transition for this.
Quoting:

DESCRIPTION
   DO NOT USE!
   This module has fundamental errors in the way it handles closures,
   which are not fixable. Runtime keywords will never be able to work
   properly with the current design of this module. There are certain
   cases where this module is still safe to use (keywords that only
   have effect at compile time, or keywords that never call any of
   the "parse_*" functions), but that is limiting enough to make
   this module mostly worthless, and I likely won't be continuing
   to maintain it. Be warned!

-- 
Niko Tyni   nt...@debian.org