mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-03 04:01:22 +00:00
Improve default compiler story for wasmer cli
This commit reenables the clif compiler as the default for wasmer cli, updates an error message, and adds a compile_error if no backends are enabled.
This commit is contained in:
parent
d639748a20
commit
ab111443be
@ -74,7 +74,7 @@ serde = { version = "1", features = ["derive"] } # used by the plugin example
|
|||||||
typetag = "0.1" # used by the plugin example
|
typetag = "0.1" # used by the plugin example
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["fast-tests", "wasi"]
|
default = ["fast-tests", "wasi", "backend-cranelift"]
|
||||||
"loader-kernel" = ["wasmer-kernel-loader"]
|
"loader-kernel" = ["wasmer-kernel-loader"]
|
||||||
debug = ["wasmer-runtime-core/debug"]
|
debug = ["wasmer-runtime-core/debug"]
|
||||||
trace = ["wasmer-runtime-core/trace"]
|
trace = ["wasmer-runtime-core/trace"]
|
||||||
|
@ -40,6 +40,13 @@ use wasmer_runtime_core::{
|
|||||||
#[cfg(feature = "wasi")]
|
#[cfg(feature = "wasi")]
|
||||||
use wasmer_wasi;
|
use wasmer_wasi;
|
||||||
|
|
||||||
|
#[cfg(all(
|
||||||
|
not(feature = "backend-cranelift"),
|
||||||
|
not(feature = "backend-llvm"),
|
||||||
|
not(feature = "backend-singlepass")
|
||||||
|
))]
|
||||||
|
compile_error!("Please enable at least one of the compiler backends");
|
||||||
|
|
||||||
#[derive(Debug, StructOpt)]
|
#[derive(Debug, StructOpt)]
|
||||||
#[structopt(name = "wasmer", about = "Wasm execution runtime.", author)]
|
#[structopt(name = "wasmer", about = "Wasm execution runtime.", author)]
|
||||||
/// The options for the wasmer Command Line Interface
|
/// The options for the wasmer Command Line Interface
|
||||||
@ -560,7 +567,12 @@ fn execute_wasm(options: &Run) -> Result<(), String> {
|
|||||||
|
|
||||||
let compiler: Box<dyn Compiler> = match get_compiler_by_backend(options.backend, options) {
|
let compiler: Box<dyn Compiler> = match get_compiler_by_backend(options.backend, options) {
|
||||||
Some(x) => x,
|
Some(x) => x,
|
||||||
None => return Err("the requested backend is not enabled".into()),
|
None => {
|
||||||
|
return Err(format!(
|
||||||
|
"the requested backend, \"{}\", is not enabled",
|
||||||
|
options.backend.to_string()
|
||||||
|
))
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#[cfg(feature = "backend-llvm")]
|
#[cfg(feature = "backend-llvm")]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user