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

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

Issue 111103002: Make the solver deterministic (again). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Make log discard from the middle. Created 7 years 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 3c64e531a7312876b565a10b9dfc119ff2609c7f..c462120575050fbbd1c10ad7c171cb02e1ea51bc 100644
--- a/sdk/lib/_internal/pub/lib/src/solver/dependency_queue.dart
+++ b/sdk/lib/_internal/pub/lib/src/solver/dependency_queue.dart
@@ -65,6 +65,10 @@ class DependencyQueue {
}
}
+ // Sort the selected/locked packages by name just to ensure the solver is
+ // deterministic.
+ presorted.sort((a, b) => a.name.compareTo(b.name));
+
return new DependencyQueue._(solver, new Queue<PackageDep>.from(presorted),
remaining);
}

Powered by Google App Engine
This is Rietveld 408576698