]> git.proxmox.com Git - cargo.git/commit
Auto merge of #10902 - epage:lock, r=ehuss
authorbors <bors@rust-lang.org>
Wed, 27 Jul 2022 20:39:51 +0000 (20:39 +0000)
committerbors <bors@rust-lang.org>
Wed, 27 Jul 2022 20:39:51 +0000 (20:39 +0000)
commit015143c4d43147db162454d067881b9b1e452276
tree25e15e6f7e9e18650a9139a87e504458347e5e81
parent85b500ccad8cd0b63995fd94a03ddd4b83f7905b
parent5789c12e45c8ba5111eda6c8562b881ced867b0d
Auto merge of #10902 - epage:lock, r=ehuss

fix(add): Update the lock file

This is done in the command, rather than in the op,
- To consistently construct the `Workspace`
- It is more composable as an API

A downside is we update the git dependencies a second time and any sources we didn't initially update.

Unlike the proposal in the attached issue, this does not roll back on error.
- For some errors, the user might want to debug what went wrong.  Losing the intermediate state makes that difficult
- Rollback adds its own complications and risks, including since its
  non-atomic

We've already tried to address most potential errors during `cargo add`s processing.  To meet this desire, we now error if `--locked` is passed in and we would change the manifest.  See that individual commit's message for more details.

Fixes #10901