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

Issue 24246002: Lazily throw pubspec parsing exceptions. (Closed)

Created:
7 years, 3 months ago by nweiz
Modified:
7 years, 3 months ago
Reviewers:
Bob Nystrom
CC:
reviews_dartlang.org
Visibility:
Public.

Description

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

Patch Set 1 #

Total comments: 32

Patch Set 2 : Code review changes #

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

Messages

Total messages: 5 (0 generated)
nweiz
7 years, 3 months ago (2013-09-19 00:51:40 UTC) #1
Bob Nystrom
https://codereview.chromium.org/24246002/diff/1/sdk/lib/_internal/pub/lib/src/pubspec.dart File sdk/lib/_internal/pub/lib/src/pubspec.dart (right): https://codereview.chromium.org/24246002/diff/1/sdk/lib/_internal/pub/lib/src/pubspec.dart#newcode31 sdk/lib/_internal/pub/lib/src/pubspec.dart:31: /// This will be null if this was created ...
7 years, 3 months ago (2013-09-23 17:11:22 UTC) #2
nweiz
https://codereview.chromium.org/24246002/diff/1/sdk/lib/_internal/pub/lib/src/pubspec.dart File sdk/lib/_internal/pub/lib/src/pubspec.dart (right): https://codereview.chromium.org/24246002/diff/1/sdk/lib/_internal/pub/lib/src/pubspec.dart#newcode31 sdk/lib/_internal/pub/lib/src/pubspec.dart:31: /// This will be null if this was created ...
7 years, 3 months ago (2013-09-23 22:06:10 UTC) #3
Bob Nystrom
LGTM!
7 years, 3 months ago (2013-09-23 22:09:27 UTC) #4
nweiz
7 years, 3 months ago (2013-09-23 22:21:52 UTC) #5
Message was sent while issue was closed.
Committed patchset #2 manually as r27784 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698