|
Lazily throw pubspec parsing exceptions.
The user-visible effect of this is to make operations that only look at part of
a pubspec work if other parts of the pubspec are somehow invalid. This is
particularly important for the following scenario:
1. We release a version of pub in SDK 1.0.0 that parses pubspec field "foo" as
an integer.
2. Sally uploads version 0.1.0 of her package, libsally.
3. We release a new version of pub in SDK 1.1.0 that supports strings in "foo".
4. Sally uploads libsally 0.2.0, which uses a string in "foo". The new version
of libsally has an SDK constraint of ">= 1.1.0", since it uses the new "foo"
feature.
5. Tom is using SDK 1.0.0 and runs "pub install" in a package that depends on
libsally.
Everyone's done everything right here; we made a backwards-compatible pubspec
change, Sally chose the correct SDK constraint, and Tom has a dependency on a
package that has a compatible version available.
However, prior to this change, Tom's "pub install" would crash. His outdated
version of pub would try and fail to parse libsally 0.2.0's "foo" field, and his
version resolution would crash. With this change, it will only attempt to parse
the SDK constraint portion of Sally's pubspec, and ignore anything else it
doesn't understand.
R=rnystrom@google.com
BUG=
Committed: https://code.google.com/p/dart/source/detail?r=27784
Total comments: 32
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+665 lines, -505 lines) |
Patch |
 |
M |
sdk/lib/_internal/pub/lib/src/barback.dart
|
View
|
|
1 chunk |
+2 lines, -3 lines |
0 comments
|
Download
|
 |
M |
sdk/lib/_internal/pub/lib/src/command.dart
|
View
|
1
|
1 chunk |
+3 lines, -11 lines |
0 comments
|
Download
|
 |
M |
sdk/lib/_internal/pub/lib/src/package.dart
|
View
|
|
2 chunks |
+1 line, -29 lines |
0 comments
|
Download
|
 |
M |
sdk/lib/_internal/pub/lib/src/pubspec.dart
|
View
|
1
|
2 chunks |
+391 lines, -288 lines |
0 comments
|
Download
|
 |
M |
sdk/lib/_internal/pub/lib/src/solver/version_solver.dart
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
sdk/lib/_internal/pub/lib/src/source.dart
|
View
|
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
sdk/lib/_internal/pub/lib/src/source/hosted.dart
|
View
|
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
sdk/lib/_internal/pub/lib/src/source/path.dart
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
sdk/lib/_internal/pub/lib/src/utils.dart
|
View
|
1
|
3 chunks |
+24 lines, -10 lines |
0 comments
|
Download
|
 |
M |
sdk/lib/_internal/pub/lib/src/validator/pubspec_field.dart
|
View
|
1
|
1 chunk |
+73 lines, -26 lines |
0 comments
|
Download
|
 |
M |
sdk/lib/_internal/pub/test/install/git/dependency_name_match_pubspec_test.dart
|
View
|
|
1 chunk |
+2 lines, -3 lines |
0 comments
|
Download
|
 |
M |
sdk/lib/_internal/pub/test/install/git/require_pubspec_name_test.dart
|
View
|
|
1 chunk |
+2 lines, -5 lines |
0 comments
|
Download
|
 |
M |
sdk/lib/_internal/pub/test/install/git/require_pubspec_test.dart
|
View
|
|
1 chunk |
+2 lines, -3 lines |
0 comments
|
Download
|
 |
M |
sdk/lib/_internal/pub/test/install/path/no_pubspec_test.dart
|
View
|
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
sdk/lib/_internal/pub/test/pub_install_and_update_test.dart
|
View
|
|
4 chunks |
+8 lines, -9 lines |
0 comments
|
Download
|
 |
M |
sdk/lib/_internal/pub/test/pubspec_test.dart
|
View
|
|
8 chunks |
+65 lines, -103 lines |
0 comments
|
Download
|
 |
M |
sdk/lib/_internal/pub/test/serve/fails_to_load_a_pubspec_with_reserved_transformer_config_test.dart
|
View
|
|
1 chunk |
+5 lines, -4 lines |
0 comments
|
Download
|
 |
M |
sdk/lib/_internal/pub/test/serve/fails_to_load_a_transform_from_a_non_dependency_test.dart
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
sdk/lib/_internal/pub/test/update/git/update_to_incompatible_pubspec_test.dart
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
sdk/lib/_internal/pub/test/update/git/update_to_nonexistent_pubspec_test.dart
|
View
|
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
sdk/lib/_internal/pub/test/validator/pubspec_field_test.dart
|
View
|
1
|
3 chunks |
+72 lines, -0 lines |
0 comments
|
Download
|
Total messages: 5 (0 generated)
|