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 issue with replace / provide #9749

Closed
alcohol opened this issue Mar 4, 2021 · 12 comments
Closed

Solver issue with replace / provide #9749

alcohol opened this issue Mar 4, 2021 · 12 comments
Assignees

Comments

@alcohol
Copy link
Member

alcohol commented Mar 4, 2021

My composer.json:

{}

Output of composer diagnose:

$ 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 oauth access: 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: 2.0.11
PHP version: 8.0.2
PHP binary path: /usr/local/bin/php
OpenSSL version: OpenSSL 1.1.1j  16 Feb 2021
cURL version: 7.74.0 libz 1.2.11 ssl OpenSSL/1.1.1j
zip: extension present, unzip present

When I run this command:

composer require symfony/symfony:^4.4 sentry/sentry-symfony --ignore-platform-reqs

I get the following output:

Using version ^4.0 for sentry/sentry-symfony
./composer.json has been updated
Running composer update symfony/symfony sentry/sentry-symfony
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Conclusion: don't install symfony/symfony v4.4.1 (conflict analysis result)
    - Conclusion: don't install symfony/symfony v4.4.2 (conflict analysis result)
    - Conclusion: don't install symfony/symfony v4.4.3 (conflict analysis result)
    - Conclusion: don't install symfony/symfony v4.4.4 (conflict analysis result)
    - Conclusion: don't install symfony/symfony v4.4.5 (conflict analysis result)
    - Conclusion: don't install symfony/symfony v4.4.6 (conflict analysis result)
    - Conclusion: don't install symfony/symfony v4.4.7 (conflict analysis result)
    - Conclusion: don't install symfony/symfony v4.4.8 (conflict analysis result)
    - Conclusion: don't install symfony/symfony v4.4.9 (conflict analysis result)
    - Conclusion: don't install symfony/symfony v4.4.10 (conflict analysis result)
    - Conclusion: don't install symfony/symfony v4.4.11 (conflict analysis result)
    - Conclusion: don't install symfony/symfony v4.4.12 (conflict analysis result)
    - Conclusion: don't install symfony/symfony v4.4.13 (conflict analysis result)
    - Conclusion: don't install symfony/symfony v4.4.14 (conflict analysis result)
    - Conclusion: don't install symfony/symfony v4.4.15 (conflict analysis result)
    - Conclusion: don't install symfony/symfony v4.4.16 (conflict analysis result)
    - Conclusion: don't install symfony/symfony v4.4.17 (conflict analysis result)
    - Conclusion: don't install symfony/symfony v4.4.18 (conflict analysis result)
    - Conclusion: don't install symfony/symfony v4.4.19 (conflict analysis result)
    - sentry/sentry-symfony[4.0.0, ..., 4.0.3] require symfony/security-core ^3.4.43||^4.4.11||^5.0.11 -> satisfiable by symfony/symfony[v4.4.11, ..., v4.4.19], symfony/security-core[v3.4.43, ..., v3.4.47, v4.4.11, ..., v4.4.19, v5.0.11, ..., v5.2.3].
    - Only one of these can be installed: symfony/security-core[v3.4.43, ..., v3.4.47, v4.4.11, ..., v4.4.19, v5.0.11, ..., v5.2.3], symfony/symfony[v4.4.0, ..., v4.4.19]. symfony/symfony replaces symfony/security-core and thus cannot coexist with it.
    - Root composer.json requires symfony/symfony ^4.4 -> satisfiable by symfony/symfony[v4.4.0, ..., v4.4.19].
    - Root composer.json requires sentry/sentry-symfony ^4.0 -> satisfiable by sentry/sentry-symfony[4.0.0, 4.0.1, 4.0.2, 4.0.3].


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

And I expected this to happen:

Installed both packages.

@alcohol
Copy link
Member Author

alcohol commented Mar 4, 2021

I think things get funky because symfony/symfony replaces symfony/security which in turn also replaces symfony/security-core (but that is also replaced by symfony/symfony itself). I am just speculating though.. you are way more experienced when it comes to the solver component @naderman so care to weigh in here?

@stof
Copy link
Contributor

stof commented Mar 4, 2021

