Browse Source

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 <wasmtime-publish@users.noreply.github.com>
Co-authored-by: Alex Crichton <alex@alexcrichton.com>
Co-authored-by: Kyle Brown <kylebrw@gmail.com>
pull/5937/head v5.0.0
wasmtime-publish 2 years ago
committed by GitHub
parent
commit
dbc6db0cfb
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 41
      RELEASES.md
  2. 1
      crates/wasmtime/Cargo.toml
  3. 2
      crates/wasmtime/src/config.rs
  4. 4
      crates/wasmtime/src/trap.rs
  5. 25
      tests/all/traps.rs

41
RELEASES.md

@ -2,12 +2,51 @@
## 5.0.0
Unreleased.
Released 2023-01-20.
### Added
* A `wasmtime::component::bingen!` macro has been added for generating bindings
from `*.wit` files. Note that WIT is still heavily in development so this is
more of a preview of what will be as opposed to a finished feature.
[#5317](https://github.com/bytecodealliance/wasmtime/pull/5317)
[#5397](https://github.com/bytecodealliance/wasmtime/pull/5397)
* The `wasmtime settings` CLI command now has a `--json` option for
machine-readable output.
[#5411](https://github.com/bytecodealliance/wasmtime/pull/5411)
* Wiggle-generated bindings can now generate the trait for either `&mut self` or
`&self`.
[#5428](https://github.com/bytecodealliance/wasmtime/pull/5428)
* The `wiggle` crate has more convenience APIs for working with guest data
that resides in shared memory.
[#5471](https://github.com/bytecodealliance/wasmtime/pull/5471)
[#5475](https://github.com/bytecodealliance/wasmtime/pull/5475)
### Changed
* Cranelift's egraph support has been rewritten and updated. This functionality
is still gated behind a flag and may become the default in the next release.
[#5382](https://github.com/bytecodealliance/wasmtime/pull/5382)
* The implementation of codegen for WebAssembly linear memory has changed
significantly internally in Cranelift, moving more responsibility to the
Wasmtime embedding rather than Cranelift itself. This should have no
user-visible change, however.
[#5386](https://github.com/bytecodealliance/wasmtime/pull/5386)
* The `Val::Float32` and `Val::Float64` variants for components now store `f32`
and `f64` instead of the bit representation.
[#5510](https://github.com/bytecodealliance/wasmtime/pull/5510)
### Fixed
* Handling of DWARF debugging information in components with multiple modules
has been fixed to ensure the right info is used for each module.
[#5358](https://github.com/bytecodealliance/wasmtime/pull/5358)
--------------------------------------------------------------------------------
## 4.0.0

1
crates/wasmtime/Cargo.toml

@ -12,6 +12,7 @@ rust-version.workspace = true
[package.metadata.docs.rs]
rustdoc-args = ["--cfg", "nightlydoc"]
features = ["component-model"]
[dependencies]
wasmtime-runtime = { workspace = true }

2
crates/wasmtime/src/config.rs

@ -365,8 +365,6 @@ impl Config {
/// This option is `true` by default.
///
/// [`WasmBacktrace`]: crate::WasmBacktrace
#[deprecated = "Backtraces will always be enabled in future Wasmtime releases; if this \
causes problems for you, please file an issue."]
pub fn wasm_backtrace(&mut self, enable: bool) -> &mut Self {
self.wasm_backtrace = enable;
self

4
crates/wasmtime/src/trap.rs

@ -98,7 +98,9 @@ pub(crate) fn from_runtime_box(
error,
needs_backtrace,
} => {
debug_assert!(needs_backtrace == backtrace.is_some());
debug_assert!(
needs_backtrace == backtrace.is_some() || !store.engine().config().wasm_backtrace
);
(error, None)
}
wasmtime_runtime::TrapReason::Jit(pc) => {

25
tests/all/traps.rs

@ -1160,3 +1160,28 @@ fn standalone_backtrace_disabled() -> Result<()> {
f.call(&mut store, ())?;
Ok(())
}
#[test]
fn host_return_error_no_backtrace() -> Result<()> {
let mut config = Config::new();
config.wasm_backtrace(false);
let engine = Engine::new(&config)?;
let mut store = Store::new(&engine, ());
let module = Module::new(
&engine,
r#"
(module
(import "" "" (func $host))
(func $foo (export "f") call $bar)
(func $bar call $host)
)
"#,
)?;
let func = Func::wrap(&mut store, |_cx: Caller<'_, ()>| -> Result<()> {
bail!("test")
});
let instance = Instance::new(&mut store, &module, &[func.into()])?;
let f = instance.get_typed_func::<(), ()>(&mut store, "f")?;
assert!(f.call(&mut store, ()).is_err());
Ok(())
}

Loading…
Cancel
Save