Skip to content

WIP: fix8/nvm-alias — #1703 function-call stdin inheritance + #1704 respawn text fidelity - #1810

Merged
caomengxuan666 merged 3 commits into
masterfrom
fix8/nvm-alias
Oct 27, 2026
Merged

caomengxuan666 merged 3 commits into
masterfrom
fix8/nvm-alias

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

WIP: nvm-alias 簇交付(#1703 / #1704),两 commit、逐单对应。

Fixes #1703
Fixes #1704

基线声明:本分支基线为 2157a3af(master 现为 41fdf7a2);rebase / 集成由主会话另行处置,本 PR 保持 draft。

#1703(commit 96a9d64)

function_call_stdin(src/executor/function_calls.rs):

  • 无自有重定向的函数调用在 fd 0 为活 File 端点(复合命令 < file 绑定)时直接继承该描述符,不再快照(GNU execute_function execute_cmd.c:5181/:5395;do_redirections redir.c:854 RX_UNDOABLE)。
  • 调用带自有 heredoc/here-string 时:若 fd 0 端点(非空 File / Text / ProcessSubstitution / CoprocStdout)会遮蔽 FUNCTION_STDIN 镜像,改为把 body 以 Text 端点绑定到 fd 0(FunctionCallStdinBinding,返回时恢复原端点及共享游标)——否则 body 的 read 会读到调用方流而非 heredoc。守卫的「自有 body」判据与消费者 stdin_string_for_command_mut 的咨询集对齐(fd-0 winner + 旧字段 + heredoc_redirects)。

#1704(commit 6489343)

respawn 文本保真:print_comsub 管道连接符(print_cmd.c:249-272)、bash_command_text 赋值 raw 形(print_cmd.c:578-586)、case 主词/模式 raw 形(print_cmd.c:750/782)。

验证(本视图真构建,二进制 mtime 2026-10-26 23:15 UTC、md5 a7ee5bc4100a97211943537b3bcd0550)

已知残差(不在本 PR 范围)

ecosuite lifecycle 链 rc=1(止于 STEP 6,别名解析写空)/ variants rc=1(STEP 3)——存量分歧、本簇修复前已同形红,主会话已另行立案。

@caomengxuan666

Copy link
Copy Markdown
Member Author

集成证据(主会话集成线):已合入 master 6290f08,四门在合并树全绿

合并点:merge commit f82549f0(普通 merge,未 rebase、未 force push),远端 head 经 gh api 核实 = f82549f051432afcda7cd8141b3df40dee9a91e8,PR 现 MERGEABLE。保持 draft,待主会话合并。

冲突处置(2 处,均在 #1704 文件;#1703 的 function_calls.rs 自动合入无冲突)

  1. src/executor/print_comsub.rs——纯注释冲突:两边代码同为 cprintf(" | ")([bug] Background job re-serializes functions dropping pipes inside $(...): silent wrong output or bogus syntax error near '(' (follow-up to #202) #1664 与 [ecosuite] nvm alias paths break in full nvm.sh context: empty alias file, empty global-package list, call-time parse errors #1704 对同一根因的同形修复)。解法:保留代码,注释合并两条出处(print_cmd.c:249-272 + [ecosuite] nvm alias paths break in full nvm.sh context: empty alias file, empty global-package list, call-time parse errors #1704/[bug] Background job re-serializes functions dropping pipes inside $(...): silent wrong output or bogus syntax error near '(' (follow-up to #202) #1664 双引)。
  2. src/executor/command_text.rs 的 bash_command_text 赋值段——真冲突:两边同为「优先 raw RHS、回退 cooked 值(剥 IFS_GLUE)」。解法取 master [bug] Background job re-serializes functions dropping pipes inside $(...): silent wrong output or bogus syntax error near '(' (follow-up to #202) #1664 版为体:它多了 raws_aligned 对齐守卫(raws 与 assignments 等长才信 raw,合成赋值不带 raw 时不会错位读到别人的 raw——本线无守卫版在此形状上有潜在错位读),本线 [ecosuite] nvm alias paths break in full nvm.sh context: empty alias file, empty global-package list, call-time parse errors #1704 的语义(引号原样保留、多行引号值/comsub 不丢引号)在对齐的常态路径上逐字保留,注释补记 [ecosuite] nvm alias paths break in full nvm.sh context: empty alias file, empty global-package list, call-time parse errors #1704 出处与守卫理由。本线在同文件的另一段(case 主题词/模式 raw 形,[ecosuite] nvm alias paths break in full nvm.sh context: empty alias file, empty global-package list, call-time parse errors #1704)master 未触、自动合入无损。
  3. function_calls.rs 相邻面自查:vs 本线 HEAD 仅多 master [bug] BASH_SOURCE[0] inside a function reports the caller source, not the definition file (duplicates slot 1; shows "bash"/$0 under -c) #1587 的 BASH_SOURCE 定义点改动(call-frame 区),与 [ecosuite] while read loop: calling a function in the body swallows the loop's remaining redirected input #1703 的 function_call_stdin 段(文件尾部)零交叠;vs master 仅剩 [ecosuite] while read loop: calling a function in the body swallows the loop's remaining redirected input #1703 本段。ms-stopbleed 的 session/cwd 锚定面(path.rs/ast_exec.rs/glob.rs)全部自动合入。

四门数字(合并树真构建,二进制 mtime 2026-10-27 01:10 UTC、34,382,848 B;日志 integ-gate.log + .done 标记在簇目录)

过程如实:首轮门在槽位排队约 1.5h 后被运行时重启杀于队列(零执行、无 .done、不计),重启后立即重提、约 5 分钟获槽跑出上列数字。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant