Skip Menu |

This queue is for tickets about the List-Gather CPAN distribution.

Report information
The Basics
Id: 116694
Status: resolved
Priority: 0/
Queue: List-Gather

People
Owner: Nobody in particular
Requestors: simcop2387 [...] simcop2387.info
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 0.13



Subject: Does not work with recent perl-blead
Date: Wed, 3 Aug 2016 09:59:35 -0700
To: bug-List-Gather [...] rt.cpan.org
From: Ryan Voots <simcop2387 [...] simcop2387.info>
Fails to compile on recent perl-blead versions: --- BEGIN perl -V --- Summary of my perl5 (revision 5 version 25 subversion 4) configuration: Snapshot of: 9648eab63b366c001d38f6de565f005cf6cea10a Platform: osname=linux osvers=4.1.5-x86_64-linode61 archname=x86_64-linux uname='linux simcop2387.info 4.1.5-x86_64-linode61 #7 smp mon aug 24 13:46:31 edt 2015 x86_64 gnulinux ' config_args='-de -Dprefix=/home/ryan/perl5/perlbrew/perls/perlbot-blead-2016-07-25_29411 -Dusedevel -Aeval:scriptdir=/home/ryan/perl5/perlbrew/perls/perlbot-blead-2016-07-25_29411/bin' hint=recommended useposix=true d_sigaction=define useithreads=undef usemultiplicity=undef use64bitint=define use64bitall=define uselongdouble=undef usemymalloc=n bincompat5005=undef Compiler: cc='cc' ccflags ='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2' optimize='-O2' cppflags='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include' ccversion='' gccversion='4.9.2' gccosandvers='' intsize=4 longsize=8 ptrsize=8 doublesize=8 byteorder=12345678 doublekind=3 d_longlong=define longlongsize=8 d_longdbl=define longdblsize=16 longdblkind=3 ivtype='long' ivsize=8 nvtype='double' nvsize=8 Off_t='off_t' lseeksize=8 alignbytes=8 prototype=define Linker and Libraries: ld='cc' ldflags =' -fstack-protector-strong -L/usr/local/lib' libpth=/usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/4.9/include-fixed /usr/include/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib libs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc libc=libc-2.19.so so=so useshrplib=false libperl=libperl.a gnulibc_version='2.19' Dynamic Linking: dlsrc=dl_dlopen.xs dlext=so d_dlsymun=undef ccdlflags='-Wl,-E' cccdlflags='-fPIC' lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector-strong' Characteristics of this binary (from libperl): Compile-time options: HAS_TIMES PERLIO_LAYERS PERL_COPY_ON_WRITE PERL_DONT_CREATE_GVSV PERL_HASH_FUNC_ONE_AT_A_TIME_HARD PERL_MALLOC_WRAP PERL_OP_PARENT PERL_PRESERVE_IVUV PERL_USE_DEVEL USE_64_BIT_ALL USE_64_BIT_INT USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_LOCALE_TIME USE_PERLIO USE_PERL_ATOF Locally applied patches: Devel::PatchPerl 1.38 Built under linux Compiled at Jul 25 2016 14:32:57 %ENV: PERLBREW_BASHRC_VERSION="0.73" PERLBREW_HOME="/home/ryan/.perlbrew" PERLBREW_MANPATH="/home/ryan/perl5/perlbrew/perls/perlbot-inuse/man" PERLBREW_PATH="/home/ryan/perl5/perlbrew/bin:/home/ryan/perl5/perlbrew/perls/perlbot-inuse/bin" PERLBREW_PERL="perlbot-inuse" PERLBREW_ROOT="/home/ryan/perl5/perlbrew" PERLBREW_VERSION="0.73" @INC: /home/ryan/perl5/perlbrew/perls/perlbot-blead-2016-07-25_29411/lib/site_perl/5.25.4/x86_64-linux /home/ryan/perl5/perlbrew/perls/perlbot-blead-2016-07-25_29411/lib/site_perl/5.25.4 /home/ryan/perl5/perlbrew/perls/perlbot-blead-2016-07-25_29411/lib/5.25.4/x86_64-linux /home/ryan/perl5/perlbrew/perls/perlbot-blead-2016-07-25_29411/lib/5.25.4 ---- END perl -V ---- Show quoted text
--- BEGIN Build log --- -> % cpanm --verbose List::Gather cpanm (App::cpanminus) 1.7027 on perl 5.025004 built for x86_64-linux Work directory is /home/ryan/.cpanm/work/1470243406.25449 You have make /usr/bin/make You have LWP 6.15 You have /bin/tar: tar (GNU tar) 1.27.1 Copyright (C) 2013 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html
>.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by John Gilmore and Jay Fenlason. You have /usr/bin/unzip Searching List::Gather on cpanmetadb ... --> Working on List::Gather Fetching http://www.cpan.org/authors/id/E/ET/ETHER/List-Gather-0.12.tar.gz ... OK Unpacking List-Gather-0.12.tar.gz List-Gather-0.12/ List-Gather-0.12/CONTRIBUTING List-Gather-0.12/Changes List-Gather-0.12/Gather.xs List-Gather-0.12/INSTALL List-Gather-0.12/LICENSE List-Gather-0.12/MANIFEST List-Gather-0.12/META.json List-Gather-0.12/META.yml List-Gather-0.12/Makefile.PL List-Gather-0.12/README List-Gather-0.12/dist.ini List-Gather-0.12/inc/ List-Gather-0.12/lib/ List-Gather-0.12/t/ List-Gather-0.12/weaver.ini List-Gather-0.12/xt/ List-Gather-0.12/xt/author/ List-Gather-0.12/xt/release/ List-Gather-0.12/xt/release/changes_has_content.t List-Gather-0.12/xt/release/cpan-changes.t List-Gather-0.12/xt/release/distmeta.t List-Gather-0.12/xt/release/kwalitee.t List-Gather-0.12/xt/release/minimum-version.t List-Gather-0.12/xt/release/mojibake.t List-Gather-0.12/xt/release/pod-coverage.t List-Gather-0.12/xt/release/pod-no404s.t List-Gather-0.12/xt/release/pod-syntax.t List-Gather-0.12/xt/release/portability.t List-Gather-0.12/xt/author/00-compile.t List-Gather-0.12/xt/author/eol.t List-Gather-0.12/xt/author/no-tabs.t List-Gather-0.12/t/00-report-prereqs.dd List-Gather-0.12/t/00-report-prereqs.t List-Gather-0.12/t/basic.t List-Gather-0.12/t/context.t List-Gather-0.12/t/errors.t List-Gather-0.12/t/exceptions.t List-Gather-0.12/t/modifier.t List-Gather-0.12/t/return.t List-Gather-0.12/t/syntax.t List-Gather-0.12/lib/List/ List-Gather-0.12/lib/List/Gather.pm List-Gather-0.12/inc/MMHelper.pm List-Gather-0.12/inc/MakeMaker.pm Entering List-Gather-0.12 Checking configure dependencies from META.json Checking if you have ExtUtils::MakeMaker 0 ... Yes (7.18) Checking if you have IO::File 0 ... Yes (1.16) Checking if you have Devel::CallParser 0 ... Yes (0.002) Checking if you have Devel::CallChecker 0 ... Yes (0.007) Running Makefile.PL Configuring List-Gather-0.12 ... Checking if your kit is complete... Looks good Generating a Unix-style Makefile Writing Makefile for List::Gather Writing MYMETA.yml and MYMETA.json OK Checking dependencies from MYMETA.json ... Checking if you have Devel::CallChecker 0 ... Yes (0.007) Checking if you have File::Spec 0 ... Yes (3.64) Checking if you have Test::More 0.98 ... Yes (1.302045) Checking if you have Try::Tiny 0 ... Yes (0.24) Checking if you have Sub::Exporter 0 ... Yes (0.987) Checking if you have XSLoader 0 ... Yes (0.22) Checking if you have warnings 0 ... Yes (1.37) Checking if you have ExtUtils::MakeMaker 0 ... Yes (7.18) Checking if you have Test::Fatal 0 ... Yes (0.014) Checking if you have strict 0 ... Yes (1.11) Checking if you have Devel::CallParser 0 ... Yes (0.002) Building and testing List-Gather-0.12 ... cp lib/List/Gather.pm blib/lib/List/Gather.pm Running Mkbootstrap for Gather () chmod 644 "Gather.bs" "/home/ryan/perl5/perlbrew/perls/perlbot-blead-2016-07-25_29411/bin/perl5.25.4" -MExtUtils::Command::MM -e 'cp_nonempty' -- Gather.bs blib/arch/auto/List/Gather/Gather.bs 644 "/home/ryan/perl5/perlbrew/perls/perlbot-blead-2016-07-25_29411/bin/perl5.25.4" "/home/ryan/perl5/perlbrew/perls/perlbot-blead-2016-07-25_29411/lib/5.25.4/ExtUtils/xsubpp" -typemap '/home/ryan/perl5/perlbrew/perls/perlbot-blead-2016-07-25_29411/lib/5.25.4/ExtUtils/typemap' Gather.xs > Gather.xsc mv Gather.xsc Gather.c cc -c -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -I. -O2 -DVERSION=\"0.12\" -DXS_VERSION=\"0.12\" -fPIC "-I/home/ryan/perl5/perlbrew/perls/perlbot-blead-2016-07-25_29411/lib/5.25.4/x86_64-linux/CORE" Gather.c Gather.xs: In function ‘myck_entersub_gather’: Gather.xs:224:14: error: ‘OP’ has no member named ‘op_sibling’ if (!pushop->op_sibling) ^ Gather.xs:227:17: error: ‘OP’ has no member named ‘op_sibling’ blkop = pushop->op_sibling; ^ Gather.xs: In function ‘myck_entersub_take’: Gather.xs:261:16: error: ‘OP’ has no member named ‘op_sibling’ while (lastop->op_sibling != cLISTOPx(listop)->op_last) ^ Gather.xs:262:20: error: ‘OP’ has no member named ‘op_sibling’ lastop = lastop->op_sibling; ^ Gather.xs:263:19: error: ‘OP’ has no member named ‘op_sibling’ rv2cvop = lastop->op_sibling; ^ Makefile:338: recipe for target 'Gather.o' failed make: *** [Gather.o] Error 1 FAIL ! Installing List::Gather failed. See /home/ryan/.cpanm/work/1470243406.25449/build.log for details. Retry with --force to force install it.
On 2016-08-03 09:59:56, simcop2387@simcop2387.info wrote: Show quoted text
> Fails to compile on recent perl-blead versions:
Yes, the op_sibling changes in 5.25.1 require this code to be updated. Unfortunately it's not trivial, and requires good understanding of the parser.
Subject: Re: [rt.cpan.org #116694] Does not work with recent perl-blead
Date: Wed, 3 Aug 2016 10:16:15 -0700
To: bug-List-Gather [...] rt.cpan.org
From: Ryan Voots <simcop2387 [...] simcop2387.info>
I figured it wouldn't be trivial to fix, any time something that low level in perl changes it's usually not trivial to fix. Mostly filed the bug to make sure you were aware that it wasn't working on the next version of perl. On Wed, Aug 3, 2016 at 10:11 AM, Karen Etheridge via RT < bug-List-Gather@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=116694 > > > On 2016-08-03 09:59:56, simcop2387@simcop2387.info wrote:
> > Fails to compile on recent perl-blead versions:
> > Yes, the op_sibling changes in 5.25.1 require this code to be updated. > Unfortunately it's not trivial, and requires good understanding of the > parser. >
From: davem [...] iabyn.com
Here are patches I tried to email to the p5p list last December.
Subject: 0001-List-Gather-add-ppport.h.patch

Message body is not shown because it is too large.

Subject: 0002-List-Gather-make-work-with-PERL_OP_PARENT.patch
From 2f17ccfa206974d9658927978d13acfa8ff73283 Mon Sep 17 00:00:00 2001 From: David Mitchell <davem@iabyn.com> Date: Fri, 9 Dec 2016 11:29:51 +0000 Subject: [PATCH 2/2] List-Gather: make work with PERL_OP_PARENT --- Gather.xs | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/Gather.xs b/Gather.xs index 9aa2c65..1ca2144 100644 --- a/Gather.xs +++ b/Gather.xs @@ -170,7 +170,12 @@ gen_take_op (pTHX_ OP *listop, PADOFFSET gatherer_offset) takeop->op_ppaddr = pp_take; takeop->op_targ = gatherer_offset; cUNOPx(takeop)->op_flags = OPf_KIDS; +#ifdef op_sibling_splice + cLISTOPx(takeop)->op_first = cLISTOPx(takeop)->op_last = NULL; + op_sibling_splice(takeop, NULL, 0, listop); +#else cLISTOPx(takeop)->op_first = cLISTOPx(takeop)->op_last = listop; +#endif return takeop; } @@ -183,20 +188,28 @@ static OP *(*methodwrapper_nxck_entersub)(pTHX_ OP *o); static OP * methodwrapper_myck_entersub (pTHX_ OP *entersubop) { + OP *parent = entersubop; OP *pushop, *sigop, *realop, *methop; pushop = cUNOPx(entersubop)->op_first; - if(!pushop->op_sibling) + if(!OpHAS_SIBLING(pushop)) { + parent = pushop; pushop = cUNOPx(pushop)->op_first; + } - if((sigop = pushop->op_sibling) && sigop->op_type == OP_CONST && + if( (sigop = OpSIBLING(pushop)) && sigop->op_type == OP_CONST && cSVOPx_sv(sigop) == methodwrapper_sv && - (realop = sigop->op_sibling) && - (methop = realop->op_sibling) && - !methop->op_sibling && - methop->op_type == OP_METHOD_NAMED) { + (realop = OpSIBLING(sigop)) && + (methop = OpSIBLING(realop)) && + !OpHAS_SIBLING(methop) && + methop->op_type == OP_METHOD_NAMED) + { +#ifdef op_sibling_splice + op_sibling_splice(parent, sigop, 1, NULL); +#else sigop->op_sibling = realop->op_sibling; realop->op_sibling = NULL; +#endif op_free(entersubop); return realop; } @@ -222,10 +235,10 @@ myck_entersub_gather (pTHX_ OP *entersubop, GV *namegv, SV *protosv) PERL_UNUSED_ARG(protosv); pushop = cUNOPx((parent = entersubop))->op_first; - if (!pushop->op_sibling) + if (!OpHAS_SIBLING(pushop)) pushop = cUNOPx((parent = pushop))->op_first; - blkop = pushop->op_sibling; + blkop = OpSIBLING(pushop); #ifdef op_sibling_splice op_sibling_splice(parent, pushop, 1, NULL); @@ -259,9 +272,9 @@ myck_entersub_take (pTHX_ OP *entersubop, GV *namegv, SV *protosv) op_free(entersubop); lastop = cLISTOPx(listop)->op_first; - while (lastop->op_sibling != cLISTOPx(listop)->op_last) - lastop = lastop->op_sibling; - rv2cvop = lastop->op_sibling; + while (OpSIBLING(lastop) != cLISTOPx(listop)->op_last) + lastop = OpSIBLING(lastop); + rv2cvop = OpSIBLING(lastop); #ifdef op_sibling_splice op_sibling_splice(listop, lastop, -1, NULL); -- 2.4.11
RT-Send-CC: davem [...] iabyn.com
On 2017-03-29 01:47:08, davem@iabyn.com wrote: Show quoted text
> Here are patches I tried to email to the p5p list last December.
Thanks, Dave, I've applied and shipped this in the 0.13 release. I saw mention in https://rt.perl.org/Ticket/Display.html?id=128179 that you sent me a patch earlier, but I'm afraid I didn't get it -- did you send it as a plain old email, i.e. not part of a p5p thread or rt ticket? There was also some discussion of how to handle fixing up this code in https://github.com/karenetheridge/List-Gather/pull/1 -- e.g. the possible appropriateness of OpMAYBESIB_set(). You may be able to clear that up for us.
Subject: Re: [rt.cpan.org #116694] Does not work with recent perl-blead
Date: Sat, 1 Apr 2017 09:35:20 +0100
To: Karen Etheridge via RT <bug-List-Gather [...] rt.cpan.org>
From: Dave Mitchell <davem [...] iabyn.com>
On Fri, Mar 31, 2017 at 08:33:51PM -0400, Karen Etheridge via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=116694 > > > On 2017-03-29 01:47:08, davem@iabyn.com wrote:
> > Here are patches I tried to email to the p5p list last December.
> > Thanks, Dave, I've applied and shipped this in the 0.13 release. I saw > mention in https://rt.perl.org/Ticket/Display.html?id=128179 that you > sent me a patch earlier, but I'm afraid I didn't get it -- did you send > it as a plain old email, i.e. not part of a p5p thread or rt ticket?
I emailed them to "Karen Etheridge <perl@froods.org>" on 9 Dec 2016, Cced to perl5-porters@perl.org. They never made it to the list, and presumably not to you either. Show quoted text
> There was also some discussion of how to handle fixing up this code in > https://github.com/karenetheridge/List-Gather/pull/1 -- e.g. the > possible appropriateness of OpMAYBESIB_set(). You may be able to clear > that up for us.
My patch made use of the new op_sibling_splice() function, which is a high-level interface - while OpMAYBESIB_set() is a low level interface. I prefer the former: it allows you to logically express what you are trying to achieve ("remove the op following sigop") rather than a bunch of low-level manipulation of op_sibling pointers. -- Please note that ash-trays are provided for the use of smokers, whereas the floor is provided for the use of all patrons. -- Bill Royston
RT-Send-CC: davem [...] iabyn.com
On 2017-04-01 01:35:45, davem@iabyn.com wrote: Show quoted text
> My patch made use of the new op_sibling_splice() function, which is a > high-level interface - while OpMAYBESIB_set() is a low level interface. I > prefer the former: it allows you to logically express what you are trying > to achieve ("remove the op following sigop") rather than a bunch of > low-level manipulation of op_sibling pointers.
Ah, splendid, I did not know about that function! Thanks again for this. (I'll also tackle Cond-Expr soon.)