Hi Jakub,

On Tue, February 10, 2015 12:56, Jakub Zelenka wrote:
> Hey
>
>
> On Tue, Feb 10, 2015 at 2:47 AM, Xinchen Hui <larue...@php.net> wrote:
>
>>
>> why make this thing in this way complicated? why not just simply include
>> the generated files as others did?
>
>
> First of all the others did exactly what I have already done. :) It means
>  they included re2c generated files and did not include bison generated
> files.
>
> There are few reasons why I would like to do it slightly differently in
> json and make the re-generation optional.
>
> 1. I want to prevent an accidental re-generation of files with the old
> version of re2c and bison. It happens to me from time to time when I
> switch branches and build often. Then I see that I have changes (git diff)
> in the zend_language_scanner.c and other re2c generated files even if I
> haven't edited them. The reason is because the version that I use is
> different and the files got regenerated (you won't see that if you use the
> same version). That could be even bigger problem with bison where the the
> version differences are much more often.
>
> 2. As soon as I start using new features (like utf8 ranges in re2c) that
> are not available in the old version and someone would try to do some
> changes in the scanner and regenerate it, then it would fail with error.
> I
> believe that it's better if the user gets a warning during the
> configuration and the compilation exits the build instead of generating
> an error.
>
> 3 It is sort of a signal which version is currently supported and it
> hopefully prevents things like regenerating files with the old version and
>  pushing it to the repo (as Anatol did yesterday in
> https://github.com/php/php-src/commit/89893541305594eba373c15156eb54d7a7c
> b5960 ).
>
It's actually so that there is a range of tool versions supported. That
means any version within the range should be valid for use. If another
range of versions is defined, so it's obviously to follow it. It's good to
make thoughts about the new features, but that'll be probably require
updating the guidelines and changing the valid versions range.
>
> As I said in the PR. This change won't affect anyone who doesn't change
> json scanner and parser which is 99% of all users that build PHP. The 1%
> is probably just me so it's not really complicated IMHO...
>
> I would also like to add all of this to the json README (it's very
> outdated and I plan to update it anyway) and possibly other build doc if
> we have any.
>
Yeah, so why don't just push file and have it done? ATM there might be
some fixes needed, so regeneration required. Later on it's supposed to be
a very rare case - just in case of bugs or new development. Btw also
people who don't have a required re2c/bison/etc version for whatever
reasons would still be able to compile, test or develop other parts.

Regards

Anatol



-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to