-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Closed
Labels
A-diagnosticsArea: Error and warning messages generated by Cargo itself.Area: Error and warning messages generated by Cargo itself.C-bugCategory: bugCategory: bug
Description
$ cargo --version
cargo 1.54.0-nightly (aa8b09297 2021-06-09)
$ cargo new repro
$ cd repro
$ cargo metadata --format-version 1 --frozen --offline
error: can't update in the offline mode
Cargo's error message is "can't update in the offline mode", implying --offline
is the problem here. It is not:
$ cargo metadata --format-version 1 --frozen
error: the lock file /git/tmp/repro/Cargo.lock needs to be updated but --frozen was passed to prevent this
If you want to try to generate the lock file without accessing the network, use the --offline flag.
In fact --frozen
was the problem in the first place. We absolutely can "update in the offline mode":
$ cargo metadata --format-version 1 --offline
{"packages":[{"name":"repro","version":"0.1.0","id":"repro 0.1.0","license":null,"license_file":null,"description":null,"source":null,"dependencies":[],"targets":[{"kind":["bin"],"crate_types":["bin"],"name":"repro","edition":"2018","doc":true,"doctest":false,"test":true}],"features":{},"metadata":null,"publish":null,"authors":[],"categories":[],"keywords":[],"readme":null,"repository":null,"homepage":null,"documentation":null,"edition":"2018","links":null}],"workspace_members":["repro 0.1.0"],"resolve":{"nodes":[{"id":"repro 0.1.0","dependencies":[],"deps":[],"features":[]}],"root":"repro 0.1.0"},"version":1,"metadata":null}
ijackson
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Error and warning messages generated by Cargo itself.Area: Error and warning messages generated by Cargo itself.C-bugCategory: bugCategory: bug