-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added --generate-lockfile
for generating a new lockfile
#341
Conversation
@acmcarther Hey, do you have time to take a look at this today? Would hugely appreciate it 🙏 😅 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LG, but I'm still not completely clear why just using Cargo.lock doesn't work. Can you explain that again?
You said above
This will always generate a Cargo.raze.lock file which will take precedence over an existing Cargo.lock file. As a reminder, this file exists because to allow projects using binary_deps to have a lockfile that doesn't conflict with the standard lockfile. I'm hoping to one day delete the need for this file and standardize on the canonical Cargo.lock file, but for now, the use of Cargo.raze.lock makes the outputs of cargo-raze more consistent.
But I'm not clear why this "[allows] projects using binary_deps to have a lockfile that doesn't conflict with the standard lockfile". What happens if you just used Cargo.lock
?
Currently, binary dependencies are being added to manifests during the cargo-raze/impl/src/metadata.rs Lines 328 to 364 in 0cb6178
This will cause the lockfile to contain content not reproducible via canonical Cargo commands. To avoid any conflicts with things like rust-analyzer that might update the Users can use However, Maybe I can be smarter about detecting which lockfile is relevant, the custom |
Given what you've said above, I prefer always using our weird cargo.raze.lock, rather than conditionally using it when we need to. |
This PR adds a new argument
--generate-lockfile
which will force a new lockfile to be generated.CargoWorkspaceFiles
was deletedCargo.toml
andCargo.lock
were basically never used for anything other than finding the cargo workspace. It's simpler to pass around aPath
and allow the underlying cargo command to handle finding the correct metadata.--generate-lockfile
This will always generate a
Cargo.raze.lock
file which will take precedence over an existingCargo.lock
file. As a reminder, this file exists because to allow projects usingbinary_deps
to have a lockfile that doesn't conflict with the standard lockfile. I'm hoping to one day delete the need for this file and standardize on the canonicalCargo.lock
file, but for now, the use ofCargo.raze.lock
makes the outputs ofcargo-raze
more consistent.Running this command against the
examples/remote/cargo_workspace
example yields the following changes to the workspaceNote the addition of
cargo/Cargo.raze.lock
here.cargo-raze
will use this for subsequent runs. It's also worth noting that if noCargo.lock
orCargo.raze.lock
files exist, aCargo.raze.lock
file will be generated.New warning for missing checksum
There's a new warning in the
checks
module that will print a warning for when a crates.io crate is missing a checksum:With the following diff
The following error is produced