-
-
Notifications
You must be signed in to change notification settings - Fork 242
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
Only have git patchers and freeform patcher? #472
Conversation
Pull Request Test Coverage Report for Build 4159058115
💛 - Coveralls |
I tested this on our project, it worked the first install (possibly because the library already existed on disk) but after
I'm not sure what that error means exactly. Is there a problem with the patch? It would be pretty bad if patches directly from GitHub can't be applied. Let me know if you want a separate issue for this. |
@danepowell I cloned your project and gave it a try with
"extra": {
"patches": {
"symfony/filesystem": [
{
"description": "patch does something",
"url": "assets/symfony-fs-mirror.patch",
"depth": 5
}
],
},
}
"extra": {
"patches": {
"symfony/filesystem": [
"assets/symfony-fs-mirror.patch"
],
},
"composer-patches": {
"package-depths": {
"symfony/filesystem": 5
}
}
}, After getting that patch to apply, it looks like there is another that is failing -- https://patch-diff.githubusercontent.com/raw/consolidation/self-update/pull/21.patch This one (I think) is a legit failure. That patch was added to your I didn't go further than that -- does that help? |
Thanks. For the symfony/filesystem patch, I tried setting the package depth both ways you suggested and no matter what Composer Patches passed I'll concede that the consolidation/self-update patch may be borked. Also this was hard to debug because the errors changed every time I ran |
Oh I figured it out, Composer Patches was completely ignoring my composer.json changes because patches.lock existed. In the end, removing all of my composer, vendor, and patches.lock files and setting the depth correctly fixed it. But yikes, it shouldn't be that complicated to debug. Maybe you should store a hash of composer.json inside patches.lock so that you can make sure to pick up changes to composer.json. This is what composer.lock obviously does, and composer.lock and patches.lock are effectively siblings (I understand you created patches.lock just because you couldn't store arbitrary data in composer.lock). |
The plugin works a little differently now -- https://docs.cweagans.net/composer-patches/usage/recommended-workflows/ Not automatically deleting stuff was an explicit goal -- that caused a lot of problems for people in the past. I agree that it should have warned you that patches.lock should be updated though. Opened #479 |
Description
Continuation of #471. If the Git patcher works for everything, why even bother with
patch
? We could potentially use the git patchers for everything and people can use theFreeformPatcher
that this PR adds to run arbitrary commands to apply other patches in some way.I'm not sure if this is the right thing to do though.
Related tasks
Other notes