Description: avoid WASM-only crates
Author: Jonas Smedegaard <dr@jones.dk>
Forwarded: not-needed
Last-Update: 2023-07-19
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -50,13 +50,6 @@
 wasmtime-environ = { workspace = true }
 wasmtime-explorer = { workspace = true, optional = true }
 wasmtime-wast = { workspace = true, optional = true }
-wasi-common = { workspace = true, default-features = true, features = ["exit", "tokio"], optional = true }
-wasmtime-wasi = { workspace = true, default-features = true, optional = true }
-wasmtime-wasi-nn = { workspace = true, optional = true }
-wasmtime-wasi-runtime-config = { workspace = true, optional = true }
-wasmtime-wasi-keyvalue = { workspace = true, optional = true }
-wasmtime-wasi-threads = { workspace = true, optional = true }
-wasmtime-wasi-http = { workspace = true, optional = true }
 clap = { workspace = true }
 clap_complete = { workspace = true, optional = true }
 anyhow = { workspace = true, features = ['std'] }
@@ -144,10 +137,7 @@
   "crates/c-api/artifact",
   "crates/environ/fuzz",
   "crates/test-programs",
-  "crates/wasi-preview1-component-adapter",
-  "crates/wasi-preview1-component-adapter/verify",
   "examples/fib-debug/wasm",
-  "examples/wasi/wasm",
   "examples/tokio/wasm",
   "examples/component/wasm",
   "examples/min-platform",
@@ -155,9 +145,6 @@
   "fuzz",
   "winch/codegen",
 ]
-exclude = [
-  'docs/rust_wasi_markdown_parser',
-]
 
 [workspace.package]
 version = "26.0.1"
@@ -204,12 +191,6 @@
 wasmtime-fiber = { path = "crates/fiber", version = "=26.0.1" }
 wasmtime-jit-debug = { path = "crates/jit-debug", version = "=26.0.1" }
 wasmtime-wast = { path = "crates/wast", version = "=26.0.1" }
-wasmtime-wasi = { path = "crates/wasi", version = "26.0.1", default-features = false }
-wasmtime-wasi-http = { path = "crates/wasi-http", version = "=26.0.1", default-features = false }
-wasmtime-wasi-nn = { path = "crates/wasi-nn", version = "26.0.1" }
-wasmtime-wasi-runtime-config = { path = "crates/wasi-runtime-config", version = "26.0.1" }
-wasmtime-wasi-keyvalue = { path = "crates/wasi-keyvalue", version = "26.0.1" }
-wasmtime-wasi-threads = { path = "crates/wasi-threads", version = "26.0.1" }
 wasmtime-component-util = { path = "crates/component-util", version = "=26.0.1" }
 wasmtime-component-macro = { path = "crates/component-macro", version = "=26.0.1" }
 wasmtime-asm-macros = { path = "crates/asm-macros", version = "=26.0.1" }
@@ -217,10 +198,6 @@
 wasmtime-slab = { path = "crates/slab", version = "=26.0.1" }
 component-test-util = { path = "crates/misc/component-test-util" }
 component-fuzz-util = { path = "crates/misc/component-fuzz-util" }
-wiggle = { path = "crates/wiggle", version = "=26.0.1", default-features = false }
-wiggle-macro = { path = "crates/wiggle/macro", version = "=26.0.1" }
-wiggle-generate = { path = "crates/wiggle/generate", version = "=26.0.1" }
-wasi-common = { path = "crates/wasi-common", version = "=26.0.1", default-features = false }
 wasmtime-fuzzing = { path = "crates/fuzzing" }
 wasmtime-jit-icache-coherence = { path = "crates/jit-icache-coherence", version = "=26.0.1" }
 wasmtime-wit-bindgen = { path = "crates/wit-bindgen", version = "=26.0.1" }
@@ -247,9 +224,6 @@
 
 winch-codegen = { path = "winch/codegen", version = "=26.0.1" }
 
-wasi-preview1-component-adapter = { path = "crates/wasi-preview1-component-adapter" }
-byte-array-literals = { path = "crates/wasi-preview1-component-adapter/byte-array-literals" }
-
 # Bytecode Alliance maintained dependencies:
 # ---------------------------
 regalloc2 = "0.10.2"
@@ -360,7 +334,6 @@
 [features]
 default = [
   # All subcommands are included by default.
-  "run",
   "compile",
   "explore",
   "serve",
@@ -368,13 +341,6 @@
   "config",
   "completion",
 
-  # On-by-default WASI features
-  "wasi-nn",
-  "wasi-threads",
-  "wasi-http",
-  "wasi-runtime-config",
-  "wasi-keyvalue",
-
   # Most features of Wasmtime are enabled by default.
   "wat",
   "parallel-compilation",
@@ -418,11 +384,6 @@
 #
 # These features are all included in the `default` set above and this is
 # the internal mapping for what they enable in Wasmtime itself.
-wasi-nn = ["dep:wasmtime-wasi-nn"]
-wasi-threads = ["dep:wasmtime-wasi-threads", "threads"]
-wasi-http = ["component-model", "dep:wasmtime-wasi-http", "dep:tokio", "dep:hyper"]
-wasi-runtime-config = ["dep:wasmtime-wasi-runtime-config"]
-wasi-keyvalue = ["dep:wasmtime-wasi-keyvalue"]
 pooling-allocator = ["wasmtime/pooling-allocator", "wasmtime-cli-flags/pooling-allocator"]
 component-model = [
   "wasmtime/component-model",
@@ -445,7 +406,6 @@
 # CLI subcommands for the `wasmtime` executable. See `wasmtime $cmd --help`
 # for more information on each subcommand.
 serve = [
-  "wasi-http",
   "component-model",
   "dep:http-body-util",
   "dep:http",
@@ -455,14 +415,6 @@
 wast = ["dep:wasmtime-wast"]
 config = ["cache"]
 compile = ["cranelift"]
-run = [
-  "dep:wasmtime-wasi",
-  "wasmtime/runtime",
-  "dep:listenfd",
-  "dep:wasi-common",
-  "dep:tokio",
-  "wasmtime-cli-flags/async",
-]
 completion = ["dep:clap_complete"]
 
 [[test]]
@@ -479,7 +431,6 @@
 
 [[example]]
 name = "tokio"
-required-features = ["wasi-common/tokio"]
 
 [[bench]]
 name = "instantiation"
@@ -497,33 +448,6 @@
 name = "call"
 harness = false
 
-[[bench]]
-name = "wasi"
-harness = false
-
-[profile.release.package.wasi-preview1-component-adapter]
-opt-level = 's'
-strip = 'debuginfo'
-
-[profile.dev.package.wasi-preview1-component-adapter]
-# Make dev look like a release build since this adapter module won't work with
-# a debug build that uses data segments and such.
-incremental = false
-opt-level = 's'
-# Omit assertions, which include failure messages which require string
-# initializers.
-debug-assertions = false
-# Omit integer overflow checks, which include failure messages which require
-# string initializers.
-overflow-checks = false
-
-# Same as `wasi-preview1-component-adapter` above
-[profile.dev.package.wit-bindgen]
-incremental = false
-debug-assertions = false
-overflow-checks = false
-opt-level = 's'
-
 [profile.fastest-runtime]
 inherits = "release"
 codegen-units = 1
--- a/crates/wiggle/Cargo.toml
+++ b/crates/wiggle/Cargo.toml
@@ -16,7 +16,6 @@
 
 [dependencies]
 thiserror = { workspace = true }
-witx = { version = "0.9.1", optional = true }
 wiggle-macro = { workspace = true }
 tracing = { workspace = true }
 bitflags = { workspace = true }
@@ -52,12 +51,6 @@
 
 
 [features]
-# The wiggle proc-macro emits some code (inside `pub mod metadata`) guarded
-# by the `wiggle_metadata` feature flag. We use this feature flag so that
-# users of wiggle are not forced to take a direct dependency on the `witx`
-# crate unless they want it.
-wiggle_metadata = ['witx', "wiggle-macro/wiggle_metadata"]
-
 # The `tracing` crate can use the `log` ecosystem of backends with this
 # non-default feature. We don't need to provide this by default, but its
 # useful for users that don't want to use `tracing-subscriber` to get
--- a/crates/bench-api/Cargo.toml
+++ b/crates/bench-api/Cargo.toml
@@ -26,8 +26,6 @@
 wasmtime-cli-flags = { workspace = true, default-features = true, features = [
     "cranelift",
 ] }
-wasi-common = { workspace = true, default-features = true }
-wasmtime-wasi-nn = { workspace = true, optional = true }
 cap-std = { workspace = true }
 clap = { workspace = true }
 
@@ -35,5 +33,4 @@
 wat = { workspace = true }
 
 [features]
-default = ["shuffling-allocator", "wasi-nn"]
-wasi-nn = ["wasmtime-wasi-nn"]
+default = ["shuffling-allocator"]
--- a/crates/wasmtime/Cargo.toml
+++ b/crates/wasmtime/Cargo.toml
@@ -94,7 +94,6 @@
 proptest = { workspace = true }
 rand = { workspace = true }
 tempfile = { workspace = true }
-wasi-common = { path = "../wasi-common", default-features = true }
 
 [build-dependencies]
 cc = { workspace = true, optional = true }
--- a/crates/c-api/Cargo.toml
+++ b/crates/c-api/Cargo.toml
@@ -31,11 +31,6 @@
 # Optional dependency for the `wat2wasm` API
 wat = { workspace = true, optional = true }
 
-# Optional dependencies for the `wasi` feature
-cap-std = { workspace = true, optional = true }
-tokio = { workspace = true, optional = true, features = ["fs"] }
-wasmtime-wasi = { workspace = true, optional = true, features = ["preview1"] }
-
 # Optional dependencies for the `async` feature
 futures = { workspace = true, optional = true }
 
@@ -45,7 +40,6 @@
 profiling = ["wasmtime/profiling"]
 cache = ["wasmtime/cache"]
 parallel-compilation = ['wasmtime/parallel-compilation']
-wasi = ['cap-std', 'wasmtime-wasi', 'tokio']
 logging = ['dep:env_logger']
 disable-logging = ["log/max_level_off", "tracing/max_level_off"]
 coredump = ["wasmtime/coredump"]
--- a/crates/test-programs/Cargo.toml
+++ b/crates/test-programs/Cargo.toml
@@ -12,8 +12,6 @@
 
 [dependencies]
 anyhow = { workspace = true, features = ['std'] }
-wasi = "0.11.0"
-wasi-nn = "0.6.0"
 wit-bindgen = { workspace = true, features = ['default'] }
 libc = { workspace = true }
 getrandom = "0.2.9"
