Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(250)

Unified Diff: sdk/lib/_internal/pub/lib/src/solver/dependency_queue.dart

Issue 242373006: Show a better error message on no version errors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698