Skip to content

Commit fc76a81

Browse files
committed
Drop --locked from cargo xtask manifest
cargo metadata --locked hard-fails whenever Cargo.lock needs even a trivial refresh (e.g. right after a dependency is added but before a build updates the lock). Resolve normally so the manifest command stays usable in that window. Signed-off-by: Roman Inflianskas <roman.inflianskas@amd.com>
1 parent 03a9dc5 commit fc76a81

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

xtask/src/main.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,15 @@ struct Package {
9090
}
9191

9292
/// Run `cargo metadata` and deserialize the parts we need.
93+
///
94+
/// Deliberately does not pass `--locked`: the table reflects the resolved
95+
/// dependency graph, and `--locked` would make the command hard-fail whenever
96+
/// `Cargo.lock` needs even a trivial update (e.g. right after a dependency is
97+
/// added but before a build refreshes the lock). Letting cargo resolve normally
98+
/// keeps `cargo xtask manifest` usable in that window.
9399
fn load_metadata() -> Result<Metadata> {
94100
let output = ProcessCommand::new(std::env::var_os("CARGO").unwrap_or_else(|| "cargo".into()))
95-
.args(["metadata", "--format-version", "1", "--locked"])
101+
.args(["metadata", "--format-version", "1"])
96102
.output()
97103
.context("failed to run `cargo metadata`")?;
98104
if !output.status.success() {

0 commit comments

Comments
 (0)