mirror of
https://github.com/nearai/ironclaw.git
synced 2026-09-02 23:56:24 +08:00
fix(ci): target wasm32-wasip2 in WASM build script (#2175)
* fix(ci): target wasm32-wasip2 in WASM build script cargo-component defaults to wasm32-wasip1 in CI, placing the binary at the wrong path. All slack_auth_integration tests panic because they look for the module at the wasm32-wasip2 target directory. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * test: add regression test for wasm32-wasip2 build target --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: Zaki Manian <zaki@iqlusion.io>
This commit is contained in:
@@ -43,7 +43,7 @@ build_extension() {
|
||||
fi
|
||||
|
||||
echo " BUILD $name ($crate_name) from $source_dir"
|
||||
if ! cargo component build --release --manifest-path "$source_dir/Cargo.toml" 2>&1; then
|
||||
if ! cargo component build --release --target wasm32-wasip2 --manifest-path "$source_dir/Cargo.toml" 2>&1; then
|
||||
echo " FAIL $name"
|
||||
FAILED+=("$name")
|
||||
return 1
|
||||
|
||||
@@ -215,7 +215,7 @@ async fn expect_no_message(stream: &mut ironclaw::channels::MessageStream, timeo
|
||||
);
|
||||
}
|
||||
|
||||
// ── Tests without integration gate (on_http_request only) ───────────────
|
||||
// ── Tests without integration gate (on_http_request only) ───────────────────
|
||||
|
||||
#[tokio::test]
|
||||
async fn test_dm_from_owner_accepted() {
|
||||
@@ -867,3 +867,16 @@ async fn test_channel_message_without_mention_ignored() {
|
||||
assert_eq!(response.status, 200);
|
||||
expect_no_message(&mut stream, 500).await;
|
||||
}
|
||||
|
||||
/// Regression: build script must target wasm32-wasip2 so binaries land at the
|
||||
/// path that `slack_wasm_path()` expects. Without `--target wasm32-wasip2`
|
||||
/// cargo-component defaults to wasip1 and CI tests silently skip.
|
||||
#[test]
|
||||
fn build_script_targets_wasip2() {
|
||||
let script = std::fs::read_to_string(find_project_file("scripts/build-wasm-extensions.sh"))
|
||||
.expect("build script should exist");
|
||||
assert!(
|
||||
script.contains("--target wasm32-wasip2"),
|
||||
"build-wasm-extensions.sh must pass --target wasm32-wasip2"
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user