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

Side by Side Diff: utils/pub/solver/backtracking_solver.dart

Issue 14247026: Disable SDK constraint checking on bleeding edge. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add test. 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /// A back-tracking depth-first solver. Attempts to find the best solution for 5 /// A back-tracking depth-first solver. Attempts to find the best solution for
6 /// a root package's transitive dependency graph, where a "solution" is a set 6 /// a root package's transitive dependency graph, where a "solution" is a set
7 /// of concrete package versions. A valid solution will select concrete 7 /// of concrete package versions. A valid solution will select concrete
8 /// versions for every package reached from the root package's dependency graph, 8 /// versions for every package reached from the root package's dependency graph,
9 /// and each of those packages will fit the version constraints placed on it. 9 /// and each of those packages will fit the version constraints placed on it.
10 /// 10 ///
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 if (!package.descriptionEquals(required.ref)) return null; 581 if (!package.descriptionEquals(required.ref)) return null;
582 } 582 }
583 583
584 return package; 584 return package;
585 } 585 }
586 } 586 }
587 587
588 /// Ensures that if [pubspec] has an SDK constraint, then it is compatible 588 /// Ensures that if [pubspec] has an SDK constraint, then it is compatible
589 /// with the current SDK. Throws a [SolverFailure] if not. 589 /// with the current SDK. Throws a [SolverFailure] if not.
590 void _validateSdkConstraint(Pubspec pubspec) { 590 void _validateSdkConstraint(Pubspec pubspec) {
591 // If the user is running a continouous build of the SDK, just disable SDK
592 // constraint checking entirely. The actual version number you get is
593 // impossibly old and not correct. We'll just assume users on continuous
594 // know what they're doing.
595 if (sdk.isBleedingEdge) return;
596
591 if (pubspec.environment.sdkVersion.allows(sdk.version)) return; 597 if (pubspec.environment.sdkVersion.allows(sdk.version)) return;
592 598
593 throw new CouldNotSolveException( 599 throw new CouldNotSolveException(
594 'Package ${pubspec.name} requires SDK version ' 600 'Package ${pubspec.name} requires SDK version '
595 '${pubspec.environment.sdkVersion} but the current SDK is ' 601 '${pubspec.environment.sdkVersion} but the current SDK is '
596 '${sdk.version}.'); 602 '${sdk.version}.');
597 } 603 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698