From a59bc697e3e9646f3756cc8a25a0fd6f08dcb0b1 Mon Sep 17 00:00:00 2001 From: ObserverOfTime Date: Thu, 7 Nov 2024 12:12:27 +0200 Subject: [PATCH] feat(xtask): let upgrade-wasmtime update Cargo.lock --- xtask/src/upgrade_wasmtime.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/xtask/src/upgrade_wasmtime.rs b/xtask/src/upgrade_wasmtime.rs index f2584408..6a8f4976 100644 --- a/xtask/src/upgrade_wasmtime.rs +++ b/xtask/src/upgrade_wasmtime.rs @@ -23,7 +23,11 @@ fn update_cargo(version: &Version) -> Result<()> { std::fs::write("lib/Cargo.toml", new_lines.join("\n") + "\n")?; - Ok(()) + Command::new("cargo") + .arg("update") + .status() + .map(|_| ()) + .with_context(|| "Failed to execute cargo update") } fn zig_fetch(lines: &mut Vec, version: &Version, url_suffix: &str) -> Result<()> { @@ -119,7 +123,7 @@ fn create_commit(repo: &Repository, version: &Version) -> Result<()> { Some("HEAD"), &signature, &signature, - &format!("build(deps): bump wasmtime to v{version}"), + &format!("build(deps): bump wasmtime-c-api to v{version}"), &tree, &[&parent_commit], )?; @@ -128,10 +132,10 @@ fn create_commit(repo: &Repository, version: &Version) -> Result<()> { } pub fn run(args: &UpgradeWasmtime) -> Result<()> { - println!("Upgrading wasmtime in lib/Cargo.toml"); + println!("Upgrading wasmtime for Rust"); update_cargo(&args.version)?; - println!("Upgrading wasmtime in build.zig.zon"); + println!("Upgrading wasmtime for Zig"); update_zig(&args.version)?; let repo = Repository::open(".")?;