Skip to content

fix(windows): let the bundled coreutils own the shell tree (niubash#346) - #649

Merged
caomengxuan666 merged 1 commit into
masterfrom
fix/niu346-shell-tree
Oct 16, 2026
Merged

caomengxuan666 merged 1 commit into
masterfrom
fix/niu346-shell-tree

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

niubash#346. WinuxCmd's native_path now resolves the shell namespace itself (shell_tree_to_native_w mirrors shell_path_to_windows), so the engine no longer needs to re-impose the native spelling on the one class that can resolve it:

  • a posix_aware child (the bundled WinuxCmd applets) gets /usr/bin, /etc, /tmp, /home and /mnt/X verbatim and renders the POSIX face — readlink -f and realpath now agree with the spelling-preserving pwd;
  • every other child class (native exes, cmd, MSYS/Cygwin tools) is untouched and still resolves the same roots through the engine map, so ls /usr/bin | wc -l keeps working;
  • drive forms (/d/x, /cygdrive/d/x) keep the rubash#592 engine translation, so the shipped toolchain always receives a spelling it can open.

The predicate (windows_shell_namespace_argument) is the shell-tree class only — virtual roots, the temp namespaces, /home, /mnt/X, the bare / and /dev/* — and is pinned by a shape-class test.

Dependency

Do not merge before a WinuxCmd release carries the shell-tree layer. The niubash pin scripts/release/winuxcmd-pin.json (currently v1.1.7) must be bumped in the same niubash release. With the pre-shell-tree WinuxCmd, ls -d /usr/bin fails.

Refs unixwin/WinuxCmd#1185, unixwin/niubash#346.

niubash#346: WinuxCmd's native_path now resolves the shell namespace itself
(shell_tree_to_native_w mirrors shell_path_to_windows), so a posix_aware child
gets /usr/bin, /etc, /tmp, /home and /mnt/X VERBATIM instead of the
pre-translated native spelling and renders the POSIX face — readlink -f and
realpath now agree with the spelling-preserving pwd, and the engine no longer
re-imposes the native form on the one class that can resolve it.

Every other child class (native exes, cmd, MSYS/Cygwin tools) is untouched and
still resolves the same roots through the engine map; drive forms (/d/x,
/cygdrive/d/x) keep the rubash#592 translation so the shipped toolchain always
receives a spelling it can open.

Requires a WinuxCmd release carrying the shell-tree layer: bump niubash's
scripts/release/winuxcmd-pin.json before this ships in a release.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant