diff --git a/CHANGELOG.md b/CHANGELOG.md index 60ff42f8b9b..a047d4a1f03 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## **[Unreleased]** +- [#1033](https://github.com/wasmerio/wasmer/pull/1033) Set cranelift backend as default compiler backend again, require at least one backend to be enabled for Wasmer CLI - [#1030](https://github.com/wasmerio/wasmer/pull/1030) Ability to generate `ImportObject` for a specific version WASI version with the C API. - [#1028](https://github.com/wasmerio/wasmer/pull/1028) Introduce strict/non-strict modes for `get_wasi_version` - [#1029](https://github.com/wasmerio/wasmer/pull/1029) Add the “floating” `WasiVersion::Latest` version. diff --git a/Cargo.toml b/Cargo.toml index 557fade49e3..3d1a6b847d1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -74,7 +74,7 @@ serde = { version = "1", features = ["derive"] } # used by the plugin example typetag = "0.1" # used by the plugin example [features] -default = ["fast-tests", "wasi"] +default = ["fast-tests", "wasi", "backend-cranelift"] "loader-kernel" = ["wasmer-kernel-loader"] debug = ["wasmer-runtime-core/debug"] trace = ["wasmer-runtime-core/trace"] diff --git a/src/bin/wasmer.rs b/src/bin/wasmer.rs index 652612103ef..222a58ab1c0 100644 --- a/src/bin/wasmer.rs +++ b/src/bin/wasmer.rs @@ -47,6 +47,13 @@ use std::{cell::RefCell, io::Write, rc::Rc}; #[cfg(feature = "backend-llvm")] use wasmer_runtime_core::backend::BackendCompilerConfig; +#[cfg(not(any( + feature = "backend-cranelift", + feature = "backend-llvm", + feature = "backend-singlepass" +)))] +compile_error!("Please enable one or more of the compiler backends"); + #[derive(Debug, StructOpt)] #[structopt(name = "wasmer", about = "Wasm execution runtime.", author)] /// The options for the wasmer Command Line Interface @@ -592,7 +599,12 @@ fn execute_wasm(options: &Run) -> Result<(), String> { } let compiler: Box = get_compiler_by_backend(options.backend, options) - .ok_or_else(|| "the requested backend is not enabled")?; + .ok_or_else(|| { + format!( + "the requested backend, \"{}\", is not enabled", + options.backend.to_string() + ) + })?; #[allow(unused_mut)] let mut backend_specific_config = None;