cargo-bitbake: Add an option to trust lockfiles #71
+24
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
When using Cargo Bitbake in combination with lockfiles, I was a little surprised that
cargo-bitbake
didn't just read from the lockfile directly as that has the resolution information I'd like to use.--require-lockfile
can now be used to blindly trust an existing lockfile without performing resolution. This is done so that users can avoid performing resolution if they already have a lockfile checked in.I could see a fair argument here that the right way of doing this is likely staying more similar to the rest of the family of cargo tools, and accepting something like a
--locked
and--offline
flag, and if we attempt to access the network or modify the Lockfile while performing resolution, we panic.That being said, this was the easiest thing for my company to do without thinking about it too much, so we went with this 🤷 . Would love to discuss how
cargo bitbake
is intended to interact with lockfiles in the ecosystem as a whole if anyone has ideas!Caveat: this won't work with workspaces / virtual manifests correctly, but this tool doesn't seem to handle them, so I don't think this is really a regression.
Test Plan
I tested this by running it on all of my companies recipes, but can do some more testing / testing in a public way if desired!