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

Issue 115533003: Show implicit pub dependency on barback in errors. (Closed)

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

Description

Show implicit pub dependency on barback in errors. BUG=https://code.google.com/p/dart/issues/detail?id=15592 Committed: https://code.google.com/p/dart/source/detail?r=31149

Patch Set 1 #

Total comments: 9
Unified diffs Side-by-side diffs Delta from patch set Stats (+87 lines, -28 lines) Patch
M sdk/lib/_internal/pub/lib/src/solver/backtracking_solver.dart View 2 chunks +20 lines, -13 lines 6 comments Download
M sdk/lib/_internal/pub/test/implicit_barback_dependency_test.dart View 3 chunks +66 lines, -15 lines 3 comments Download
M sdk/lib/_internal/pub/test/test_pub.dart View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Bob Nystrom
7 years ago (2013-12-13 22:36:21 UTC) #1
Bob Nystrom
Committed patchset #1 manually as r31149 (presubmit successful).
7 years ago (2013-12-13 23:09:32 UTC) #2
Bob Nystrom
Argh, I got my patches confused. Sorry, I didn't mean to commit this. I thought ...
7 years ago (2013-12-13 23:13:41 UTC) #3
nweiz
There should also be a test for the case where: * the solver selects a ...
7 years ago (2013-12-13 23:15:21 UTC) #4
Bob Nystrom
7 years ago (2013-12-14 00:07:35 UTC) #5
Message was sent while issue was closed.
> There should also be a test for the case where:
>
> * the solver selects a package that has a path dependency on barback,
> * the solver backtracks far enough back to unselect that package,
> * the solver selects a package that has a hosted dependency on barback.
>
> We want to be sure that the old implicit dependency doesn't stick around in
any way.

I can do this if you really want me to, but it will be a pain. I'm confident
this won't happen because of the structure of the solver. The reason it's broken
into separate Solver and Traverser classes is specifically for this case. It
ensures that the entire Traverser is destroyed as soon as any backtracking
starts and all of its transitive state is discarded.

Since merging this patch with the other solver error patch actually caused some
issues anyway, I made the changes here in that patch:
https://codereview.chromium.org/109703008

Sorry again for the code review mix-up. :(

https://codereview.chromium.org/115533003/diff/1/sdk/lib/_internal/pub/lib/sr...
File sdk/lib/_internal/pub/lib/src/solver/backtracking_solver.dart (right):

https://codereview.chromium.org/115533003/diff/1/sdk/lib/_internal/pub/lib/sr...
sdk/lib/_internal/pub/lib/src/solver/backtracking_solver.dart:515: // the Dart
team are on the bleeding edge and have a path dependency on the
On 2013/12/13 23:15:21, nweiz wrote:
> Long lines.

Done.

https://codereview.chromium.org/115533003/diff/1/sdk/lib/_internal/pub/lib/sr...
sdk/lib/_internal/pub/lib/src/solver/backtracking_solver.dart:517: if (dep.name
== "barback" && dependencies.length == 1) {
On 2013/12/13 23:15:21, nweiz wrote:
> Document why you're checking [dependencies.length] here. I assume it's because
> you don't want to add the dependency from pub if it's already there?

Yup. Done.

https://codereview.chromium.org/115533003/diff/1/sdk/lib/_internal/pub/lib/sr...
sdk/lib/_internal/pub/lib/src/solver/backtracking_solver.dart:529:
dependencies.add(new Dependency("pub", barbackDep));
On 2013/12/13 23:15:21, nweiz wrote:
> Just using the string "pub" here worries me. If we ever release a package
named
> pub (which seems likely at some point), that could wreak some serious havoc.
> 
> We have pretty stringent rules on what package names can appear in a pubspec,
so
> we should be able to create a "special" name that avoids conflict by having it
> contain spaces or start with "*" or something.

Changed it to "pub itself" and then tweaked SolveFailure to not quote that name.
Looks like:

Incompatible version constraints on 'barback':
- 'myapp' depends on version $previous
- pub itself depends on version >=0.11.0 <0.12.0

https://codereview.chromium.org/115533003/diff/1/sdk/lib/_internal/pub/test/i...
File sdk/lib/_internal/pub/test/implicit_barback_dependency_test.dart (right):

https://codereview.chromium.org/115533003/diff/1/sdk/lib/_internal/pub/test/i...
sdk/lib/_internal/pub/test/implicit_barback_dependency_test.dart:108:
integration("include pub in the error if a solve failed because there "
On 2013/12/13 23:15:21, nweiz wrote:
> "include" -> "includes"

Done.

Powered by Google App Engine
This is Rietveld 408576698