Re: Bison 3 support for PHP 5.5

From: Date: Thu, 29 May 2014 18:01:09 +0000
Subject: Re: Bison 3 support for PHP 5.5
References: 1 2 3 4 5 6 7 8  Groups: php.internals 
Request: Send a blank email to internals+get-74637@lists.php.net to get a copy of this message
On May 29, 2014, at 13:21, Adam Harvey <aharvey@php.net> wrote: > On 28 May 2014 08:06, Nikita Popov <nikita.ppv@gmail.com> wrote: >> On Wed, May 28, 2014 at 1:41 PM, Derick Rethans <derick@php.net> wrote: >> >>> On Fri, 23 May 2014, Julien Pauli wrote: >>> >>>> That's a no-go for 5.5. >>>> 5.5 is stable, 1year old (at this email date), and we should not >>>> change such a thing into this stable branch. >>> >>> Right, but it's going to be supported for at least another year. And >>> right now, on the latest Ubuntu's with only bison 3 you can't actually >>> build it. Because of that, a patch like this should absolutely be >>> considered. >> >> The patch (as proposed) changes the ABI for zendlex and zendparse. As such >> I don't think it's applicable to PHP 5.5 in this form. > > Agreed, but as Derick said, there's definitely an argument for some > sort of Bison 3 compatibility in 5.5. > > John, can you see a way — however hackish — to get Bison 3 support in > 5.5 without changing those functions? > > Thanks, > > Adam If we want to fix this up for PHP 5.5, I think I see a way, and it’ll be super-hackish, but I think I can make it work. Basically, where necessary, the six functions affected (zendlex, zendparse, zenderror, ini_lex, ini_parse, and ini_error) would be given new names, and the old names would be wrapper functions with the old ABI that call-through (and either pass in NULL or TSRM_LS as appropriate). PHP internally would call the new names; the only names/wrapper functions would be there for ABI compatibility only. If that sounds reasonable, I’ll go ahead and give that a try, and if it works, we can merge that implementation into 5.5 and 5.6, and then I can revert the really hacky bits in the 5.6 branch since they’re not necessary because we can change the ABI. Two notes: At the least, I need to update the 5.6 version of the PR to account for that zenderror is exported as phperror, and the definition in main/php.h is wrong. (I think; following the macros is a bit confusing.) I’ll take care of that later tonight. I’d also suggest that perhaps in >= 5.6, those functions shouldn’t even be exported as part of the public API. In php-src, they’re basically treated as internal implementation details. zenderror and zendlex are only ever called directly from the parser, and zendparse is only ever called directly from the compile_(file|filename) functions in the scanner. (That doesn’t mean they aren’t called from external modules, but there’s a lot of setup and teardown you have to do besides, so it’d certainly be a quite advanced use. Does anyone know if those functions actually are used by pecl or other third-party modules?) -John

« previous php.internals (#74637) next »