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

Update containers to use Composer 2.0 #1063

Closed
morrisonlevi opened this issue Oct 24, 2020 · 6 comments
Closed

Update containers to use Composer 2.0 #1063

morrisonlevi opened this issue Oct 24, 2020 · 6 comments
Labels

Comments

@morrisonlevi
Copy link
Collaborator

I recommend updating our testing containers to use the newer composer version. It's compatible all the way back to PHP 5.3, so we're safe on that front.

The main motivation is that it is significantly faster, and slow updates/installs are annoying. This should help us out quite a bit. For instance, look at the speed up of common installations:

Performance improvements of Composer 2.0 compared to 1.0 on Drupal, Laravel, and Symfony
Taken from https://blog.packagist.com/composer-2-0-is-now-available/#performance-improvements.

I recommend a phased roll-out in case we encounter issues.

@morrisonlevi
Copy link
Collaborator Author

I've identified two issues so far:

  1. symfony/flex needs to be updated to 1.9.8+. This one is trivial and obvious; expect a PR for it.
  2. Symfony 2.3 has this issue:

Fatal error: Uncaught TypeError: Argument 1 passed to Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap() must be an instance of Composer\Script\CommandEvent, instance of Composer\Script\Event given, called in phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php on line 323 and defined in /home/circleci/datadog/tests/Frameworks/Symfony/Version_2_3/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Composer/ScriptHandler.php:33
Stack trace:
#0 phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php(323): Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap(Object(Composer\Script\Event))
#1 phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php(219): Composer\EventDispatcher\EventDispatcher->executeEventPhpScript('Sensio\Bundle\D...', 'buildBootstrap', Object(Composer\Script\Event))
#2 phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php(101): Composer\EventDispatc in /home/circleci/datadog/tests/Frameworks/Symfony/Version_2_3/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Composer/ScriptHandler.php on line 33
Makefile:593: recipe for target 'test_web_symfony_23' failed

The Sensio distribution bundle has been abandoned, so unless this can be fixed via a composer update then we can't use composer 2 when running Symfony 2.3 tests. Symfony 2.3 was an LTS release that reached EOL in May 2017.

If Symfony 2.3 ends up being literally only one that can't use Composer 2 then I think we should consider dropping it from the test suite.

@SammyK
Copy link
Contributor

SammyK commented Nov 3, 2020

I'm 👍 for removing Symfony 2.3 from the test suite to allow more momentum on actively supported software.

@morrisonlevi
Copy link
Collaborator Author

Looks like it was fixable via an update: #1075. After we've released 0.50 do you think you could help me get all the composer 2 changes over the finish line?

@labbati
Copy link
Member

labbati commented Feb 8, 2021

@morrisonlevi what's the work on this? I think we completed the migration or we still have work to do?

@morrisonlevi
Copy link
Collaborator Author

Here's what I remember:

  1. Tried upgrading to composer 2 in some CI jobs, went fine, so moved on to point 2.
  2. Upgraded it in containers. A bunch of things broke in CI. Downgraded the containers.
  3. Opened PR Upgrade to composer 2 #1075, which added self-update to more CI jobs, fixed some Symfony stuff specifically.

All has been well since, I think. This probably means that we're good to try upgrading composer in containers the next time we are working on them (or want to prioritize it).

@labbati
Copy link
Member

labbati commented Feb 8, 2021

Thanks @morrisonlevi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants