Add support for both wasmtime latest (39.x) and LTS (36.x) versions#301
Add support for both wasmtime latest (39.x) and LTS (36.x) versions#301jsturtevant wants to merge 2 commits intohyperlight-dev:mainfrom
Conversation
ae7ec12 to
165ceab
Compare
|
LGTM, but shouldn't default be LTS? Otherwise it would be a break change. Or maybe that's what we want? |
| // Re-export wasmtime based on expected version | ||
| #[cfg(all(feature = "wasmtime_latest", feature = "wasmtime_lts"))] | ||
| compile_error!( | ||
| "Features 'wasmtime_latest' and 'wasmtime_lts' are mutually exclusive. Please enable only one." | ||
| ); | ||
|
|
||
| #[cfg(not(any(feature = "wasmtime_latest", feature = "wasmtime_lts")))] | ||
| compile_error!("Either 'wasmtime_latest' or 'wasmtime_lts' feature must be enabled."); | ||
|
|
||
| #[cfg(not(feature = "wasmtime_lts"))] | ||
| extern crate wasmtime; | ||
| #[cfg(feature = "wasmtime_lts")] | ||
| extern crate wasmtime_lts as wasmtime; | ||
|
|
There was a problem hiding this comment.
Is there any value in making these not mutually exclusive? If both are enabled, we could default to one of them, similar to mshv and mshv3 used to work in hyperlight. I think mutually exclusive features are generally discouraged
There was a problem hiding this comment.
I didn't think there was any value in having both. I did default to one in the cargo.toml so that the users wouldn't need to choose. If its discouraged I could try it with both
I don't think it is a breaking change, just a decency bump. My thought was that most WASM users would want to the latest wasmtime. |
57528c8 to
84d5c03
Compare
Introduces wasmtime_lts feature flag to switch between wasmtime versions. Default uses latest (39.0.1), pass --lts flag to AOT compiler or enable wasmtime_lts feature for LTS version (36.0.3). CI updated to test both. Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
4c8fece to
5af7655
Compare
The pulley feature was only forwarded to the latest wasmtime dep via wasmtime?/pulley. When building with wasmtime_lts, the pulley feature on the LTS wasmtime crate was not enabled, causing the runtime to execute pulley-compiled AOT code as native x86 (InvalidOpcode). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Introduces wasmtime_lts feature flag to switch between wasmtime versions.
Default uses latest (39.0.1), pass --lts flag to AOT compiler for LTS version (36.0.3). CI updated to test both.