dart-lang / pub

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

Infinity character in some shells is incorrectly shown #3428

Open asashour opened 2 years ago

asashour commented 2 years ago

Environment

Problem

  1. On trying to play around with Dart SDK versions to get latest linter, I came across a message of <2.0.0-∞, which seems to be incorrect, but in another shell it is shown as <2.0.0-∞

  2. does <2.0.0-∞ make sense? I understand this is as "less than 2", and infinity? I guess <2.0.0 should be enough.

Steps:

Expected behavior

The version should always be visible, in all shells.

Actual behavior

<2.0.0-∞ is shown

--trace output

The current Dart SDK version is 2.18.0-98.0.dev.

Because every version of analyzer_plugin from path depends on yaml ^3.1.0 and linter >=0.1.57 <1.0.0 depends on yaml ^2.1.2, analyzer_plugin from path is incompatible with linter >=0.1.57 <1.0.0.
And because linter >=0.0.2+1 <0.1.57 requires SDK version <2.0.0-∞, analyzer_plugin from path is incompatible with linter >=0.0.2+1 <1.0.0.
So, because analysis_server depends on both analyzer_plugin from path and linter ^0.1.30, version solving failed.

From the Terminal, which is using another shell:

The current Dart SDK version is 2.18.0-98.0.dev.

Because every version of analyzer_plugin from path depends on yaml ^3.1.0 and linter >=0.1.57 <1.0.0 depends on yaml ^2.1.2, analyzer_plugin from path is incompatible
  with linter >=0.1.57 <1.0.0.
And because linter >=0.0.2+1 <0.1.57 requires SDK version <2.0.0-∞, analyzer_plugin from path is incompatible with linter >=0.0.2+1 <1.0.0.
So, because analysis_server depends on both analyzer_plugin from path and linter ^0.1.30, version solving failed.
jonasfj commented 2 years ago

We discussed this a bit, and figured out that we probably can't avoid having to use a special character of some sort.

But maybe we can change it to \infinity based on terminal detection.

jonasfj commented 2 years ago

Context: We need to write <2.0.0-∞ because the upper-bound comes from >=2.0.0-dev <2.0.0 which means that the <2.0.0 part is not interpreted as <2.0.0-0 which otherwise would (this is done to exclude prereleases).

asashour commented 2 years ago

Thanks for explaining.

As a humble user, I initially understood it as "lower bound is<2.0.0 and upper bound ".

I am also not sure if is an intuitive representation of 'release versions', as I now possibly understand.