Dart Error: Incompatible version constraints on analyzer

37 views
Skip to first unread message

Cristian Garcia

unread,
Jan 28, 2015, 10:54:31 PM1/28/15
to mi...@dartlang.org
I have a very weird problem. I have some dependencies that previous to adding a new dependency work well, but as soon as I add a new one (in this specific case `async_await`) I get an `Incompatible version constraints on analyzer` error when using `pub get`. The curious thing is: `async_await` is NOT an incompatible constraint!  

> Pub get failed, [1] Resolving dependencies... Incompatible version<br>
> constraints on analyzer:<br>
> - angular 1.0.0 depends on version >=0.15.0 <0.19.0<br>
> - di 3.3.1 depends on version >=0.15.0 <0.22.0<br>
> - redstone_mapper 0.1.1 depends on version >=0.13.0 <0.14.0<br>

Why doesn't this error show when I remove `async_await` (this same thing happened with another import) if the constraints should still fail?

Bob Nystrom

unread,
Jan 29, 2015, 2:04:19 PM1/29/15
to General Dart Discussion
I responded on the bug, but just for the folks following along here:

Pub's version solver is doing a global analysis of all of the version constraints in all of your dependencies. Not just that, but each version of a dependency has different constraints.

This means constraint failures can be non-local. It's not just that async_await has a constraint that causes a problem. It could be that:

    • async_await adds a constraint on foo.
    • That forces you to take a different version of foo than you would otherwise.
    • That in turn gives you a different set of constraints coming from foo.
    • Those in turn tweak some of the versions of other dependencies.
    • Which then lead to other different constraints...
    • And so on...

In practice, most of the errors like this we've seen recently seem to have the analyzer package as their lynchpin. The analyzer folks rev that package really frequently (or at least did for a while) and change its minor version often. That means there are a lot of packages that depend on disjoint sets of analyzer versions.

Like @Günter suggests, the workaround is to override a couple of dependencies, so that can cause its own problems. (It basically turns a "pub get time" failure into a possible runtime failure.)

Cheers!

- bob


--
For other discussions, see https://groups.google.com/a/dartlang.org/
 
For HOWTO questions, visit http://stackoverflow.com/tags/dart
 
To file a bug report or feature request, go to http://www.dartbug.com/new

To unsubscribe from this group and stop receiving emails from it, send an email to misc+uns...@dartlang.org.

Reply all
Reply to author
Forward
0 new messages