| Index: sdk/lib/_internal/pub/lib/src/solver/dependency_queue.dart
|
| diff --git a/sdk/lib/_internal/pub/lib/src/solver/dependency_queue.dart b/sdk/lib/_internal/pub/lib/src/solver/dependency_queue.dart
|
| index c462120575050fbbd1c10ad7c171cb02e1ea51bc..b2152477304323d2226515fee0ee5b6b375fd9f7 100644
|
| --- a/sdk/lib/_internal/pub/lib/src/solver/dependency_queue.dart
|
| +++ b/sdk/lib/_internal/pub/lib/src/solver/dependency_queue.dart
|
| @@ -130,6 +130,18 @@ class DependencyQueue {
|
| }
|
|
|
| return _solver.cache.getVersions(dep.toRef()).then((versions) {
|
| + // If the root package depends on this one, ignore versions that don't
|
| + // match that constraint. Since the root package's dependency constraints
|
| + // won't change during solving, we can safely filter out packages that
|
| + // don't meet it.
|
| + for (var rootDep in _solver.root.immediateDependencies) {
|
| + if (rootDep.name == dep.name) {
|
| + versions = versions.where(
|
| + (id) => rootDep.constraint.allows(id.version));
|
| + break;
|
| + }
|
| + }
|
| +
|
| return versions.length;
|
| }).catchError((error, trace) {
|
| // If it fails for any reason, just treat that as no versions. This
|
|
|