fix: translate MSYS drive-mount root on Windows nodes (1.27.3)#72
Merged
Conversation
`drive mount <node>:/c/Users/foo/dir-x` sent the MSYS/Git-Bash style root to the node verbatim. On Windows `dart:io` treats `/c/...` as relative to the current drive, so the mirror was created at `C:\c\Users\foo\dir-x` (surfacing as `/c/c/Users/foo/dir-x`) instead of `C:\Users\foo\dir-x`. NodeDriveService now applies the existing `windowsPathFromMsys` helper to the mount root (guarded by `Platform.isWindows`), mirroring the shell-exec backends. POSIX nodes are unaffected. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Problem
omnyshell drive mount /my-local/dir-x windows-2gpu:/c/Users/foo/dir-xcreated the node mirror at/c/c/Users/foo/dir-x(i.e.C:\c\Users\foo\dir-x) instead ofC:\Users\foo\dir-x.The client sends the remote root in MSYS/Git-Bash form (
/c/...= theC:drive).NodeDriveService.run()resolved it with onlyexpandUserHome(...), which leaves/c/...untouched. On Windows,dart:iotreats a/-rooted path as relative to the current drive, soDirectory('/c/Users/foo/dir-x').create()producedC:\c\Users\foo\dir-x.Fix
NodeDriveServicenow applies the existingwindowsPathFromMsyshelper to the mount root, guarded byPlatform.isWindows && _root.startsWith('/')— the same pattern the shell-exec backends (process_shell_backend.dart,winpty_shell_backend.dart) already use for working directories. POSIX nodes are unaffected, since/c/...is a legitimate absolute path there.The single resolved
_rootfield corrects every downstream use (directory creation, content source, git clone/sync).omnydrive
No change required — the sibling package never converts path styles or prepends drive letters; it stores and uses the already-resolved root verbatim. Fixing
_rootin omnyshell is necessary and sufficient.Verification
dart format(no changes) anddart analyze(no issues).windowsPathFromMsystest suite passes (covers/c/Users/x→C:\Users\xand leaves non-drive paths unchanged).🤖 Generated with Claude Code