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

Lower compatible version is not installed #10136

Closed
alexander-schranz opened this issue Oct 3, 2021 · 6 comments
Closed

Lower compatible version is not installed #10136

alexander-schranz opened this issue Oct 3, 2021 · 6 comments
Labels
Milestone

Comments

@alexander-schranz
Copy link
Contributor

alexander-schranz commented Oct 3, 2021

My composer.json created with composer require symfony/http-kernel:"~5.3":

{
    "require": {
        "symfony/http-kernel": "~5.3"
    }
}

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 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.1.8
PHP version: 8.0.10
PHP binary path: /usr/local/Cellar/php/8.0.10/bin/php
OpenSSL version: OpenSSL 1.1.1k  25 Mar 2021
cURL version: 7.78.0 libz 1.2.11 ssl (SecureTransport) OpenSSL/1.1.1l
zip: extension present, unzip present, 7-Zip present (7z)

When I run this command:

composer require runtime/roadrunner-symfony-nyholm -vvv

I get the following output:


Running 2.1.8 (2021-09-15 13:55:14) with PHP 8.0.10 on Darwin / 18.7.0
Reading ./composer.json (/private/tmp/test5/composer.json)
Loading config file /Users/alexanderschranz/.composer/config.json
Loading config file /Users/alexanderschranz/.composer/auth.json
Loading config file ./composer.json (/private/tmp/test5/composer.json)
Checked CA file /usr/local/etc/openssl@1.1/cert.pem: valid
Executing command (/private/tmp/test5): git branch -a --no-color --no-abbrev -v
Executing command (/private/tmp/test5): git describe --exact-match --tags
Executing command (CWD): git --version
Executing command (/private/tmp/test5): git log --pretty="%H" -n1 HEAD --no-show-signature
Executing command (/private/tmp/test5): hg branch
Executing command (/private/tmp/test5): fossil branch list
Executing command (/private/tmp/test5): fossil tag list
Executing command (/private/tmp/test5): svn info --xml
Reading /Users/alexanderschranz/.composer/composer.json
Loading config file /Users/alexanderschranz/.composer/config.json
Loading config file /Users/alexanderschranz/.composer/auth.json
Loading config file /Users/alexanderschranz/.composer/composer.json (/Users/alexanderschranz/.composer/composer.json)
Loading config file /Users/alexanderschranz/.composer/auth.json
Reading /Users/alexanderschranz/.composer/auth.json
Reading /private/tmp/test5/vendor/composer/installed.json
Reading /Users/alexanderschranz/.composer/vendor/composer/installed.json
Downloading https://repo.packagist.org/packages.json
[200] https://repo.packagist.org/packages.json
Writing /Users/alexanderschranz/Library/Caches/composer/repo/https---repo.packagist.org/packages.json into cache
Reading /Users/alexanderschranz/Library/Caches/composer/repo/https---repo.packagist.org/provider-runtime~roadrunner-symfony-nyholm.json from cache
Downloading https://repo.packagist.org/p2/runtime/roadrunner-symfony-nyholm.json if modified
[304] https://repo.packagist.org/p2/runtime/roadrunner-symfony-nyholm.json
Using version ^0.2.0 for runtime/roadrunner-symfony-nyholm
./composer.json has been updated
Reading ./composer.json (/private/tmp/test5/composer.json)
Loading config file /Users/alexanderschranz/.composer/config.json
Loading config file /Users/alexanderschranz/.composer/auth.json
Loading config file ./composer.json (/private/tmp/test5/composer.json)
Executing command (/private/tmp/test5): git branch -a --no-color --no-abbrev -v
Executing command (/private/tmp/test5): git describe --exact-match --tags
Executing command (/private/tmp/test5): git log --pretty="%H" -n1 HEAD --no-show-signature
Executing command (/private/tmp/test5): hg branch
Executing command (/private/tmp/test5): fossil branch list
Executing command (/private/tmp/test5): fossil tag list
Executing command (/private/tmp/test5): svn info --xml
Reading /Users/alexanderschranz/.composer/composer.json
Loading config file /Users/alexanderschranz/.composer/config.json
Loading config file /Users/alexanderschranz/.composer/auth.json
Loading config file /Users/alexanderschranz/.composer/composer.json (/Users/alexanderschranz/.composer/composer.json)
Loading config file /Users/alexanderschranz/.composer/auth.json
Reading /Users/alexanderschranz/.composer/auth.json
Reading /private/tmp/test5/vendor/composer/installed.json
Reading /Users/alexanderschranz/.composer/vendor/composer/installed.json
Running composer update runtime/roadrunner-symfony-nyholm
Reading ./composer.lock (/private/tmp/test5/composer.lock)
Loading composer repositories with package information
Downloading https://repo.packagist.org/packages.json
[200] https://repo.packagist.org/packages.json
Writing /Users/alexanderschranz/Library/Caches/composer/repo/https---repo.packagist.org/packages.json into cache
Reading /Users/alexanderschranz/Library/Caches/composer/repo/https---repo.packagist.org/provider-runtime~roadrunner-symfony-nyholm.json from cache
Downloading https://repo.packagist.org/p2/runtime/roadrunner-symfony-nyholm.json if modified
[304] https://repo.packagist.org/p2/runtime/roadrunner-symfony-nyholm.json
Reading /Users/alexanderschranz/Library/Caches/composer/repo/https---repo.packagist.org/provider-nyholm~psr7.json from cache
Downloading https://repo.packagist.org/p2/nyholm/psr7.json if modified
Reading /Users/alexanderschranz/Library/Caches/composer/repo/https---repo.packagist.org/provider-spiral~roadrunner.json from cache
Downloading https://repo.packagist.org/p2/spiral/roadrunner.json if modified
Reading /Users/alexanderschranz/Library/Caches/composer/repo/https---repo.packagist.org/provider-symfony~dependency-injection.json from cache
Downloading https://repo.packagist.org/p2/symfony/dependency-injection.json if modified
Reading /Users/alexanderschranz/Library/Caches/composer/repo/https---repo.packagist.org/provider-symfony~psr-http-message-bridge.json from cache
Downloading https://repo.packagist.org/p2/symfony/psr-http-message-bridge.json if modified
Reading /Users/alexanderschranz/Library/Caches/composer/repo/https---repo.packagist.org/provider-symfony~runtime.json from cache
Downloading https://repo.packagist.org/p2/symfony/runtime.json if modified
[304] https://repo.packagist.org/p2/nyholm/psr7.json
[304] https://repo.packagist.org/p2/spiral/roadrunner.json
[304] https://repo.packagist.org/p2/symfony/dependency-injection.json
[304] https://repo.packagist.org/p2/symfony/psr-http-message-bridge.json
[304] https://repo.packagist.org/p2/symfony/runtime.json
Reading /Users/alexanderschranz/Library/Caches/composer/repo/https---repo.packagist.org/provider-psr~http-message.json from cache
Downloading https://repo.packagist.org/p2/psr/http-message.json if modified
Reading /Users/alexanderschranz/Library/Caches/composer/repo/https---repo.packagist.org/provider-php-http~message-factory.json from cache
Downloading https://repo.packagist.org/p2/php-http/message-factory.json if modified
Reading /Users/alexanderschranz/Library/Caches/composer/repo/https---repo.packagist.org/provider-psr~http-factory.json from cache
Downloading https://repo.packagist.org/p2/psr/http-factory.json if modified
Reading /Users/alexanderschranz/Library/Caches/composer/repo/https---repo.packagist.org/provider-spiral~roadrunner-worker.json from cache
Downloading https://repo.packagist.org/p2/spiral/roadrunner-worker.json if modified
Reading /Users/alexanderschranz/Library/Caches/composer/repo/https---repo.packagist.org/provider-spiral~roadrunner-cli.json from cache
Downloading https://repo.packagist.org/p2/spiral/roadrunner-cli.json if modified
Reading /Users/alexanderschranz/Library/Caches/composer/repo/https---repo.packagist.org/provider-spiral~roadrunner-http.json from cache
Downloading https://repo.packagist.org/p2/spiral/roadrunner-http.json if modified
Reading /Users/alexanderschranz/Library/Caches/composer/repo/https---repo.packagist.org/provider-psr~container.json from cache
Downloading https://repo.packagist.org/p2/psr/container.json if modified
Reading /Users/alexanderschranz/Library/Caches/composer/repo/https---repo.packagist.org/provider-symfony~service-contracts.json from cache
Downloading https://repo.packagist.org/p2/symfony/service-contracts.json if modified
[304] https://repo.packagist.org/p2/psr/http-message.json
[304] https://repo.packagist.org/p2/php-http/message-factory.json
[304] https://repo.packagist.org/p2/psr/http-factory.json
[304] https://repo.packagist.org/p2/spiral/roadrunner-worker.json
[304] https://repo.packagist.org/p2/spiral/roadrunner-cli.json
[304] https://repo.packagist.org/p2/spiral/roadrunner-http.json
[304] https://repo.packagist.org/p2/psr/container.json
[304] https://repo.packagist.org/p2/symfony/service-contracts.json
Reading /Users/alexanderschranz/Library/Caches/composer/repo/https---repo.packagist.org/provider-spiral~goridge.json from cache
Downloading https://repo.packagist.org/p2/spiral/goridge.json if modified
Reading /Users/alexanderschranz/Library/Caches/composer/repo/https---repo.packagist.org/provider-symfony~console.json from cache
Downloading https://repo.packagist.org/p2/symfony/console.json if modified
Reading /Users/alexanderschranz/Library/Caches/composer/repo/https---repo.packagist.org/provider-symfony~http-client.json from cache
Downloading https://repo.packagist.org/p2/symfony/http-client.json if modified
Reading /Users/alexanderschranz/Library/Caches/composer/repo/https---repo.packagist.org/provider-composer~semver.json from cache
Downloading https://repo.packagist.org/p2/composer/semver.json if modified
Reading /Users/alexanderschranz/Library/Caches/composer/repo/https---repo.packagist.org/provider-spiral~roadrunner-worker.json from cache
Reading /Users/alexanderschranz/Library/Caches/composer/repo/https---repo.packagist.org/provider-psr~container.json from cache
[304] https://repo.packagist.org/p2/spiral/goridge.json
[304] https://repo.packagist.org/p2/symfony/console.json
[304] https://repo.packagist.org/p2/symfony/http-client.json
[304] https://repo.packagist.org/p2/composer/semver.json
Reading /Users/alexanderschranz/Library/Caches/composer/repo/https---repo.packagist.org/provider-symfony~service-contracts.json from cache
Reading /Users/alexanderschranz/Library/Caches/composer/repo/https---repo.packagist.org/provider-symfony~string.json from cache
Downloading https://repo.packagist.org/p2/symfony/string.json if modified
[304] https://repo.packagist.org/p2/symfony/string.json
Reading /Users/alexanderschranz/Library/Caches/composer/repo/https---repo.packagist.org/provider-symfony~polyfill-intl-grapheme.json from cache
Downloading https://repo.packagist.org/p2/symfony/polyfill-intl-grapheme.json if modified
Reading /Users/alexanderschranz/Library/Caches/composer/repo/https---repo.packagist.org/provider-symfony~polyfill-intl-normalizer.json from cache
Downloading https://repo.packagist.org/p2/symfony/polyfill-intl-normalizer.json if modified
[304] https://repo.packagist.org/p2/symfony/polyfill-intl-grapheme.json
[304] https://repo.packagist.org/p2/symfony/polyfill-intl-normalizer.json
Updating dependencies
Generating rules
Resolving dependencies through SAT
Looking at all rules.

Dependency resolution completed in 0.001 seconds
Reading /Users/alexanderschranz/Library/Caches/composer/repo/https---repo.packagist.org/provider-symfony~http-kernel.json from cache
Downloading https://repo.packagist.org/p2/symfony/http-kernel.json if modified
[304] https://repo.packagist.org/p2/symfony/http-kernel.json
Reading /Users/alexanderschranz/Library/Caches/composer/repo/https---repo.packagist.org/provider-symfony~http-kernel.json from cache
Reading /Users/alexanderschranz/Library/Caches/composer/repo/https---repo.packagist.org/provider-symfony~http-kernel~dev.json from cache
Downloading https://repo.packagist.org/p2/symfony/http-kernel~dev.json if modified
[304] https://repo.packagist.org/p2/symfony/http-kernel~dev.json
Reading /Users/alexanderschranz/Library/Caches/composer/repo/https---repo.packagist.org/provider-symfony~http-kernel.json from cache
Reading /Users/alexanderschranz/Library/Caches/composer/repo/https---repo.packagist.org/provider-symfony~http-kernel~dev.json from cache
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires runtime/roadrunner-symfony-nyholm ^0.2.0 -> satisfiable by runtime/roadrunner-symfony-nyholm[0.2.0].
    - runtime/roadrunner-symfony-nyholm 0.2.0 requires symfony/http-kernel ^5.4 || ^6.0 -> found symfony/http-kernel[5.4.x-dev, 6.0.x-dev] but it does not match your minimum-stability.

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

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

And I expected this to happen:

Install runtime/roadrunner-symfony-nyholm:0.1.

Interesting is that:

composer require runtime/roadrunner-symfony-nyholm:"*"
# or
composer require runtime/roadrunner-symfony-nyholm:"^0.1 || ^0.2"

works and install runtime/roadrunner-symfony-nyholm the 0.1 version.

@xabbuh
Copy link
Contributor

xabbuh commented Oct 4, 2021

This is the important part from the command output:

Using version ^0.2.0 for runtime/roadrunner-symfony-nyholm

If you run composer require without a version constraint, Composer will pick one for you. IIRC it will take the required PHP version into account, but doesn't apply any further constraints as that would mean to run the full solving process.

@alexander-schranz
Copy link
Contributor Author

@xabbuh would be good if it fails that it would fallback to full solving process to install a lower version.

@Seldaek
Copy link
Member

Seldaek commented Oct 4, 2021

Yeah it's a bit complicated though because requiring it with * is the only way we could reasonably try IMO, but that leads to really bad constraints which are not future-safe. So letting the user figure it out in those few instances where it actually fails is the best course I'd say.

@alexander-schranz
Copy link
Contributor Author

@Seldaek Thought just to find out the version to use * but then place it with ^found-version into the project.

But I undestand that its complicated would be nice to maybe add something like this as additonal hint?

Or try to require a specific version by running for example composer require runtime/roadrunner-symfony-nyholm:^0.1 which is maybe compatible with your used dependencies.

@Seldaek Seldaek added the Bug label Oct 4, 2021
@Seldaek Seldaek added this to the 2.1 milestone Oct 4, 2021
@Seldaek
Copy link
Member

Seldaek commented Oct 4, 2021

Yeah hinting at how one can solve it is a more reasonable fix IMO.

@alexander-schranz
Copy link
Contributor Author

@Seldaek Thank you 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants