Closed Tudyx closed 1 year ago
Ah, so, the --locked
is there to ensure that the checked-in Cargo.lock
is actually up-to-date. The default behavior of Cargo isn't quite the same as --locked
, as by default it will automatically update your Cargo.lock
if you have added a new dependency to your Cargo.toml
for example. If CI didn't check with --locked
then you could make a change to your Cargo.toml
, check in that change without checking in an updated lockfile, and then still have CI succeed even though your project actually doesn't build with the currently-present Cargo.lock
.
I wonder why you use
--locked
withcargo test
in inside jobs, even if respecting the lockfile is the default behavior. To my knowledge, onlycargo install
don't respect the lockfile I see your great video about how to set up CI and even some extra explanations you gave on twitterbut I still struggle to understand why. Could you please elaborate on this?