Skip to content

A lightweight WebAssembly runtime that is fast, secure, and standards-compliant

Warn about CLI usage of wasi-common or wasi-threads (#13264)

Alex Crichton244c19657295
diff --git a/src/commands/run.rs b/src/commands/run.rs
index 2d69b41d81..100ab696f0 100644
--- a/src/commands/run.rs
+++ b/src/commands/run.rs
@@ -1121,6 +1121,18 @@ impl RunCommand {
// are enabled, then use the historical preview1
// implementation.
(Some(false), _) | (None, Some(true)) => {
+ let flag = if self.run.common.wasi.preview2 == Some(false) {
+ "-Spreview2=n"
+ } else {
+ "-Sthreads"
+ };
+ eprintln!(
+ "\
+WARNING: the `{flag}` flag will be a hard error in Wasmtime 47.0.0 on 2026-07-20. \
+For more information see https://github.com/bytecodealliance/rfcs/pull/47 and \
+please reach out on Zulip with questions.
+ "
+ );
wasi_common::tokio::add_to_linker(linker, |host| {
host.legacy_p1_ctx.as_mut().unwrap()
})?;