Skip to content

A lightweight WebAssembly runtime that is fast, secure, and standards-compliant

Allow using `demangle` feature in `no_std` builds. (#12740)

Piotr Sikora7746998dffdd
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 82e1804bf2..782cbe97c3 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -552,7 +552,7 @@ jobs:
os: ubuntu-latest
test: >
cargo check -p wasmtime --no-default-features --features runtime,component-model &&
- cargo check -p wasmtime --no-default-features --features runtime,gc,component-model,async,debug-builtins &&
+ cargo check -p wasmtime --no-default-features --features runtime,gc,component-model,pulley,async,debug,debug-builtins,demangle,anyhow &&
cargo check -p cranelift-control --no-default-features &&
cargo check -p cranelift-assembler-x64 --lib &&
cargo check -p pulley-interpreter --features encode,decode,disas,interp &&
diff --git a/crates/environ/Cargo.toml b/crates/environ/Cargo.toml
index 9a92d5fdff..255d996a8f 100644
--- a/crates/environ/Cargo.toml
+++ b/crates/environ/Cargo.toml
@@ -20,7 +20,7 @@ all-features = true
[dependencies]
anyhow = { workspace = true }
postcard = { workspace = true }
-cpp_demangle = { version = "0.4.3", optional = true }
+cpp_demangle = { version = "0.4.3", default-features = false, features = ['alloc'], optional = true }
cranelift-entity = { workspace = true, features = ['enable-serde'] }
cranelift-bitset = { workspace = true, features = ['enable-serde'] }
cranelift-bforest = { workspace = true }
@@ -32,7 +32,7 @@ serde_derive = { workspace = true }
log = { workspace = true }
gimli = { workspace = true }
object = { workspace = true }
-rustc-demangle = { version = "0.1.16", optional = true }
+rustc-demangle = { version = "0.1.16", default-features = false, optional = true }
target-lexicon = { workspace = true }
wasm-encoder = { workspace = true, optional = true }
wasmprinter = { workspace = true, optional = true }
@@ -70,7 +70,7 @@ component-model = [
"dep:semver",
"wasmparser/component-model",
]
-demangle = ['std', 'dep:rustc-demangle', 'dep:cpp_demangle']
+demangle = ['dep:rustc-demangle', 'dep:cpp_demangle']
gc = []
gc-drc = ["gc"]
gc-null = ["gc"]
@@ -90,6 +90,8 @@ std = [
'wasmparser/std',
'indexmap/std',
'wasmtime-core/std',
+ 'cpp_demangle?/std',
+ 'rustc-demangle?/std',
]
rr = [
"component-model"
diff --git a/crates/wasmtime/Cargo.toml b/crates/wasmtime/Cargo.toml
index abc14cda02..0aca1b9b26 100644
--- a/crates/wasmtime/Cargo.toml
+++ b/crates/wasmtime/Cargo.toml
@@ -249,7 +249,7 @@ trace-log = ["wasmtime-cranelift?/trace-log"]
# Enables support for demangling WebAssembly function names at runtime in
# errors such as backtraces.
-demangle = ["wasmtime-environ/demangle", "std"]
+demangle = ["wasmtime-environ/demangle"]
# Enable support for generating core dumps on traps.
coredump = ["dep:wasm-encoder", "runtime", "std"]
diff --git a/docs/stability-platform-support.md b/docs/stability-platform-support.md
index db54c0a7ec..82e1ddd4fb 100644
--- a/docs/stability-platform-support.md
+++ b/docs/stability-platform-support.md
@@ -83,6 +83,11 @@ Cargo features are:
* `gc`
* `component-model`
* `pulley`
+* `async`
+* `debug`
+* `debug-builtins`
+* `demangle`
+* `anyhow`
This notably does not include the `default` feature which means that when
depending on Wasmtime you'll need to specify `default-features = false`. This