Detect and use Alire metadata found in pinned directory#450
Conversation
2dce4c8 to
9824fac
Compare
| affect the user experience. It is intended as a one-stop point for users to | ||
| stay on top of `alr` new features. | ||
|
|
||
| ## Use crate metadata when pinning to a directory |
There was a problem hiding this comment.
Awesome I was about to suggest that when reading the main PR :)
If there are more than one release in the crate, which one is going to be used for that? |
This should cause an error, because we expect the local Actually this ties in a bit with a follow-up discussion I want to have about the maintenance/publishing workflow, because I think we should move to making |
If a path given to with/pin --use contains a loadable alire workspace (i.e., for a crate manually initialized, or retrieved with `get`), the release found there will be used to retrieve additional dependencies, and its project paths will also be used.
When adding a dependency as a pinned dir, and the target dir is a regular Alire crate, we can autodetect the crate we are adding as dependency. In that case the command becomes `alr with --use <path>`. This can also be useful in the future for remote URLs that will also provide the crate being retrieved.
Goes on top of #449.
PR #447 introduces the ability to pin a folder that needs not be an Alire crate. This allows the use of Ada code entirely out of the Alire ecosystem to fulfill a dependency. The shortcoming is that any dependencies introduced by such code will remain unknown and have to be manually dealt with. Also, if the target folder was, indeed, an Alire crate, its information is ignored.
This is an incremental feature in which, if the target folder contains Alire metadata, it is loaded and used to
alr with --urlform.In short, the pinned Alire crate is used normally as if it had been retrieved as a regular dependency, except for the version, which is ignored (the dependency will always be fulfilled, as if it were a "raw" pinned folder).