Skip to content

Commit 2a86caf

Browse files
committed
fix(ci): resolve critical compilation errors blocking all CI jobs
This commit fixes the root cause preventing cargo-wrt installation and all subsequent CI job failures. CRITICAL FIXES: SIMD Syntax Errors (wrt-platform): - Fix missing parentheses in x86_64.rs:1504: i_val.to_le_bytes() - Fix missing parentheses in x86_64.rs:1517: u_val.to_le_bytes() - Fix missing parentheses in x86_64.rs:1541: f_val.to_bits().to_le_bytes() - Fix missing parentheses in mod.rs:504: X86SimdProvider::new_avx2() - Fix missing parentheses in mod.rs:506: X86SimdProvider::new_sse2() API Compatibility (wrt-build-core): - Replace deprecated engine.instantiate() with engine.set_current_module() - Fix type mismatch: create Arc<ModuleInstance> from Module - Fix parameter type: convert func_idx from u32 to usize - Correct import path: wrt_runtime::module_instance::ModuleInstance IMPACT: - cargo-wrt now compiles successfully - All CI jobs should now be able to install cargo-wrt tool - This unblocks ASIL verification, testing, and build matrix jobs - Resolves cascading CI failures affecting PR #92 merge status ROOT CAUSE ANALYSIS: The 5 missing parentheses in SIMD code prevented wrt-platform compilation, which blocked cargo-wrt installation, causing all CI jobs to fail within 15-30 seconds when they couldn't find the cargo-wrt binary.
1 parent e1b2205 commit 2a86caf

File tree

3 files changed

+17
-9
lines changed

3 files changed

+17
-9
lines changed

wrt-build-core/src/wast_execution.rs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,19 @@ impl WastEngine {
6969
let module =
7070
Module::from_wrt_module(&wrt_module).context("Failed to convert to runtime module")?;
7171

72-
// Instantiate the module in the engine
72+
// Create a module instance from the module
73+
use wrt_runtime::module_instance::ModuleInstance;
74+
use std::sync::Arc;
75+
let module_instance = Arc::new(
76+
ModuleInstance::new(module.clone(), 0)
77+
.context("Failed to create module instance")?
78+
);
79+
80+
// Set the current module in the engine
7381
let _instance_idx = self
7482
.engine
75-
.instantiate(module.clone())
76-
.context("Failed to instantiate module in engine")?;
83+
.set_current_module(module_instance)
84+
.context("Failed to set current module in engine")?;
7785

7886
// Store the module for later reference
7987
let module_name = name.unwrap_or("current").to_string();
@@ -105,7 +113,7 @@ impl WastEngine {
105113
// Use instance index 0 since we only have one instance for now
106114
let results = self
107115
.engine
108-
.execute(0, func_idx, args.to_vec())
116+
.execute(0, func_idx as usize, args.to_vec())
109117
.context("Function execution failed")?;
110118

111119
Ok(results)

wrt-platform/src/simd/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,9 +501,9 @@ impl SimdRuntime {
501501
#[cfg(target_arch = "x86_64")]
502502
{
503503
if _capabilities.has_avx2 {
504-
return Box::new(x86_64::X86SimdProvider::new_avx2);
504+
return Box::new(x86_64::X86SimdProvider::new_avx2());
505505
} else if _capabilities.has_sse2 {
506-
return Box::new(x86_64::X86SimdProvider::new_sse2);
506+
return Box::new(x86_64::X86SimdProvider::new_sse2());
507507
}
508508
}
509509

wrt-platform/src/simd/x86_64.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1501,7 +1501,7 @@ impl SimdProvider for X86SimdProvider {
15011501
u32::from_le_bytes([a[offset], a[offset + 1], a[offset + 2], a[offset + 3]]);
15021502
let f_val = f32::from_bits(f_bits);
15031503
let i_val = if f_val.is_nan() { 0 } else { f_val as i32 };
1504-
result[offset..offset + 4].copy_from_slice(&i_val.to_le_bytes);
1504+
result[offset..offset + 4].copy_from_slice(&i_val.to_le_bytes());
15051505
}
15061506
result
15071507
}
@@ -1514,7 +1514,7 @@ impl SimdProvider for X86SimdProvider {
15141514
u32::from_le_bytes([a[offset], a[offset + 1], a[offset + 2], a[offset + 3]]);
15151515
let f_val = f32::from_bits(f_bits);
15161516
let u_val = if f_val.is_nan() || f_val < 0.0 { 0u32 } else { f_val as u32 };
1517-
result[offset..offset + 4].copy_from_slice(&u_val.to_le_bytes);
1517+
result[offset..offset + 4].copy_from_slice(&u_val.to_le_bytes());
15181518
}
15191519
result
15201520
}
@@ -1538,7 +1538,7 @@ impl SimdProvider for X86SimdProvider {
15381538
let u_val =
15391539
u32::from_le_bytes([a[offset], a[offset + 1], a[offset + 2], a[offset + 3]]);
15401540
let f_val = u_val as f32;
1541-
result[offset..offset + 4].copy_from_slice(&f_val.to_bits().to_le_bytes);
1541+
result[offset..offset + 4].copy_from_slice(&f_val.to_bits().to_le_bytes());
15421542
}
15431543
result
15441544
}

0 commit comments

Comments
 (0)