Skip to content

fix(build): add missing closed field to two FileFd literals (Refs #3213) - #3666

Merged
caomengxuan666 merged 2 commits into
masterfrom
fix/3473-tip-compile-closed-field
Nov 15, 2026
Merged

caomengxuan666 merged 2 commits into
masterfrom
fix/3473-tip-compile-closed-field

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

根因

#3473 给 fd_table::FileFd 加了 closed: Cell<bool> 字段(src/executor/fd_table.rs:77-91,#3213 面),全树其它字面量都补了,唯独漏了 src/executor/external_setup.rs 的两处 FileFd { handle, path: ... }:

  • src/executor/external_setup.rs:2727(let handle = crate::fd::into_handle(seeked); 臂)
  • src/executor/external_setup.rs:2769(duplicate_handle_inheritable 臂)

cargo build 因此报两处 error[E0063]: missing field 'closed',尖自 #3473 合入(2026-11-15 13:06 CST)起不可编译。

本 PR

两处各加一行 closed: std::cell::Cell::new(false),,与同一文件另 8 处字面量的写法逐字同形。仅此两行,不动其它;无行为变化(字段构造时即为 false,与其他所有构造点一致)。

本 PR 删除了什么

什么也没删除。仅新增两行字段初始化;无文件、无代码、无测试删除。

验证

  • 修前 cargo check --locked --lib --bins 在尖 0dab80c 上两处 E0063,rc=101(fail-first)。
  • 修后 cargo check --locked --lib --bins 干净,rc=0;cargo build --locked -j1 --bin rubash 成功(2m25s)。
  • varredir 物化 fd 在 shell 自身 /proc/$$/fd 视图不可见(GNU 可见) #3213 钉 stem tests/issue3213_varredir_proc_fd_visibility.rs:7/7 全绿。
  • smoke:--version 正常;exec {v}>f.txt 后 v=10,/proc/7829/fd 含该号且 readlink 指向 f.txt。

UNVERIFIED-BY-CAPTAIN

Refs #3213

…3213)

#3473 added `closed: Cell<bool>` to `fd_table::FileFd`
(fd_table.rs:77-91) and updated every other struct literal in the
tree, but missed the two `FileFd { handle, path: ... }` literals in
`src/executor/external_setup.rs:2727` and `:2769`. `cargo build` on
master therefore failed with two `error[E0063]: missing field
'closed'` errors and the tip has been uncompilable since #3473
merged (2026-11-15 13:06 CST).

This adds `closed: std::cell::Cell::new(false),` at both sites, in
the exact form used by the other eight literals in the same file.
No behaviour change: the field is `false` at construction, matching
every other construction site.

Refs #3213
@caomengxuan666

Copy link
Copy Markdown
Member Author

队长复核 PASS(2026-11-15 14:2x,gh 核 + REPORT 全读)。

修法:external_setup.rs:2727、:2769 两处 FileFd 字面量各补 closed: Cell::new(false),与同文件另 8 处逐字同形,1 文件 +2/−0。根因对:#3473 加字段漏了这两处,尖自 13:06 起编不过。

腿(车道实测,队长核过 REPORT 与 PR diff):

覆盖缺口裁定(不拦合入):两处在 apply_procsub_spawn_plan_fd(procsub spawn-plan fd 恢复臂),#3213 stem 不走这两臂,故无逐点执行证据。裁定:本单为两行机械补字段(初值 false 与全部构造点一致、无行为变化),编译通过 + 同形 + #3213 行为面 7/7 已足;两臂的执行覆盖是 procsub 面的既有测试覆盖问题,不由本编译修复单补钉。

合入轮:基底 0dab80c 落后尖 e527da1 四合(#3166/#3600/#3475/#3589,皆不碰 external_setup.rs/fd_table.rs,零交集已核);合入前 update-branch + 合并形重验(check + #3213 stem + RUSTFLAGS="-D warnings" check)。#3213 仍 OPEN(Refs-only)。

@caomengxuan666
caomengxuan666 marked this pull request as ready for review November 15, 2026 06:38
@caomengxuan666
caomengxuan666 merged commit 2e02e90 into master Nov 15, 2026
8 of 11 checks passed
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