Skip to content

Commit

Permalink
Merge pull request #2772 from lann/relax-wasi-sdk-bug-check
Browse files Browse the repository at this point in the history
Relax buggy wasi-sdk heuristic
  • Loading branch information
lann authored Aug 27, 2024
2 parents ec6d40c + c4d239a commit eaef343
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions crates/componentize/src/bugs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ impl WasiLibc377Bug {
if let Some((major, minor, patch)) = parse_clang_version(clang_version) {
let earliest_safe =
parse_clang_version(EARLIEST_PROBABLY_SAFE_CLANG_VERSION).unwrap();
if (major, minor, patch) >= earliest_safe {
return Ok(());
} else {
if (major, minor, patch) < earliest_safe {
return Err(Self {
clang_version: Some(clang_version.clone()),
});
Expand All @@ -37,20 +35,16 @@ impl WasiLibc377Bug {
);
}
}
// If we can't assert that the module uses wit-bindgen OR was compiled
// with a new-enough wasi-sdk, conservatively assume it may be buggy.
Err(Self {
clang_version: None,
})
Ok(())
}
}

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

0 comments on commit eaef343

Please sign in to comment.