crystal-lang / shards

Dependency manager for the Crystal language
Other
765 stars 102 forks source link

Commit version restriction cannot be resolved #384

Closed straight-shoota closed 4 years ago

straight-shoota commented 4 years ago

I get a strange error on shards master. Using this dependency:

dependencies:
  shards:
    github: crystal-lang/shards
    commit: "5666481"
$ shards install
Resolving dependencies
Fetching https://github.com/crystal-lang/shards.git
Unable to satisfy the following requirements:

- `shards (commit 5666481)` required by `shard.yml`
Failed to resolve dependencies

The shards binary is built from current master Shards 0.10.0 [ee74934] (2020-05-06).

5666481 is definitely a valid commit on this repo, so I see no reason why this should fail.

The latest release build (Shards 0.10.0 [4091ac5] (2020-04-06)) works as expected.

waj commented 4 years ago

Does it work with the full commit hash?

straight-shoota commented 4 years ago

Ah, forgot to mention. Yes full hash works. But only the full hash.

It's a bit confusing though that the error output is always the same, i.e. the commit is always abbreviated to 5666481.

waj commented 4 years ago

It's resolving the ref but then it's comparing the full hash with the short one: https://github.com/crystal-lang/shards/blob/ee74934aec8653490629c2073e8a46054bb28ffd/src/resolvers/git.cr#L164

The error always shows the first 7 chars for readability, but we could change that.

waj commented 4 years ago

It's probably better to show the full hash for errors, and abbreviated only for install information.