You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, dependency overrides don't work very well with circular dependencies. Suppose A 1.0.0 depends on B ^1.0.0, and B 1.0.0 depends on A ^1.0.0. When the developer is working on A 2.0.0, the declared version in the pubspec is 2.0.0-dev, which is incompatible with B's dependency. This seems like a case where dependency overrides should be able to help, but currently they don't: if A declares a dependency override on B, that only overrides dependencies onto B, not B's dependency back onto A. And there's no way to declare a dependency override for A itself.
I see two possible solutions for this:
Allow packages to declare dependency overrides on themselves. This would mean that all dependencies back onto the root package are considered satisfied, no matter what.
Adjust the semantics of dependency overrides to consider outgoing dependencies on the root package in particular to be satisfied.
I prefer the second solution. It matches the behavior of dependency overrides with respect to SDK constraints. The first solution, on the other hand, is at odds with the way dependency overrides are usually declared, since it wouldn't make sense to override the source or version constraint for the root package.
The text was updated successfully, but these errors were encountered:
Currently, dependency overrides don't work very well with circular dependencies. Suppose A 1.0.0 depends on B
^1.0.0
, and B 1.0.0 depends on A^1.0.0
. When the developer is working on A 2.0.0, the declared version in the pubspec is2.0.0-dev
, which is incompatible with B's dependency. This seems like a case where dependency overrides should be able to help, but currently they don't: if A declares a dependency override on B, that only overrides dependencies onto B, not B's dependency back onto A. And there's no way to declare a dependency override for A itself.I see two possible solutions for this:
I prefer the second solution. It matches the behavior of dependency overrides with respect to SDK constraints. The first solution, on the other hand, is at odds with the way dependency overrides are usually declared, since it wouldn't make sense to override the source or version constraint for the root package.
The text was updated successfully, but these errors were encountered: