PHP 8 Support broken because of Elasticsearchbundle being locked @ ver 5.2
Closed this issue · 7 comments
Q | A |
---|---|
Bug? | no |
New Feature? | yes |
SuluArticleBundle Version | 2.5.0 |
Sulu Version | 2.5.9 |
Actual Behavior
Running composer require sulu/article-bundle:2.5.0
results in the following output.
./composer.json has been updated
Running composer update sulu/article-bundle --with-all-dependencies
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- handcraftedinthealps/elasticsearch-bundle[5.2.6.4, ..., 5.2.6.6] require php ^5.6|^7.0 -> your php version (8.2.6) does not satisfy that requirement.
- handcraftedinthealps/elasticsearch-bundle[5.2.6.7, ..., 5.2.6.9] require symfony/framework-bundle ^2.8|^3.0|^4|^5 -> found symfony/framework-bundle[v2.8.0, ..., v2.8.52, v3.0.0, ..., v3.4.47, v4.0.0, ..., v4.4.49, v5.0.0, ..., v5.4.24] but it conflicts with your root composer.json require (^6.2).
- handcraftedinthealps/elasticsearch-bundle[5.3.0, ..., 5.4.0] require doctrine/annotations ~1.2 -> found doctrine/annotations[v1.2.0, ..., 1.14.3] but these were not loaded, likely because it conflicts with another require.
- sulu/article-bundle 2.5.0 requires handcraftedinthealps/elasticsearch-bundle ^5.2.6.4 -> satisfiable by handcraftedinthealps/elasticsearch-bundle[5.2.6.4, ..., 5.4.0].
- Root composer.json requires sulu/article-bundle 2.5.0 -> satisfiable by sulu/article-bundle[2.5.0].
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
Expected Behavior
We expect SuluArticleBundle to install without a hitch.
Steps to Reproduce
- Start a new Sulu project with PHP 8.2.6
- run
composer require sulu/article-bundle:2.5.0
The handcraftedinthealps/elasticsearch-bundle
requires doctrine/annotations ~1.2
.
So at current state to workaround this problem issue is to resolve the dependencies with the update-with-dependencies flag:
composer require sulu/article-bundle --update-with-dependencies
Hello @alexander-schranz, still an issue.
composer require sulu/article-bundle --update-with-dependencies
Using version ^2.5 for sulu/article-bundle
./composer.json has been updated
Running composer update sulu/article-bundle --with-all-dependencies
Loading composer repositories with package information
Restricting packages listed in "symfony/symfony" to "6.3.*"
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- handcraftedinthealps/elasticsearch-bundle[5.2.6.4, ..., 5.2.6.6] require php ^5.6|^7.0 -> your php version (8.2.7) does not satisfy that requirement.
- handcraftedinthealps/elasticsearch-bundle[5.2.6.7, ..., 5.2.6.9] require symfony/framework-bundle ^2.8|^3.0|^4|^5 -> found symfony/framework-bundle[v2.8.0, ..., v2.8.52, v3.0.0, ..., v3.4.47, v4.0.0, ..., v4.4.49, v5.0.0, ..., v5.4.25] but it conflicts with your root composer.json require (^6.2).
- handcraftedinthealps/elasticsearch-bundle[5.3.0, ..., 5.4.0] require doctrine/annotations ~1.2 -> found doctrine/annotations[v1.2.0, ..., 1.14.3] but these were not loaded, likely because it conflicts with another require.
- handcraftedinthealps/elasticsearch-bundle 5.4.1 requires doctrine/annotations ^1.10 -> found doctrine/annotations[1.10.0, ..., 1.14.3] but these were not loaded, likely because it conflicts with another require.
- sulu/article-bundle 2.5.0 requires handcraftedinthealps/elasticsearch-bundle ^5.2.6.4 -> satisfiable by handcraftedinthealps/elasticsearch-bundle[5.2.6.4, ..., 5.4.1].
- Root composer.json requires sulu/article-bundle ^2.5 -> satisfiable by sulu/article-bundle[2.5.0].
You can also try re-running composer require with an explicit version constraint, e.g. "composer require sulu/article-bundle:*" to figure out if any version is installable, or "composer require sulu/article-bundle:^2.1" if you know which you need.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
@pocky As written in your error message you same as above you need to findout which packages does not support doctrine/annotations
:^1.14
and check why, also check your own composer.json.
- handcraftedinthealps/elasticsearch-bundle 5.4.1 requires doctrine/annotations ^1.10 -> found doctrine/annotations[1.10.0, ..., 1.14.3] but these were not loaded, likely because it conflicts with another require.
@alexander-schranz I can dig to my packages but this version will remain a problem : the last version of https://packagist.org/packages/handcraftedinthealps/elasticsearch-bundle#5.2.6.9 is not compatible with Symfony 6.
@pocky I think you are misinterpreting the composer.json of the SuluArticleBundle requires handcraftedinthealps/elasticsearch-bundle:^5.2.6.4
the ^
, means basically semanatic versioning means it supports all 5.* versions, this includes the Symfony 6 support: https://packagist.org/packages/handcraftedinthealps/elasticsearch-bundle#5.4.1
If you are unfamiliar with the different versioning modifiers I can recommend you the following site: https://semver.madewithlove.com/?package=handcraftedinthealps%2Felasticsearch-bundle&constraint=^5.2.6.4&stability=stable
Also the sulu-demo
is running on Symfony 6 with the article bundle which you can checkout: https://github.com/sulu/sulu-demo
@alexander-schranz I thought ^5.2.6.4 will restrict to 5.2.6.4 <5.3.0 but I made mistakes with "~".
friendsofphp/php-cs-fixer requires doctrine/annotations:^2 since 3.14.3 (https://packagist.org/packages/friendsofphp/php-cs-fixer#v3.14.3) and sulu requires "friendsofphp/php-cs-fixer": "^3.9".
After making changes with "friendsofphp/php-cs-fixer": "3.14.2", everything works.
Clsoing this as PHP 8 support works as expected and is tested in our CIs.