Skip to content

In most books the inportant --locked cargo flag is not mentioned. #4386

@StefanSalewski

Description

@StefanSalewski

We just had a discussion in the Rust forum, see https://users.rust-lang.org/t/why-old-versions-of-crate-get-downloaded-equally-everyday/130042/16

Our current feeling is, that the Cargo.lock file is ignored, unless the --locked flag is passed to cargo install (or cargo build). I never read that before somewhere, but from the Cargo book it seems to be true:

https://doc.rust-lang.org/cargo/faq.html#why-have-cargolock-in-version-control

"cargo install will select the latest dependencies unless --locked is passed in."

We are still not sure about "cargo build", that command might use the Cargo.lock by default. But "--locked" seems to be important for "cargo install".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions