-
Notifications
You must be signed in to change notification settings - Fork 1
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
Automatically build extensions available on PECL #377
Comments
It's much much much easier said than done; I've tried to prototype it ;) We use Composer with a custom installer for platform package installation; the packages contain PHP and extensions, and the installer is a plugin; all runs together during an initial For installation, all available packages must therefor be known ahead of time, so that Composer can calculate an installable set of dependencies. We can't "try" an installation, not install e.g. My approach was to proxy all package metadata from However, the plan already falls apart with this bug: https://bugs.php.net/76719 Assuming that bug were ever fixed (by rewriting the entire codebase to not use string concatenation for XML, so that it'll actually be properly reliable), we could give it another shot :) |
Thanks for the response @dzuelke, these things are always more complicated in practice :) Edit: that bug though 😁 |
I'm glad you're excited about that bug and are volunteering to fix it @asgrim, for the good of all mankind ;) |
Another thing is that many Pecl extensions are actually binding for C extensions. And then, supporting them would depend on having the C extension available in the stack image. Otherwise, the compilation will fail. |
Very good point! |
Although that'd typically be fixable with an APT buildpack. |
I'm trying too to add a simple pecl (or apt) library (zmq). I passed the whole day trying to implement it.. forking and analysing other implementation of this same repo but without any luck. Where in the documentation (if any) can we understand of to achieve this? |
All the necessary docs are at https://github.com/heroku/heroku-buildpack-php/blob/master/support/build/README.md (yes, it takes a while to understand; no, it can't be simplified). The |
yep, adding some extensions from pecl is a PAIN. |
If anybody wants to help with this, https://bugs.php.net/76719 needs to be fixed in order for this functionality to have any chance of ever being able to see the light of day. |
Guys, please vote on that issue. https://bugs.php.net/bug.php?id=76719 Anyway, how we can support fixing? Who to write to and where bug should be fixed? |
Came across this while looking into customizing the PHP buildpack to add protobuf and grpc (using this as a vague go-by). Insane that that bug is as old as 2010. 👀 (the original linked at the bottom of that convo) But I voted. 😅 In the meantime, gonna see if that Sitepoint guide will help. |
The bug still exists; if you run this, it'll show you all the PECL categories with broken XML (as in, those who have more than one
If anyone wants to help move this forward, the PECL website code has been substantially reworked in the meantime, so it should be a lot easier to fix this. https://github.com/php/web-pecl/blob/master/src/Rest.php is the code in question. As you can see, it uses string concatenation to generate XML, instead of a DOM or XMLWriter based approach, and that's where the problems come from. https://github.com/php/web-pecl/blob/master/templates/pages/feeds/feeds.php could/should also be fixed in the same instance; it probably uses properly escaped input, but still. If you're a little familiar with TAL, https://github.com/phptal/PHPTAL might be an alternative solution for templating purposes (for both parts of the code I linked), since it would allow a template based approach that's guaranteed to produce well-formed XML. @JSn1nj4 please do not follow that Sitepoint article, the instructions are old, outdated, and will not work. The PHP buildpack supports custom package repositories, you do not have to run a modified version of the buildpack. Please see https://github.com/cachewerk/heroku-php-extensions for an example where @tillkruss maintains a few third-party extensions. |
@dzuelke thanks for heading me off. I'll dig into that other repo you linked. |
I've seen several requests in the issues backlog for "support extension X, Y, Z" sort of things. I started reading through https://github.com/heroku/heroku-buildpack-php/blob/master/support/build/README.md and realised what a huge document this is and how complex this process is currently...
I feel like this could be solved by, if Heroku finds an extension not supported "out the box" that it tries to install it from PECL, e.g. #371, if an application depends on
ext-uuid
, anduuid
is not available already, it triespecl install uuid
perhaps?I think this would solve the majority of extension requirements, but I have a feeling it might be easier said than done 😅
The text was updated successfully, but these errors were encountered: