Add pie to replace pecl/pear
Recently the PHP foundation has been working on a new official tool for installing extensions, which has now been released as PHP PIE. See also https://thephp.foundation/blog/2024/11/19/pie-pre-release/ and https://github.com/php/pie. Given that this aims to replace PECL (and indirectly PEAR), which currently are already deprecated and are causing more and more issues (see e.g. #1552 and #1553), the official image could probably follow the same path at some point.
Given that the tool is currently still in pre-release state and still requires more testing and moreover requires the PHP extension ecosystem to make some active changes to allow installation, the time to migrate is most likely not now just yet. However, I am hoping to slowly start discussing the possibilities and required steps with this issue.
Nice, this is good to see!
However, I think we'll definitely wait until it's more well-baked / official within the community before considering it, but I'm honestly also kind of inclined to not include it unless/until it's part of the standard PHP install (which is the only reason we include PECL / PEAR today).
Leaving it out also sounds quite reasonable; probably the first course of action then, when things stabilize a bit more, is adjusting the docs to list PIE as an alternative/preferred way to install extensions and make note of the deprecation of PECL/PEAR installs.
Wondering though, it seems that PECL/PEAR could also just be installed on their own without including them in the base image. So it feels that there's still some choice here? Although if there's no option to bundle PIE at installation time in a future version, probably not doing that makes more sense. And then keeping PECL/PEAR around until downstream finally removes it is the least disruptive course of action.
Yeah, we've historically included PECL/PEAR because a "default install" includes them, and we've been explicit about including that configure flag to try and help manage the transition to deprecation, but once it's gone, we definitely don't plan to sideload them or anything like that (especially as related to our experience with similar discussions in Ruby, Python, and Node.js communities who've also had arguments against the "default included" package managers).
Including a blurb in the documentation is totally sane though. :+1:
A small consideration to add here: as PIE is not bundled with PHP, it is not automatically compatible with new (alpha/beta/rc) releases, hence does some (hard) checking of its own for compatibility. Therefore if you were to include it in the base image whenever a new alpha appears (e.g. #1589), this would mean you'd be installing a tool not practically usable yet with that version. With PECL this never caused me issues, but with PIE I can't install any extensions when using the newest PHP 8.5 alpha image.
For reference I've opened https://github.com/php/pie/issues/279 describing my proposed solution for more flexibility there.
All in all this may be another point to argue against including this by default and prefer going down the road with only documenting this as the go-to tool for installing extensions at some point.
Hey there 👋 PIE maintainer here. PECL is officially deprecated and PIE is the replacement now; is there anything I can do to help get PIE into the PHP Docker images?
I'm honestly also kind of inclined to not include it unless/until it's part of the standard PHP install (which is the only reason we include PECL / PEAR today).
FWIW, at least for, now PIE won't be bundled with PHP itself, primarily because PIE is iterating much faster than PHP as we develop new features and improve.
We do publish the pie.phar as a Docker image (see docs) if that's any help?
Hey there 👋 PIE maintainer here. PECL is officially deprecated and PIE is the replacement now; is there anything I can do to help get PIE into the PHP Docker images?
I'm honestly also kind of inclined to not include it unless/until it's part of the standard PHP install (which is the only reason we include PECL / PEAR today).
FWIW, at least for, now PIE won't be bundled with PHP itself, primarily because PIE is iterating much faster than PHP as we develop new features and improve.
We do publish the
pie.pharas a Docker image (see docs) if that's any help?
I guess PIE could be used to replace the docker-php-extension-installer script at some point seeing as the maintainer doesn't want to integrate a tool that is not backwards compatible with PHP 8.0 and below. You could add an example to the readme explaining how to install PHP extensions in a multi stage build step and copy the relevant files into the final container?