-
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
Offline mode #5655
Comments
cc @Eh2406 |
Thanks for the write up. I think "no way to populate local crate storage" is overstated. There are pretty good, approximate, ways to do it like having used that dep in any previous project. Nead an ecosystem, build stdx, or equivalent and you have most of it. And complete, manually ways to do it, download all the crates and unpack them into carcos cache directory. It just takes a lot of disk space ~12 GB. Both of these the community can develop and improve once people are using Given that, I think we should work to stabilize the existing |
One TODO item I might add as well is to audit the error messages and make sure they're understandable. For example if resolution fails due to the inability to update the registry then the error message should state that Otherwise I do personally still feel that population of the local storage is somewhat important. I see this as a sort of "what do I do before I get on a plane?" question. Or similarly what does Crater do before building all its crates? I think we'd want it along the lines of |
An audit of the error messages is a good idea. I think the " I think that an initial version of a |
An excellent idea!
I'd be totally on board with that |
I'm sure I mentioned this in a previous issue but I've used |
Is it intentional that offline mode will fail if an optional dependency is missing? It seems like it shouldn't because in online mode it doesn't fetch anything (AFAIK). Example: [package]
name = "off"
version = "0.1.0"
[dependencies]
# A very old version you are unlikely to have in your cache.
bitflags = {version="=0.1.0", optional=true}
|
A similar situation seems to happen with target specific dependencies. Something with this in the Cargo.toml will fail to build on windows with [target.x86_64-unknown-linux-gnu.dependencies]
x11-dl = "~2.14" Giving
|
@Jasper-Bekkers is that the full error message? Does Cargo print any other information? |
It's pretty much the full error message.
|
@Jasper-Bekkers ah ok, did that not indicate enough that |
I figured I'd bump this but if a new ticket is needed then I can file a new one. |
@Jasper-Bekkers oh that issue is different from this one and is covered by #5133 |
I don't think it does: #5133 (comment) |
That's an implementation bug, not a reflection of the feature-to-be-stabilized |
Can we have this as a Use case: a project that wants to vendor all their dependencies and compile without making external network requests (e.g. for technical reasons or auditing purposes). Changing |
I have published a subcommand to download popular crates: https://crates.io/crates/cargo-prefetch |
What is the status of offline mode? Other than stabilising |
Yea, once we decide the fate of #6871 I was going to make a stabilization report and fcp request. |
This is a proposal to stabilize the offline feature. @rfcbot fcp merge Stabilization Target: 1.36 — Release date July 4 2019 What is being stabilizedThe offline feature adds a flag to prevent Cargo from accessing the network, and to perform dependency resolution if the required dependencies are already downloaded. I propose making the following changes when stabilizing:
The offline mode behavior is fairly straightforward. An overview of when running in offline mode:
|
Team member @ehuss has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. The RFC will be merged soon. |
Stabilize offline mode. This stabilizes the `--offline` flag as detailed at #5655 (comment). It also adds the `net.offline` config value. Closes #5655 Closes #4686
I'm using "cargo 1.35.0 (6f3e9c3 2019-04-04)" and tried to get "cargo build" working with pre-cached crates, but had no luck. I've tried "cargo build --offline" and also CARGO_NET_OFFLINE=true environment variable. Any hints how to use it? Thanks! |
Ok i've just updated to beta "cargo 1.36.0-beta (c4fcfb7 2019-05-15)" and the option --offline is now available. Thanks and sorry. |
Implementation PR: #4770
Original issue: #4686
Summary:
Running Cargo with
-Z offline
flag changes the resolution process such that it only considered crates, already downloaded locally.Steps:
currently, there's no way to populate local crate storage, see Add an "airplane" flag to Cargo, altering it's dependency resolution behavior #4686 for details
write precise documentation about effects and intended use-case for this flag. See https://github.com/rust-lang/cargo/blob/5845464cf92a348f95dc6b43133c017c37fcb684/src/doc/src/reference/unstable.md#offline-mode for current docs
Stabilization TODO:
-Z offline
unstable cli option to a stable one, which works the same way as--frozen
and--locked
flags do.-Z offline actively breaks building crate offline #6014The text was updated successfully, but these errors were encountered: