Repository navigation
fix(tooling): batch the workspace rustfmt hook on Windows - #3569
Conversation
Enumerate workspace target roots with cargo metadata and bound each rustfmt argv below the Windows command-line limit. Fail closed if required tooling is missing. Include the two pre-existing rustfmt wrapping corrections so the gate passes without bypasses. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
CI 复核补充:本 PR 的 Windows tests compile check、Compatibility CLI、跨目标检查、Shell functionality、API ledger、niubash canary 均已通过;Rust tests(Linux/macOS)与 GNU regression job 失败,不能标 CI 全绿。三个失败都指向 api::consumer_tests::issue2875_input_procsub_child_runs_as_rubash_shell,在 src/api/consumer_tests.rs:2911 断言前由测试执行器报 Unrecognized option: c。已读取精确基底 master 8b48c16 的 CI run 43553720862 原始失败日志:同一项测试、同一断言、同样的 -c 拒绝在三个 job 中均已存在;macOS 与 GNU job 的总数也一致(1243/1/4、1350/1/4)。因此这是已在基底 CI 出现的阻塞,不是格式门禁已通过就把整个 CI 当绿。本 PR 保持 draft,不在这里混入无关测试运行器修复。 |
Reject missing workspace member packages, empty target sets, and targets without source paths before launching any rustfmt batch. Malformed metadata must not silently reduce the gate's coverage and still report success. Preserve edition fallback, target deduplication, CLI and bounded batching. All 15 checker tests pass; the real gate checks 1486 targets in 10 batches. Refs #3569. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Bring the formatting-gate feature history into this draft feature branch so follow-up commits run the normal Windows pre-commit check without the legacy command-line overflow. This does not merge either PR into master. Refs #3569; its review and landing remain independent. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
【WIN-AGENT-AUDIT】 机制核查:
腿(逐项给数字与名字,不许只写「全绿」):
阻塞项:
F 点:无。 续作记录:本轮未动代码。 未跑/VOID 的腿:
|
|
【WIN-AGENT-AUDIT】 本轮复核(只核阻塞条件,不重复全腿):
结论:不合、不关。等方案裁决 + rebase。 |
|
【WIN-AGENT-AUDIT】 head: b7086c3(gh 实时,未变) mergeable=CONFLICTING/DIRTY 裁决建议:fail-closed 全量 Python 门(本 PR 方案)是更贴仓库现状的方向;master 的 staged fallback 不应作为终态。 依据:
代价如实列出:+591 行 Python;要求安装钩子的提交者具备 Python 3(pre-commit 已对 python3/python 做真实版本探测,Store 别名 stub 不误判);完全替代 对 #3564 的联动:本 PR 与 #3564 同线( 队长时间线:第3轮 PENDING 的唯一阻塞 B1(2026-11-16T05:06Z)与第4轮复核(2026-11-16T12:07Z)都把「两方案取舍」列为待裁点,本评论即该输入;是否采纳由队长定。 未跑/VOID 的腿:无(纯裁决评论,未动代码、未起构建;所引数字均来自 gh/git 只读核验与两轮既有审计)。 |
Conflict resolution: scripts/git-hooks/pre-commit kept the PR's fail-closed batched check-rustfmt.py gate. Master's staged-file fallback (#3658) is the weaker same-symptom workaround this PR supersedes (whole-workspace coverage vs staged-only, fail-closed vs fail-open); the audit trail on #3569 recommends this direction. Also applies rustfmt --edition 2021 to four master-side files (src/executor/{external_inner,external_redirects,trap_exec}.rs, tests/pipeline_stderr_redirect_streaming.rs) that drifted unformatted under commits that bypassed full-workspace fmt coverage; required so the merged tree passes the gate being introduced. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…#3564) * fix(exec): rebind the exec target with GNU full_pathname (Refs #3316) builtins/exec.def:172 rebinds the target word with full_pathname (general.c:931-943): an absolute word verbatim, otherwise sh_makepath(NULL, word, MP_DOCWD|MP_RMDOT) -- the cwd, a '/', and the word with exactly one leading "./" removed. The exec builtin instead used the session-anchored resolved program (cwd join keeping "./") as the execve filename and script $0, and its failure reports ran a different, over-eager canonicalization (dropping every "." and ".."). One full_pathname helper now produces the execve filename (so a #! script's $0), the ENOEXEC re-entry's $0, and every exec failure report name, over the shared spawn funnel's word (path::spawn_exec_name). Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(tooling): batch the workspace rustfmt hook on Windows Enumerate workspace target roots with cargo metadata and bound each rustfmt argv below the Windows command-line limit. Fail closed if required tooling is missing. Include the two pre-existing rustfmt wrapping corrections so the gate passes without bypasses. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(tooling): reject incomplete workspace formatting metadata Reject missing workspace member packages, empty target sets, and targets without source paths before launching any rustfmt batch. Malformed metadata must not silently reduce the gate's coverage and still report success. Preserve edition fallback, target deduplication, CLI and bounded batching. All 15 checker tests pass; the real gate checks 1486 targets in 10 batches. Refs #3569. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(exec): preserve Unix spelling in full_pathname GNU builtins/exec.def:151/172 exec_builtin rebinds the target through general.c:931 full_pathname. general.h:264-270 ABSPATH recognizes only a leading slash on Unix, and lib/sh/makepath.c:66 sh_makepath copies the cwd and remaining word unchanged after stripping one leading ./. Restrict backslash folding and DOS-drive recognition to Windows. Unix backslashes in filenames and cwd remain ordinary bytes; D:/ is relative. Preserve the original Windows behavior and the exec target owner. Match the test fixture's Unix PWD to Command::current_dir, as in a real parent shell. The distinct pre-existing stale-PWD repair defect is #3570. New Linux pins: 4 pass/3 fail before, 7 pass after. Adjacent exec/argv0/ name diagnostics: 35 pass. Existing Windows pin: 1 pass. Full formatting gate: 1487 targets in 11 batches. Refs #3316, #3564. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> --------- Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Changes
cargo fmt --checkcommand with a bounded whole-workspace rustfmt check.cargo metadata --no-deps --format-version 1; deduplicate source roots by edition and check all roots, not just changed files.tests/d11_pipeline_squote_carrier_regressions.rs.Verification
cargo fmt --checkfailure:os error 206.b7086c3d.Raw local evidence:
target/issue-suites/results/fmt-gate/, includingmetadata-unit.*,metadata-real.*,metadata-commit.*,hook-fixture-{bad,good}.*, and the initial verification logs.CI / Scope
f7af2e55has three red jobs on the same issue2875 test andassertion already observed on exact base master
8b48c164(run43553720862).Raw comparison and limitations are in the review comment; this is NOT
a claim that the entire CI is green.
cargo fmtand existing CI workflow commands are unchanged.