alire icon indicating copy to clipboard operation
alire copied to clipboard

alire seems to pick cached version of crates instead of exiting with error

Open dkm opened this issue 3 years ago • 4 comments

I have something like this in alire.toml:

[[depends-on]]
click = "~0.1.0-dev"
...
[[pins]]
click = { url=http://something/correct/click' }

The project builds correctly (expected). Then, I've changed the pin (should have used path instead of url here...):

[[depends-on]]
click = "~0.1.0-dev"
...
[[pins]]
click = { url='../git/some/path/click' }

and went on hacking in this other source repository that is incorrectly described... And only when I was really expecting some compilation error I realized alire was not using my new code, but instead picked the cached version from the last success:

~/p/p/f/ada ❯❯❯ alr build --release                                                                                                                                                                            ✘ 1
ⓘ Synchronizing workspace...
Dependencies automatically updated as follows:

   New solution is complete.
   ⊙ click 0.1.0-dev (path=alire/cache/pins/click,url=../git/some/path/click)
   = gnat  11.2.2    (gnat_arm_elf)

I would have expected at least a message telling me my pins setting for the crate can't be found (the url didn't even point to a valid local path and is not a valid url...) and should be corrected.

dkm avatar Jul 13 '22 12:07 dkm

So, if I understand correctly, the url after the change does not exist, but alr is not complaining. Right, that should fail, just like when a new pin is created with an invalid path.

mosteo avatar Jul 13 '22 14:07 mosteo

Correct. Initially wanted to switch from a github URL to local git. I changed the http:// by a local path. IIUC, that's not correct, I should have changed url=... by path=... . And on top of that, the local path given to url= was incorrect.

dkm avatar Jul 13 '22 15:07 dkm

I'm guessing that as you gave a correct path the url was ignored, or some variation of that. Thanks for the report.

mosteo avatar Jul 13 '22 15:07 mosteo

Hmmm, yes. That's even more confusing. If I use url=/the/correct/path it's using something (which in my case does not compile correctly because of valid error in "the" code). If I use path=/the/correct/path, it builds correctly. If I switch back to the wrong url=/the/correct/path, it still fails. So not really sure about what it is using, but it feels like even the cached version is not updated... At least, the behavior can be very confusing :D

dkm avatar Jul 13 '22 15:07 dkm