Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gen_stub.php: consider dropping support for older PHP ABIs #16112

Open
DanielEScherzer opened this issue Sep 28, 2024 · 7 comments
Open

gen_stub.php: consider dropping support for older PHP ABIs #16112

DanielEScherzer opened this issue Sep 28, 2024 · 7 comments

Comments

@DanielEScherzer
Copy link
Contributor

Description

#8931 updated the script so that it could generate arg_info for older versions of the PHP ABI. At the time, it supported 7.0, 8.0, 8.1, and 8.2.

Given that PHP 8.0 has reached EOL, I propose that we drop support for 7.0 or both 7.0 and 8.0, which would allow simplifying the generator script

@DanielEScherzer
Copy link
Contributor Author

DanielEScherzer commented Sep 28, 2024

CC @kocsismate - happy to work on this if the patches would be approved

@bwoebi
Copy link
Member

bwoebi commented Sep 28, 2024

In my opinion the arginfo generation for old versions of the PHP API is misguided and is better covered by a compatibility shim translating the header invocations to something compatible with old versions.

I'd drop it altogether and rather maintain something like:
https://github.com/DataDog/dd-trace-php/blob/9d041954f90ff77b23f73c0108336279fbf04eb9/ext/compatibility.h#L232-L244 (these highlighted lines are just the compatibility shims for PHP 7, there's more in that file for other versions.)

@cmb69
Copy link
Member

cmb69 commented Sep 29, 2024

Note that gen_stub.php is not only used for php-src, but also by some extensions. These may very well still target older PHP releases. I was told only 2 weeks ago by an extension maintainer that they still deliberately support PHP 5.6.

Maybe @remicollet has something to say about this.

@Girgias
Copy link
Member

Girgias commented Sep 29, 2024

Yes, gen_stub.php is very much used by extensions as it is provided by the skeleton. And I think that is a good think, but I also think @bwoebi's solution of having a compatibility header is probably a better idea as I wouldn't be surprised of extensions already having such a header (or defines).

@kocsismate
Copy link
Member

I wouldn't be surprised of extensions already having such a header (or defines).

Yes, definitely! I surely saw a few such headers for XDebug a few years ago, but I guess other stub users also have to create their own shims as gen_stub.php doesn't always generate 100% compatible code below PHP 8.0.

Regarding the original question: I know the possible BC compliance makes gen_stub.php very convoluted and difficult to maintain, and i'm happy to find a possibility which improves the situation. However, I don't think it's a good idea to remove support for PHP 7.4 and PHP 8.0 yet.. I would rather prefer if we had some kind of ABI compatibility promise, like maintaining ABI compatibility for e.g. at least two major releases (PHP 7.x: until 9.x, PHP 8.y: until 10.y), or like giving at least 6-8 (?) years of support.

@NattyNarwhal
Copy link
Member

NattyNarwhal commented Sep 29, 2024

FWIW, I'm supporting 7.3+ in the IBM database extensions, but I'm not opposed to having to raise the minimum supported version, or use an alternative to the legacy arginfo. Another thing is the CI there for it also downloads a specific version of gen_stub, so perhaps a legacy gen_stub could be provided that i.e. matches a (set of?) versions?

@nikic
Copy link
Member

nikic commented Sep 29, 2024

apcu uses gen_stubs.php all the way back to PHP 7.0 (using @generate-legacy-arginfo).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants