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

Unified Diff: utils/pub/solver/backtracking_solver.dart

Issue 14298006: Select packages that match SDK constraints. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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: utils/pub/solver/backtracking_solver.dart
diff --git a/utils/pub/solver/backtracking_solver.dart b/utils/pub/solver/backtracking_solver.dart
index 0a583e2f6077cac765d207b3bf92181ea04d19de..94487920b6486d06026319334dd852335471a97d 100644
--- a/utils/pub/solver/backtracking_solver.dart
+++ b/utils/pub/solver/backtracking_solver.dart
@@ -74,7 +74,7 @@ class BacktrackingVersionSolver extends VersionSolver {
/// The number of possible solutions that have been attempted.
int get attemptedSolutions => _attemptedSolutions;
- var _attemptedSolutions = 0;
+ var _attemptedSolutions = 1;
BacktrackingVersionSolver(SourceRegistry sources, Package root,
LockFile lockFile, List<String> useLatest)
@@ -122,12 +122,13 @@ class BacktrackingVersionSolver extends VersionSolver {
/// previous selections, and so on. If there is nothing left to backtrack to,
/// completes to the last failure that occurred.
Future<List<PackageId>> _traverseSolution() {
- _attemptedSolutions++;
-
return new Traverser(this).traverse().catchError((error) {
if (error is! SolveFailure) throw error;
- if (_backtrack(error)) return _traverseSolution();
+ if (_backtrack(error)) {
+ _attemptedSolutions++;
nweiz 2013/04/16 23:52:32 Why is this moving in here? Won't this just decrem
Bob Nystrom 2013/04/17 17:28:44 This handles a weird little corner case. If the ro
+ return _traverseSolution();
+ }
// All out of solutions, so fail.
throw error;
@@ -307,6 +308,8 @@ class Traverser {
_visited.add(id);
return _solver.cache.getPubspec(id).then((pubspec) {
+ validateSdkConstraint(pubspec);
+
var refs = pubspec.dependencies.toList();
// Include dev dependencies of the root package.

Powered by Google App Engine
This is Rietveld 408576698