hexpm-rust icon indicating copy to clipboard operation
hexpm-rust copied to clipboard

Parsing error when floor of package version number range is incomplete

Open Rhal95 opened this issue 1 year ago • 1 comments

When a package is specified in the gleam.toml like this

gleam_stdlib = ">= 0.34 and < 2.0.0"

it will produce a very unhelpful parsing error.

$ gleam deps update
  Resolving versions
error: Dependency resolution failed

An error occurred while determining what dependency packages and
versions should be downloaded.
The error from the version resolver library was:

An error occurred while trying to retrieve dependencies of
[email protected]: encountered unexpected token: " "

$

Considering that the now deprecated schema "~> 0.34" was generated by older versions of gleam add it can easily happen that a bad version like this is written while updating older libraries.

Rhal95 avatar Sep 24 '24 14:09 Rhal95

Maybe related; When messing with the numbers of other version specifiers a different but still unhelpful error is raised: gleam_stdlib = ">= 0.34.0 and < 2.0" or gleam_stdlib = ">= 0.34"

$ gleam deps update
  Resolving versions
error: Dependency resolution failed

An error occurred while determining what dependency packages and
versions should be downloaded.
The error from the version resolver library was:

An error occured while trying to retrieve dependencies of
[email protected]: expected more input
$

Rhal95 avatar Sep 24 '24 14:09 Rhal95