#101159DependencyOrderingService cannot properly handle polyfill replaces
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.
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
History 2
-
Riccardo De Contardi changed Duplicates #96388 07/21/23, 13:24
-
Riccardo De Contardi commented and changed status
NewClosed 07/21/23, 13:28
I close this issue in agreement with the reporter as a duplicate of #96388 – please continue the discussion there; this issue has been linked to #96388 to keep track of it.
If you think that this is the wrong decision please reopen it or ping me and I’ll do
Thank you.