drupal-composer / preserve-paths

A composer plugin for keeping specified files and directories when installing/updating new composer packages. Can be used to supported nested packages.
28 stars 28 forks source link

Add support for composer 2 #34

Closed hussainweb closed 3 years ago

hussainweb commented 4 years ago

I couldn't run tests locally due to PHP version conflict but I'm hoping Travis will give meaningful results.

hussainweb commented 4 years ago

Tagging https://github.com/composer/composer/issues/8726

hussainweb commented 4 years ago

Only the test on PHP 5.4 failed. The error seems like a random composer issue. In any case, I don't know if we should worry too much about PHP 5.4.

greg-1-anderson commented 4 years ago

The right thing to do (short of fixing the PHP 5.4 failure) would be to make a new major release that supports Composer 2 and drops support for PHP 5.4 there.

hussainweb commented 3 years ago

@greg-1-anderson, I'm guessing that this was a random issue and want to retry the job. I don't think the change itself has anything to do with the failure on PHP 5.4.

As for the change: since this only adds support for composer 2, I don't think we need a major release just for this reason. I agree that if we were to drop support for PHP 5.4, we would need a major release but I don't think that's related to this change.

greg-1-anderson commented 3 years ago

I'm not a maintainer here, so I can't retry the job, but you're right -- php 5.3 and php 5.5 worked, so the 5.4 failure was probably transient. Try pushing a no-op commit to make all the tests rerun.

hussainweb commented 3 years ago

@greg-1-anderson, my bad. I have pushed an empty commit to see what happens.

VladimirAus commented 3 years ago

Getting an error on composer require drupal-composer/preserve-paths.

  - Installing drupal-composer/preserve-paths (dev-composer2 b385cf1): Cloning b385cf12d9 from cache

Fatal error: Uncaught Error: Undefined class constant 'PRE_PACKAGE_INSTALL' in /vendor/drupal-composer/preserve-paths/src/Plugin.php:42
Stack trace:
#0 phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php(363): DrupalComposer\PreservePaths\Plugin::getSubscribedEvents()
#1 phar:///usr/local/bin/composer/src/Composer/Plugin/PluginManager.php(322): Composer\EventDispatcher\EventDispatcher->addSubscriber(Object(DrupalComposer\PreservePaths\Plugin))
#2 phar:///usr/local/bin/composer/src/Composer/Plugin/PluginManager.php(223): Composer\Plugin\PluginManager->addPlugin(Object(DrupalComposer\PreservePaths\Plugin), false)
#3 phar:///usr/local/bin/composer/src/Composer/Installer/PluginInstaller.php(76): Composer\Plugin\PluginManager->registerPackage(Object(Composer\Package\CompletePackage), true)
#4 [internal function]: Composer\Installer\PluginInstaller->Composer\Installer\{closure}(NULL)
#5 phar:///usr/local/bin/composer/vendor/react/promise/src/React/Promise/ in /vendor/drupal-composer/preserve-paths/src/Plugin.php on line 42
VladimirAus commented 3 years ago

Added PR here: https://github.com/hussainweb/preserve-paths/pull/1

greg-1-anderson commented 3 years ago

Please see #36.

hussainweb commented 3 years ago

Thanks, @greg-1-anderson. This got lost in things but I have now merged that PR.

hussainweb commented 3 years ago

I see similar changes in #36. If I don't come back to this issue in a short while, please consider #36 instead.

greg-1-anderson commented 3 years ago

I have a couple additional insignificant changes in #36 that I would still recommend. It would be less confusing if you closed here. If you prefer to keep working here, please merge in my changes & I will close my PR.

hussainweb commented 3 years ago

@greg-1-anderson, my availability isn't great for a few days/weeks and would rather close if you're going to take over. Thanks for your work here.