Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix doc, threads are enabled by default now #3665

Merged
merged 3 commits into from
Mar 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/c-api/src/wasm_c_api/unstable/features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ pub extern "C" fn wasmer_features_delete(_features: Option<Box<wasmer_features_t
///
/// The [WebAssembly threads proposal][threads] is not currently fully
/// standardized and is undergoing development. Support for this feature can
/// be enabled through this method for appropriate WebAssembly modules.
/// be disabled through this method for appropriate WebAssembly modules.
///
/// This feature gates items such as shared memories and atomic
/// instructions.
///
/// This is `false` by default.
/// This is `true` by default.
///
/// [threads]: https://github.com/webassembly/threads
///
Expand Down
8 changes: 6 additions & 2 deletions lib/cli/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@ pub struct WasmFeatures {
#[clap(long = "enable-simd")]
pub simd: bool,

/// Enable support for the threads proposal.
/// Disable support for the threads proposal.
#[clap(long = "disable-threads")]
pub disable_threads: bool,

/// Deprecated, threads are enabled by default.
#[clap(long = "enable-threads")]
pub threads: bool,
ptitSeb marked this conversation as resolved.
Show resolved Hide resolved
pub _threads: bool,

/// Enable support for the reference types proposal.
#[clap(long = "enable-reference-types")]
Expand Down
5 changes: 4 additions & 1 deletion lib/cli/src/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,12 @@ impl CompilerOptions {

/// Get the enaled Wasm features.
pub fn get_features(&self, mut features: Features) -> Result<Features> {
if self.features.threads || self.features.all {
if !self.features.disable_threads || self.features.all {
features.threads(true);
}
if self.features.disable_threads && !self.features.all {
features.threads(false);
}
if self.features.multi_value || self.features.all {
features.multi_value(true);
}
Expand Down