Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82370 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 87344 invoked from network); 10 Feb 2015 11:56:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Feb 2015 11:56:12 -0000 Authentication-Results: pb1.pair.com header.from=jakub.php@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=jakub.php@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.179 as permitted sender) X-PHP-List-Original-Sender: jakub.php@gmail.com X-Host-Fingerprint: 209.85.223.179 mail-ie0-f179.google.com Received: from [209.85.223.179] ([209.85.223.179:35853] helo=mail-ie0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 93/65-47508-BD1F9D45 for ; Tue, 10 Feb 2015 06:56:11 -0500 Received: by ierx19 with SMTP id x19so17551725ier.3 for ; Tue, 10 Feb 2015 03:56:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=S+VSSescxCJfOzFg87jbUcgZMxNmPyNw0EpqhZiSic8=; b=OVtgs+4sW5jJifn523ImjoXR57q5JeqZVSSWVwtKjEEBefAByNQaihVmNyf1lq2XNz 7VoIf6qmImXhnZCCvGqBzrj22FTrOIBhcw5w0okunChoakqoGMCbkyDkg2BqoUwsctXw PnE5y1uVB692PJvobCca+vlSr4jxfenAVc1qdUvocxk617560v3sjd1+0DSBRfR/LZBq 7aXcjw3iAtaAVo8hLPIvRua30EvpiLwUL5VhZ9tfRBv8+8sXlN0ACFGXavsqtBIul7EG qDosWy4sSmdNL/jEKAweOLZE2ojZR0pW4WEylS3VKbDurDqQUvTz235qGeGgUlwBY/OZ FChw== MIME-Version: 1.0 X-Received: by 10.107.135.216 with SMTP id r85mr11111785ioi.38.1423569369227; Tue, 10 Feb 2015 03:56:09 -0800 (PST) Sender: jakub.php@gmail.com Received: by 10.107.169.216 with HTTP; Tue, 10 Feb 2015 03:56:09 -0800 (PST) In-Reply-To: References: Date: Tue, 10 Feb 2015 11:56:09 +0000 X-Google-Sender-Auth: AeqV7cNIbP5R2tG311VdJXUo1kA Message-ID: To: Xinchen Hui Cc: Pierre Joye , Anatol Belski , PHP internals Content-Type: multipart/alternative; boundary=001a113fc1ec910812050eba9218 Subject: Re: [PHP-DEV] new json, push generated file? From: bukka@php.net (Jakub Zelenka) --001a113fc1ec910812050eba9218 Content-Type: text/plain; charset=UTF-8 Hey On Tue, Feb 10, 2015 at 2:47 AM, Xinchen Hui 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/89893541305594eba373c15156eb54d7a7cb5960 ). 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. Cheers Jakub --001a113fc1ec910812050eba9218--