Skip to content

test(issue3182): drop never-read Outcome.stdout field from diagnostic faces pin - #3418

Merged
caomengxuan666 merged 1 commit into
masterfrom
fix/issue-3411
Nov 12, 2026
Merged

caomengxuan666 merged 1 commit into
masterfrom
fix/issue-3411

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

Summary

Pure test hygiene for the #3182 diagnostic-faces pin. The pin's Outcome struct carried a stdout field that no cell reads — every assertion in the file uses rc / stderr only — and that dead field was the sole error point of the whole-tree RUSTFLAGS="-D warnings" cargo check --tests on master (field stdout is never read, tests/issue3182_diagnostic_faces.rs:30).

This change deletes the field and its one initialization in run(). No assertion, expectation, or product code changes.

Fixes #3411

本 PR 删除了什么

The never-read Outcome.stdout field and its initialization (2 lines, test file only). Nothing else; pure test-hygiene PR.

Verification

Box legs (Simular box, flock, -j 1) — results posted as a comment on this PR:

  • whole-tree RUSTFLAGS="-D warnings" cargo check --tests: the issue3182 point gone, no new points
  • pin stem issue3182_diagnostic_faces: all cells pass
  • cargo fmt --check: rc=0

…ic faces pin

The pin's Outcome struct carried a stdout field that no cell reads
(every assertion uses rc/stderr only), which made the whole-tree
RUSTFLAGS="-D warnings" cargo check --tests fail on master at
tests/issue3182_diagnostic_faces.rs:30 (field `stdout` is never read).
Drop the field and its sole initialization; no assertion or
expectation changes.

Fixes #3411
@caomengxuan666

Copy link
Copy Markdown
Member Author