Can you try to first install symfony/symfony ^4.4 only (without sentry/sentry-symfony and then running composer why-not sentry/sentry-symfony 4.0.3 ?

@alcohol
Copy link
Member Author

alcohol commented Mar 4, 2021

That just gives me the following unfortunately:

$ composer why-not sentry/sentry-symfony 4.0.3
                                                              
  [InvalidArgumentException]                                      
  Could not find package "sentry/sentry-symfony" in your project 

@alcohol
Copy link
Member Author

alcohol commented Mar 4, 2021

FYI, if I try to install with symfony/symfony already installed I get a different problem set.

composer require sentry/sentry-symfony --ignore-platform-reqs
Using version ^4.0 for sentry/sentry-symfony
./composer.json has been updated
Running composer update sentry/sentry-symfony
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - sentry/sentry-symfony[4.0.0, ..., 4.0.3] require sentry/sdk ^3.1 -> satisfiable by sentry/sdk[3.1.0].
    - sentry/sdk 3.1.0 requires sentry/sentry ^3.1 -> satisfiable by sentry/sentry[3.1.0, ..., 3.2.0].
    - sentry/sentry[3.1.0, ..., 3.2.0] require php-http/async-client-implementation ^1.0 -> could not be found in any version, but the following packages provide it:
      - symfony/http-client Provides powerful methods to fetch HTTP resources synchronously or asynchronously
      - php-http/guzzle6-adapter Guzzle 6 HTTP Adapter
      - symfony/symfony The Symfony PHP framework
      - php-http/curl-client PSR-18 and HTTPlug Async client with cURL
      - php-http/guzzle7-adapter Guzzle 7 HTTP Adapter
      - php-http/mock-client Mock HTTP client
      - voku/httpful A Readable, Chainable, REST friendly, PHP HTTP Client
      - php-http/react-adapter React HTTP Adapter
      - swisnl/php-http-fixture-client Fixture client for PHP-HTTP
      - betalabs/guzzle6-adapter Guzzle 6 HTTP Adapter
      - phpgt/fetch Asynchronous HTTP client with promises for PHP 7 applications.
      - phpgt/curl cURL object wrapper.
      - john_zuk/php-nbp-api NBP (Narodowy Bank Polski) API client
      - christophwurst/nextcloud-http-client HTTPlug and PSR7 adapter for Nextcloud
      - devster/http-client Symfony HttpClient component
      - gogoprint/guzzle6-adapter Guzzle 6 HTTP Adapter
      - phpgt/curlinterface cURL object wrapper.
      - ramphor/httplug-guzzle6-adapter Guzzle 6 HTTP Adapter
      - tschope/guzzle7-adapter Guzzle 7 HTTP Adapter
      Consider requiring one of these to satisfy the php-http/async-client-implementation requirement.
    - Root composer.json requires sentry/sentry-symfony ^4.0 -> satisfiable by sentry/sentry-symfony[4.0.0, 4.0.1, 4.0.2, 4.0.3].

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
 - It's a private package and you forgot to add a custom repository to find it

Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

Note that the required php-http/async-client-implementation should be resolved already though because of symfony/symfony being installed.

@stof
Copy link
Contributor

stof commented Mar 4, 2021

$ composer why-not sentry/sentry-symfony 4.0.3

[InvalidArgumentException]
Could not find package "sentry/sentry-symfony" in your project

this looks wrong to me.composer why-not with a version number is meant to look at the package remotely, not in the project.

@alcohol
Copy link
Member Author

alcohol commented Mar 4, 2021

I believe prohibits (why-not) works a bit less straight forward than it appears. But again, I could be mistaken.

@stof
Copy link
Contributor

stof commented Mar 4, 2021

Note that the required php-http/async-client-implementation should be resolved already though because of symfony/symfony being installed.

The symfony/symfony package does not define the provide rule for php-http/async-client-implementation yet. this has been solved in symfony/symfony#40086 but the release is not done yet.

@alcohol
Copy link
Member Author

alcohol commented Mar 4, 2021

So even though it replaces symfony/http-client it doesn't automatically inherit the provides from said packages? Okay, makes sense then. Still does not really explain why trying to install both at the same time gives a completely different problem set. But it does explain the latter situation.

@stof
Copy link
Contributor

stof commented Mar 4, 2021

Update: the Symfony release containing the fix is now done 😄

@Seldaek
Copy link
Member

Seldaek commented Mar 5, 2021

So in short this was a symfony/symfony bug and we can close, or is there smth to look at on our end?

@alcohol
Copy link
Member Author

alcohol commented Mar 6, 2021

Looks like it works in both flows/scenarios now yeah. The problem set was quite weird and unclear though in the former scenario. Not sure if that is worth looking into however. 🤷

@Seldaek
Copy link
Member

Seldaek commented Mar 7, 2021

Ok then I guess we close because seems like an edge case.

@Seldaek Seldaek closed this as completed Mar 7, 2021
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

4 participants