Skip to content

Refs #1535 #1537: wpm shim payload resolution and entry links - #1538

Merged
caomengxuan666 merged 3 commits into
mainfrom
fix/WINX-SHIM-wave1
Nov 8, 2026
Merged

caomengxuan666 merged 3 commits into
mainfrom
fix/WINX-SHIM-wave1

Conversation

@caomengxuan666

@caomengxuan666 caomengxuan666 commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

Refs #1535
Refs #1537

UNVERIFIED-BY-CAPTAIN — 车道本地只改码不编译,本 PR 由 CI 编译验证。

根因(两单同根:shim payload 的解析只有半套)

修法(机制面,src/commands/wpm.cpp,+69/−11)

  1. shim_payload_for 补第三臂:目录级映射按其目标目录树搜命令可执行文件(复用既有 find_file_recursive)——约定 → per-file → 目录树,三处一序。
  2. missing_shim_map_entries 改走同一解析器(经 artifact_for_current_arch 取已装包的 artifact),rebuild 与安装从此同解。
  3. package_entry_links 的 shim 臂改走同一解析器(顺带使目录映射包第一次能拿到 bin\ 入口);新增 payload_has_sibling_dlls:payload 同目录有 DLL 时,入口与 argv-adapter 命令同路改指 forwarder(forwarder 在 payload 本地目录启动它,DLL 就在旁)。

本 PR 删除了什么

删除了 package_entry_links 里 shim 布局自带的约定路径直算(一行)与 missing_shim_map_entries 里只查约定路径的解析(两行),均由统一解析取代;shim_payload_for 头注里「两处」的旧说法一并改写。无删除性 API/行为变更:无 DLL 的 payload 入口保持零成本硬链接(钉有对照格)。

钉

  • tests/unit/wpm/issue1537_shim_directory_registration.cpp(+191):目录映射安装写注册(tool/helper 两命令 + usr\bin forwarder + bin\ 入口)与 links rebuild 补注册两格。
  • tests/unit/wpm/issue1535_shim_entry_link_dll.cpp(+168):带私有 DLL 的 payload 入口走 forwarder、无 DLL 对照格两格。

两钉在本机未编译(C++ MSVC 仓口径),fail-first 由构造保证:基底上目录映射注册恒缺、DLL payload 入口恒为 payload 硬链接。CI 终态全集绿:build-windows 四格 + oracle/compare/baseline/baseline-growth/i18n-drift 全 PASS,ctest 3788/3788(含四格新钉逐格 Passed);attempts 1–5 的 x64 失败均为 configure 期 FetchContent 下载 pcre2 的 504/503 基建问题,rerun 后通过。

