dart-lang / dart-lang/pub

Provide clear error message for "version solving"

Open
#2,902 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type-enhancement
Dominant language
Dart
Stars
1.1k
Forks
242
Avg merge
4d 21h
Merged PRs (30d)
15

Description

I get this error message for a version conflict.

Because graphql_flutter >=4.0.2-beta.1 <4.0.3-alpha.1 depends on graphql ^4.0.2-beta.1 and graphql_flutter >=4.0.3-alpha.1 depends on graphql ^4.0.3-alpha.1, graphql_flutter >=4.0.2-beta.1 requires graphql ^4.0.2-beta.1.
(1) So, because graphql >=4.0.0-alpha.4 depends on uuid_enhanced ^3.0.2 which depends on crypto ^2.0.0, graphql_flutter >=4.0.2-beta.1 requires crypto ^2.0.0.

    Because graphql >=4.0.3-alpha.1 depends on gql_exec ^0.3.0-nullsafety.1 and graphql >=4.0.0-alpha.0 <4.0.3-alpha.1 depends on http ^0.12.1, graphql >=4.0.0-alpha.0 requires gql_exec ^0.3.0-nullsafety.1 or http ^0.12.1.
    And because graphql_flutter >=4.0.0-alpha.0 <4.0.3-alpha.1 depends on gql_exec ^0.2.2 and graphql_flutter >=4.0.1 <4.0.2-beta.1 depends on graphql ^4.0.1, graphql_flutter >=4.0.1 <4.0.2-beta.1 requires http ^0.12.1.
    And because graphql_flutter >=4.0.2-beta.1 requires crypto ^2.0.0 (1), graphql_flutter >=4.0.1 requires crypto ^2.0.0 or http ^0.12.1.
    And because google_fonts 2.0.0 depends on http ^0.13.0, if graphql_flutter >=4.0.1 and google_fonts 2.0.0 then crypto ^2.0.0.
    And because google_fonts 2.0.0 depends on crypto ^3.0.0 and no versions of google_fonts match >2.0.0 <3.0.0, graphql_flutter >=4.0.1 is incompatible with google_fonts ^2.0.0.
    So, because folio_app depends on both google_fonts ^2.0.0 and graphql_flutter ^4.0.1, version solving failed.
pub get failed (1;     So, because folio_app depends on both google_fonts ^2.0.0 and graphql_flutter ^4.0.1, version solving failed.)

At the first look, it is so confusing to understand what is depending on what and what is causing the conflict. Instead of having it very verbose/ descriptive can we can have something like

Following are the conflicts
crypto
   google_fonts ^2.0.0 requires  crypto ^3.0.0
   graphql_flutter ^4.0.1 requires crypto ^2.0.0. 
   
   Dependency Chain:
   google_fonts =>  crypto
   graphql_flutter => graphql => uuid_enhanced => crypto

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported pub get failure and inspect how pub currently formats version-solving failures. Compare the existing verbose explanation with the proposed conflict-and-dependency-chain format; done means the same conflict is presented clearly while retaining enough information to identify incompatible constraints.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart
Domain
cli, developer-experience
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.