From 98dca67e34886ad626eabb00e74d05f32217986c Mon Sep 17 00:00:00 2001 From: Cheng Shao Date: Wed, 14 Sep 2022 10:57:06 +0000 Subject: [PATCH] Add --disable-parallel-compilation CLI flag --- crates/cli-flags/Cargo.toml | 1 + crates/cli-flags/src/lib.rs | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/crates/cli-flags/Cargo.toml b/crates/cli-flags/Cargo.toml index 1c27f3528105..2b406c318a59 100644 --- a/crates/cli-flags/Cargo.toml +++ b/crates/cli-flags/Cargo.toml @@ -22,6 +22,7 @@ default = [ "wasmtime/cranelift", "wasmtime/jitdump", "wasmtime/vtune", + "wasmtime/parallel-compilation", ] pooling-allocator = [] memory-init-cow = [] diff --git a/crates/cli-flags/src/lib.rs b/crates/cli-flags/src/lib.rs index 5f57363f15ce..058522bbb94e 100644 --- a/crates/cli-flags/src/lib.rs +++ b/crates/cli-flags/src/lib.rs @@ -124,6 +124,10 @@ pub struct CommonOptions { #[clap(long)] pub disable_cache: bool, + /// Disable parallel compilation + #[clap(long)] + pub disable_parallel_compilation: bool, + /// Enables or disables WebAssembly features #[clap(long, value_name = "FEATURE,FEATURE,...", parse(try_from_str = parse_wasm_features))] pub wasm_features: Option, @@ -292,6 +296,10 @@ impl CommonOptions { } } + if self.disable_parallel_compilation { + config.parallel_compilation(false); + } + if let Some(max) = self.static_memory_maximum_size { config.static_memory_maximum_size(max); }