Repository navigation
Refs #1535 #1537: wpm shim payload resolution and entry links - #1538
Merged
Merged
Conversation
caomengxuan666
marked this pull request as ready for review
November 8, 2026 11:22
This was referenced Nov 8, 2026
Merged
Merged
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>
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.
Refs #1535
Refs #1537
UNVERIFIED-BY-CAPTAIN — 车道本地只改码不编译,本 PR 由 CI 编译验证。
根因(两单同根:shim payload 的解析只有半套)
.wpm/shims.map的shim_payload_for只认opt\<pkg>\<cmd>.exe约定路径与 per-file 映射,目录级映射(mingw 的{"from":"mingw64/","to":"./"})被直接跳过 → payload 在opt\mingw\bin\gcc.exe却永不注册;links rebuild的迁移路径missing_shim_map_entries更只查约定路径,同样补不上。package_entry_links对 shim 布局自带一套约定路径直算,非 adapter 命令的bin\<cmd>.exe恒为 payload 本体硬链接;payload 旁的私有 DLL(ezwinports pkg-config 形)留在 payload 目录,从 bin\ 启动即 0xC0000135。修法(机制面,src/commands/wpm.cpp,+69/−11)
shim_payload_for补第三臂:目录级映射按其目标目录树搜命令可执行文件(复用既有find_file_recursive)——约定 → per-file → 目录树,三处一序。missing_shim_map_entries改走同一解析器(经artifact_for_current_arch取已装包的 artifact),rebuild 与安装从此同解。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 后通过。