Bug #101159
closedDependencyOrderingService cannot properly handle polyfill replaces
0%
Description
I found an issue with the DependencyOrderingService when using the following replaces in my root composer.json and then requiring an extension that depends on one of that polyfills.
As of https://github.com/symfony/polyfill#design, my root composer.json uses this replace section to not load the polyfills when my php version is high enough.
{
"replace": {
"paragonie/random_compat": "*",
"symfony/polyfill-php54": "*",
"symfony/polyfill-php55": "*",
"symfony/polyfill-php56": "*",
"symfony/polyfill-php70": "*",
"symfony/polyfill-php71": "*",
"symfony/polyfill-php72": "*",
"symfony/polyfill-php73": "*",
"symfony/polyfill-php74": "*",
"symfony/polyfill-php81": "*",
"symfony/polyfill-php82": "*"
},
}
This however is a problem with extensions that require such a polyfill. This then adds a dependency from the required extension to the virtual root package which itself requires the extension. The DependencyOrderingService then throws an exception:
Your dependencies have cycles. That will not work out. Cycles found ...
Since there is an issue with the virtual root package, the exceptions reports the full cycle of all packages. The actual underlying issue is quite hard to debug and find.