wasmerio/wasmer · error · anyhow::Error
The `{compiler}` compiler is not included in this binary.
Error message
The `{compiler}` compiler is not included in this binary. What it means
Wasmer binaries are built with a subset of compilers via cargo features. When get_sys_compiler_config matches a BackendType whose compiler was not compiled into this binary (cfg(not(all(singlepass, cranelift, llvm)))) it bails with the compiler name. This is a compile-feature availability error, not a code bug.
Source
Thrown at lib/cli/src/backend.rs:538
config.enable_verifier();
}
if self.enable_nan_canonicalization {
config.canonicalize_nans(true);
}
if let Some(p) = &self.profiler {
match p {
Profiler::Perfmap => config.enable_perfmap(),
Profiler::Gdb => config.enable_debugger(Debugger::Gdb),
Profiler::Lldb => config.enable_debugger(Debugger::Lldb),
}
}
Box::new(config)
}
BackendType::V8 => unreachable!(),
#[cfg(not(all(feature = "singlepass", feature = "cranelift", feature = "llvm")))]
compiler => {
bail!("The `{compiler}` compiler is not included in this binary.")
}
};
#[allow(unreachable_code)]
{
let mut compiler_config = compiler_config;
if self.experimental_artifact {
compiler_config.experimental_artifact(true);
}
Ok(compiler_config)
}
}
}
/// The compiler used for the store
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
#[allow(clippy::upper_case_acronyms, dead_code)]
pub enum BackendType {View on GitHub (pinned to 8c4b9ee9d3)
Solutions
- Install/rebuild Wasmer with the needed compiler feature (e.g. --features llvm)
- Choose a backend that is included in this binary (e.g. --cranelift on a cranelift-only build)
- Check available compilers with `wasmer compile --help` / binary feature info before scripting
Example fix
// before cargo install wasmer --no-default-features --features cranelift wasmer run app.wasm --llvm // after cargo install wasmer --features cranelift,llvm wasmer run app.wasm --llvm
Defensive patterns
Strategy: validation
Validate before calling
// probe feature availability before selecting a backend
#[cfg(not(feature = "llvm"))]
compile_error!("this build lacks the llvm compiler; rebuild with --features llvm"); Type guard
fn backend_available(rt: &BackendType) -> bool {
match rt {
#[cfg(feature = "singlepass")]
BackendType::Singlepass => true,
#[cfg(feature = "cranelift")]
BackendType::Cranelift => true,
#[cfg(feature = "llvm")]
BackendType::LLVM => true,
_ => false,
}
} Try / catch
match result {
Err(e) if e.to_string().contains("is not included in this binary") => {
eprintln!("{}", e); // user must reinstall with the right features
Err(e)
}
other => other?,
} Prevention
- Check the binary's compiled-in features before scripting backend flags
- Install wasmer with all compiler features in shared environments
- Document required cargo features wherever a specific backend is mandated
When it happens
Trigger: Selecting e.g. BackendType::LLVM (via --llvm) on a binary built without the `llvm` feature; any backend arm other than V8 when not all three compiler features are enabled.
Common situations: Minimal `wasmer` builds with only cranelift; distro-packaged binaries with trimmed features; switching backend flags in scripts without checking the installed binary's features.
Related errors
- The {} backend does not support the required features for th
- No backends support the required features for the Wasm modul
- The headless engine can't be chosen
- Unable to determine the wasmer dir: {e}
- The gdb profiler requires --experimental-artifact
AI-assisted analysis of wasmerio/wasmer@8c4b9ee9d3 (2026-09-01).
Data as JSON: /api/errors/460105ed4d180189.
Report an issue: GitHub.