Skip to content

test: gate unix-only helpers in issue2066 pin stem with #[cfg(unix)] (Refs #3507) - #3518

Merged
caomengxuan666 merged 1 commit into
masterfrom
fix/3507-dead-code-issue2066-pin
Nov 14, 2026
Merged

caomengxuan666 merged 1 commit into
masterfrom
fix/3507-dead-code-issue2066-pin

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

Refs #3507

根因

tests/issue2066_pipeline_host_flag_regressions.rs 中全部 #[test] 均为 #[cfg(unix)],但共享辅助项未加门控:两条 use 行(std::path::PathBuf / std::sync::Mutex 与 rubash::api::{RunOptions, Session},其中 Session 导入即未用导入面)、static SERIAL、以及 serial() / temp_dir() / opts() 三个函数。在非 unix 目标上这五项构成 dead code,使 Windows 的 RUSTFLAGS="-D warnings" 测试目标构建失败。与 #3503 同类(已由 PR #3508 修复)。

修法

对上述五项及其两条 use 行精确添加 #[cfg(unix)]:7 行插入、0 删除。测试逻辑零改动;unix 上行为等价。

验证状态

UNVERIFIED-BY-CAPTAIN:修法已由车道在盘核验(rustfmt、git diff --check 通过;Linux stem 报 9 passed;Windows 腿车道报双绿)。队长复核腿(基底 fail-first、修后 stem、-D warnings)将在复核轮补跑。

本 PR 删除了什么

无删除。仅新增 7 行 #[cfg(unix)] 属性。

…(Refs #3507)

Root cause: every #[test] in tests/issue2066_pipeline_host_flag_regressions.rs
is #[cfg(unix)], but the shared helpers were ungated: the two use lines
(std::path::PathBuf / std::sync::Mutex and rubash::api::{RunOptions, Session},
the Session import being the unused-import face), static SERIAL, and the
functions serial(), temp_dir() and opts(). On non-unix targets these five
items are dead code, which fails RUSTFLAGS="-D warnings" builds of the test
target on Windows — the same class as #3503 (fixed by PR #3508).

Fix: add #[cfg(unix)] to exactly those items (7 insertions, 0 deletions).
No test logic changes; on unix the file is byte-equivalent in behaviour.

Verification (lane evidence, UNVERIFIED-BY-CAPTAIN): the fixed file passes
rustfmt and git diff --check; the Linux stem run reported 9 passed; Windows
legs were reported dual-green by the fix lane. Captain review legs (fail-first
on the base file, post-fix stem, -D warnings) are still owed and will run in
the review round.

本 PR 删除了什么:无删除。仅新增 7 行 #[cfg(unix)] 属性。
@caomengxuan666

Copy link
Copy Markdown
Member Author

队长复核 PASS

结论:合入。 Refs-only,合入后队长手关 #3507。

Diff(已核对原文): 1 文件 +7/−0,tests/issue2066_pipeline_host_flag_regressions.rs 上恰好 7 处 #[cfg(unix)] 插入(2 条 use 行 + SERIAL + serial/temp_dir/opts),与 #3503/#3508 同类修法一致;测试逻辑零改动。

Linux 腿(~/workspace/review-3518/linux-legs.md,逐 stem test result 行已从盘核验,零 VOID):

CI(run 43540172947): 3 红 job 唯一失败名均为 issue2875(#3292 基线类);决定性面 Windows tests compile check PASS,API tripwire PASS,darwin/linux-android cross-target PASS。另:该 stem 在 CI 日志中 0 提及(#3430 型缺口),本轮 Linux 腿已补齐。

交集: merge-base 5219be90..live tip 2acdfc41 共 24 文件,0 个触及 issue2066——零交集例外成立,无需 update-branch。

删除节: 正文已有(无删除),与 diff 一致。

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