Skip to content
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

Add support for composer 2 #34

Closed
wants to merge 8 commits into from

Conversation

hussainweb
Copy link
Contributor

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

@hussainweb
Copy link
Contributor Author

Tagging composer/composer#8726

@hussainweb
Copy link
Contributor Author

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
Copy link
Contributor

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
Copy link
Contributor Author

@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
Copy link
Contributor

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
Copy link
Contributor Author

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

@VladimirAus
Copy link
Contributor

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

  • PHP: PHP 7.3.21 (cli) (built: Aug 31 2020 14:12:48) ( NTS )
  • Composer: Composer version 2.0.4 2020-10-30 22:39:11
  - 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
Copy link
Contributor

Added PR here: hussainweb#1

@greg-1-anderson greg-1-anderson mentioned this pull request Nov 7, 2020
@greg-1-anderson
Copy link
Contributor

Please see #36.

Composer2 compatibility. PackageEvents update.
@hussainweb
Copy link
Contributor Author

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

@hussainweb
Copy link
Contributor Author

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
Copy link
Contributor

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
Copy link
Contributor Author

@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.

@hussainweb hussainweb closed this Nov 7, 2020
@VladimirAus VladimirAus mentioned this pull request Nov 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants