Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:119363 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 68335 invoked from network); 20 Jan 2023 10:51:32 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 20 Jan 2023 10:51:32 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 7C1031804F7 for ; Fri, 20 Jan 2023 02:51:30 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=BAYES_00,HTML_MESSAGE, SPF_HELO_NONE,SPF_SOFTFAIL,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS24971 77.93.192.0/19 X-Spam-Virus: No X-Envelope-From: Received: from mail-mahalux.mvorisek.com (mail-mahalux.mvorisek.com [77.93.195.127]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 20 Jan 2023 02:51:29 -0800 (PST) Received: from fecb0ab3e67b (10.228.0.138) by mail-mahalux.mvorisek.com (10.228.0.4) with Microsoft SMTP Server (TLS); Fri, 20 Jan 2023 11:51:23 +0100 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=_97b3e0639c9bb1fc6b609e7e5411c059" Date: Fri, 20 Jan 2023 11:51:23 +0100 To: Max Kellermann Cc: internals@lists.php.net In-Reply-To: References: <192ba7b6-dcf0-e2da-c99e-cbad40519e27@gmx.de> Message-ID: X-Mailer: SAP NetWeaver 7.03 Subject: Re: [PHP-DEV] RFC: rules for #include directives From: vorismi3@fjfi.cvut.cz (=?UTF-8?Q?Michael_Vo=C5=99=C3=AD=C5=A1ek_-_=C4=8CVUT_FJFI?=) --=_97b3e0639c9bb1fc6b609e7e5411c059 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8; format=flowed > comments like #include "zend_execute.h" // for zend_vm_calc_used_stack() Maintaining "the correct" includes manually is hard. Maintaining the comments manually is even harder. In https://github.com/php/php-src/blob/a3a3f326bd32005dd68936edf0e01f98a2fbe163/CODING_STANDARDS.md?plain=1#L269 you proposed a tool to determine the needed includes. I would highly appreciate if this could be done automatically, ie. generate "the correct" includes and assert them by https://github.com/php/php-src/blob/php-8.2.1/.github/actions/verify-generated-files/action.yml CI. If you can generate the comments too, they can be asserted by CI reliably then as well. With kind regards / Mit freundlichen Grüßen / S přátelským pozdravem, Michael Voříšek On 20 Jan 2023 11:17, Max Kellermann wrote: > On 2023/01/20 10:53, Jakub Zelenka wrote: > >> I'm afraid it's too late for PHP. > > It's never too late. Don't give up PHP :-) > > PHP is an old code base. I want to help modernize it. > >> As it was said, this is problematic for bug fixes when merging up >> and it's extra hurdle for maintainers - read this will slow down the >> development. > > Can I do anything to help with those merges? > >> Also this is not something I would like to see in a minor version bump even >> though we can break ABI in that version but in general we try to introduce >> as little changes as possible for extensions. If anything it should at >> least wait for the next major version bump when extension devs expect more >> work to be done. > > What about: let's branch PHP 8.3 out, and declare master will become > 9.0. (Or create a new branch for 9.0 and let 8.3 stay in master; > branches names doesn't matter, only the idea matters.) > > I volunteer to do regular (daily?) merges from the 8.3 branch to the > 9.0 branch, and fix all the problems that may occur. > >> I think comments are more useful in the actual header to explain >> what it is for which can be done in a few lines. It can be more >> detailed and doesn't need to be repeated... > > I agree with that part. More documentation for headers is useful. > > As I said in another reply, I feel those comments are only really > useful for those large and obscure catch-all headers such as > "zend_types.h". Check my "zend_result.h" commit - it makes lots of my > comments disappear, because suddenly the #include directive becomes > self-explaining. > >> - some of the removed headers from libc should be kept as there's >> just a small benefit in removing them (e.g. errno.h) > > There is a benefit in removing them; improved compile times and > reduced namespace pollution (which is a theoretical benefit which is > probably not valued by all). > > But the benefit of keeping it is only source compatibility with buggy > extensions. > > And source compatibility with buggy extensions can be had by moving > those #include directives to "php_compat.h", with a way for "good" > extensions to opt out of the bloat. > > If you believe source compatibility even with "bad" extensions is > utterly important, I'll consider that in my submissions, and will > consider all build breakages as regressions that need to be fixed in > PHP (e.g. php_compat.h). I don't have a real opinion on that, I'll > accept whatever you decide and will help implement it. > > Max --=_97b3e0639c9bb1fc6b609e7e5411c059--