-
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
cache crates index and downloaded crates for offline use #2654
Comments
Or perhaps we could add a This would be helpful if you're offline, start a new project, and add build dependencies that are already downloaded (because you have other projects using them, so they already exist in |
Maven has a -o ("offline") switch which will do its best to run with the current versions (even on things that are "snapshots" - i.e. running builds) and fail early if it absolutely can't. That may reverse some of the "stability of builds" though, but since it'd be explicit, it may be a reasonable price to pay. |
I think the best solution would not require a command line switch (though adding one would certainly a good idea), but revert to offline usage if the package index cannot be reached and notify the user of this change. Also perhaps add some flag to the Cargo.lock that marks the dependencies as potentially outdated, so that cargo can remind the user to update once online. |
As Alex said elsewhere:
Can you reproduce the scenario where this happens? |
Yes. And cargo fetch indeed works as advertised (though I need to be online for it to work). |
Yes, as @steveklabnik quoted Cargo already implements what this issue is. I believe what you specifically are asking for is covered by #1882, so I'm going to close in favor of that. |
👍 |
Using cargo (from a nightly) while offline leads to a network error while updating the crates index. I think in general cargo should cache the index and downloaded crates to allow for automatic offline use – perhaps issue a warning, but continue running.
The text was updated successfully, but these errors were encountered: