rust-lang / wg-cargo-std-aware

Repo for working on "std aware cargo"
133 stars 8 forks source link

Consider doing a forced lock of the standard library. #38

Open ehuss opened 4 years ago

ehuss commented 4 years ago

It might be a good idea to do the equivalent of --locked for the standard library to ensure that the Cargo.lock isn't modified, and that it is correct.

alexcrichton commented 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!

adamgemmell commented 5 months ago

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.