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

SolverProblemsException #8856

Closed
enumag opened this issue May 1, 2020 · 2 comments
Closed

SolverProblemsException #8856

enumag opened this issue May 1, 2020 · 2 comments
Milestone

Comments

@enumag
Copy link
Contributor

enumag commented May 1, 2020

My composer.json:

{
    "require": {
        "amphp/file": "^1.0@dev",
        "amphp/http-client": "^4.2"
    },
    "require-dev": {
        "psr/log": "*"
    }
}

Output of composer diagnose:

Checking composer.json: WARNING
No license specified, it is recommended to do so. For closed-source software you may use "proprietary" as license.
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: 
Tags Public Key Fingerprint: 57815BA2 7E54DC31 7ECC7CC5 573090D0  87719BA6 8F3BB723 4E5D42D0 84A14642
Dev Public Key Fingerprint: 4AC45767 E5EC2265 2F0C1167 CBBB8A2B  0C708369 153E328C AD90147D AFE50952
OK
Checking composer version: OK
Composer version: 1.10.5
PHP version: 7.4.4
PHP binary path: /usr/bin/php7.4
OpenSSL version: OpenSSL 1.1.1d  10 Sep 2019

When I run this command:

composer up

I get the following output:

  [Composer\DependencyResolver\SolverProblemsException]                        
  Problem 1                                                                    
      - Installation request for amphp/file ^1.0@dev -> satisfiable by amphp/file[1.x-dev].                                                               
      - amphp/http-client v4.2.2 conflicts with amphp/file[dev-master].        
      - remove amphp/file 1.x-dev|keep amphp/file dev-master                   
      - Installation request for amphp/http-client ^4.2 -> satisfiable by amphp/http-client[v4.2.2].   

And I expected this to happen:

Successful installation.


Additional notes:

The peculiar thing is that this composer.json actually works fine:

{
    "require": {
        "amphp/file": "^1.0@dev",
        "amphp/http-client": "^4.2"
    }
}

But as soon as I add anything (even a package completely unrelated to these two) into require-dev, it breaks with the exception above.

I think that the bug is somehow caused by this conflict in amphp/http-client. As you can see http-client has a conflict with amphp/file >=2 - which doesn't exist ofc, here is the reasoning behind the conflict. But aside from blocking nonexistent 2.x, the conflict also blocks amphp/file dev-master. This is not intentional however so there is a branch-alias in place to specify that master is 1.x which should make the installation pass. Which it does, but only when require-dev it empty.

@kelunik
Copy link

kelunik commented May 1, 2020

I can reproduce the exact behavior and also believe this is a bug in the solver rather than a wrong dependency / conflict specification in the mentioned packages.

Works fine with Composer version 2.0-dev (2.0-dev+56811b4c8fec9c2eda5bd47a2c079e121c668eb4), but fails with 1.10.1.

@Seldaek
Copy link
Member

Seldaek commented May 1, 2020

That's a bug we fixed in 2.0 indeed. The fact that a conflict on >=x matches dev-master. It's not fixable in 1.x sorry.

@Seldaek Seldaek closed this as completed May 1, 2020
@Seldaek Seldaek added this to the 2.0-core milestone May 1, 2020
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

3 participants