-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
[Composer2] Downgrade transitive dependency to satisfy deps on "require" #8910
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
Comments
This was causting doctrine/inflector v2 to be installed. Then, if a user required another package that only worked with v1 - like doctrine/orm, that package would fail to install because the user's app is locked on v2. Dropping support for v2 isn't really a fix, but will make it more compatible with the ecosystem at the current time. Later, especially when doctrine/orm allows 2, we can again. See also composer/composer#8910
…erryan) This PR was squashed before being merged into the 1.0-dev branch. Discussion ---------- Dropping doctrine/inflector v2 support temporarily This was causting doctrine/inflector v2 to be installed. Then, if a user required another package that only worked with v1 - like doctrine/orm, that package would fail to install because the user's app is locked on v2. Dropping support for v2 isn't really a fix, but will make it more compatible with the ecosystem at the current time. Later, especially when doctrine/orm allows 2, we can again. See also composer/composer#8910 Note: I kept the v2 compatible code in the bundle for now. Fixes #609 Commits ------- e75a956 Dropping doctrine/inflector v2 support temporarily
The error reporting in v2 handles this better to suggest you a way out. I tweaked things so it covers more cases. So now you'd see this in your case:
I think/hope that's clear enough :) |
@Seldaek In that error message I find it confusing that it says "is fixed to 2.0.0 (lock file version) by a partial update", what partial update? Should we change the message if it's the require command? We could generally improve this a little bit by changing the require output to:
|
I like the last suggestion, because special casing the error message based on it being a require/remove command sounds horrible :) I'll try and implement that. |
This looks much better - thank you! |
@Seldaek should |
@stof Doesn't it already in v2? |
Hi!
Apologies if an issue exists or if this has been discussed - I couldn't find an issue immediately.
Suppose there are 2 packages:
acme/foo
, which requirestransitive/dependency: "^1 | ^2
acme/bar
, which requirestransitive/dependency: "^1
The problem:
In theory (because
transitive/dependency
is not a root requirement), Composer could notice that, whileacme/bar
doesn't work with v2, that dependency could be downgraded to v1 to satisfy all packages. That "should" (with huge air-quotes) be safe, as it's just a transitive dependency. However, if we're worried that users might be inadvertently using the dependency directly, and this could break things, we could (instead) issue a clear warning on how to fix this:(This invents a new
--allow-major-downgrades
flag).I'm sure this shouldn't be done in v1, but is it possible for v2?
The text was updated successfully, but these errors were encountered: