composer / composer

Dependency Manager for PHP
https://getcomposer.org/
MIT License
28.6k stars 4.55k forks source link

Update with --prefer-lowest fails #7265

Closed geerteltink closed 4 years ago

geerteltink commented 6 years ago

The lowest Travis CI builds are failing since a while because of conflicting dependencies. See Travis and zendframework/zend-expressive-skeleton#251.

zendframework/zend-expressive-tooling requires ocramius/package-versions:^1.3 jean85/pretty-package-versions requires ocramius/package-versions:^1.2.0

Since zendframework/zend-expressive-tooling requires at least ^1.3 I expect this the minimum requirement for all packages.

$ composer update --no-interaction --no-scripts --prefer-lowest --prefer-stable`
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - zendframework/zend-expressive-tooling 1.0.0 requires ocramius/package-versions ^1.3 -> satisfiable by ocramius/package-versions[1.3.0].
    - zendframework/zend-expressive-tooling 1.0.1 requires ocramius/package-versions ^1.3 -> satisfiable by ocramius/package-versions[1.3.0].
    - Conclusion: don't install ocramius/package-versions 1.3.0
    - Installation request for zendframework/zend-expressive-tooling ^1.0 -> satisfiable by zendframework/zend-expressive-tooling[1.0.0, 1.0.1].

After removing zendframework/zend-expressive-tooling I get this:

- Installing ocramius/package-versions (1.2.0): Loading from cache
$ composer why ocramius/package-versions
jean85/pretty-package-versions  1.0.3  requires  ocramius/package-versions (^1.2.0)
$ composer why jean85/pretty-package-versions
phpstan/phpstan  0.9.2  requires  jean85/pretty-package-versions (^1.0.3)

I guess this is a composer issue as zend-expressive-tooling requires ocramius/package-versions:^1.3. It shouldn't load lower than that, even though jean85/pretty-package-versions is fine with ^1.2.

geerteltink commented 6 years ago

I'm wondering if this can be caused by in "minimum-stability": "dev" in zend-expressive-tooling/composer.json.

geerteltink commented 6 years ago

It seems to be fixed by using install instead of update: zendframework/zend-expressive-skeleton#252

Seldaek commented 6 years ago

Might have been related to https://github.com/composer/composer/issues/7268 - would be good if you can try to revert the fix you did and see if Composer v1.6.5 helps or not. That said there are definitely some edge cases where prefer lowest causes issues I think, they're just really hard to reproduce and iron out.

geerteltink commented 6 years ago

I just restarted the Travis job instead of reverting the fix :)

Unfortunately it's still failing with 1.6.5 and has the same problem: https://travis-ci.org/zendframework/zend-expressive-skeleton/jobs/366159908

Seldaek commented 6 years ago

Ok I hoped maybe it'd help.. In this case I am not sure what to do about it really.

Seldaek commented 4 years ago

Closing as very old, not sure if still relevant, might be fixed by 2.0, if not feel free to reopen.