Skip to content

Bump Wasmtime to v47.0.0#3605

Merged
itowlson merged 6 commits into
mainfrom
bump-wasmtime/prerelease-47.0.0
Jul 21, 2026
Merged

Bump Wasmtime to v47.0.0#3605
itowlson merged 6 commits into
mainfrom
bump-wasmtime/prerelease-47.0.0

Conversation

@spinframeworkbot

Copy link
Copy Markdown
Collaborator

Bumps Wasmtime to v47.0.0 prerelease

@itowlson

itowlson commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Looks like I fouled up the regex and this one upgraded some of the wasmtime-related bits but not wasmtime itself. Another spectacular start.

ETA: yep it used to be wasmtime = { version = ... } and that's what the regex checks for, but now it's a plain version (because async no longer requires a feature).

@itowlson

itowlson commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

I fixed the bump manually. There's still a bunch of errors but it's possible they're real breaking changes.

@itowlson

Copy link
Copy Markdown
Collaborator

Okay I think I fixed the compile errors but it was extremely "randomly incant at bindgen until it produces the thing that would make my life least painful" rather than any understanding of what I was doing so one of you giant brains had better review the heck out of it!

spinframeworkbot and others added 3 commits July 17, 2026 12:39
Signed-off-by: spinframeworkbot <202838904+spinframeworkbot@users.noreply.github.com>
Signed-off-by: itowlson <ivan.towlson@fermyon.com>
Signed-off-by: itowlson <ivan.towlson@fermyon.com>
@itowlson
itowlson force-pushed the bump-wasmtime/prerelease-47.0.0 branch from cedb743 to bce7e24 Compare July 17, 2026 00:43
Signed-off-by: itowlson <ivan.towlson@fermyon.com>
@itowlson
itowlson force-pushed the bump-wasmtime/prerelease-47.0.0 branch from bd9246a to e892922 Compare July 17, 2026 02:47
Signed-off-by: itowlson <ivan.towlson@fermyon.com>
@itowlson
itowlson force-pushed the bump-wasmtime/prerelease-47.0.0 branch from e892922 to d437be9 Compare July 17, 2026 03:02
@itowlson

itowlson commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Okay I had to comment out the dependency review action because:

  • we need to do a cargo update after revving wasmtime
  • cargo update revved everything
  • dependency-review-action then complained about everything
  • and it did it ONE DEP AT A TIME

So we need a better solution for whatever this is meant to achieve, and I don't know what that is.

ETA: AARGH I CAN'T COMMENT IT OUT BECAUSE SOMEONE HAS MADE IT A REQUIRED CHECK AARGH

@itowlson
itowlson force-pushed the bump-wasmtime/prerelease-47.0.0 branch from cfd3ba5 to d437be9 Compare July 17, 2026 03:12
@alexcrichton

Copy link
Copy Markdown
Contributor

Was going to start to do the 47 bump but saw this (yay ty!) and changes here look good to me. Both test failures look to be:

Error: expected body chunk '[80, 97, 116, 104, 58, 32, 47, 116, 101, 115, ...(131095 more items)]', got 'Path: /testywesty
test integration_tests::test_middleware_with_kv ... FAILED
'
...
failures:
    integration_tests::test_middleware_with_kv

Do you know if that's spurious? If not I can help try to dig in

@itowlson

itowlson commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

@alexcrichton I am not sure. When I test locally, I get the error from #3613, and this is something different. Since, in principle, nothing has changed in this area since #3603, I suspect it's real - but I am not sure...

ETA: My "local test gets 3613" was running a test under the Spin CLI, where I could view the results and diagnose behaviour better. In make test-integration, which uses the release build, I did locally see the new error. So I am doing a release build of the Spin CLI and will see what I get with my otherwise known good middleware test app.

@itowlson

Copy link
Copy Markdown
Collaborator

@alexcrichton I'm now testing in a release CLI and seeing a panic on the unwrap at https://github.com/spinframework/spin/blob/bump-wasmtime/prerelease-47.0.0/crates/factors-executor/src/lib.rs#L357 (which does not appear to have changed in this PR). Which looks suspiciously related to #3613 again! But I am not sure if that's the same as what we're seeing in CI error, which appears to be a successful return with an unexpected body...

@alexcrichton

Copy link
Copy Markdown
Contributor

Hm yeah this might all just point back at the same issue... I'm testing locally to see if I can reproduce CI's failure, and if I can I'll see if updating to Wasmtime's main branch resolves that. If it does I'll do a backport of the fix to use 47.0.2 of Wasmtime

@alexcrichton

Copy link
Copy Markdown
Contributor

Ok cherry-picking the fix for #3613 doesn't help, and printing the stderr is revealing:

Logging component stdio to ".spin/logs/"
Storing default key-value data to ".spin/sqlite_key_value.db".
This is a debug build - preparing Wasm modules might take a few seconds
If you're experiencing long startup times please switch to the release build

worker failed: error while executing at wasm backtrace:
    0:  0x1ff7f - <&wit_bindgen[3c7cc2be13d57c6b]::rt::async_support::future_support::FutureVtable<core[5fc5b684768b7dfa]::result::Result<core[5fc5b684768b7dfa]::option::Option<middleware_primary[839a409df07103f8]::wasi::http0_3_0::types::Fields>, middleware_primary[839a409df07103f8]::wasi::http0_3_0::types::ErrorCode>> as wit_bindgen[3c7cc2be13d57c6b]::rt::async_support::future_support::FutureOps>::drop_writable
                    at /home/alex/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wit-bindgen-0.59.0/src/rt/async_support/future_support.rs:248:18
    1:   0xf40c - <wit_bindgen[3c7cc2be13d57c6b]::rt::async_support::future_support::RawFutureWriter<&wit_bindgen[3c7cc2be13d57c6b]::rt::async_support::future_support::FutureVtable<core[5fc5b684768b7dfa]::result::Result<core[5fc5b684768b7dfa]::option::Option<middleware_primary[839a409df07103f8]::wasi::http0_3_0::types::Fields>, middleware_primary[839a409df07103f8]::wasi::http0_3_0::types::ErrorCode>>> as core[5fc5b684768b7dfa]::ops::drop::Drop>::drop
                    at /home/alex/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wit-bindgen-0.59.0/src/rt/async_support/future_support.rs:581:22
    2:   0xf3fb - core[5fc5b684768b7dfa]::ptr::drop_glue::<wit_bindgen[3c7cc2be13d57c6b]::rt::async_support::future_support::RawFutureWriter<&wit_bindgen[3c7cc2be13d57c6b]::rt::async_support::future_support::FutureVtable<core[5fc5b684768b7dfa]::result::Result<core[5fc5b684768b7dfa]::option::Option<middleware_primary[839a409df07103f8]::wasi::http0_3_0::types::Fields>, middleware_primary[839a409df07103f8]::wasi::http0_3_0::types::ErrorCode>>>>
                    at /home/alex/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:825:1
    3:  0x1f565 - <wit_bindgen[3c7cc2be13d57c6b]::rt::async_support::future_support::RawFutureWrite<&wit_bindgen[3c7cc2be13d57c6b]::rt::async_support::future_support::FutureVtable<core[5fc5b684768b7dfa]::result::Result<core[5fc5b684768b7dfa]::option::Option<middleware_primary[839a409df07103f8]::wasi::http0_3_0::types::Fields>, middleware_primary[839a409df07103f8]::wasi::http0_3_0::types::ErrorCode>>> as core[5fc5b684768b7dfa]::future::future::Future>::poll::{closure#0}
                    at /home/alex/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wit-bindgen-0.59.0/src/rt/async_support/future_support.rs:724:13
    4:   0xff36 - <core[5fc5b684768b7dfa]::task::poll::Poll<(wit_bindgen[3c7cc2be13d57c6b]::rt::async_support::future_support::WriteComplete<core[5fc5b684768b7dfa]::result::Result<core[5fc5b684768b7dfa]::option::Option<middleware_primary[839a409df07103f8]::wasi::http0_3_0::types::Fields>, middleware_primary[839a409df07103f8]::wasi::http0_3_0::types::ErrorCode>>, wit_bindgen[3c7cc2be13d57c6b]::rt::async_support::future_support::RawFutureWriter<&wit_bindgen[3c7cc2be13d57c6b]::rt::async_support::future_support::FutureVtable<core[5fc5b684768b7dfa]::result::Result<core[5fc5b684768b7dfa]::option::Option<middleware_primary[839a409df07103f8]::wasi::http0_3_0::types::Fields>, middleware_primary[839a409df07103f8]::wasi::http0_3_0::types::ErrorCode>>>)>>::map::<core[5fc5b684768b7dfa]::result::Result<(), wit_bindgen[3c7cc2be13d57c6b]::rt::async_support::future_support::FutureWriteError<core[5fc5b684768b7dfa]::result::Result<core[5fc5b684768b7dfa]::option::Option<middleware_primary[839a409df07103f8]::wasi::http0_3_0::types::Fields>, middleware_primary[839a409df07103f8]::wasi::http0_3_0::types::ErrorCode>>>, <wit_bindgen[3c7cc2be13d57c6b]::rt::async_support::future_support::RawFutureWrite<&wit_bindgen[3c7cc2be13d57c6b]::rt::async_support::future_support::FutureVtable<core[5fc5b684768b7dfa]::result::Result<core[5fc5b684768b7dfa]::option::Option<middleware_primary[839a409df07103f8]::wasi::http0_3_0::types::Fields>, middleware_primary[839a409df07103f8]::wasi::http0_3_0::types::ErrorCode>>> as core[5fc5b684768b7dfa]::future::future::Future>::poll::{closure#0}>
                    at /home/alex/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/task/poll.rs:54:43
    5:  0x2015d - <wit_bindgen[3c7cc2be13d57c6b]::rt::async_support::future_support::RawFutureWrite<&wit_bindgen[3c7cc2be13d57c6b]::rt::async_support::future_support::FutureVtable<core[5fc5b684768b7dfa]::result::Result<core[5fc5b684768b7dfa]::option::Option<middleware_primary[839a409df07103f8]::wasi::http0_3_0::types::Fields>, middleware_primary[839a409df07103f8]::wasi::http0_3_0::types::ErrorCode>>> as core[5fc5b684768b7dfa]::future::future::Future>::poll
                    at /home/alex/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wit-bindgen-0.59.0/src/rt/async_support/future_support.rs:719:14
    6:  0x1f8c9 - <<wit_bindgen[3c7cc2be13d57c6b]::rt::async_support::future_support::RawFutureWriter<_>>::write_and_forget::DeferredWrite<&wit_bindgen[3c7cc2be13d57c6b]::rt::async_support::future_support::FutureVtable<core[5fc5b684768b7dfa]::result::Result<core[5fc5b684768b7dfa]::option::Option<middleware_primary[839a409df07103f8]::wasi::http0_3_0::types::Fields>, middleware_primary[839a409df07103f8]::wasi::http0_3_0::types::ErrorCode>>> as alloc[3a89b060e961ae38]::task::Wake>::wake
                    at /home/alex/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wit-bindgen-0.59.0/src/rt/async_support/future_support.rs:556:62
    7:   0x4c08 - alloc[3a89b060e961ae38]::task::raw_waker::wake::<<wit_bindgen[3c7cc2be13d57c6b]::rt::async_support::future_support::RawFutureWriter<_>>::write_and_forget::DeferredWrite<&wit_bindgen[3c7cc2be13d57c6b]::rt::async_support::future_support::FutureVtable<core[5fc5b684768b7dfa]::result::Result<core[5fc5b684768b7dfa]::option::Option<middleware_primary[839a409df07103f8]::wasi::http0_3_0::types::Fields>, middleware_primary[839a409df07103f8]::wasi::http0_3_0::types::ErrorCode>>>>
                    at /home/alex/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/task.rs:198:9
    8:  0x2e335 - <core[5fc5b684768b7dfa]::task::wake::Waker>::wake
                    at /home/alex/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/task/wake.rs:448:18
    9:  0x31bae - <wit_bindgen[3c7cc2be13d57c6b]::rt::async_support::waitable::WaitableOperation<_>>::register_waker::cabi_wake
                    at /home/alex/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wit-bindgen-0.59.0/src/rt/async_support/waitable.rs:280:39
   10:  0x2c3f7 - <wit_bindgen[3c7cc2be13d57c6b]::rt::async_support::TaskState>::deliver_waitable_event
                    at /home/alex/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wit-bindgen-0.59.0/src/rt/async_support.rs:309:13
   11:  0x2ac36 - <wit_bindgen[3c7cc2be13d57c6b]::rt::async_support::TaskState>::callback::{closure#0}
                    at /home/alex/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wit-bindgen-0.59.0/src/rt/async_support.rs:217:20
   12:  0x2ab9e - <wit_bindgen[3c7cc2be13d57c6b]::rt::async_support::TaskState>::with_p3_task_set::<wit_bindgen[3c7cc2be13d57c6b]::rt::async_support::CallbackCode, <wit_bindgen[3c7cc2be13d57c6b]::rt::async_support::TaskState>::callback::{closure#0}>
                    at /home/alex/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wit-bindgen-0.59.0/src/rt/async_support.rs:346:9
   13:  0x2e98e - <wit_bindgen[3c7cc2be13d57c6b]::rt::async_support::TaskState>::callback
                    at /home/alex/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wit-bindgen-0.59.0/src/rt/async_support.rs:202:14
   14:  0x2ed09 - wit_bindgen[3c7cc2be13d57c6b]::rt::async_support::callback
                    at /home/alex/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wit-bindgen-0.59.0/src/rt/async_support.rs:588:27
   15:  0x1082a - middleware_primary[839a409df07103f8]::exports::wasi::http0_3_0::handler::__callback_handle
                    at /home/alex/code/spin/tests/test-components/components/middleware-primary/src/lib.rs:3:1
   16:   0x6b3b - [callback][async-lift]wasi:http/handler@0.3.0#handle
                    at /home/alex/code/spin/tests/test-components/components/middleware-primary/src/lib.rs:3:1

Caused by:
    cannot drop future write end without first writing a value

Definitely looks like a bug in wit-bindgen or wasmtime, I'll keep digging

@alexcrichton

Copy link
Copy Markdown
Contributor

Indeed, a bug in Wasmtime. I'll work on getting that landed + backporting the call_hook fix and get a 47.0.2 tomorrow

@alexcrichton

Copy link
Copy Markdown
Contributor

Ok Wasmtime 47.0.2 is out now, if you want to update to that here I tink it should get past those tests in CI

@itowlson itowlson changed the title Bump Wasmtime to v47.0.0 prerelease Bump Wasmtime to v47.0.0 Jul 21, 2026
@itowlson

Copy link
Copy Markdown
Collaborator

Looking good locally; thank you, Alex.

@itowlson

Copy link
Copy Markdown
Collaborator

@fibonacci1729 What do you think we should do about the "review new dependencies" failure? I think all this stuff is indirect and not readily fixable, and most of it only happened because the cargo update in the PR spammed everything.

@fibonacci1729

Copy link
Copy Markdown
Collaborator

@itowlson Would scoping the update work here: cargo update -p wasmtime -p wasmtime-wasi -p wasmtime-wasi-http?

Signed-off-by: itowlson <ivan.towlson@fermyon.com>
@itowlson
itowlson force-pushed the bump-wasmtime/prerelease-47.0.0 branch from 4b9c2d5 to fe56f0a Compare July 21, 2026 21:37
@fibonacci1729

fibonacci1729 commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Additionally, i think we could make the dependency-review-config.yml branch-aware for bump-wasmtime/* branches or spinframeworkbot-authored PRs and run with warn-only: true.

@itowlson

Copy link
Copy Markdown
Collaborator

@itowlson Would scoping the update work here: cargo update -p wasmtime -p wasmtime-wasi -p wasmtime-wasi-http?

Fie! I looked for that option! Turns out you're right, I missed it's not a named flag: cargo update foo bar baz. TIL.

  • Should I remake this PR, or bypass the red check?
  • Do you want to add that change as part of your current Wasmtime update PR, or shall I bash it out as a separate PR?

@fibonacci1729

Copy link
Copy Markdown
Collaborator
  1. Im ok with bypassing for now.
  2. Feel free to bash it out as a separate pr.

@itowlson
itowlson marked this pull request as ready for review July 21, 2026 22:05
@itowlson
itowlson requested review from dicej and fibonacci1729 July 21, 2026 22:05
@itowlson
itowlson merged commit b1c7bfd into main Jul 21, 2026
16 of 17 checks passed
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.

4 participants