队长车道验证结果(Simular box,树 r3374 原地复用,flock + 信号复位启动器,-j 1):

  • 基线(master 82244adb,本支父):RUSTFLAGS="-D warnings" cargo check --test issue3182_diagnostic_faces rc=101,唯一 error = field \stdout` is never read`(tests/issue3182_diagnostic_faces.rs:30)——定界点在当前尖复现。
  • 全靶(本支头 5e1a245d):RUSTFLAGS="-D warnings" cargo check --tests rc=0。为防 Fresh 空转,又 touch 全部 1451 个 tests/*.rs 做 verbose 强制重查:1451/1451 个测试靶的 rustc 调用全部实带 -D warnings、distinct crate-name 1451、零 error 行、rc=0——该点消失且无新点,全靶警告面归零。旗标实加载另有 P5 touch + -v 计数佐证。
  • 钉茎 issue3182_diagnostic_faces:8 passed / 0 failed,逐格行齐全(日志 pin.log)。
  • fmt:cargo fmt --check rc=0(全树)。

日志在 box ~/work/f3411-logs/(base-3182.log、full-head.log、full-v2.log、pin.log、main.log)。本 PR 不自合,待队长复核合入。

@caomengxuan666

Copy link
Copy Markdown
Member Author

队长复核:PASS(判词只认自跑数字,Simular box,树 r3374,flock 不跨 cargo 持 fd + python 启动器逐信号 SIG_DFL,-j 1;开工盘 3.0G free、MemAvailable 2,614,056 kB)

  • 正文/标题/diff 亲读:恰 1 文件 +0/−2,单提交;删 Outcome.stdout 字段定义(原 :30)与其唯一初始化点;断言与期望零改动,产品代码零改动。全文 closing 词与 issue 号同句仅 Fixes #3411 一处;删除节一句话,合纯测试卫生豁免口径。
  • base(master 82244adb,rev-parse 在日志内断言):定向 RUSTFLAGS="-D warnings" cargo check --test issue3182_diagnostic_faces rc=101,唯一 error 恰 field `stdout` is never read @ tests/issue3182_diagnostic_faces.rs:30:5(余仅 could-not-compile 汇总行)——基线点在当前尖复现且定界准确。
  • head(5e1a245d):全靶强制重查(touch 全部 tests/*.rs 后 cargo check --tests -v)——1452 次 rustc 调用、1452 次实带 -D warnings、distinct crate-name 1452、^error 行 0、error: 行 0、warning 行 0、rc=0,非 Fresh 空转有计数为证;该点消失且无新点。
  • 钉茎 issue3182_diagnostic_faces:逐格 8 条 ok 行齐全,test result: ok. 8 passed; 0 failed。cargo fmt --check rc=0(日志 0 字节)。
  • 与车道申报对账:除全靶调用计数(车道 1451 / 本轮 1452,计数口径差——本轮 touch 为 tests/ 下递归全部 .rs,distinct crate 自洽且结论同)外逐项一致。
  • 合入条件:实时 master 已进至 2d2e15c2(区间 +1 提交 = PR fix(executor): route command <builtin> --help through the shared help gate #3381,文件集 {src/executor/command_no_alias.rs, tests/issue3339_command_builtin_help_gate.rs}),与本 PR 唯一文件交集 ∅,PR 状态 MERGEABLE/CLEAN——直合已验头即可(update-branch 结果同)。

附带裁断(#3417 前提复核,队长令):不成立。证据链(全文见复核卷宗专节):该 stderr 死字段确曾存在于 PR #3389 的 base 树 f5f65d35(:25,文件中仅定义+初始化 2 处、从未读取——#3389 复核的观察在其树上无误),但已由 PR #3369(提交 9994ad97)先行删除,其正文删除清单明列此项;现尖 82244adb 的该文件内 stderr 出现次数为 0(struct Run 仅 stdout/code 两字段)。本轮实测:base 树 touch 强制重跑定向 check rc=0(真 Checking 执行)、head 全靶 verbose 中该靶 rustc 调用在位且零 error。#3417 正文把 f5f65d3 树上的观测写成了「current master」,立案时 master 已含 #3369。建议凭此证据关 #3417(已由 #3369 修复,非无效立案)。

@caomengxuan666
caomengxuan666 marked this pull request as ready for review November 12, 2026 02:35
@caomengxuan666
caomengxuan666 merged commit cd390c1 into master Nov 12, 2026
11 checks passed
caomengxuan666 pushed a commit that referenced this pull request Nov 12, 2026
fix(pipeline): keep merged-stream order in pipeline stages

Fixes #3324

## What changed

- Pipeline stages whose inline Trap/Printf arms produce both streams now record their writes in an `OrderedOutputLog` (#2699) and stash the ordered chunks in the new `Executor::pipeline_stage_ordered_chunks` field (cleared at `execute_pipeline_stage_inner` entry). In `route_pipeline_stage_streams`, when the stage's fd 1 and fd 2 resolve to the same sink (`2>&1`, `1>&2` incl. the `ProcessStderr`≡`Stderr` variant, `>f 2>&1`), the driver rebuilds the merged stream from the log in production order and routes it once through the shared sink; when the targets differ the split pair routes exactly as before, and the `2>&1 >f` order-dependence is preserved.
- A subshell stage's chunk routing no longer degrades to pair-block writes (whole stdout, then whole stderr) when `apply_ordered_output_redirects` legitimately finds nothing to do on the stripped clone: it falls through to the chunk walk whenever `redirect_failed` and `first_open_error` are both empty, so a stage whose fd table already carries a merged binding (#2689) keeps its order.
- printf's rendering model is production-ordered: `RenderedPrintf` is now a sequence of `PrintfSegment::{Text, Error}` instead of a `(output, errors)` pair — GNU line-buffers stdout (`shell.c:1921-1922` `sh_setlinebuf`), so a conversion diagnostic lands between the values around it, not ahead of all output. `%n` counts sum over Text segments only; `-v` still receives the joined Text while diagnostics go to stderr. The direct printf path routes the ordered log through `write_buffered_builtin_output_chunks`.

## What was deleted

- `write_buffered_builtin_output_stderr_first` and the `stderr_first` parameters of `route_builtin_buffered_output_ordered` / `write_buffered_builtin_output_ordered` (dead once the interleave model replaced the #1134 stderr-first model), plus four comments stating the old fully-buffered model.
- No files, features, or tests were removed.

## Verification (captain review, all legs on the Simular box)

- Regression pin `tests/issue3324_pipeline_stage_merged_order.rs`: **18/18** on the PR head; on the true fork base (`f5f65d35`, top-up form) **7 passed / 11 failed**, the failures exactly the merged-order shapes.
- Three-way probes (32 shapes, GNU bash 5.3.20 oracle): the head matches GNU byte-for-byte on every in-scope shape — merged pipeline order both directions, printf mixed conversions, subshell/direct controls, file merge, `|&`. The two pre-existing red stems the PR body names are unchanged on the head: `issue1100_printf_option_parsing` 4 passed / 5 failed and `issue3046_exec_pipeline_chardev_stdin` 10 passed / 5 failed, with failure name sets identical on the base tree (verified bilaterally). `issue1134_printf_diag_order_regressions` 1/1 and `issue2699_builtin_output_interleaving` 7/7 stay green.
- lib 1245 passed / 0 failed / 4 ignored on both trees, failure name sets identical (empty).
- `cargo fmt --check`, marker-literal, and UTF-8 boundary hygiene legs clean; scoped `RUSTFLAGS="-D warnings"` check (lib + bins + pin) rc=0. The full-target `-D warnings` enumeration's error set is 16 pre-existing test-file lint points, each in a file byte-identical between the fork base and this head (the class master has been clearing since the fork, e.g. #3369/#3418); no point is in `src/` or in this PR's files.

Refs #3408 — `declare -p`'s mixed diagnostic/listing order on a merged stream is produced inside the declare builtin's own pending-diagnostic funnel, not the stage merge layer; captain-review probes confirm it is unchanged (still reversed) on this head, exactly as that issue records.
Refs #3409 — a builtin pipeline stage still fires the inherited EXIT trap at stage exit (missing subshell trap reset in the stage executor); captain-review probes confirm it is unchanged on this head and untouched by this PR, exactly as that issue records.
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.

tests/issue3182_diagnostic_faces.rs:30 死字段使 master 全靶 -D warnings 红(#3373 钉善后)

1 participant