symfony / orm-pack

A Symfony Pack for Doctrine ORM
MIT License
1.82k stars 18 forks source link

Dependency conflict between Ocramius and Composer package-version #31

Closed ArthurHoaro closed 4 years ago

ArthurHoaro commented 4 years ago

This commit https://github.com/symfony/orm-pack/commit/bf4bf67ca7c7760240650d67bf7b71c459470e8c added a dependency to composer/package-versions-deprecated which conflicts with any installed package using ocramius/package-versions (in my case infection).

I'm not sure what's the best way to handle this, but I can't install symfony/orm-pack.

composer require symfony/orm-pack         
Using version ^1.1 for symfony/orm-pack
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)         
Restricting packages listed in "symfony/symfony" to "5.1.*"
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for symfony/orm-pack ^1.1 -> satisfiable by symfony/orm-pack[v1.1.0].
    - Conclusion: remove ocramius/package-versions 1.9.0
    - Conclusion: don't install ocramius/package-versions 1.9.0
    - symfony/orm-pack v1.1.0 requires composer/package-versions-deprecated * -> satisfiable by composer/package-versions-deprecated[1.8.0, 1.8.1].
    - don't install composer/package-versions-deprecated 1.8.0|don't install ocramius/package-versions 1.9.0
    - don't install composer/package-versions-deprecated 1.8.1|don't install ocramius/package-versions 1.9.0
    - Installation request for ocramius/package-versions (locked at 1.9.0) -> satisfiable by ocramius/package-versions[1.9.0].

Installation failed, reverting ./composer.json to its original content.
nicolas-grekas commented 4 years ago

You need to upgrade ocramius/package-versions first. The issue is related to it being locked at v1.9 (as seen in the message).

ArthurHoaro commented 4 years ago

I can submit a PR to upgrade infection dependency if necessary, however v1.9 seems to be the latest version of that library: https://github.com/Ocramius/PackageVersions/tags

nicolas-grekas commented 4 years ago

Oh ok. Then maybe you have it listed in your root composer.json and you need to remove it? I don't have the issue so I can only guess.

ArthurHoaro commented 4 years ago

This issue can be reproduced by:

composer init
composer require --dev infection/infection
composer require symfony/orm-pack

composer --version  
Composer version 1.10.8 2020-06-24 21:23:30

I suspect that any library using this lib would produce the same issue, but I don't know how widely it is used directly. Maybe I should report this to infection or package-version repo?

nicolas-grekas commented 4 years ago

Thanks for the details. Will be fixed by https://github.com/composer/package-versions-deprecated/pull/6