Skip to content

WIP: 路径层修复 — 尾点/空格操作数与盘上 NUL.txt (#1332, #1333) - #1415

Merged
caomengxuan666 merged 5 commits into
mainfrom
fix/winx3-paths
Oct 27, 2026
Merged

caomengxuan666 merged 5 commits into
mainfrom
fix/winx3-paths

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

winx3-paths 簇(路径层)草稿 PR:先让工作在 GitHub 上可见,集成由主会话处理。

覆盖

Fixes #1332
Fixes #1333

当前进度

两条均已修复并验证(同源 harness:winlibs GCC 16.2 + Wine,mini2 = 全部 .cppm 模块 + sed/cat/grep):

#1299 重基检查(已做)

#1299 已合并;本分支已重基至 main tip 1854504 并在重基树上重建重验(build37 [81/81] + probes 全过)。winx2 的 #1297 卫士 has_device_name_leaf 与本簇 #1333 卫士并存于 to_extended_path(互补不重复)。重基中曾丢失一处闭合括号,已 amend 补回并以测试计数/括号平衡对账核实,详见簇 REPORT.md。

回归测试

11 个新测试(名中带 issue 号):sed 5、grep 4、cat 2,期望值逐项对照 GNU coreutils 9.4。尚未在 Windows CI 跑过——沙箱只能跑 harness 探针,完整工程构建与 winuxcmd-tests 待 CI。

验证边界

详细报告:簇内 REPORT.md(本地 ~/workspace/winuxcmd-fix/clusters/winx3-paths/REPORT.md)。

Trailing dot/space leaves (name., name␣) are stripped by DOS open rules,
so sed/grep on the normalize tier silently read the wrong sibling file and
sed -i overwrote it. Route the file-open sites (sed script/w/r/R inputs
and process_files open_path, hence the -i temp/rename chain; grep's five
open sites) through make_api_path_operand().extended, which names the
literal on-disk file. A trailing separator on a non-directory keeps the
normalized spelling so the #1052 ENOTDIR enforcement still rejects the
open; glob expansion inputs stay on normalize (matching only) and the
grep -r walk root stays normalized (its generic_wstring child paths do not
round-trip a \\?\\ root).

Fixes #1332
…llPathNameW

An on-disk file whose final component is a DOS device stem with an
extension (NUL.txt) was handled three different ways because the
extended-path computation consulted GetFullPathNameW, which resolves
the stem onto the device namespace (\\.\\NUL under Wine; the same DOS
rule governs plain-path opens): cat (extended tier) failed with ENOENT
after to_extended_path mangled the result to \\?\\UNC\\.\\NUL, grep
(normalize tier) read the empty device stream, and sed (normalize tier)
read the empty device stream. Route such leaves through the lexical
preserving form instead, so every tier opens the same on-disk file.
Bare device names are unaffected (make_api_path_operand_w returns them
verbatim before to_extended_path runs), as are stems that merely contain
a device name (ANUL.txt) and dot-less stems; cat needs no command change
(it was already extended-tier) and sed/grep use this form via the #1332
tier switch in the parent commit.

Fixes #1333
The #1333 commit appended nul_txt_reads_file_issue1333 directly after
issue_1288_glob_expands_past_max_path without the closing brace of the
1288 test (74 '{' vs 73 '}' in the file), so the test file did not
compile. Add the missing brace; no test content changes.

Refs #1332
Refs #1333
# Conflicts:
#	tests/unit/cat/cat_unit_test.cpp
…unctions

fc57b90 appended the #1332/#1333 test blocks to three test files and
lost the closing brace of the preceding test in each: cat (fixed in
5bbe101), grep (issue_1283 test, before the preserving_path_1332
helper namespace — MSVC C1075/C2870 on CI) and sed (the s/a*/x/2 test,
same junction shape). Add the two missing braces; no test content
changes.

Refs #1332
Refs #1333
caomengxuan666 added a commit that referenced this pull request Oct 27, 2026
….1.21 release checklist

- packaging/ffi/README.md: DESIGN 4.1 layout on the packaging side
  (usr/bin/ffi/v1.1.21/winuxcore.dll + tiers.tsv, current.txt pointer,
  SHA256SUMS.txt incl. the DLL line, keep-last-2 GC, rollback),
  wpm-index ffi field wiring described (P2, not applied)
- packaging/ffi/FFI-EXPERIMENTAL-NOTICE.md: in-package D8 notice -
  default off, NIU_WINUXCMD_FFI=1 to enable, SmartScreen/Defender
  notes, signed DLL as the hard gate for non-experimental FFI
- packaging/ffi-interim-release-checklist.md: 12 pre-release gates,
  all honestly marked unmet where unmet (incl. the real CI snapshot
  for PRs #1414/#1415/#1423), plus the CMake install-rule patch
  proposal for the coordinator - CMakeLists/CMakePresets/src are
  outside this prep's file surface and are NOT touched
- prep only: no tag, no release
@caomengxuan666
caomengxuan666 marked this pull request as ready for review October 27, 2026 18:31
@caomengxuan666
caomengxuan666 merged commit 496604b into main Oct 27, 2026
8 of 10 checks passed
@caomengxuan666
caomengxuan666 deleted the fix/winx3-paths branch October 30, 2026 01:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant