I'm upgrading my Symfony 4.4 project to Symfony 5.4 (the current LTS version). I've tried modifying composer.json
, forcing directly to the 5.4 release, but I've found lots of dependency problems, so I "solved" this migrating slowly: I moved to 5.0, then to 5.1, and now I'm trying to migrate from 5.1 to 5.2, but I have dependency problems and I don't know how to fix them.
The problem:
Problem 1
- Conclusion: don't install doctrine/doctrine-fixtures-bundle 3.4.1 (conflict analysis result)
- Conclusion: don't install doctrine/persistence[1.3.5] | install one of doctrine/persistence[1.3.7, 1.3.8, 2.2.2, 2.2.3, 2.2.4, 2.3.0] (conflict analysis result)
- Conclusion: don't install doctrine/persistence[1.3.7] | install one of doctrine/persistence[2.2.1, ..., 2.3.0] (conflict analysis result)
- Conclusion: don't install one of doctrine/common[v2.11.0], doctrine/persistence[2.2.3] (conflict analysis result)
- Conclusion: don't install one of doctrine/common[v2.11.0], doctrine/persistence[2.2.2] (conflict analysis result)
- Conclusion: don't install one of doctrine/common[v2.11.0], doctrine/persistence[2.2.1] (conflict analysis result)
- Conclusion: install doctrine/common v2.11.0 (conflict analysis result)
- Conclusion: don't install doctrine/persistence[1.3.8] | install one of doctrine/persistence[2.2.4, 2.3.0] (conflict analysis result)
- Conclusion: don't install doctrine/persistence[2.2.4] | install one of doctrine/common[2.13.1, 2.13.3] (conflict analysis result)
- Conclusion: don't install doctrine/common[2.13.3] | install doctrine/persistence[2.3.0] (conflict analysis result)
- Conclusion: don't install doctrine/common[2.13.1] | install doctrine/persistence[2.3.0] (conflict analysis result)
- Conclusion: don't install doctrine/persistence 2.3.0 (conflict analysis result)
- Conclusion: don't install one of doctrine/orm[2.7.5], doctrine/persistence[2.2.4] | install one of doctrine/common[2.13.2, 2.13.3] (conflict analysis result)
- Conclusion: don't install doctrine/persistence[1.3.6] | install doctrine/persistence[2.2.0] (conflict analysis result)
- Conclusion: don't install one of doctrine/persistence[1.2.0], doctrine/doctrine-fixtures-bundle[3.4.0] | install one of doctrine/persistence[1.3.7, 1.3.8, 2.2.0, ..., 2.3.0] (conflict analysis result)
- Conclusion: don't install doctrine/persistence 2.2.0 (conflict analysis result)
- Conclusion: don't install one of doctrine/orm[2.7.5], doctrine/persistence[2.2.2] | install one of doctrine/common[2.13.0, 2.13.1, 2.13.2, 2.13.3] (conflict analysis result)
- Conclusion: don't install one of doctrine/orm[2.7.5], doctrine/persistence[2.2.1] | install one of doctrine/persistence[1.3.8], doctrine/common[2.13.0, 2.13.1, 2.13.2, 2.13.3] (conflict analysis result)
- Conclusion: don't install one of doctrine/orm[2.7.5], doctrine/persistence[2.2.0] | install one of doctrine/persistence[1.3.8], doctrine/common[2.13.1, 2.13.2, 2.13.3] (conflict analysis result)
- Conclusion: don't install one of doctrine/orm[2.7.5], doctrine/persistence[2.1.1] | install one of doctrine/persistence[1.3.8], doctrine/common[2.13.1, 2.13.2, 2.13.3] (conflict analysis result)
- Conclusion: don't install one of doctrine/orm[2.7.5], doctrine/persistence[2.1.0] | install one of doctrine/persistence[1.1.1, 1.3.5, 1.3.7, 1.3.8], doctrine/common[2.13.0, 2.13.1, 2.13.2, 2.13.3] (conflict analysis result)
- Conclusion: don't install doctrine/orm[2.7.5] | install one of doctrine/persistence[v1.1.0, ..., 1.3.8, 2.1.0, ..., 2.3.0], doctrine/common[2.13.0, 2.13.1, 2.13.2, 2.13.3] (conflict analysis result)
- Conclusion: don't install one of doctrine/common[2.12.0], doctrine/persistence[2.3.0] | install one of doctrine/persistence[v1.1.0, 1.1.1, 1.2.0] (conflict analysis result)
- Conclusion: don't install one of doctrine/common[2.12.0], doctrine/persistence[2.0.0] | install one of doctrine/persistence[v1.1.0, ..., 1.3.8] (conflict analysis result)
- Conclusion: don't install doctrine/orm[2.7.4] | install one of doctrine/persistence[v1.1.0, 1.1.1, 1.2.0, 1.3.8, 2.2.4, 2.3.0], doctrine/common[2.13.1, 2.13.3] (conflict analysis result)
- Conclusion: don't install one of doctrine/common[2.12.0], doctrine/persistence[2.1.0] | install one of doctrine/persistence[v1.1.0, ..., 1.3.8] (conflict analysis result)
- Conclusion: don't install one of doctrine/common[2.12.0], doctrine/persistence[2.0.1] | install one of doctrine/persistence[v1.1.0, ..., 1.3.8] (conflict analysis result)
- Conclusion: don't install one of doctrine/common[v2.11.0], doctrine/persistence[2.2.2] | install one of doctrine/persistence[v1.1.0, ..., 1.3.8] (conflict analysis result)
- Conclusion: don't install one of symfony/doctrine-bridge[v5.2.10], doctrine/persistence[1.3.4] | install one of doctrine/persistence[2.1.1, ..., 2.3.0] (conflict analysis result)
- Conclusion: don't install one of doctrine/persistence[v1.1.0], doctrine/doctrine-fixtures-bundle[3.4.0] | install one of doctrine/persistence[1.3.7, 1.3.8, 2.1.1, ..., 2.3.0] (conflict analysis result)
- Conclusion: don't install doctrine/persistence 2.1.1 (conflict analysis result)
- Conclusion: don't install one of symfony/doctrine-bridge[v5.2.10], doctrine/persistence[1.3.6] | install one of doctrine/persistence[2.2.2, 2.2.3, 2.2.4, 2.3.0] (conflict analysis result)
- Conclusion: don't install one of doctrine/common[2.12.0], doctrine/persistence[2.2.4] | install one of doctrine/persistence[v1.1.0, 1.1.1, 1.2.0] (conflict analysis result)
- Root composer.json requires doctrine/common ^2 -> satisfiable by doctrine/common[2.1.3, ..., 2.13.3].
- Root composer.json requires doctrine/doctrine-fixtures-bundle ^3.4 -> satisfiable by doctrine/doctrine-fixtures-bundle[3.4.0, 3.4.1].
- doctrine/doctrine-fixtures-bundle 3.4.0 requires doctrine/persistence ^1.3.7|^2.0 -> satisfiable by doctrine/persistence[1.3.7, 1.3.8, 2.0.0, ..., 2.3.0].
- Conclusion: don't install one of doctrine/common[v2.11.0], doctrine/persistence[2.1.0] | install one of doctrine/persistence[v1.1.0, ..., 1.3.8] (conflict analysis result)
- Conclusion: don't install one of doctrine/common[v2.11.0], doctrine/persistence[2.0.1] | install one of doctrine/persistence[v1.1.0, ..., 1.3.8] (conflict analysis result)
- Conclusion: don't install one of doctrine/common[v2.11.0], doctrine/persistence[2.0.0] | install one of doctrine/persistence[v1.1.0, ..., 1.3.8] (conflict analysis result)
- Conclusion: don't install doctrine/persistence[1.1.1] | install one of doctrine/persistence[1.3.7, 2.1.1, ..., 2.2.3] (conflict analysis result)
I suppose than the problem is with the package doctrine/doctrine-fixtures-bundle
, but I'm unsure, because I find it very hard to interpret the error message. Is this the offending package? If so, is there any way to upgrade it, or should I remove it, upgrade the application and then install it again?
I need the package because I use it to populate the test database when running tests, but maybe there is any newer package for this job?
And here is my composer.json
:
{
"type": "project",
"license": "proprietary",
"require": {
"php": "^7.1.3",
"ext-ctype": "*",
"ext-iconv": "*",
"a2lix/translation-form-bundle": "^3.0",
"composer/package-versions-deprecated": "1.11.99.4",
"doctrine/annotations": "^1.0",
"doctrine/common": "^2",
"doctrine/doctrine-bundle": "^2",
"doctrine/doctrine-migrations-bundle": "^2",
"doctrine/orm": "^2",
"friendsofsymfony/jsrouting-bundle": "^2.6",
"gedmo/doctrine-extensions": "^2.4",
"knplabs/doctrine-behaviors": "^2.0",
"phpdocumentor/reflection-docblock": "^5.3",
"phpoffice/phpspreadsheet": "^1.13",
"ramsey/uuid-doctrine": "^1.6",
"sensio/framework-extra-bundle": "^5.1",
"stof/doctrine-extensions-bundle": "^1.4",
"stripe/stripe-php": "^7.39",
"symfony/apache-pack": "^1.0",
"symfony/asset": "5.2.*",
"symfony/console": "5.2.*",
"symfony/dotenv": "5.2.*",
"symfony/expression-language": "5.2.*",
"symfony/flex": "^1.3.1",
"symfony/form": "5.2.*",
"symfony/framework-bundle": "5.2.*",
"symfony/http-client": "5.2.*",
"symfony/intl": "5.2.*",
"symfony/mailer": "5.2.*",
"symfony/monolog-bundle": "^3.5",
"symfony/polyfill-uuid": "^1.15",
"symfony/process": "5.2.*",
"symfony/property-access": "5.2.*",
"symfony/property-info": "5.2.*",
"symfony/security-bundle": "5.2.*",
"symfony/serializer": "5.2.*",
"symfony/translation": "5.2.*",
"symfony/twig-bundle": "5.2.*",
"symfony/validator": "5.2.*",
"symfony/web-link": "5.2.*",
"symfony/yaml": "5.2.*",
"twig/extra-bundle": "^2.12|^3.0",
"twig/twig": "^2.12|^3.0",
"vich/uploader-bundle": "^1.13"
},
"require-dev": {
"dama/doctrine-test-bundle": "^6.5",
"doctrine/doctrine-fixtures-bundle": "^3.4",
"symfony/browser-kit": "5.2.*",
"symfony/css-selector": "5.2.*",
"symfony/debug-bundle": "5.2.*",
"symfony/maker-bundle": "^1.15",
"symfony/phpunit-bridge": "^5.2",
"symfony/stopwatch": "5.2.*",
"symfony/web-profiler-bundle": "5.2.*"
},
"config": {
"preferred-install": {
"*": "dist"
},
"sort-packages": true
},
"autoload": {
"psr-4": {
"App\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"App\\Tests\\": "tests/"
}
},
"replace": {
"paragonie/random_compat": "2.*",
"symfony/polyfill-ctype": "*",
"symfony/polyfill-iconv": "*",
"symfony/polyfill-php71": "*",
"symfony/polyfill-php70": "*",
"symfony/polyfill-php56": "*"
},
"scripts": {
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd"
},
"post-install-cmd": [
"@auto-scripts"
],
"post-update-cmd": [
"@auto-scripts"
]
},
"conflict": {
"symfony/symfony": "*"
},
"extra": {
"symfony": {
"allow-contrib": false,
"require": "5.2.*"
}
}
}
I don't know I this can be a help, but this application started as an Symfony 3.4 app, a couple years ago I upgraded to Symfony 4.4, and now I'm working in moving to 5.4...
CodePudding user response:
The problem is that you require doctrine/common
in v2. This depends on doctrine/persistence
in v1. Updating all your packages to Symfony 5.2 will also update symfony/doctrine-bridge
to 5.2 - and this requires doctrine/persistence
in v2.
Updating doctrine/common
to v3 in your composer.json
could help to resolve the problem. Also, since you are using symfony/flex
already, you can remove all explicit version constraints on the Symfony packages - it's sufficient to define the Symfony version further down in the extra
section as you already did. This makes it way easier to update all Symfony packages, as you only need to change this one line