Skip to content

Update precise in offline mode #9248

@dtolnay

Description

@dtolnay

The following behavior was surprising to me:

$ cargo update
    Updating crates.io index
      Adding serde v1.0.124

$ cargo update -p serde --precise 1.0.123
    Updating crates.io index
    Updating serde v1.0.124 -> v1.0.123

$ cargo update -p serde --precise 1.0.124
    Updating crates.io index
    Updating serde v1.0.123 -> v1.0.124

$ cargo update -p serde --precise 1.0.123 --offline
error: you can't update in the offline mode

It seems to me that Cargo should already have all the information locally to perform the last update to 1.0.123 entirely offline. Why is network access required for that update?

As a workaround, editing an "=1.0.123" dependency into the Cargo.toml and using offline build commands (cargo check --offline) appears to perform that same update offline successfully.


Cargo version: most recent nightly -- cargo 1.52.0-nightly (c68432f 2021-03-02)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-offlineArea: offline modeC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Command-update

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions