From c9d4d8bef58b7a8468786eeb23700920ce259fa3 Mon Sep 17 00:00:00 2001 From: Eduardo Rodrigues Date: Wed, 23 Aug 2023 02:47:31 +0200 Subject: [PATCH] feat(wasi-http): define default feature called sync --- Cargo.toml | 8 +++++--- crates/bench-api/Cargo.toml | 2 +- crates/c-api/Cargo.toml | 2 +- crates/test-programs/Cargo.toml | 4 +++- crates/wasi-http/Cargo.toml | 8 +++++++- crates/wasi-threads/Cargo.toml | 4 +++- crates/wasmtime/Cargo.toml | 13 ++++--------- 7 files changed, 24 insertions(+), 17 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b4a34c7cbd5f..a696ca3a5ecc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,7 +29,9 @@ wasmtime-cranelift = { workspace = true } wasmtime-environ = { workspace = true } wasmtime-explorer = { workspace = true } wasmtime-wast = { workspace = true } -wasmtime-wasi = { workspace = true, features = ["exit"] } +wasmtime-wasi = { workspace = true, default-features = true, features = [ + "exit", +] } wasmtime-wasi-nn = { workspace = true, optional = true } wasmtime-wasi-threads = { workspace = true, optional = true } wasmtime-wasi-http = { workspace = true, optional = true } @@ -150,8 +152,8 @@ wasmtime-jit = { path = "crates/jit", version = "=13.0.0" } wasmtime-jit-debug = { path = "crates/jit-debug", version = "=13.0.0" } wasmtime-runtime = { path = "crates/runtime", version = "=13.0.0" } wasmtime-wast = { path = "crates/wast", version = "=13.0.0" } -wasmtime-wasi = { path = "crates/wasi", version = "13.0.0" } -wasmtime-wasi-http = { path = "crates/wasi-http", version = "=13.0.0" } +wasmtime-wasi = { path = "crates/wasi", version = "13.0.0", default-features = false } +wasmtime-wasi-http = { path = "crates/wasi-http", version = "=13.0.0", default-features = false } wasmtime-wasi-nn = { path = "crates/wasi-nn", version = "13.0.0" } wasmtime-wasi-threads = { path = "crates/wasi-threads", version = "13.0.0" } wasmtime-component-util = { path = "crates/component-util", version = "=13.0.0" } diff --git a/crates/bench-api/Cargo.toml b/crates/bench-api/Cargo.toml index 3a617b821313..138a9d27a48f 100644 --- a/crates/bench-api/Cargo.toml +++ b/crates/bench-api/Cargo.toml @@ -21,7 +21,7 @@ shuffling-allocator = { version = "1.1.1", optional = true } target-lexicon = { workspace = true } wasmtime = { workspace = true } wasmtime-cli-flags = { workspace = true, default-features = true } -wasmtime-wasi = { workspace = true } +wasmtime-wasi = { workspace = true, default-features = true } wasmtime-wasi-nn = { workspace = true, optional = true } wasi-cap-std-sync = { workspace = true } cap-std = { workspace = true } diff --git a/crates/c-api/Cargo.toml b/crates/c-api/Cargo.toml index a464c0dbd506..26e358424405 100644 --- a/crates/c-api/Cargo.toml +++ b/crates/c-api/Cargo.toml @@ -28,7 +28,7 @@ wat = { workspace = true, optional = true } # Optional dependencies for the `wasi` feature wasi-cap-std-sync = { workspace = true, optional = true } -wasmtime-wasi = { workspace = true, optional = true } +wasmtime-wasi = { workspace = true, default-features = true, optional = true } cap-std = { workspace = true, optional = true } wasi-common = { workspace = true, optional = true } diff --git a/crates/test-programs/Cargo.toml b/crates/test-programs/Cargo.toml index b2f7ddd4fc54..be433ca0b1cb 100644 --- a/crates/test-programs/Cargo.toml +++ b/crates/test-programs/Cargo.toml @@ -36,7 +36,9 @@ wasmtime = { workspace = true, features = ['cranelift', 'component-model'] } wasi-common = { workspace = true } wasi-cap-std-sync = { workspace = true } -wasmtime-wasi = { workspace = true, features = ["tokio"] } +wasmtime-wasi = { workspace = true, default-features = true, features = [ + "tokio", +] } cap-std = { workspace = true } cap-rand = { workspace = true } tokio = { workspace = true, features = ["rt-multi-thread", "macros"] } diff --git a/crates/wasi-http/Cargo.toml b/crates/wasi-http/Cargo.toml index 3a4b44340b58..26036ba64f71 100644 --- a/crates/wasi-http/Cargo.toml +++ b/crates/wasi-http/Cargo.toml @@ -23,7 +23,9 @@ http-body = "1.0.0-rc.2" http-body-util = "0.1.0-rc.2" thiserror = { workspace = true } tracing = { workspace = true } -wasmtime-wasi = { workspace = true } +wasmtime-wasi = { workspace = true, default-features = false, features = [ + "preview2", +] } wasmtime = { workspace = true, features = ['component-model'] } # The `ring` crate, used to implement TLS, does not build on riscv64 or s390x @@ -31,3 +33,7 @@ wasmtime = { workspace = true, features = ['component-model'] } tokio-rustls = { version = "0.24.0" } rustls = { version = "0.21.0" } webpki-roots = { version = "0.23.0" } + +[features] +default = ["sync"] +sync = ["wasmtime-wasi/sync"] diff --git a/crates/wasi-threads/Cargo.toml b/crates/wasi-threads/Cargo.toml index 28408678b472..b1f82c463652 100644 --- a/crates/wasi-threads/Cargo.toml +++ b/crates/wasi-threads/Cargo.toml @@ -17,4 +17,6 @@ log = { workspace = true } rand = "0.8" wasi-common = { workspace = true } wasmtime = { workspace = true } -wasmtime-wasi = { workspace = true, features = ["exit"] } +wasmtime-wasi = { workspace = true, default-features = true, features = [ + "exit", +] } diff --git a/crates/wasmtime/Cargo.toml b/crates/wasmtime/Cargo.toml index bbe6865ae748..472c85443c3e 100644 --- a/crates/wasmtime/Cargo.toml +++ b/crates/wasmtime/Cargo.toml @@ -51,13 +51,11 @@ fxprof-processed-profile = "0.6.0" [target.'cfg(target_os = "windows")'.dependencies.windows-sys] workspace = true -features = [ - "Win32_System_Diagnostics_Debug", -] +features = ["Win32_System_Diagnostics_Debug"] [dev-dependencies] tempfile = "3.0" -wasmtime-wasi = { path = "../wasi" } +wasmtime-wasi = { path = "../wasi", default-features = true } wasi-cap-std-sync = { path = "../wasi-common/cap-std-sync" } [features] @@ -113,10 +111,7 @@ pooling-allocator = ["wasmtime-runtime/pooling-allocator"] # Enables support for all architectures in Cranelift, allowing # cross-compilation using the `wasmtime` crate's API, notably the # `Engine::precompile_module` function. -all-arch = [ - "wasmtime-cranelift?/all-arch", - "wasmtime-winch?/all-arch", -] +all-arch = ["wasmtime-cranelift?/all-arch", "wasmtime-winch?/all-arch"] # Enables in-progress support for the component model. Note that this feature is # in-progress, buggy, and incomplete. This is primarily here for internal @@ -131,4 +126,4 @@ component-model = [ "dep:encoding_rs", ] -wmemcheck = ["wasmtime-runtime/wmemcheck", "wasmtime-cranelift/wmemcheck"] \ No newline at end of file +wmemcheck = ["wasmtime-runtime/wmemcheck", "wasmtime-cranelift/wmemcheck"]