Repository navigation
Replies: 1 comment 2 replies
|
Thanks for this suggestion; I'll have a think about the best ways to approach this; #738 is being worked on for 1.7.0 too, so yeah that may indeed provide an interim workable solution :) |
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
What are you trying to do?
I'd like to declare, per package in
pie.json, patches that PIE applies to the extracted sources before runningphpize/configure/make.Typical use cases:
My concrete case: the
amqpextension on PHP 8.6. I need to apply a compatibility patch to its sources until upstream ships a release that supports PHP 8.6.Why existing mechanisms don't cover this
cweagans/composer-patches) can't be used, sincePieComposerFactory::createPieComposer()creates Composer with plugins disabled.PiePackageInstaller::install()the build runs in the same promise chain directly after extraction, sopre-package-installfires before the sources exist andpost-package-installfires after build/install.pathrepository, see Support building from a local directory / non-Packagist source #79) works, but it isn't declarative and is awkward in Docker/CI.Proposal
Patch files (not arbitrary scripts) configured under
extra, following the format ofcweagans/composer-patches:{ "extra": { "pie": { "patches": { "vendor/ext-foo": { "Fix build on musl": "/patches/ext-foo-musl.patch" } } } } }Suggested behaviour:
phpize, PIE applies all configured patches for the package in order.--download-method), it errors with a clear message.pie builddoes not result in a full rebuild #93), and they're recorded inpie.lock(cf. Add pinning of installed packages and documentation regarding pie.lock file #587).pie show -v).Optional / open for discussion:
pie install vendor/ext-foo --patch=/path/to.patch, or apatch:addcommand likerepository:add), sincepie.jsonlives in~/.config/pie/php8.x_<hash>/and is awkward to edit in Docker buildscomposer.jsonpatch/gitbinary is requiredWhy patches rather than scripts
Declarative patches are reproducible, reviewable and hashable. Arbitrary pre-build scripts raise the security concerns already discussed in #293. A generic hook could be considered separately later.
Relation to #738
#738 (separating download and build) would allow patching manually between the two steps. This proposal is the declarative counterpart for the same step. They complement each other.
I'm happy to contribute a PR if the direction is acceptable.
All reactions