Skip to content

Require T: 'static for Store, upgrade to wasmtime_runtime_layer v34.0.0#54

Merged
juntyr merged 1 commit into
masterfrom
static-store
Jul 23, 2025
Merged

Require T: 'static for Store, upgrade to wasmtime_runtime_layer v34.0.0#54
juntyr merged 1 commit into
masterfrom
static-store

Conversation

@juntyr

@juntyr juntyr commented Jun 22, 2025

Copy link
Copy Markdown
Collaborator

With bytecodealliance/wasmtime#10760, wasmtime now requires T: 'static for store. While we advocated to not have the bound in wasmi, it now seems like the ship has sailed and we have to adapt.

@alexcrichton Since you also tried to avoid a static bound for as long as possible, do you think it makes sense for our abstraction over several WASM runtimes to adopt the bound?

@Robbepop If we go forward here, it means you can bring back the static bound in wasmi as well - thank you for removing it a few versions ago to help our downstream crate, now the momentum is in favour of your original change.

@DouglasDwyer This will require a major release for wasm_runtime_layer (and wasm_component_layer). I've prepared updates for wasmtime_runtime_layer and js_wasm_runtime_layer in this PR, I think for wasmi and wasmer we just wait until their next release.

@juntyr

juntyr commented Jun 22, 2025

Copy link
Copy Markdown
Collaborator Author

The nightly error seems to come from a wasmer regression on nightly, see wasmerio/wasmer#5610

@Robbepop

Robbepop commented Jun 22, 2025

Copy link
Copy Markdown

@juntyr thanks for the CC. I wonder why Wasmtime now requires the 'static. Funny coincidence that Wasmi briefly introduced T:'static some weeks prior.

I will not re-introduce T:'static in Wasmi for now, as its not required and the most recent changes even improved performance.

@alexcrichton

Copy link
Copy Markdown

I tried my best to avoid adding it to Wasmtime but 🤷. I am but a slave to rustc compiler error messages in the end. The tl;dr; is that this helps avoid a lot of unsafe transmutes within Wasmtime and while we think it may be a bug in the Rust compiler we value safety in the interim higher for now.

@juntyr juntyr merged commit cb44aa6 into master Jul 23, 2025
5 checks passed
@juntyr juntyr deleted the static-store branch July 23, 2025 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants