-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please provide a subcommand to refresh the crates.io index #3377
Comments
Or more generally an subcommand for querying the index, so we are not each reinventing it. Maybe move the index stuff into a crate, like the crates.io library. There is rust-crates-index but it is not kept up to date with how cargo maintains the index. |
Note that crater will in 178 use |
You can use |
Since This also is a bug in |
cc #5621 where the logic for |
Uh, this means Crater won't update the registry when generating the lockfiles |
…which has stopped supporting this Does, effectively, a git fetch https://github.com/rust-lang/crates.io-index \ refs/heads/master:refs/remotes/origin/master like the original code: https://github.com/rust-lang/cargo/blob/1ee1ef0ea7ab47d657ca675e3b1bd2fcd68b5aab/src/cargo/sources/registry/remote.rs#L204 Big thanks to @Eh2406 for the original implementation, @joshtriplett for help and bastioning, and @alexcrichton for putting up with me. Closes #93 Ref: rust-lang/cargo#3377 Ref: rust-lang/cargo#5961
With the sparse registry, is this command still practical to add? Note, we also have #11034 |
With this proposal being incompatible with sparse index, I'm closing this. We still have #11034 for the comment about querying the index. If there is a reason we should keep this open, let us know! |
Could you elaborate on this incompatibility? |
With the git-based registry, the index is downloaded all-or-nothing. With the sparse registry, each package is kept in an individual file that is downloaded. What to download is context dependent. You brought up the solution of "re-downloaded whats downloaded". That might work in your case but I suspect it won't work in enough other cases for such a feature to stand on its own. Something like #11034 indirectly offers a way of providing this functionality that adapts to the needs of the user. |
In my case, the ability to download the index came from the fact that it was a substantial upfront cost that was useful to perform ahead of time as a cache-warming step. Now that this cost is effectively zero (when downloading dependencies, a majority of the cost is now the dependencies themselves, and not the index), I can rely on just downloading dependencies for crates as I need them. So, I'm fine with the decision to say, this specific use case isn't necessarily needed, but general index introspection is still good. If you really wanted to download the source for a bunch of crates ahead of time without making a custom empty crate to handle this logic, for example, that would fit under that. Downloading just the index doesn't even solve that problem anyway, since the sources still have to be downloaded separately. |
the cargo search doesn't update the index and later in the thread is pointed out this is unnecessary now. Which is good because this doesn't work anymore
According to rust-lang/cargo#3377 (comment) the cargo search doesn't update the index and later in the thread is pointed out this is unnecessary now. Which is good because this doesn't work anymore
* Change the build-docker.sh file to return exit code from build According to rust-lang/cargo#3377 (comment) the cargo search doesn't update the index and later in the thread is pointed out this is unnecessary now. Which is good because this doesn't work anymore * Version bump of Decky CLI to 0.0.2 should fix the Github Runner failing to register error status codes from `cargo build` in backend
* chore: moved version file * chore: created symbolic link * feat: upgraded logging and added config * Fixed build errors * Changed to Json logs & improved some events * Replaced last references to log & expanded logging * Fixed log level regression & formatted everything * swapped version back keep original in backend * bugfix: removed newline and fixed code to trim * Added back trim fix * Reset version to master * chore: Fixed clippy lints * Added scan interval to config * Change the build-docker.sh file to return exit code from build (#18) * Change the build-docker.sh file to return exit code from build According to rust-lang/cargo#3377 (comment) the cargo search doesn't update the index and later in the thread is pointed out this is unnecessary now. Which is good because this doesn't work anymore * Version bump of Decky CLI to 0.0.2 should fix the Github Runner failing to register error status codes from `cargo build` in backend * Refactored events * chore: did some light refactoring * chore: updated log * chore: Updated Version --------- Co-authored-by: jfreuden <jfreuden@alumni.cmu.edu>
When writing other tools that use the cargo API, and that don't want to unconditionally update the crates.io index from the network, it would help to have a cargo subcommand that refreshes the crates.io index. That avoids having to add such a subcommand to every other such tool built on the cargo API.
The text was updated successfully, but these errors were encountered: