Open ehuss opened 4 years ago
I agree with this in spirit, but --locked
probably won't work "as is" because we are actually technically vastly changing the previous lock file by deleting most nodes from it (e.g. everything related to the compiler/tools/etc). In that sense we want an assertion that the final crate graph is a subset of the original crate graph, but that's not precisely what --locked
is doing.
Either way, agreed would be good to implement!
I think it might make more sense to do this in a cargo test. I'm not sure what user configuration could break this behaviour (patching dependencies, and ignoring the lockfile with cargo install
don't work). The only thing that might change this is if the same workspace was used and the lockfiles combined, but then Alex's proposal wouldn't work.
It might be a good idea to do the equivalent of
--locked
for the standard library to ensure that theCargo.lock
isn't modified, and that it is correct.