-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
extension: Upgrade wasmtime
to v21
#15210
Conversation
Also needed to run `cargo update -p mach2` to fix some compilation errors.
wasmtime
to v20wasmtime
to v21
@@ -29,7 +29,7 @@ pub fn new_linker( | |||
f: impl Fn(&mut Linker<WasmState>, fn(&mut WasmState) -> &mut WasmState) -> Result<()>, | |||
) -> Linker<WasmState> { | |||
let mut linker = Linker::new(&wasm_engine()); | |||
wasmtime_wasi::command::add_to_linker(&mut linker).unwrap(); | |||
wasmtime_wasi::add_to_linker_async(&mut linker).unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the add_to_linker
usage based on this example:
.preopened_dir(current_dir_preopen, dir_perms, perms, ".") | ||
.preopened_dir(work_dir_preopen, dir_perms, perms, &extension_work_dir) | ||
.env("PWD", &extension_work_dir) | ||
.preopened_dir(&extension_work_dir, ".", dir_perms, file_perms)? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
preopened_dir
now takes an AsRef<Path>
for the host directory, so we don't need to call Dir::open_ambient_dir
ourselves.
The order of the parameters also changed a bit, with the guest_path
moving from the last parameter to the second.
For reference:
This PR upgrades the version of `wasmtime` and `wasmtime-wasi` in use to v21.0.1. We have to skip v20 because Tree-sitter also skipped it. Here are the changes that had to be made: ### v19 -> v20 After upgrading the `wasmtime` packages to v20, I also had to run `cargo update -p mach2` to pull in [v0.4.2](https://github.com/JohnTitor/mach2/releases/tag/0.4.2) to fix some compile errors. There were a few minor API changes in `wasmtime-wasi` from bytecodealliance/wasmtime#8228 that we needed to account for. ### v20 -> v21 Since there isn't a Tree-sitter version that depends on `wasmtime@v20`, we're jumping straight to v21. The published version of Tree-sitter (v0.22.6) still depends on `wasmtime@v19`, but there was a commit (tree-sitter/tree-sitter@7f4a578) later that month that upgrades the `wasmtime` dependency to v21. We're patching Tree-sitter to that commit so we can get the new `wasmtime` version. The main change in v21 is that imports generated by `bindgen!` are no longer automatically trapped (bytecodealliance/wasmtime#8310), so we need to add `trappable_imports: true` to our `bindgen!` calls. Release Notes: - N/A
This PR upgrades the version of
wasmtime
andwasmtime-wasi
in use to v21.0.1.We have to skip v20 because Tree-sitter also skipped it.
Here are the changes that had to be made:
v19 -> v20
After upgrading the
wasmtime
packages to v20, I also had to runcargo update -p mach2
to pull in v0.4.2 to fix some compile errors.There were a few minor API changes in
wasmtime-wasi
from bytecodealliance/wasmtime#8228 that we needed to account for.v20 -> v21
Since there isn't a Tree-sitter version that depends on
wasmtime@v20
, we're jumping straight to v21.The published version of Tree-sitter (v0.22.6) still depends on
wasmtime@v19
, but there was a commit (tree-sitter/tree-sitter@7f4a578) later that month that upgrades thewasmtime
dependency to v21.We're patching Tree-sitter to that commit so we can get the new
wasmtime
version.The main change in v21 is that imports generated by
bindgen!
are no longer automatically trapped (bytecodealliance/wasmtime#8310), so we need to addtrappable_imports: true
to ourbindgen!
calls.Release Notes: