Skip to content

Wasmtime 43#3427

Merged
itowlson merged 1 commit intospinframework:mainfrom
itowlson:wasmtime-43-readiness
Mar 23, 2026
Merged

Wasmtime 43#3427
itowlson merged 1 commit intospinframework:mainfrom
itowlson:wasmtime-43-readiness

Conversation

@itowlson
Copy link
Copy Markdown
Collaborator

I did this to get WITs and futures and stuff in order, generally to have awareness of what the upgrade would look like or if there were any issues. Obviously not ready for merge yet!

I have not yet removed unstable warnings etc. but pushed because...

There's something weird with the binding in the tests, multiply implementing FuturePayload on a single type. Not sure if this is me screwing up the WITs or the versioning or what, but I can reproduce it in vanilla projects.

@itowlson itowlson requested a review from alexcrichton March 15, 2026 21:11
@itowlson
Copy link
Copy Markdown
Collaborator Author

Okay the multiple implementations of FuturePayload might be a wit-bindgen versioning thing. That part of the code uses wit-bindgen 0.51. If I change it to 0.53 I get different errors instead ("proc macro panicked ... no entry found for key").

Comment thread crates/factor-key-value/src/host.rs Outdated
Comment on lines +359 to +364
let ksr = StreamReader::new(&mut access, producer)
.map_err(|e| anyhow!("stream error {e}"))?;
let efr =
FutureReader::new(&mut access, err_rx).map_err(|e| anyhow!("future error {e}"))?;
anyhow::Ok((ksr, efr))
})?;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For these changes, was the map_err required due to type inference otherwise not being able to figure things out? If so I think that can be solved by:

        let (ksr, efr) = accessor.with(|mut access| -> wasmtime::Result<_> {
            let ksr = StreamReader::new(&mut access, producer)?;
            let efr = FutureReader::new(&mut access, err_rx)?;
            Ok((ksr, efr))
        })?;

which may be a bit more ergonomic than map_err

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was able to drop the map_err but still needed the anyhow::Ok - for me that felt more ergonomic than writing out the return type on the closure. Thanks for prompting me to revisit!

Comment thread crates/http/src/trigger.rs Outdated
const WASI_HTTP_EXPORT_0_2_PREFIX: &str = "wasi:http/incoming-handler@0.2";
/// The `handler` export `wasi:http` version 0.3.0-rc-2025-08-15
const WASI_HTTP_EXPORT_0_3_0_UNSTABLE: &str = "wasi:http/handler@0.3.0-rc-2026-01-06";
const WASI_HTTP_EXPORT_0_3_0_RC_02: &str = "wasi:http/handler@0.3.0-rc-2026-02-09";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mentioned this on Slack but to also mention it here but I'm hoping to backport bytecodealliance/wasmtime#12781 to the 43.0.0 release so this'll want to update to the 03-15 snapshot if/when that happens.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(backport is here)

@alexcrichton
Copy link
Copy Markdown
Contributor

If I change it to 0.53 I get different errors instead ("proc macro panicked ... no entry found for key").

For posterity, @dicej tracked this down and looks like it's been fixed on wit-bindgen's main branch, so @itowlson if you want to try updating to wit-bindgen 0.54.0 that may work

@itowlson itowlson force-pushed the wasmtime-43-readiness branch 2 times, most recently from 295d918 to cce49e4 Compare March 16, 2026 22:34
@alexcrichton
Copy link
Copy Markdown
Contributor

I'll retry the build once bytecodealliance/wasmtime#12795 goes through to confirm the remaining errors go away and try to help squash any further ones that crop up.

@itowlson itowlson force-pushed the wasmtime-43-readiness branch from c6365b7 to c4fbc1e Compare March 17, 2026 23:55
Comment on lines -311 to -323
#[instrument(
name = "spin_outbound_http.send_request",
skip_all,
fields(
otel.kind = "client",
url.full = Empty,
http.request.method = %request.method(),
otel.name = %request.method(),
http.response.status_code = Empty,
server.address = Empty,
server.port = Empty,
)
)]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be the reason for the failing tests, I think I lost this in an intermediate refactoring of mine but it should be fine to plop onto send_request below

@itowlson itowlson force-pushed the wasmtime-43-readiness branch from 173c8dc to b50a029 Compare March 22, 2026 21:40
@itowlson itowlson marked this pull request as ready for review March 23, 2026 00:55
@itowlson
Copy link
Copy Markdown
Collaborator Author

Updated to Wasmtime 43 release.

@itowlson
Copy link
Copy Markdown
Collaborator Author

For the wasip3-unstable executor, I brute-force removed it. The resulting error if someone still has it is:

Error: json error: unknown variant `wasip3-unstable`, expected one of `http`, `spin`, `wagi`

Caused by:
      unknown variant `wasip3-unstable`, expected one of `http`, `spin`, `wagi`

We could leave it defined and produce a more beautiful error. I don't reckon it's worth it. But if other folks think we should handle this more gracefully then I'm happy to be talked round.

Comment thread crates/http/src/trigger.rs Outdated
@fibonacci1729
Copy link
Copy Markdown
Collaborator

@itowlson re: the output above, +1 i'm OK with the output as it stands from these changes.

@itowlson itowlson changed the title Wasmtime 43 readiness Wasmtime 43 Mar 23, 2026
Signed-off-by: itowlson <ivan.towlson@fermyon.com>
@itowlson itowlson force-pushed the wasmtime-43-readiness branch from cdf1e9a to 17d19d4 Compare March 23, 2026 22:02
@itowlson
Copy link
Copy Markdown
Collaborator Author

Last push was just squashing commits

@itowlson itowlson requested a review from fibonacci1729 March 23, 2026 22:13
Copy link
Copy Markdown
Contributor

@dicej dicej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for doing this!

@itowlson itowlson enabled auto-merge March 23, 2026 22:37
@itowlson itowlson merged commit 84b4eb5 into spinframework:main Mar 23, 2026
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