alire-project / alire

Command-line tool from the Alire project and supporting library
GNU General Public License v3.0
278 stars 49 forks source link

Improve user experience with regards to index update #1348

Closed Fabien-Chouteau closed 11 months ago

Fabien-Chouteau commented 1 year ago

We have another instance of a user having a bad experience because their index is not up-to-date: https://old.reddit.com/r/ada/comments/11r2kl7/alire_inability_to_install_some_packages_from_the/

Some ways to deal with this issue involve automatic internet access to check if index updates are available. I don't think this is a good thing to do all the time.

But we have other options:

  1. Print a message that says "try to update the index..." when a get/search/with command fails. This means no internet access, but also it could be easy to miss and won't work for new versions of existing crates.
  2. Query the user before running get/search/with/update commands whether or not they want to update the indexes. This question would default to Yes and with the option to answer Always/Never. I think this would be a good compromise. The cost of an update on my machine is less than 1 second, which is reasonable when running the commands in question.
remcycles commented 1 year ago

Adding alr index --update-all to the docs page would be helpful too. There is no mention of the alr index command in the docs except for a release note about alr index --check.

As a new Alire user, there seems to be a mismatch between the words "index" and "catalog". For example, I was getting errors like error: Crate [emacs_ada_mode] does not exist in the catalog, so I was trying to figure out how to update the catalog with no success until I found that Reddit post.