crystal-lang / shards

Dependency manager for the Crystal language
Other
763 stars 100 forks source link

Fixed version number behavior or documentation incorrect #512

Closed szabgab closed 3 years ago

szabgab commented 3 years ago

The SPEC says:

There is a special legacy behavior (its use is discouraged) when just a version number is used as the value: it works exactly the same as a >= check: x.y.z is interpreted as ">= x.y.z"

However I encountered a shard that had crystal: 0.27.2 in it. When I tried to install it on Crystal 1.0.0 I got the following error:

Unable to satisfy the following requirements:

- `crystal (~> 0.27, >= 0.27.2)` required by `github-cr 0.1.0+git.commit.119df4c747a81260b37af0878b24eab9345a94f4`
Failed to resolve dependencies, try updating incompatible shards or use --ignore-crystal-version as a workaround if no update is available.

So as I understand the required crystal version 0.27.2 was translated to ~> 0.27, >= 0.27.2 and the ~> 0.27 made it fail on crystal 1.0.0. Changing the crystal field to >= 0.27.2 solved the problem, but I think either the implementation, the documentation or my understanding is incorrect.

straight-shoota commented 3 years ago

There's just a mismatch between the version of the binary and the documentation. This was recently changed in #496 and is not yet released (a release should follow shortly).

The documentation for the latest release 0.14.1 is available at https://github.com/crystal-lang/shards/blob/v0.14.1/docs/shard.yml.adoc