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

Unified Diff: lib/src/solver/version_solver.dart

Issue 1956613002: Fix SDK constraints in lockfiles. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « no previous file | test/must_pub_get_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/solver/version_solver.dart
diff --git a/lib/src/solver/version_solver.dart b/lib/src/solver/version_solver.dart
index 55ecc3c5c25aa6a368236360c028d21a09949984..fba24418d2b27a7f6bc232f765b810d2890c6c7c 100644
--- a/lib/src/solver/version_solver.dart
+++ b/lib/src/solver/version_solver.dart
@@ -76,8 +76,12 @@ class SolveResult {
/// The [LockFile] representing the packages selected by this version
/// resolution.
LockFile get lockFile {
- var sdkConstraint = new VersionConstraint.intersection(
- pubspecs.values.map((pubspec) => pubspec.environment.sdkVersion));
+ // Don't factor in overridden dependencies' SDK constraints, because we'll
+ // accept those packages even if their constraints don't match.
+ var sdkConstraint = new VersionConstraint.intersection(pubspecs.values
+ .where((pubspec) =>
+ !_root.dependencyOverrides.any((dep) => dep.name == pubspec.name))
+ .map((pubspec) => pubspec.environment.sdkVersion));
return new LockFile(packages, _sources, sdkConstraint: sdkConstraint);
}
« no previous file with comments | « no previous file | test/must_pub_get_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698