fix(gemset): stop calling std::env::split_paths on wasm - #323
Merged
vitallium merged 2 commits intoSep 7, 2026
Conversation
std::env::split_paths is unimplemented for wasm32-wasip2 and panics with "unsupported". Gemset::env reached it whenever GEM_PATH was set in the worktree shell environment, so the extension aborted inside language_server_command. wasmtime then rejects every later call into the extension with "cannot enter component instance" until Zed restarts. Split GEM_PATH on ':' instead, matching how the value is joined when the gem home is prepended.
Gemset::env joined GEM_PATH and PATH with ':' on every host, which produces values Ruby cannot read on Windows. Take the host OS from zed::current_platform() and use ';' there.
kjanat
force-pushed
the
fix/gemset-split-paths-wasm
branch
from
September 5, 2026 19:10
9da35bb to
580534b
Compare
3 tasks
Collaborator
|
Thanks for fixing this issue! |
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.
Gemset::envcallsstd::env::split_pathswhenGEM_PATHis set in the worktree shell environment. Onwasm32-wasip2that function ispanic!("unsupported"), so the extension aborts insidelanguage_server_command:After the trap wasmtime refuses every further call into the extension with
wasm trap: cannot enter component instance, so all Ruby language servers stay down until Zed restarts. Introduced in #189.Two commits:
GEM_PATHwith a plain string split instead ofstd::env::split_paths.zed::current_platform()and use;on Windows for the split and for both joins. The joins were hard-coded to:before, which produced values Ruby cannot read on Windows.Tests cover gem home already present in
GEM_PATH,GEM_PATHabsent, and both cases on Windows.Verified with
cargo test,cargo clippy --all-targets,cargo fmt --check, andcargo build --target wasm32-wasip2.