Bug 1851334 - perl-Marpa-XS-1.008000-27.fc33 FTBFS with Perl 5.32: Constants from lexical variables potentially modified elsewhere are no longer permitted at /builddir/build/BUILD/Marpa-XS-1.008000/blib/lib/Marpa/XS/Internal.pm line 93.
Summary: perl-Marpa-XS-1.008000-27.fc33 FTBFS with Perl 5.32: Constants from lexical v...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: perl-Marpa-XS
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Petr Pisar
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1852231 (view as bug list)
Depends On:
Blocks: F33FailsToInstall
TreeView+ depends on / blocked
 
Reported: 2020-06-26 08:18 UTC by Petr Pisar
Modified: 2020-06-30 16:10 UTC (History)
4 users (show)

Fixed In Version: perl-Marpa-XS-1.008000-28.fc33
Clone Of:
Environment:
Last Closed: 2020-06-30 16:10:36 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Petr Pisar 2020-06-26 08:18:37 UTC
perl-Marpa-XS-1.008000-27.fc33 fails to build in Fedora 33 with Perl 5.32 because a test fails:

#   Failed test 'use Marpa::XS;'
#   at t/00-load.t line 27.
#     Tried to use 'Marpa::XS'.
#     Error:  Constants from lexical variables potentially modified elsewhere are no longer permitted at /builddir/build/BUILD/Marpa-XS-1.008000/blib/lib/Marpa/XS/Internal.pm line 93.
# BEGIN failed--compilation aborted at /builddir/build/BUILD/Marpa-XS-1.008000/blib/lib/Marpa/XS/Grammar.pm line 64.
# Compilation failed in require at /builddir/build/BUILD/Marpa-XS-1.008000/blib/lib/Marpa/XS.pm line 101.
# Compilation failed in require at t/00-load.t line 27.
# BEGIN failed--compilation aborted at t/00-load.t line 27.
Bailout called.  Further testing stopped:  Could not load Marpa::XS
FAILED--Further testing stopped: Could not load Marpa::XS

That's because lib/Marpa/XS/Internal.pm does:

        if ( $field !~ s/\A=//xms ) {
            $offset++;
        }

        if ( $field =~ / \A ( [^=]* ) = ( [0-9+-]* ) \z/xms ) {
            $field  = $1;
            $offset = $2 + 0;
        }

        Marpa::XS::exception("Unacceptable field name: $field")
            if $field =~ /[^A-Z0-9_]/xms;
        my $field_name = $prefix . $field;
→       *{$field_name} = sub () {$offset};

and this usage of $offset variable is forbidden since Perl 5.32. Splain explanation:

$ perl -Mblib -e 'use Marpa::XS' 2>&1 | splain
Constants from lexical variables potentially modified elsewhere are no longer
        permitted at /home/test/fedora/perl-Marpa-XS/Marpa-XS-1.008000/blib/lib/Marpa/XS/Internal.pm line 93 (#1)
    (F) You wrote something like

        my $var;
        $sub = sub () { $var };

    but $var is referenced elsewhere and could be modified after the sub
    expression is evaluated.  Either it is explicitly modified elsewhere
    ($var = 3) or it is passed to a subroutine or to an operator like
    printf or map, which may or may not modify the variable.

    Traditionally, Perl has captured the value of the variable at that
    point and turned the subroutine into a constant eligible for inlining.
    In those cases where the variable can be modified elsewhere, this
    breaks the behavior of closures, in which the subroutine captures
    the variable itself, rather than its value, so future changes to the
    variable are reflected in the subroutine's return value.

    This usage was deprecated, and as of Perl 5.32 is no longer allowed,
    making it possible to change the behavior in the future.

    If you intended for the subroutine to be eligible for inlining, then
    make sure the variable is not referenced elsewhere, possibly by
    copying it:

        my $var2 = $var;
        $sub = sub () { $var2 };

    If you do want this subroutine to be a closure that reflects future
    changes to the variable that it closes over, add an explicit return:

        my $var;
        $sub = sub () { return $var };

Comment 1 Petr Pisar 2020-06-30 07:15:40 UTC
*** Bug 1852231 has been marked as a duplicate of this bug. ***

Comment 2 Petr Pisar 2020-06-30 15:22:42 UTC
This problem is resolved. But the build fails on aarch64 and ppc64le on missing configure.sub:

+ find ./ -name config.guess -exec cp /usr/lib/rpm/config.guess '{}' ';'
cp: cannot stat '/usr/lib/rpm/config.guess': No such file or directory
cp: cannot stat '/usr/lib/rpm/config.guess': No such file or directory
+ find ./ -name config.sub -exec cp /usr/lib/rpm/config.sub '{}' ';'
cp: cannot stat '/usr/lib/rpm/config.sub': No such file or directory
cp: cannot stat '/usr/lib/rpm/config.sub': No such file or directory
+ RPM_EC=0
[...]
checking build system type... ../dist/config.guess: unable to guess system type
This script, last modified 2011-11-11, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from
  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
and
  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
If the version you run (../dist/config.guess) is already up to date, please
send the following data and any information you think might be
pertinent to <config-patches> in order to provide the needed
information to handle your system.
config.guess timestamp = 2011-11-11
uname -m = ppc64le
uname -r = 5.6.19-300.fc32.ppc64le
uname -s = Linux
uname -v = #1 SMP Wed Jun 17 15:44:47 UTC 2020
/usr/bin/uname -p = ppc64le
/bin/uname -X     = 
hostinfo               = 
/bin/universe          = 
/usr/bin/arch -k       = 
/bin/arch              = ppc64le
/usr/bin/oslevel       = 
/usr/convex/getsysinfo = 
UNAME_MACHINE = ppc64le
UNAME_RELEASE = 5.6.19-300.fc32.ppc64le
UNAME_SYSTEM  = Linux
UNAME_VERSION = #1 SMP Wed Jun 17 15:44:47 UTC 2020
configure: error: cannot guess build type; you must specify one

I will try patching it to use the new location for the autoconf files.

Comment 3 Petr Pisar 2020-06-30 16:10:36 UTC
Also fixed.


Note You need to log in before you can comment on or make changes to this bug.