-
-
Notifications
You must be signed in to change notification settings - Fork 247
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
Composer patches only respects composer.json #12
Comments
👍 Yeah, I agree. This makes a lot of sense. I don't have a lot of time to work on this right now, but if you want to submit a PR, I'd be more than happy to merge it. It should be pretty straightforward. |
I think this behaviour is also at the bottom of an issue we are having. We're seeing that patches are applied on composer update but not on composer install. Our current workaround is to move all the patches to the toplevel composer.json. IIUC a composer.lock file is supposed to define the whole installation including versions (and by extension patches) and thus should be self-contained. |
Sorry to reply on a closed issue, but I'm having the same issue as @cspitzlay above - that is we are using wikimedia/composer-merge-plugin so we can have a standard composer.json for certain kinds of project, and an instance-specific composer.local.json. If we add patches to requirements in the composer.local.json they install fine, but building a new site instance using composer install with the current composer.lock (which does appear to contain references to the patches) the patches are not installed. Manually running "composer update" for the requirement does not apply the patches on the new instance. The only workaround I've discovered to work reliably is to delete the destination folder which contains the requirement being patched and run "composer install" again. I notice that this issue has been closed, but this particular issue doesn't seem to be resolved. Is the fix in the coming 2.x branch? |
This issue is still open :) |
I think this is critical for anyone using the composer merge plugin. What's really strange is we can get it working correctly only if we manually remove the "patches_applied" section from the composer.lock file for each package that was patched from one of the merged composer.json files. If we do that, then when So our current workaround is very hacky - we have to remember to manually remove the references made in composer.lock when we include new patches. |
Although this makes a lot of sense, what would be the workflow for just applying a patch to the current version of a dependency, without actually updating the "base" version of the dependency? Currently, that just requires adding the patch to composer.json and rerunning composer install. I actually came here looking for an issue about composer.lock not being updated when you run composer install with a new patch, and having to run composer update --lock to get it to be added correctly. |
…thout package re-install or re-patch.
… package re-install or re-patch.
… package re-install or re-patch.
It's not composer.lock because that isn't super feasible, but |
When running composer install, I expect the composer.lock file to be respected, but instead, the patches defined in composer.json are always used. This isn't critical by any stretch, but it's not consistent with the way composer works.
Proposal:
The text was updated successfully, but these errors were encountered: