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

Solver: requirements not resolvable root cause unclear #8518

Closed
andig opened this issue Jan 7, 2020 · 3 comments
Closed

Solver: requirements not resolvable root cause unclear #8518

andig opened this issue Jan 7, 2020 · 3 comments
Labels

Comments

@andig
Copy link

@andig andig commented Jan 7, 2020

My composer.json for https://github.com/php-pm/php-pm-httpkernel:

{
    "name": "php-pm/httpkernel-adapter",
    "license": "MIT",
    "require": {
        "php-pm/php-pm": "^2.0",
        "symfony/http-foundation": "^3.4|^4.0|^5.0",
        "symfony/http-kernel": "^3.4|^4.0|^5.0",
        "guzzlehttp/psr7": "^1.5"
    },
    "require-dev": {
        "phpunit/phpunit": "^7.0",
        "symfony/framework-bundle": "^3.4|^4.0|^5.0",
        "symfony/yaml": "^3.4|^4.0|^5.0",
        "doctrine/annotations": "^1.6"
    },
    "autoload": {
        "psr-4": {
            "PHPPM\\": ""
        }
    },
    "autoload-dev": {
        "psr-4": {
            "PHPPM\\Tests\\": "tests"
        }
    }
}

Output of composer diagnose:

Checking composer.json: OK
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com rate limit: OK
Checking disk free space: OK
Checking pubkeys: FAIL
Missing pubkey for tags verification
Missing pubkey for dev verification
Run composer self-update --update-keys to set them up
Checking composer version: OK
Composer version: 1.9.1
PHP version: 7.4.1
PHP binary path: /usr/local/Cellar/php/7.4.1/bin/php

When I run this command during travis for phpstan dependencies:

composer require --update-with-all-dependencies  "symfony/symfony" "laravel/framework" "drupal/drupal"

I get the following output:

Using version ^5.0 for symfony/symfony
Using version ^6.10 for laravel/framework
Using version ^8.8 for drupal/drupal
./composer.json has been updated
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
    - Installation request for laravel/framework ^6.10 -> satisfiable by laravel/framework[v6.10.0].
    - Conclusion: don't install symfony/http-foundation v4.4.2
    - Conclusion: don't install symfony/http-foundation v4.4.1
    - Conclusion: don't install symfony/http-foundation v4.4.0
    - Conclusion: don't install symfony/http-foundation v4.3.9
    - Conclusion: don't install symfony/http-foundation v4.3.8
    - Conclusion: don't install symfony/http-foundation v4.3.7
    - Conclusion: don't install symfony/http-foundation v4.3.6
    - don't install symfony/http-foundation v4.3.4|don't install symfony/symfony v5.0.0
    - don't install symfony/http-foundation v4.3.4|don't install symfony/symfony v5.0.1
    - don't install symfony/http-foundation v4.3.4|don't install symfony/symfony v5.0.2
    - laravel/framework v6.10.0 requires symfony/http-foundation ^4.3.4 -> satisfiable by symfony/http-foundation[v4.3.4, v4.3.5, v4.3.6, v4.3.7, v4.3.8, v4.3.9, v4.4.0, v4.4.1, v4.4.2].
    - Conclusion: don't install symfony/http-foundation v4.3.5
    - Installation request for symfony/symfony ^5.0 -> satisfiable by symfony/symfony[v5.0.0, v5.0.1, v5.0.2].


Installation failed, reverting ./composer.json to its original content.

And I expected this to happen: no error.

Problem: the output does not give any hint as to why the installation fails or what is conflicting. If occurs even if vendor and composer.lock are wiped before running.

@Seldaek

This comment has been minimized.

Copy link
Member

@Seldaek Seldaek commented Jan 13, 2020

Your composer.json requires symfony v5, and lravel/framework v6.10, which requires symfony v4.3, so that conflicts.
Make sure you specify a version like composer require --update-with-all-dependencies "symfony/symfony:^4.3" "laravel/framework" "drupal/drupal" to avoid the version guessing picking the wrong versions.

@Seldaek Seldaek closed this Jan 13, 2020
@andig

This comment has been minimized.

Copy link
Author

@andig andig commented Jan 13, 2020

Thank you. I'm confused by difference in the lines starting with Conclusion and don't- both seems to indicate the same type of issue? Unfortunately it is-even for the somewhat experienced composer user- still hard to guess the cause of the error out of the log. At any rate it is for me...

@Seldaek

This comment has been minimized.

Copy link
Member

@Seldaek Seldaek commented Jan 14, 2020

Yeah those are very similar, but the key ones are don't install symfony/http-foundation v4.3.4|don't install symfony/symfony v5.0.0 which indicate what conflicts. Then the most interesting ones to figure out why are "Installation request" because those come from composer.json rules, then if you follow the dependency chain you can get to the reason of the conflict.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.