Merged
Conversation
Also needed to run `cargo update -p mach2` to fix some compilation errors.
wasmtime to v20wasmtime to v21
maxdeviant
commented
Jul 25, 2024
| ) -> 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(); |
Member
Author
There was a problem hiding this comment.
Updated the add_to_linker usage based on this example:
maxdeviant
commented
Jul 25, 2024
| .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)? |
Member
Author
There was a problem hiding this comment.
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:
CharlesChen0823
pushed a commit
to CharlesChen0823/zed
that referenced
this pull request
Jul 29, 2024
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR upgrades the version of
wasmtimeandwasmtime-wasiin 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
wasmtimepackages to v20, I also had to runcargo update -p mach2to pull in v0.4.2 to fix some compile errors.There were a few minor API changes in
wasmtime-wasifrom 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 thewasmtimedependency to v21.We're patching Tree-sitter to that commit so we can get the new
wasmtimeversion.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: trueto ourbindgen!calls.Release Notes: