crystal-lang / shards

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

Ambiguous sources #469

Closed carlhoerberg closed 3 years ago

carlhoerberg commented 3 years ago

This used to work but with Shards 0.13.0 [dfb6a87] (2021-01-21) I'm getting:

Error shard name (amq-protocol) has ambiguous sources: 'path: ../amq-protocol.cr' and 'git: https://github.com/cloudamqp/amq-protocol.cr.git'.

if I in an app set the amq-protocol dependency to a local path, but another dependency in the same app (amqp-client.cr in this case) has specified the github url to the same dependency.

bcardiff commented 3 years ago

That is so far expected. Main and nested dependencies are solved all together, so there is conflicting information if sources do not match.

For your use case, probably having the following shard.override.yml is what you need:

dependencies:
  amq-protocol:
    path: ../amq-protocol.cr

Running shards install should like a symlink to that path in ./lib and a nice notice in the shard.lock file

carlhoerberg commented 3 years ago

ok, great! For others that finds this thread, here's more information here: https://github.com/crystal-lang/shards/pull/422