Repository navigation
test: gate unix-only helpers in issue2066 pin stem with #[cfg(unix)] (Refs #3507) - #3518
Merged
Merged
Conversation
…(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)] 属性。
Member
Author
队长复核 PASS结论:合入。 Refs-only,合入后队长手关 #3507。 Diff(已核对原文): 1 文件 +7/−0, Linux 腿(
CI(run 43540172947): 3 红 job 唯一失败名均为 交集: merge-base 删除节: 正文已有(无删除),与 diff 一致。 |
caomengxuan666
marked this pull request as ready for review
November 14, 2026 02:23
This was referenced Nov 14, 2026
Closed
Closed
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 #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)]属性。