shards icon indicating copy to clipboard operation
shards copied to clipboard

Unable to install shard with specific version

Open pyrsmk opened this issue 4 years ago • 4 comments

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

pyrsmk avatar Oct 01 '20 11:10 pyrsmk

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

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

asterite avatar Oct 01 '20 12:10 asterite

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

bcardiff avatar Oct 01 '20 15:10 bcardiff

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.

pyrsmk avatar Oct 01 '20 16:10 pyrsmk

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.

straight-shoota avatar Oct 30 '20 12:10 straight-shoota