Repository navigation
fix(desktop): WSL backend starts in distros without automounted drives - #25734
Merged
Merged
Conversation
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.
Problem
In a WSL2 distro whose
/etc/wsl.confsets[automount] enabled=false, no Windows drive is mounted, sowsl.exe -d <distro> -- wslpath -u "C:/..."exits 1 with empty stdout. The desktop app installs the WSL runtime from the packaged archive by translating the archive's Windows path withwslpath, soprepareRuntimefailed withwslpath conversion failed for …. The mounted-tree fallback needswslpathtoo, so preflight retried 12 times and the app reverted to the Windows backend. The WSL backend could never start in such a distro.Change
When
wslpathcannot translate the runtime archive's path,prepareRuntimenow copies the archive into the distro overwsl.exestdin instead of reading it through/mnt:~/.t3/wsl-runtime/and prints its path.wsl.exe --exec dd of=<stage>/runtime.tar.gz(no shell, no quoting in argv)..tmp.name means the existing prune collects one orphaned by a crash.When
wslpathsucceeds, the existing path runs unchanged.runWslShellnow wraps a smallrunWslProcesshelper so the copy shares its spawn, drain and timeout handling.Scope and approval
Fixes #8297
Triaged via the automated issue flow. The issue also notes that a secondary-backend preflight failure has no dialog in parallel mode and that the Connections picker shows "Off" after an in-memory fallback; those are separate defects and not changed here.
Verification
apps/desktop/src/wsl/DesktopWslEnvironment.test.ts› "installs the runtime when wslpath cannot translate the archive's Windows path". It drives the realDesktopWslEnvironment.layerwith a fakewsl.exethat runs the distro side under local bash and makeswslpathexit 1 withwslpath: <path>on stderr, as automount-off does. On main it fails:t3 --versionruns.vp test run src/wsl/DesktopWslEnvironment.test.ts src/backend/DesktopBackendConfiguration.test.ts: 35/35 pass.vp run check:changed: format, lint, knip, typecheck, tests pass.wsl.exe --exec ddreceiving the host's stdin as raw bytes with EOF passed through, as the existingwsl.exe --exec sh -sscript channel already does. A truncated or corrupted copy would fail the SHA-256 check with a clear error instead of installing.Model and harness: Claude Opus 5.5 (lead, red test, implementation, review B) and Codex gpt-6.1-sol (review A), in T3 Code.
🤖 Generated with Claude Code