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

Compatibility with Composer 2.0 #7391

Closed
limenet opened this issue Oct 26, 2020 · 8 comments
Closed

Compatibility with Composer 2.0 #7391

limenet opened this issue Oct 26, 2020 · 8 comments

Comments

@limenet
Copy link
Contributor

limenet commented Oct 26, 2020

Bug Report

A couple days ago, Composer 2.0 was released and for a while now, Composer 1.10.x has been warning about invalid PSR-0 and PSR-4 configurations and most packages have been upgraded/fixed.

From the release post:

Invalid PSR-0 / PSR-4 configurations will not autoload anymore in optimized-autoloader mode, as per the warnings introduced in Composer 1.10.

Further, the release post contains this snippet:

As for Composer 1.x, it is now more or less EOL. It will also receive critical fixes if anything comes up but the goal for everyone should be to migrate to 2.x as soon as possible.

Almost all of Pimcore's dependencies are compatible with Composer 2.0 except for doctrine/doctrine-migrations-bundle which uses an almost two-year old version with now being superseded by two major versions.

Expected behavior

Pimcore can safely be installed with Composer 2.0 which is the new stable version of Composer and replaces Composer 1.x which is now EOL.

Actual behavior

Due to depending on an old version of doctrine/doctrine-migrations-bundle, which is not compatible with Composer 2.0, it is currently not safely possible to use Composer 2.0 when installing Pimcore.

Steps to reproduce

  1. Install Composer 1.x
  2. Run composer install
  3. Observe the following message: Deprecation Notice: Class Doctrine\Bundle\MigrationsBundle\Tests\DependencyInjection\DoctrineCommandTest located in ./vendor/doctrine/doctrine-migrations-bundle/Tests/Command/DoctrineCommandTest.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201

I realize this is unlikely to cause any issues (since the message affects a test used by that bundle) yet it unfortunately prevents us from safely using Composer 2.0 in production in conjunction with Pimcore and instead relying on a now EOL version of Composer.

@dpfahlbusch
Copy link
Contributor

There is currently another problem with composer v2.
The wikimedia/composer-merge-plugin is not composer v2 compatible at the moment.

wikimedia/composer-merge-plugin#184

@HaaseIT
Copy link
Contributor

HaaseIT commented Oct 27, 2020

Furthermore, in the pimcore dockerfile:

https://github.com/pimcore/docker/blob/df45b64f4875a5cf1bbeabd91d1d5adc3954dfbb/Dockerfile.template

hirak/prestissimo:^0.3

is required, this is also incompatible with Composer 2.0

@brusch
Copy link
Member

brusch commented Oct 27, 2020

@brusch brusch closed this as completed Oct 27, 2020
@HaaseIT
Copy link
Contributor

HaaseIT commented Oct 27, 2020

@brusch What about the the docker part?

@brusch
Copy link
Member

brusch commented Oct 27, 2020

@HaaseIT pimcore/docker#29

@limenet
Copy link
Contributor Author

limenet commented Oct 27, 2020

@brusch thanks for the changes! Most Composer 2.0 issues now appear fixed.

However, while #7349 upgraded a number of Doctrine packages, the one mentioned in my initial report, doctrine/doctrine-migrations-bundle, remained untouched and as such the deprecation notice still appears. I've verified this with the current masters of both the demo and skeleton repo.

Do you have any plans on upgrading that package as well?

@jdreesen
Copy link
Contributor

jdreesen commented Oct 27, 2020

I don't think that's an issue as it's only a test file that cannot be loaded. You don't want to run the tests locally (when installed as a composer dependency) which is why they are ignored in the export for version 2 & 3.

@brusch
Copy link
Member

brusch commented Oct 28, 2020

For 6.x it's fine as it is I'd say (however PRs are welcome), for 7 we're going to update the dependencies anyway.

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

No branches or pull requests

5 participants