Skip to content

Understand provides in pinned crate #1693

@reznikmm

Description

@reznikmm

Describe the bug
I want Alire to be able to pin a crate implementing a "virtual crate".

Use case: I have a crate (mybin) that depends on a "virtual crate" (coollib) and another crate (mylib) that provides that coollib in its alire.toml. I want to run alr pin mylib --use=<path>, but it fails.

To Reproduce

alr init --lib mylib
sed -i.bak -e '$aprovides=["coollib=1.0.0"]' mylib/alire.toml
alr init --bin mybin
sed -i.bak -e '$a[[depends-on]]\ncoollib = "^1.0"' mybin/alire.toml
alr -C mybin pin mylib --use=../mylib

ⓘ Synchronizing workspace...
Dependencies automatically updated as follows:

   New solution is incomplete.
   Missing:
   +❗      coollib ^1.0 (new,missing:unknown)

error: crate mismatch: expected coollib but found mylib at /tmp/bug/mylib

$ alr -C mybin with mylib --use=../mylib
error: crate mismatch: expected coollib but found mylib at /tmp/bug/mylib

Expected Behavior
I want Alire to accept mylib as an implementation of coollib dependency.

alr version
alr 2.0.1

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions