-
Notifications
You must be signed in to change notification settings - Fork 28
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
Incompatible with cweagans/composer-patches #10
Comments
I think we can set weights for the event listeners. @derhasi, if you want to coordinate setting our listener weights appropriately, I'm happy to change things on my end to ensure that your plugin is supported by mine and vice-versa! |
@cweagans I try to have a closer look on this in the next days. |
Any update on this issue? Is there any workaround possible in the mean time? |
@eelkeblok this package works fine with: "netresearch/composer-patches-plugin" |
I haven't looked into it, as I'm presently in the middle of a rewrite of my plugin. If you open a corresponding issue in my queue, I'll make sure 2.x is compatible. |
It looks like cweagans/composer-patches#42 is basically the equivalent of this issue in the composer-patches queue. |
Related question composer/composer#6261 |
Is this still an issue? I haven't used the plugin in a while. |
Yes, this is not resolved yet. |
For those interested, you can try my ugly patch here SebCorbin/composer-patches@1cb9bac. |
The patch by @SebCorbin worked for me. I simply added the following to composer.json and my paths were preserved:
|
@SebCorbin thanks for the patch @shahinam @Others is this only a Drupal core 7 problem then let's alter the title and add a Drupal 7 only label. My experience is this is only happening on D7 core only. |
Same as @clemens-tolboom |
My experience was with Drupal 7 |
I think it is correct that this happens with Drupal 7, not 8. IIRC, it has something to do with the file system structure. Plus, these plugins seem to be used almost exclusively in Drupal projects, so in practice Drupal 7 is likely the only project affected. I am a bit hesitant to tag it as D7 exclusive, but it should definitely be noted in the issue summary. |
What I learned so far is Drupal 8 is installed/added as a component like any normal OTOH Drupal 7 lives in /web together with ie /web/sites/sites/* which We @work decided to live with this and go with the Drupal 7 composer and do core updates manually. Unfortunately unavailable time prevents testing this. What would you do? |
I put my modules themes and libraries outside web folder and use composer-post install script to link inside Drupal 7 structure; this fails under Windows but is good enough to me |
We've decided to stick with drush make 😇 Composer is neat, but maintaining one of the components (Drupal core) manually - especially with patches - sounds like a step back, to me. YMMV. |
This seems to be a bug in composer-patches, as per the comment from @SebCorbin above. Nothing to change here, so I'd suggest to close this issue. |
The patch from #10 (comment) is now added to https://github.com/drupal-composer/drupal-project/commits/7.x in |
this patch does not apply anymore. |
@drzraf The patch #10 (comment) seems to apply for me using 1.6.5 of cweagans/composer-patches. |
@dmp1ce The patch doesn't apply on the initial Subsequent @cweagans is there a reason the It shouldn't break anything, and actually makes your plugin more flexible with other composer plugins. edit: We can add an |
cweagans/composer-patches#42 (comment) is really my main concern at this point. |
Following my comment, I did some research into it and I think it should be fine to merge that code in. The parameters of note are passed in perfectly as per the original implementation. The only ones which could do with some work are the The current version of the plugin is unstable as it actively breaks composer in a pretty big way by not notifying other plugins when an uninstall is occurring, so I would prioritize not breaking that API contract and create a separate issue which addresses the creation of the The ideal solution would be to replicate the |
Patch taken from SebCorbin@1cb9bac Composer project tries to apply this patch: https://github.com/drupal-composer/drupal-project/blob/339c81dcfd6881f3f3e1069b8ab3fe4149094e6b/composer.json#L76-L80 But this does not work reliably: drupal-composer/preserve-paths#10 (comment) So we have to keep it in our own fork. And install composer-patches from the fork.
It's looking like the |
When adding or deleting patches, paths are not preserved.
This is the test composer.json I am using.
After installing, I am making changes in robots.txt which I want to preserve.
Adding or updating any packages works fine and preserves the changes.
Now If I add/remove a patch and do
composer update
, all the changes are gone.I did a short debugging, and here is what I think is happening:
For cleanly applying patches composer-patches plugin deletes package files (in this case docroot) by responding to
ScriptEvents::PRE_INSTALL_CMD
event which happens to be before theScriptEvents::PRE_PACKAGE_INSTALL
/ScriptEvents::PRE_PACKAGE_UPDATE
events in event loop - where composer-preserve-paths plugin backs up the files. So when composer-preserve-paths gets chance to backup files, they are already removed, so nothing to backup and hence restore.The text was updated successfully, but these errors were encountered: