Skip to content
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

Dependency overrides should assert compatibility with the root package #1443

Closed
nex3 opened this issue Aug 23, 2016 · 2 comments
Closed

Dependency overrides should assert compatibility with the root package #1443

nex3 opened this issue Aug 23, 2016 · 2 comments
Assignees
Labels
type-enhancement A request for a change that isn't a bug

Comments

@nex3
Copy link
Member

nex3 commented Aug 23, 2016

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:

  1. 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.
  2. 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.

@nex3 nex3 added the type-enhancement A request for a change that isn't a bug label Aug 23, 2016
@nex3 nex3 self-assigned this Aug 24, 2016
@nex3 nex3 closed this as completed in fdf7b48 Aug 25, 2016
@nex3
Copy link
Member Author

nex3 commented Jun 22, 2017

It looks like this isn't fixed in all cases; see dart-archive/package_resolver#4.

@nex3 nex3 reopened this Jun 22, 2017
@nex3
Copy link
Member Author

nex3 commented Jun 28, 2017

False alarm!

@nex3 nex3 closed this as completed Jun 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

1 participant