docker-library / php

Docker Official Image packaging for PHP
https://php.net
MIT License
3.81k stars 2k forks source link

Add PECL wrapper commands #1339

Closed zeriyoshi closed 9 months ago

zeriyoshi commented 1 year ago

PECL use is currently supported, but PECL by default does not support parallel compilation like the -j option, and huge extensions such as gRPC take a huge amount of build time.

To solve this problem, we add a script that wraps PECL.

This is useful because so far PECL is the only native extension package manager for PHP and has many useful and essential extensions for production environments (gRPC, protobuf, APCu, Redis, etc.).

tianon commented 1 year ago

See #919, especially https://github.com/docker-library/php/issues/919#issuecomment-564737047 -- I haven't seen the deprecation of pecl being part of the PHP distribution be pushed forward (as in, full removal), but I haven't seen the deprecation be cancelled either (indeed, the --with-pear flag appears to still be officially deprecated: https://github.com/php/php-src/blob/f6c9a90e19d648355c39da84af9bc59b2ff60c15/configure.ac#L1216).

To add just a little bit more meat here, my biggest concern is maintaining yet-more code above and beyond what is distributed by the PHP project, especially for something that is in most cases reasonably straightforward already, even with cleanup of dependencies (https://github.com/docker-library/php/issues/919#issuecomment-562359749), and even more especially that does so in an unconventional way (we've got a few of those, and they're definitely sources of friction for users and maintainers).

I imagine the number of extensions where -j is going to be useful/necessary is probably relatively small? (If it isn't, that seems like a great feature request to pecl itself :eyes:)

zeriyoshi commented 1 year ago

@tianon Yes, I too believe that this feature should originally be implemented in pecl.

However, since PECL is already in maintenance mode and deprecated, I do not see any new functionality being incorporated. That said, PECL is currently the only repository for PHP extensions, and many extensions are hosted in PECL.

For the above reasons, docker-php still expects to support PECL even after its deprecation. In light of this situation, we believe it would be appropriate to incorporate a follow-up to PECL on the docker-php side.

On the other hand, PHP certainly needs to resolve the issue of hosting Native Extensions.

tianon commented 9 months ago

For the above reasons, docker-php still expects to support PECL even after its deprecation.

I'm sorry, but we do not expect this, actually -- if PECL is finally removed, we will not be doing anything but removing any reference to it. :sweat_smile: