Shards: Unable to install shard with specific version

Created on 1 Oct 2020  ·  4Comments  ·  Source: crystal-lang/shards

I want to install a shard by its version but it does not work (maybe this is because there is only one tag on the repo? or that is not an annotated tag?).

Here's what I have in my shard.yml:

dependencies:
  origin:
    github: pyrsmk/origin
    version: ~> 0.1.0

And the issue:

❯ shards install
Resolving dependencies
Fetching https://github.com/pyrsmk/origin.git
Unable to satisfy the following requirements:

- `origin (~> 0.1.0)` required by `shard.yml`
Failed to resolve dependencies

It does not work either if I set explicitly the version:

dependencies:
  origin:
    github: pyrsmk/origin
    version: 0.1.0

But if I remove the version constraint, the shard installs as expected:

❯ shards install
Resolving dependencies
Fetching https://github.com/pyrsmk/origin.git
Installing origin (0.1.0 at 2a3f364)
Writing shard.lock

For simplicity, here's the relevant repository: https://github.com/pyrsmk/origin

Most helpful comment

I don't think there's any benefit from supporting tags both with and without v prefix. It just adds confusion. We settled on v prefix for tags and that's it. Just use it that way.
However, this needs to be properly documented. Currently the spec only covers spec.yml and there's no specification for git integration.

All 4 comments

I think the tag must be v0.1.0 instead of 0.1.0.

Which, in my opinion, is very unintuitive, but 🤷

That's right, shards looks for v{version} tags only as convention.

Maybe it should be somewhere in the docs or, better, we could support both syntaxes? Because it's not uncommon that tags are defined as X.X.X instead of vX.X.X.

I don't think there's any benefit from supporting tags both with and without v prefix. It just adds confusion. We settled on v prefix for tags and that's it. Just use it that way.
However, this needs to be properly documented. Currently the spec only covers spec.yml and there's no specification for git integration.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vladfaust picture vladfaust  ·  5Comments

InstanceOfMichael picture InstanceOfMichael  ·  5Comments

straight-shoota picture straight-shoota  ·  7Comments

jwoertink picture jwoertink  ·  6Comments

stakach picture stakach  ·  4Comments