--locked-for-binaries flag (same as --locked but only if the crate is / has a binary) #12091
Labels
A-lockfile
Area: Cargo.lock issues
C-feature-request
Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
S-needs-team-input
Status: Needs input from team on whether/how to proceed.
Problem
I have a monorepo that has many crates in it. For every crate, I'd like to ensure that, if it has a binary, the
Cargo.lock
file is up to date.In order to do that, I want to run
cargo check --locked
on all of the binaries that I have, and if it fails I want to fail CI.Given that the recommendation is that binaries check in their
Cargo.lock
files and libraries don't, it'd be awesome if there was acargo
command that I could run that would add --locked only ifcargo
is working on a binary.I couldn't find an easy way to figure out whether or not a crate had a binary. At the moment, my solution has been...
But this means I'm running
cargo check
twice for each binary I have.Proposed Solution
Provide a flag
--locked-for-binaries
wherecargo check
(and other commands) errors if cargo needs something not in the lock file for binaries, but doesn't error if theCargo.lock
file doesn't exist for libraries.Notes
No response
The text was updated successfully, but these errors were encountered: