Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Wasmtime to 20.0.2 #2512

Merged
merged 1 commit into from
May 15, 2024

Conversation

alexcrichton
Copy link
Contributor

This commit updates the Wasmtime version used by Spin from 18.0.4 to 20.0.2. No motivation beyond keeping things up-to-date. This involved a number of minor WASI refactorings such as moving some items around and some refactorings around the wasmtime-wasi-http traits-and-types. Notably the chained handler was switched from anyhow::Result to wasmtime_wasi_http::HttpResult which helps make more explicit which errors are traps and which are normal error codes.

@alexcrichton alexcrichton force-pushed the update-wasmtime-to-20 branch 2 times, most recently from 279fe6d to 36f0a0b Compare May 14, 2024 22:00
@@ -21,7 +21,7 @@ concurrency:

env:
CARGO_TERM_COLOR: always
RUST_VERSION: 1.74
RUST_VERSION: 1.75
Copy link
Contributor

Choose a reason for hiding this comment

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

We should bump the MSRV in Cargo.toml if this is now needed.

@alexcrichton alexcrichton force-pushed the update-wasmtime-to-20 branch from 36f0a0b to c247b69 Compare May 14, 2024 22:03
Copy link
Collaborator

@rylev rylev left a comment

Choose a reason for hiding this comment

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

LGTM - some small observations, but nothing that should block merging this.

wasi_builder: impl FnOnce(WasiCtxBuilder) -> WasiCtxBuilder,
) -> Store<Context> {
wasi_builder: impl FnOnce(&mut WasiCtxBuilder) -> Result<()>,
) -> Result<Store<Context>> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

It seems we unwrap this result in the caller. Perhaps we should just keep this infallible and unwrap (or better yet expect) in the closures?

@@ -715,7 +723,9 @@ impl OutboundWasiHttpHandler for HttpRuntimeData {
"self".into()
};
eprintln!("To allow requests, add 'allowed_outbound_hosts = [\"{}\"]' to the manifest component section.", host);
anyhow::bail!("destination-not-allowed (error 1)")
return Err(HttpError::trap(anyhow::anyhow!(
Copy link
Collaborator

Choose a reason for hiding this comment

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

I realize we were trapping before, but I do wonder if we should be returning HTTP-request-denied instead.

This commit updates the Wasmtime version used by Spin from 18.0.4 to
20.0.2. No motivation beyond keeping things up-to-date. This involved a
number of minor WASI refactorings such as moving some items around and
some refactorings around the `wasmtime-wasi-http` traits-and-types.
Notably the chained handler was switched from `anyhow::Result` to
`wasmtime_wasi_http::HttpResult` which helps make more explicit which
errors are traps and which are normal error codes.

Also update the MSRV of Spin to 1.75 as that's what Wasmtime requires

Signed-off-by: Alex Crichton <[email protected]>
@alexcrichton alexcrichton force-pushed the update-wasmtime-to-20 branch from e0a582c to f973c6d Compare May 15, 2024 16:34
@alexcrichton alexcrichton enabled auto-merge May 15, 2024 16:45
@alexcrichton alexcrichton merged commit 04f0ddd into fermyon:main May 15, 2024
17 checks passed
@alexcrichton alexcrichton deleted the update-wasmtime-to-20 branch May 15, 2024 17:04
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