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
composer update packages on remove a package #8870
Comments
Currently, the @naderman is it possible that the new architecture of the solver in Composer 2 will solve this, by fixing the version of all components without forcing them to be installed ? That would solve the case of |
Figured out how to reproduce it easier: To make it smaller and imitate the outdated 2 packages:
{
"require": {
"symfony/filesystem": "5.0.7",
"symfony/finder": "5.0.7",
"symfony/framework-bundle": "^5.0"
}
} Commands:
Remove 2 lines from
Run this command:
I get the following output:
And I not expect to have
|
Yeah this is completely expected in v1.. And not fixable there, unless you do In v2 I think it might be fixable as we have way better control over the pool via poolbuilder. I believe fixed packages are required to be present so that wouldn't really be an option, but either we add a concept of soft-fixed package which must be at version X or gone, or we could add a second pass to the update which would first remove the packages you ask to remove, and then run the equivalent of a I think a better alternative might be a new setUpdateAllowTransitiveDependencies mode for the Installer, smth like |
@Seldaek I think this could be solved, by ensuring that fixed package have only that version in the pool (so that they cannot change version), but without forcing to add a root requirement for them in the solver (so the solver would not select them if they are unused, leading to their removal). Removing unused dependencies should not require an extra step in the new architecture IMO. |
Yup I think that's what my last suggestion would do internally, assuming
that's working (fixed packages not required). I haven't checked yet and am
not sure anymore.
|
@vnagara See my comment, I'm really talking about |
In #9207 I have documented another issue with the |
Here what I have
And here is the problem:
It does update packages, but as you can see it leaves a lot of
|
Fixed by #9223 |
@vnagara hm can you provide an example of what you mean? with a few commands to reproduce? |
Update: Next my comment describes how to reproduce it easier:
Cross it out: I tried to reduce composer to minimal version to reproduce bug and unfortunately the bug doesn't reveal. I have to add my lock file to reproduce the bug as it very tricky.
Prerequisite: download composer.lock (https://gist.github.com/vnagara/1b097e6e941e7fae724c6b4619743c33) and do
composer install
first.My
composer.json
:Output of
composer diagnose
:When I run this command:
I get the following output:
And I expected to NOT HAVE this lines:
And it for
composer outdated
there another 10 packages that wasn't updated. Therefore it updates only partially. However I expect packages as they were before, no updates unless I explicitly asked for it.Plus as side effect symfony.lock doesn't reflect this update either and shows symfony/filesystem v5.0.7.
The text was updated successfully, but these errors were encountered: