If a project requires multiple shards, one of which specifies the other, specifying a commit for that one becomes impossible, short of using a shard.override
Steps to reproduce:
- Create a new shard and push (https://codeberg.org/Sylphrena/one)
- Create another shard and push (https://codeberg.org/Sylphrena/two)
- To better illustrate a real-world example, set version of this shard to 0.2.0 (optional)
- Make shard
one require shard two with version >= 0.1.0 for example
- Tag both shards,
one with v0.1.0 and two with v0.2.0
- Create a new shards file using
shards init somewhere and add the two shards as dependencies.
name: shards-test
version: 0.1.0
dependencies:
one:
codeberg: sylphrena/one
version: 0.1.0
two:
codeberg: sylphrena/two
version: 0.2.0
- Run
shards install and notice that it works.
- Delete the lock file
- Change the new
shard.yml to specify a commit, it can even be the one that's tagged, doesn't matter.
name: shards-test
version: 0.1.0
dependencies:
one:
codeberg: sylphrena/one
version: 0.1.0
two:
codeberg: sylphrena/two
commit: 95d6a271ed01c4a4228a2fe6ef641451f469cb8c
- Run
shards install and notice that it does not work
Resolving dependencies
Fetching https://codeberg.org/sylphrena/one.git
Fetching https://codeberg.org/sylphrena/two.git
Unable to satisfy the following requirements:
- `two (commit 95d6a27)` required by `shard.yml`
- `two (>=0.1.0)` required by `one 0.1.0`
Failed to resolve dependencies
Even though commit 95d6a27 is a tagged version 0.2.0 which worked previously.
Would it be possible to have shards reconcile this difference? I know it can be solved by using a shard.override, but it'd be neat if that weren't necessary. This is also the case when 2 dependencies require the same shard, one with the version and one with the commit.
If a project requires multiple shards, one of which specifies the other, specifying a commit for that one becomes impossible, short of using a
shard.overrideSteps to reproduce:
onerequire shardtwowith version>= 0.1.0for exampleonewithv0.1.0andtwowithv0.2.0shards initsomewhere and add the two shards as dependencies.shards installand notice that it works.shard.ymlto specify a commit, it can even be the one that's tagged, doesn't matter.shards installand notice that it does not workEven though commit
95d6a27is a tagged version 0.2.0 which worked previously.Would it be possible to have
shardsreconcile this difference? I know it can be solved by using ashard.override, but it'd be neat if that weren't necessary. This is also the case when 2 dependencies require the same shard, one with the version and one with the commit.