Skip to content
Snippets Groups Projects
Commit 84ee8ed9 authored by nweiz@google.com's avatar nweiz@google.com Committed by Natalie Weizenbaum
Browse files

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=

Review URL: https://codereview.chromium.org//24246002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge@27784 260f80e4-7a28-3924-810f-c04153c831b5
parent c2b1729c
No related branches found
No related tags found
No related merge requests found
Showing
with 593 additions and 505 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment