-
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
Update “How can Cargo work offline?” FAQ section in Cargo book #14330
Comments
The documentation seems clear to me: https://doc.rust-lang.org/cargo/commands/cargo-build.html#manifest-options
Can you say what you find confusing? |
Hmm… just realized they were talking about https://doc.rust-lang.org/cargo/faq.html#how-can-cargo-work-offline. That part needs to update to what ChrisDenton posted accordingly. |
faq: rephrase offline usage. ### What does this PR try to resolve? fixes #14330. FAQ tried to explain the history of cargo offline, and thus was distracting from the core flags.
link flags, fixes rust-lang#14330. Co-authored-by: Weihang Lo <[email protected]>
link flags, fixes rust-lang#14330. Co-authored-by: Weihang Lo <[email protected]>
Problem
cargo flags --frozen and --offline are confusing. the cargo book says:
_As of Rust 1.11.0, Cargo understands a new flag, --frozen, which is an assertion that it shouldn’t touch the network. When passed, Cargo will immediately return an error if it would otherwise attempt a network request. The error should include contextual information about why the network request is being made in the first place to help debug as well. Note that this flag does not change the behavior of Cargo, it simply asserts that Cargo shouldn’t touch the network as a previous command has been run to ensure that network activity shouldn’t be necessary.
The --offline flag was added in Rust 1.36.0. This flag tells Cargo to not access the network, and try to proceed with available cached data if possible. You can use cargo fetch in one project to download dependencies before going offline, and then use those same dependencies in another project with the --offline flag (or configuration value)._
if you paste here a better description what the difference is i d create a pull request to adjust. if it is really the same, maybe drop one of the flags. it sounds weird that experienced programmers use both flags then, like COSMIC desktop build vendored with:
cargo build --release --frozen --offline
reference:
The text was updated successfully, but these errors were encountered: