From c1ea7a9ef21c4714f4d9379e6fe5749371b58ff4 Mon Sep 17 00:00:00 2001 From: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com> Date: Wed, 4 Nov 2026 21:22:40 +0800 Subject: [PATCH] test(plugins): build the command template with the SDK's lockfile The resolver also looks up the SDK's wasm-only dependencies, which a clean cargo cache doesn't have, so the offline build failed in CI. --- crates/ide-host/src/bin/openidea-plugin/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/ide-host/src/bin/openidea-plugin/main.rs b/crates/ide-host/src/bin/openidea-plugin/main.rs index 7d07cbef3..ef9a7fa76 100644 --- a/crates/ide-host/src/bin/openidea-plugin/main.rs +++ b/crates/ide-host/src/bin/openidea-plugin/main.rs @@ -946,8 +946,12 @@ mod tests { std::fs::create_dir_all(path.parent().unwrap()).unwrap(); std::fs::write(path, content).unwrap(); } + // The SDK's lockfile keeps the versions its own CI builds with (the resolver also + // looks up the wasm-only dependencies, which may not be downloaded yet). + let sdk_lock = concat!(env!("CARGO_MANIFEST_DIR"), "/../../sdk/rust/openidea-plugin/Cargo.lock"); + std::fs::copy(sdk_lock, plugin.join("Cargo.lock")).unwrap(); let out = Command::new(std::env::var("CARGO").unwrap_or_else(|_| "cargo".into())) - .args(["test", "--offline", "--manifest-path"]) + .args(["test", "--manifest-path"]) .arg(plugin.join("Cargo.toml")) .env("CARGO_TARGET_DIR", dir.join("target")) .output()