Bug#1042847: libstring-license-perl: broken with Perl 5.38: syntax error near "class String::License::Naming::Custom :"

Niko Tyni ntyni at debian.org
Mon Aug 7 18:44:20 BST 2023


Control: found -1 0.0.9-1
Control: tag -1 patch

On Tue, Aug 01, 2023 at 10:25:04PM +0300, Niko Tyni wrote:
> Package: libstring-license-perl
> Version: 0.0.2-1
> Severity: important
> Tags: ftbfs trixie sid
> Forwarded: https://rt.cpan.org/Public/Bug/Display.html?id=148507
> User: debian-perl at lists.debian.org
> Usertags: perl-5.38-transition
> Control: affects -1 licensecheck
> 
> Some modules in this package report syntax errors with Perl 5.38
> (currently in experimental.)
> 
> This also makes the test suite fail, so the package fails to build
> from source.
> 
> When this is fixed, please file a bug on the perl package
> to add a Breaks entry for earlier versions so that partial
> upgrades cannot end up with a broken combination.

As seen in

  http://perl.debian.net/rebuild-logs/perl-5.38-throwaway/libstring-license-perl_0.0.9-1/libstring-license-perl_0.0.9-1_amd64-2023-08-05T15:35:07Z.build

this has now turned into

  Class :isa attribute requires a class but "String::License::Naming" is not one at /home/ntyni/tmp/libstring-license-perl/blib/lib/String/License/Naming/Custom.pm line 64.

This looks like a bug in the current (still experimental) Perl
core implementation of the class feature.  I've just filed
https://github.com/Perl/perl5/issues/21332 about it.

Working around that reveals new errors:

  Bareword "__CLASS__" not allowed while "strict subs" in use at lib/String/License.pm line 59.
  Attempt to access disallowed key '__ANON__' in a restricted hash at lib/String/License.pm line 64.

String::License using the __CLASS__ keyword, which was not yet implemented
in the core version for 5.38. A quick fix is to just use Object::Pad
instead of Feature::Compat::Class, which fixes the other error as well.

Doing that shows one more instance of the first issue:

  Class :isa attribute requires a class but "String::License::Naming" is not one at /home/ntyni/tmp/libstring-license-perl/blib/lib/String/License/Naming/SPDX.pm line 57.

The attached patch has workarounds for all of these. It passes the
test suite for me on both Perl 5.36 (Debian sid) and 5.38 (Debian
experimental.)

Hope this helps,
-- 
Niko Tyni   ntyni at debian.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Workarounds-for-the-class-feature-on-Perl-5.38.patch
Type: text/x-diff
Size: 1821 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-perl-maintainers/attachments/20230807/a49ea7d2/attachment.patch>


More information about the pkg-perl-maintainers mailing list