Skip to content

Commit c4d239a

Browse files
committed
Relax buggy wasi-sdk heuristic
Unfortunately there are some toolchains that don't emit enough information for this heuristic to detect that they are positively safe, so we'll need to default to allow. Signed-off-by: Lann Martin <[email protected]>
1 parent ec6d40c commit c4d239a

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

crates/componentize/src/bugs.rs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ impl WasiLibc377Bug {
2323
if let Some((major, minor, patch)) = parse_clang_version(clang_version) {
2424
let earliest_safe =
2525
parse_clang_version(EARLIEST_PROBABLY_SAFE_CLANG_VERSION).unwrap();
26-
if (major, minor, patch) >= earliest_safe {
27-
return Ok(());
28-
} else {
26+
if (major, minor, patch) < earliest_safe {
2927
return Err(Self {
3028
clang_version: Some(clang_version.clone()),
3129
});
@@ -37,20 +35,16 @@ impl WasiLibc377Bug {
3735
);
3836
}
3937
}
40-
// If we can't assert that the module uses wit-bindgen OR was compiled
41-
// with a new-enough wasi-sdk, conservatively assume it may be buggy.
42-
Err(Self {
43-
clang_version: None,
44-
})
38+
Ok(())
4539
}
4640
}
4741

4842
impl std::fmt::Display for WasiLibc377Bug {
4943
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5044
write!(
5145
f,
52-
"This Wasm module may have been compiled with wasi-sdk version <19 which \
53-
contains a critical memory safety bug. For more information, see: \
46+
"This Wasm module appears to have been compiled with wasi-sdk version <19 \
47+
which contains a critical memory safety bug. For more information, see: \
5448
https://github.com/fermyon/spin/issues/2552"
5549
)
5650
}

0 commit comments

Comments
 (0)