Skip to content

Commit dbc6db0

Browse files
wasmtime-publishalexcrichtonesoterra
authored
Release Wasmtime 5.0.0 (#5602)
* Release Wasmtime 5.0.0 [automatically-tag-and-release-this-commit] * Update release notes for 5.0.0 (#5539) * Fix a debug assert with `wasm_backtrace(false)` (#5580) This commit fixes an issue where when backtraces were disabled but a host function returned an error it would trigger a debug assertion within Wasmtime. The fix here is to update the condition of the debug assertion and add a test doing this behavior to ensure it works in the future. I've also further taken the liberty in this commit to remove the deprecation notice for `Config::wasm_backtrace`. We don't really have a strong reason for removing this functionality at this time and users have multiple times now reported issues with performance that seem worthwhile to keep the option. The latest issue, #5577, has a use case where it appears the quadratic behavior is back in a way that Wasmtime won't be able to detect. Namely with lots of wasm interleaved with host on the stack if the original error isn't threaded through the entire time then each host error will trigger a new backtrace since it doesn't see a prior backtrace in the error being returned. While this could otherwise be fixed with only capturing one contiguous backtrace perhaps this seems reasonable enough to leave the `wasm_backtrace` config option for now. Closes #5577 * Add component model wasmtime feature to Docs.rs (#5558) Co-authored-by: Wasmtime Publish <[email protected]> Co-authored-by: Alex Crichton <[email protected]> Co-authored-by: Kyle Brown <[email protected]>
1 parent e2e98f6 commit dbc6db0

File tree

5 files changed

+69
-4
lines changed

5 files changed

+69
-4
lines changed

RELEASES.md

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,51 @@
22

33
## 5.0.0
44

5-
Unreleased.
5+
Released 2023-01-20.
66

77
### Added
88

9+
* A `wasmtime::component::bingen!` macro has been added for generating bindings
10+
from `*.wit` files. Note that WIT is still heavily in development so this is
11+
more of a preview of what will be as opposed to a finished feature.
12+
[#5317](https://github.com/bytecodealliance/wasmtime/pull/5317)
13+
[#5397](https://github.com/bytecodealliance/wasmtime/pull/5397)
14+
15+
* The `wasmtime settings` CLI command now has a `--json` option for
16+
machine-readable output.
17+
[#5411](https://github.com/bytecodealliance/wasmtime/pull/5411)
18+
19+
* Wiggle-generated bindings can now generate the trait for either `&mut self` or
20+
`&self`.
21+
[#5428](https://github.com/bytecodealliance/wasmtime/pull/5428)
22+
23+
* The `wiggle` crate has more convenience APIs for working with guest data
24+
that resides in shared memory.
25+
[#5471](https://github.com/bytecodealliance/wasmtime/pull/5471)
26+
[#5475](https://github.com/bytecodealliance/wasmtime/pull/5475)
27+
928
### Changed
1029

30+
* Cranelift's egraph support has been rewritten and updated. This functionality
31+
is still gated behind a flag and may become the default in the next release.
32+
[#5382](https://github.com/bytecodealliance/wasmtime/pull/5382)
33+
34+
* The implementation of codegen for WebAssembly linear memory has changed
35+
significantly internally in Cranelift, moving more responsibility to the
36+
Wasmtime embedding rather than Cranelift itself. This should have no
37+
user-visible change, however.
38+
[#5386](https://github.com/bytecodealliance/wasmtime/pull/5386)
39+
40+
* The `Val::Float32` and `Val::Float64` variants for components now store `f32`
41+
and `f64` instead of the bit representation.
42+
[#5510](https://github.com/bytecodealliance/wasmtime/pull/5510)
43+
44+
### Fixed
45+
46+
* Handling of DWARF debugging information in components with multiple modules
47+
has been fixed to ensure the right info is used for each module.
48+
[#5358](https://github.com/bytecodealliance/wasmtime/pull/5358)
49+
1150
--------------------------------------------------------------------------------
1251

1352
## 4.0.0

crates/wasmtime/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ rust-version.workspace = true
1212

1313
[package.metadata.docs.rs]
1414
rustdoc-args = ["--cfg", "nightlydoc"]
15+
features = ["component-model"]
1516

1617
[dependencies]
1718
wasmtime-runtime = { workspace = true }

crates/wasmtime/src/config.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,8 +365,6 @@ impl Config {
365365
/// This option is `true` by default.
366366
///
367367
/// [`WasmBacktrace`]: crate::WasmBacktrace
368-
#[deprecated = "Backtraces will always be enabled in future Wasmtime releases; if this \
369-
causes problems for you, please file an issue."]
370368
pub fn wasm_backtrace(&mut self, enable: bool) -> &mut Self {
371369
self.wasm_backtrace = enable;
372370
self

crates/wasmtime/src/trap.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ pub(crate) fn from_runtime_box(
9898
error,
9999
needs_backtrace,
100100
} => {
101-
debug_assert!(needs_backtrace == backtrace.is_some());
101+
debug_assert!(
102+
needs_backtrace == backtrace.is_some() || !store.engine().config().wasm_backtrace
103+
);
102104
(error, None)
103105
}
104106
wasmtime_runtime::TrapReason::Jit(pc) => {

tests/all/traps.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,3 +1160,28 @@ fn standalone_backtrace_disabled() -> Result<()> {
11601160
f.call(&mut store, ())?;
11611161
Ok(())
11621162
}
1163+
1164+
#[test]
1165+
fn host_return_error_no_backtrace() -> Result<()> {
1166+
let mut config = Config::new();
1167+
config.wasm_backtrace(false);
1168+
let engine = Engine::new(&config)?;
1169+
let mut store = Store::new(&engine, ());
1170+
let module = Module::new(
1171+
&engine,
1172+
r#"
1173+
(module
1174+
(import "" "" (func $host))
1175+
(func $foo (export "f") call $bar)
1176+
(func $bar call $host)
1177+
)
1178+
"#,
1179+
)?;
1180+
let func = Func::wrap(&mut store, |_cx: Caller<'_, ()>| -> Result<()> {
1181+
bail!("test")
1182+
});
1183+
let instance = Instance::new(&mut store, &module, &[func.into()])?;
1184+
let f = instance.get_typed_func::<(), ()>(&mut store, "f")?;
1185+
assert!(f.call(&mut store, ()).is_err());
1186+
Ok(())
1187+
}

0 commit comments

Comments
 (0)