Skip to content

Cargo config option to default to locked/frozen #8207

Description

@rickvanprim

Describe the problem you are trying to solve
I would like to be able to specify in a workspace's cargo config that by default running commands such as cargo build imply the --locked/--frozen option so that users/build machines don't accidentally update Cargo.lock or rely on the network. To go along with this, cargo would need to support --unlocked/--unfrozen switches or cargo vendor would need to ignore --locked/--frozen.

Describe the solution you'd like
Somewhere in .cargo/config I am able to specify default switches for cargo invocations and cargo has command line options to unset binary switches that may be defaulted on.

Notes
The intent here is to ensure that dependencies are only explicitly and deliberately updated, instead of accidentally happening if someone happens to invoke cargo incorrectly (or a tool like rust-analyzer does).

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-configurationArea: cargo config files and env varsC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions