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
Unable to resolve circular dependency #11879
Comments
Do you have to use development versions? Do you have to alias them to a large number? It's not clear to me why you can't make an atomic change to each package in turn and create new versions of those. If you're only adding support for a new version of PHP, then it sounds like a minor change according to semantic versioning; or if you're also dropping support for an older version, then it's a major change, but the API should be the same, so the "child" package (which seems to be both sides) would support both "old" and "new" versions, so I guess this would be much more complicated if you're also changing the API at the same time, which seems like something that could be optional / deferred to another version. Edit: to clarify what I mean by making the changes in turn / independently:
Or, if not dropping support for old PHP, it's a lot simpler:
|
Hi Fredden Thanks for the speedy and detailed response. I am actually doing pretty much what you described, but it's not always straight-forward to do a single package at a time, due to interface changes (primarily inherited from a shared base model package). In theory, I guess it would be possible to make the changes more incrementally, but it's already a very large undertaking and this would add to the complexity. In answer to your specific questions:
I'll take a more in-depth look at our dependency tree and try to determine whether it might be possible to tackle the packages in a different order, but I'd still like to understand why this is happening in the first place. Specifically, why does composer think there's a dependency on a version of the current package other than the current root version? ie Is this a limitation of composer's dependency resolver, a bug, or something I'm doing wrong? Thanks Marcus |
I'm not sure why you set COMPOSER_ROOT_VERSION to 9999999-dev, but you should set it to |
I'm in the process of updating our composer packages to be compatible with PHP 8.3, but I've run into a problem with a circular dependency that I'm really struggling to resolve.
Here's the (stripped-down) content of the current
composer.json
:Output of
composer diagnose
:When I run
composer update
, I get the following:COMPOSER_ROOT_VERSION is set to 9999999-dev.
I've tried various workarounds, including adding an explicit version to composer.json and using a branch alias, but nothing seems to make a difference. In short, composer doesn't seem to recognise that the root package matches the one being requested.
Unfortunately, it's not possible to remove this circular dependency without a major refactor, so I really need an alternative workaround. Is anyone able to suggest a solution please?
Thanks
The text was updated successfully, but these errors were encountered: