dart-lang / pub

The pub command line tool
https://dart.dev/tools/pub/cmd
BSD 3-Clause "New" or "Revised" License
1.04k stars 228 forks source link

Improve the version solver #912

Closed DartBot closed 6 years ago

DartBot commented 9 years ago

Edit by @nex3: I've retargeted this issue to track a major version solver refactor that should allow us to fix the solver's invalid error messages, further limit the cases in which it goes exponential, and semantically determine when a package graph is too complex to solve.


Issue by tomaskulich Originally opened as dart-lang/sdk#17429


Attachments: pubspec.yaml (625 Bytes) pubtrace.zip (0 Bytes)

chrisdlangton commented 6 years ago

I literally git cloned flutter and ran flutter doctor today and came up against this issue (Got socket error trying to find package archive at https://pub.dartlang.org)

Looks like i can't install flutter on a fresh install (no packages apart form git installed) of ubuntu 16.04 LTS due to this dependency having such a long ongoing issue - which i assume is much wider problem and quite concerning it hasn't been tested to be working on the current Ubuntu LTS...

zoechi commented 6 years ago

@chrisdlangton I'm sure "socket error" is entirely unrelated to this issue. Perhaps network problems or server problems. pub.dartlang.org occasionally stutters a bit.

kevmoo commented 6 years ago

@chrisdlangton – your comment was deleted for violating our code of conduct.

Expressing frustration is fine – but it must be polite and professional.

kevmoo commented 6 years ago

@chrisdlangton – your comment will be deleted and you will be banned from dart-lang for violating our code of conduct.

MikeMitterer commented 6 years ago

@kevmoo I don't know what chris said but I'm probably thinking the same. Even your own packages like reflectable (https://github.com/dart-lang/reflectable/blob/master/pubspec.yaml) are failing with those version problems. I just wanted to port some of my libs from mirrors to built-mirrors (via reflectable) I can't even start because it's not possible to solve the version constraints.

It's incredible frustrating! Almost 2.0 and this is still a huge problem... capturfiles-20180320_111352

kevmoo commented 6 years ago

@nex3 is cranking hard on this https://github.com/dart-lang/pub/tree/feature.solver

munificent commented 6 years ago

🎉🎉🎉🎉

thosakwe commented 6 years ago

🎈 Congrats!

dnfield commented 6 years ago

I believe I'm getting this issue now in flutter dev and master. I get errors for a few packages on flutter_tools - if I manually roll them back to versions that were published before May, they all work.

So I changed these:

async: 2.0.6 # was 2.0.7
matcher: 0.1.12 # was 0.12.2+1
pub_semver: 1.3.7 # was 1.4.1

in https://github.com/flutter/flutter/blob/master/packages/flutter_tools/pubspec.yaml and I'm now able to install packages and run the tool.

I suspect this is a version solving issue, but let me know if this should actually be an issue in flutter/flutter.

zoechi commented 6 years ago

Usually there are just conflicting dependency constraints Do you get any error message?

dnfield commented 6 years ago

Error message:

Building flutter tool...
Because flutter_tools depends on async 2.0.7 which doesn't match any versions, version solving failed.
Error: Unable to pub upgrade flutter tool. Retrying in five seconds...

Some more verbose error:

SLVR:   fact: no versions of async match 2.0.7
SLVR:   conflict: no versions of async match 2.0.7
SLVR:   ! async 2.0.7 is satisfied by async 2.0.7
SLVR:   ! which is caused by "flutter_tools depends on async 2.0.7"
SLVR:   ! thus: version solving failed
SLVR: Version solving took 0:00:01.110941 seconds.
    | Tried 1 solutions.
FINE: Resolving dependencies finished (1.116s).
ERR : Because flutter_tools depends on async 2.0.7 which doesn't match any versions, version solving failed.
FINE: Exception type: SolveFailure
FINE: package:pub/src/solver/version_solver.dart 308  VersionSolver._resolveConflict
    | package:pub/src/solver/version_solver.dart 131  VersionSolver._propagate
    | package:pub/src/solver/version_solver.dart 96   VersionSolver.solve
    | ===== asynchronous gap ===========================
zoechi commented 6 years ago

I guess the error message needs to be improved. I'd suggest you create a new issue with above info. There is no guarantee anyone will read comments on closed issues and it's different issue anyway.

dnfield commented 6 years ago

Good advice, although at this point I'm not consistently reproducing it - may have been environmental or caching issue :(

I'll open a new issue if I see it again/am able to consistently reproduce.

hpoit commented 5 years ago

I am consistently reproducing mine.

natebosch commented 5 years ago

@hpoint - please update to a newer Dart SDK which includes the solution to this issue.

hpoit commented 5 years ago

Hi Nate. I was on 2.4.0, but angular_router does not work with it.

kevmoo commented 5 years ago

This is likely because angular_router is not stable – https://pub.dev/packages/angular_router/versions/2.0.0-alpha+24

You'll have to put a dependency of ^2.0.0-alpha in your pubspec

On Wed, Jul 31, 2019 at 4:38 PM Henry Poit notifications@github.com wrote:

Hi Nate. I was on 2.4.0, but angular_router does not work with it.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dart-lang/pub/issues/912?email_source=notifications&email_token=AAAEFCVYOOG7MNZI55NYQTLQCIPADA5CNFSM4BHIHLP2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3I3WTI#issuecomment-517061453, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAEFCQFI2QYUUD3OWPMT5DQCIPADANCNFSM4BHIHLPQ .

hpoit commented 5 years ago

Great, thanks Kevin

hpoit commented 5 years ago

The problem was that I was using angular_router 1.0.2. In general, is it okay to always use the alpha releases?

kevmoo commented 5 years ago

There are no plans to release a stable version of angular_router, so that's your only option.

On Wed, Jul 31, 2019 at 4:52 PM Henry Poit notifications@github.com wrote:

The problem was that I was using angular_router 1.0.2. In general, is it okay to always use the alpha releases?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dart-lang/pub/issues/912?email_source=notifications&email_token=AAAEFCVMXDM62CYVJAAZY63QCIQTFA5CNFSM4BHIHLP2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3I4M3Q#issuecomment-517064302, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAEFCSDL7WAIINXLE35HPDQCIQTFANCNFSM4BHIHLPQ .

hpoit commented 5 years ago

Nate and Kevin, thanks for helping out so soon. I was just about to start using AngularJS, and I prefer AngularDart, and Dart.

hpoit commented 5 years ago

There are no plans to release a stable version of angular_router, so that's your only option.

Thanks