@caomengxuan666
caomengxuan666 marked this pull request as ready for review November 8, 2026 11:22
@caomengxuan666
caomengxuan666 merged commit e5eb01c into main Nov 8, 2026
28 of 34 checks passed
caomengxuan666 added a commit that referenced this pull request Nov 14, 2026
…ult echo (#1488)

Restricted-fix batch, captain-landed after dual review (lead audit +
verification-lane re-run):

- childproc: quote_windows_arg -> pub(crate)
- echo: echo_bytes(&[&[u8]]) core; OS argv boundary does a single
  lossy conversion; default echo keeps raw bytes (0xff stays 0xff,
  NUL truncation preserved)
- xargs: is_cmd_image (cmd/cmd.exe leaf, case-insensitive, full
  paths) gets literal caret escaping after /c (space tab ^ & | < >
  ( ) "); incremental UTF-16 budget counts escape overhead
- run-gate.sh harness: composite local array assignments split (no
  backslash stripping); GATE_ARTIFACT_DIR/GATE_GNU_REMOTE_ROOT
  parameterized end-to-end; stdout compared via cmp on captured
  files (old shell-variable compare dropped NUL bytes); stderr
  samples copied verbatim; missing side or non-numeric rc = fail.
  No expectation relaxed; new checks can only add failures.

Verification (gate-xargs-reviewed-05, valid rerun; 04 kept as an
environment record): 141 rows (134 strict + 5 exit + 2 win), GNU
139/0, win 2/0, ledger byte-identical to reviewed-03; 9/9 direct
argv/raw-byte probes PASS; cargo test xargs 25/0, echo 15/0.

PR #1625 oracle leg FAILURE adjudicated per the #1538 precedent
(savannah gnulib HTTP 500 at checkout, no test touched); job rerun
green.
caomengxuan666 added a commit that referenced this pull request Nov 14, 2026
…ult echo (#1488)

Restricted-fix batch, captain-landed after dual review (lead audit +
verification-lane re-run):

- childproc: quote_windows_arg -> pub(crate)
- echo: echo_bytes(&[&[u8]]) core; OS argv boundary does a single
  lossy conversion; default echo keeps raw bytes (0xff stays 0xff,
  NUL truncation preserved)
- xargs: is_cmd_image (cmd/cmd.exe leaf, case-insensitive, full
  paths) gets literal caret escaping after /c (space tab ^ & | < >
  ( ) "); incremental UTF-16 budget counts escape overhead
- run-gate.sh harness: composite local array assignments split (no
  backslash stripping); GATE_ARTIFACT_DIR/GATE_GNU_REMOTE_ROOT
  parameterized end-to-end; stdout compared via cmp on captured
  files (old shell-variable compare dropped NUL bytes); stderr
  samples copied verbatim; missing side or non-numeric rc = fail.
  No expectation relaxed; new checks can only add failures.

Verification (gate-xargs-reviewed-05, valid rerun; 04 kept as an
environment record): 141 rows (134 strict + 5 exit + 2 win), GNU
139/0, win 2/0, ledger byte-identical to reviewed-03; 9/9 direct
argv/raw-byte probes PASS; cargo test xargs 25/0, echo 15/0.

PR #1625 oracle leg FAILURE adjudicated per the #1538 precedent
(savannah gnulib HTTP 500 at checkout, no test touched); job rerun
green.
caomengxuan666 added a commit that referenced this pull request Nov 14, 2026
* rust2(xargs): GNU findutils 4.9 xargs library port (#1488)

Port of findutils 4.9.0 xargs.c/buildcmd.c on the shared childproc
resolver: read_line/read_string state machines (quotes, backslash, EOF
string quirks, logical lines), -0/-d escapes, -I insertion with the
bc_do_insert budget, -n/-L/-I exclusion warnings, -s accounting with the
GNU limit diagnostics plus the Windows command-line budget (32767 UTF-16
units, 8191 for cmd.exe), -t/-p gnulib shell-escape quoting, -p/-o via
CONIN$, -P with WaitForMultipleObjects, --process-slot-var,
--show-limits, and the 0/123/124/125/126/127/1 status contract.
Input streams lazily; the default command runs the library echo
in-process. Unit tests: 21 (scripted tty, broken-pipe streaming).

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* rust2(xargs): register xargs in the winux-cmds registry (#1488)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* gate(xargs): 141-case findutils 4.9 differential table (#1488)

134 strict / 5 exit / 2 win rows; children follow the timeout/nohup
convention (default echo, echo/printf images, sh -c for statuses),
multi-line inputs via -a setup files. GNU-gated 139/139, win 2/2.

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* docs(gate): xargs section — results, r=c:no ledger, documented gaps (#1488)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* rust2(xargs): literal caret-escaping for cmd images + byte-exact default echo (#1488)

Restricted-fix batch, captain-landed after dual review (lead audit +
verification-lane re-run):

- childproc: quote_windows_arg -> pub(crate)
- echo: echo_bytes(&[&[u8]]) core; OS argv boundary does a single
  lossy conversion; default echo keeps raw bytes (0xff stays 0xff,
  NUL truncation preserved)
- xargs: is_cmd_image (cmd/cmd.exe leaf, case-insensitive, full
  paths) gets literal caret escaping after /c (space tab ^ & | < >
  ( ) "); incremental UTF-16 budget counts escape overhead
- run-gate.sh harness: composite local array assignments split (no
  backslash stripping); GATE_ARTIFACT_DIR/GATE_GNU_REMOTE_ROOT
  parameterized end-to-end; stdout compared via cmp on captured
  files (old shell-variable compare dropped NUL bytes); stderr
  samples copied verbatim; missing side or non-numeric rc = fail.
  No expectation relaxed; new checks can only add failures.

Verification (gate-xargs-reviewed-05, valid rerun; 04 kept as an
environment record): 141 rows (134 strict + 5 exit + 2 win), GNU
139/0, win 2/0, ledger byte-identical to reviewed-03; 9/9 direct
argv/raw-byte probes PASS; cargo test xargs 25/0, echo 15/0.

PR #1625 oracle leg FAILURE adjudicated per the #1538 precedent
(savannah gnulib HTTP 500 at checkout, no test touched); job rerun
green.

---------

Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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