Repository navigation
fix(builtins): typeset listing hides unmaterialized BASH_ARGV0 and renders GROUPS from its cell (Refs #3026) - #3702
caomengxuan666 wants to merge 1 commit into
Conversation
…nders GROUPS from its cell (Refs #3026) Root cause: listings must render the stored cell; a by-name read binds (materializes) it. GNU (variables.c:1850/1886/1637/1175-1189, 1096-1104): BASH_ARGV0 is a dynamic scalar with a NULL value cell until find_variable binds it; GROUPS is an empty array until get_groupset fills it; the enumeration (print_var_list, variables.c:1066) never fires the getter. #2997 fixed the pristine faces but left the materialization chain broken: - GROUPS: the declare-form view called the free groups_words() without setting groups_materialized, so a named read did not stick into later listings; now the method self.groups_words() is used. - BASH_ARGV0: dynamic_parameter_value explicitly did not cache it, and the listing hid it with a static invisible mark forever; now a by-name read caches the live value as the cell, the set-form listing renders it once materialized, and the declare-form renders it valued (bare while the cell is NULL). Nails: tests/issue3026_typeset_listing_argv0_groups.rs - 2 new tests (declare -p listing shows materialized values after named reads; expansion read materializes BASH_ARGV0 into later listings) on top of the 3 pre-existing nails from #3169. UNVERIFIED-BY-CAPTAIN: no build slot available (Simular box wallet empty; X299/old-server routes transit the box). No test leg has run; CI on the draft PR is the only compile signal.
|
【WIN-AGENT-AUDIT】PR #3702 第1轮 — 建议:PENDING(CONFLICTING/DIRTY,且已被 #3708 取代;内容腿全绿) head: a13bc85 base(merge-base): e81a1af 文件: 4 个 +148/-22 重复实现:master 已含 机制核查:
腿(逐项):
F 点:无(语义面)。 阻塞项(不合并的原因):
续作记录:无(未改代码;PENDING 不合不关)。 |
|
【WIN-AGENT-AUDIT】PR #3702 第2轮 — 建议:PENDING(superseded;建议 owner 关闭本 PR) T 波处置(收尾波,分工 t4):
未跑/VOID 的腿:本轮未重跑(重复实现处置优先)。 |
|
【WIN-AGENT-AUDIT】 head: a13bc85(未变) 本轮复核(Z 波,收网第四轮):
未跑/VOID 的腿:本轮未重跑(重复实现处置优先;前轮腿结论存档见第 1/2 轮评论)。 |
|
【WIN-AGENT-AUDIT】superseded 建议关闭 f3 车道复核(2026-11-17 19:5x +08,master a41909d):
建议:owner 关闭本 PR,不返工。若需保留钉面(本 PR 比 #3708 多 expansion 读 / declare -p listing 2 格),请单独提钉 PR。 |
根因
列表应渲染存储 cell,按名读才物化 cell。GNU(variables.c):BASH_ARGV0 是 value cell 为 NULL 的动态标量(variables.c:1850),只有 find_variable(variables.c:1175-1189)按名查找才调 get_bash_argv0 把值绑进 cell;GROUPS 是空数组,直到 get_groupset(variables.c:1637-1655)被查找时填入元素;枚举 print_var_list(variables.c:1066)从不触发 getter;var_isset==0 的变量不打印(variables.c:1096-1104),空数组印
GROUPS=()(arrayfunc.c:1239)。#2997 修了 pristine 面,但物化链是断的:
groups_words(),只渲染、不置groups_materialized,于是declare -p GROUPS后随后的typeset仍印GROUPS=()(GNU 印([0]=\"0\"))。dynamic_parameter_value明确不缓存它,列表用静态 invisible 标记永远隐藏——按名读/展开读后 GNU 显示值,rubash 仍不显示。另正名:BASH_ARGV0 在 GNU 里没有 att_invisible(variables.c 全文无对其 VSETATTR)。#2997 的静态标记模型在 pristine 态与 GNU 等价,物化后是错的。
GNU 锚点
INIT_DYNAMIC_VAR("BASH_ARGV0", NULL, get_bash_argv0, assign_bash_argv0)init_dynamic_array_var("GROUPS", get_groupset, ...)())改动
src/executor/dynamic_arrays.rs:dynamic_parameter_value缓存 BASH_ARGV0 的 live 值作 cell(存在=已物化;表值仍是 live $0 载体);declare-form GROUPS 臂改调self.groups_words()(置 groups_materialized);dynamic_set_views物化后追加 BASH_ARGV0 标量供应;dynamic_cell_view的 provider 标量表加入 BASH_ARGV0(物化后渲染值,未物化渲染裸名)。src/builtins/set.rs:DynamicSetView增加scalar位;print_shell_variables按位渲染标量/数组,供应名字豁免 invisible 跳过。src/executor/declare_local.rs:listing 构造的标量块加入 BASH_ARGV0。tests/issue3026_typeset_listing_argv0_groups.rs:新增 2 钉(命名读后 declare -p 列表显示物化值;展开读物化 BASH_ARGV0 进随后列表),既有 3 钉不动。本 PR 删除了什么
dynamic_parameter_value旧注释中“table-backed BASH_ARGV0 不缓存”的排除口径(该模型是本单根因之一)。groups_words()的调用(改调置位的方法self.groups_words())。验证
UNVERIFIED-BY-CAPTAIN。 构建槽全断:Simular box 冬眠且钱包为空(box_ensure:top up at https://box.simular.ai/billing,需用户充值);老服务器与 X299 路由均经 box,故同断;本 VM 按规矩不本地构建。以下腿全部欠账,待槽恢复后补跑:钉 stem(5 钉,含 fail-first 复核)、全量 lib 与 base 逐数对齐、邻域 stem(#2973/#2700/#1046)、
RUSTFLAGS="-D warnings" cargo check --locked --lib --bins、hygiene。已做的非构建核查:cargo fmt --check4 文件 rc=0;probe-battery 三轮 ALL PASS(15:37/16:04/16:12 UTC)。CI 绿不等于钉绿(ci.yml nextest 表无新钉 stem),仅作编译信号。已知残差(另单处理):source 内物化、算术 resolve() 路径、COMP_WORDBREAKS 同机制未覆盖、
declare BASH_ARGV0=<值>绑定前物化、unset 后重绑 invisible 残留。详见工作区 REPORT(不入仓)。Refs #3026