Repository navigation
Replies: 1 comment
|
The predicate is exactly as you describe, and the asymmetry sits in the admission check rather than in the file backend.
if (platform !== 'win32') return posix.isAbsolute(path)
const root = win32.parse(path).root
return win32.isAbsolute(path) && root !== '\\' && root !== '/'For The write failures follow from that, and your two citations are the ones I would lead with:
So this is not an errno-mapping wart on top of a working copy; the DACL-copy publication path has no meaning on a share that does not implement those calls. Where I would put the fix, and the tradeoff. Rejecting at admission is the honest place, because the alternative is teaching every fs-local publication path a second, untested fallback for a filesystem class the sandbox cannot fence either — the write grant edits the workspace root's security descriptor, which is the same family of API that fails here. A one-line test in that predicate, The cost of that one-liner is that it also rejects UNC workspaces that today read and list fine, and any workspace reached through a network share on purpose. That is a product decision, not a regex decision, so the smaller change may be to keep admitting the path but fail |
Uh oh!
There was an error while loading. Please reload this page.
Summary
packages/workspace/workspace/src/paths.ts:16-23admits\\wsl.localhost\<distro>\...as a workspace (the win32 check only requiresroot !== '\\' && root !== '/'), but the file toolchain's Windows publicationpath assumes NTFS primitives that the 9P share does not provide. The result is
a workspace that boots, reads, and then fails every write with misleading
errors.
Steps to reproduce
\\wsl.localhost\<distro>\home\<you>\projas a workspace in desktop.Actual behavior
EIO— the measured textis
Error: GetFileSecurityW EIO (Win32 1): \\wsl.localhost\.... Root cause:fs-local's Windows publication copies the source DACL viaGetFileSecurityW(packages/fs/fs-local/src/win32.ts:88-115), which onthe 9P share returns Win32 error 1 (
ERROR_INVALID_FUNCTION), thenpublishes via
ReplaceFileW(win32.ts:122-134) — neither is a 9Pprimitive (
packages/fs/fs-local/src/fsio.ts:622-647).link(temp, dest)(fsio.ts:633-638);the 9P share rejects hard links, so
linkreturnsENOTSUP, which the fsseam wraps as its generic
FS_IO_ERROR— the errno survives only in themessage text (
cannot write "<path>": …), not as the code.at roughly 200× the per-file metadata cost of the same tree from inside the
distro: ~17 000 µs per
statagainst ~86 µs measured in-distro.symlink as a reparse point whose POSIX target Windows cannot resolve, so
stat,realpathandreadon/etc/os-releaseor/libreturnENOENT(the seam reports
FS_NOT_FOUND). On Ubuntu/bin,/liband/etc/os-releaseare symlinks, so read-only tooling that reaches for themfails as well — the breakage is not confined to writes.
cmd.exe, which prints"UNC paths are not supported" and abandons the directory.
Expected behavior
Either:
\\wsl.localhost\...workspaces with a clear"not supported" signal, so users do not discover the limitation as
EIO/FS_IO_ERRORmid-session; orhow
packages/sshpairsfs/subprocess/sandboxremotes).Note that (1) is not free: these workspaces read and list today, and admitting
the form is what lets a WSL-aware directory picker hand the registry a project
directory at all — an outright rejection would also stop setups that work now.
Accepting them read-only, behind a persistent banner, would remove the
misleading mid-session errors without that regression.
Notes
(
workspace/src/paths.ts) and an NTFS-assuming implementation(
fs-local/src/win32.ts). Nothing connects them, which is why the failureappears as per-operation I/O errors rather than an adoption-time signal.
dsh-plugin-wsl-envis an incremental version of (2) — a resident-agentsubstrate for
ctx.fsand shell execution, a root-plane filesystem thatroutes by coordinates, search-spawn rewriting, terminal handling and
directory-picker integration, with the workspace identity kept as the UNC
path. It is not complete: the
@-completion traversal still reads the sharethrough upstream's own
node:fswalk, because the seam it would need doesnot exist yet. Happy to share measurements, traces, or probe scripts if
useful for deciding between (1) and (2).
All reactions