Skip to content

WIP: posix interactive shells load the generated plugin loader (#603) - #617

Merged
caomengxuan666 merged 7 commits into
masterfrom
fix/603-posix-loader
Oct 27, 2026
Merged

caomengxuan666 merged 7 commits into
masterfrom
fix/603-posix-loader

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

Fixes #603

裁定(issue 评论 comment-6438427011)

generated loader 是 niu 自家的产品集成面(启动契约),不是用户文件;posix 模式只管辖用户文件的选择与次序,不管辖产品集成是否加载。posix 交互壳在任何登录态下都不加载 loader 与 #590 已定性的缺陷同类。

本 PR 内容

  • chore(pin):rubash pin 升至 0e9f8d45(开工时 master),根 Cargo.lock 同步(stacker/psm)。
  • fix:run_startup_files 的 posix 分支在 $ENV 之前加载 generated loader,镜像普通分支的相对次序——登录 posix = profile 链之后([P3][startup] 登录交互 shell 连 generated loader 一并跳过,且文档未声明此例外 #590 同位)、$ENV 之前;非登录 posix = 随其 rc(ENV)面同位、$ENV 之前。loader 内 exit 按启动文件纪律在 $ENV 与登录尾之前展开。posix 模式不源任何 rc,双执行守卫传 None(与登录分支同口径);NIU_PLUGIN_LOADER=off 与 validate 门照常生效。
  • 回归钉 tests/issue603_posix_loader.rs:登录/非登录 × posix/普通四格矩阵(ORDER 序列断言生效与次序)+ 登录 posix 的 loader exit 展开钉。
  • docs:advanced-usage.md 启动文件章节 + getting-started.md §7 同步声明 posix 行为。

门与验证口径见簇 REPORT(随交卷补齐)。不自合。

Baseline refresh for the #603 branch. Rolls up the rubash clearance
wave merged since 8fffc99e, including the stacker dependency
rubash#1836 added for the #1801 stack-growth fix; the root Cargo.lock
gains stacker/psm (and their object/ar_archive_writer deps) with this
bump.
…shells (#603)

run_startup_files' posix branch sourced $ENV and returned without
ever loading the generated plugin loader, so posix interactive shells
silently lost every plugin and theme in both login states — the #590
defect class on the one branch #590 could not reach.

Per the product-semantics ruling on #603, the loader is niu's own
activation plane, not a user file: posix mode governs the choice and
order of user files (profile chain, then $ENV), not whether the
product integration loads. The posix branch now loads the loader
before $ENV, mirroring the ordinary branch's relative order — a
login shell has just sourced the profile chain, so the loader lands
after it (the #590 slot) and before $ENV; a non-login shell loads it
at its rc face's seat, before $ENV, so $ENV lines win just as rc
lines do. An exit inside the loader unwinds before $ENV and the
login tail, like any startup file. No rc is sourced in posix mode,
so the double-execution guard gets None, as on the login branch; the
NIU_PLUGIN_LOADER=off switch and the validate gate still apply.

Regression pins (tests/issue603_posix_loader.rs): the four-cell
login/non-login x posix/ordinary matrix asserting loader effect and
order via an ORDER sequence (PLE / LE / PL / LR), plus a login-posix
loader-exit unwind pin.
advanced-usage.md's startup section and getting-started.md's plugin
section now state that POSIX interactive shells load the generated
loader — after the profile chain and before $ENV for login shells,
before $ENV otherwise — with $ENV in the rc's seat.
@caomengxuan666

Copy link
Copy Markdown
Member Author

CI 红归因(与本 PR 的 #603 改动无关,证据如下)

本 PR head 50807f7 的 CI 8 项红中,7 项(build-and-test、各 cross-check / cross-target)死在同一处编译错误:

error: unnecessary parentheses around `match` scrutinee expression
  --> rubash/src/executor/job_builtins.rs:3559:28
error: could not compile `rubash` (lib) due to 1 previous error
  • 出处:rubash commit e766471a(compgen #1798 修复,随 rubash PR #1829 合入 master)的 let status = match (if matches!(...) {...}) 形状——多余括号在 rubash 自家 CI 不设 -D warnings 时只是警告,在 niu CI 的工具链默认 -D warnings 下是硬错误。
  • 本 PR 的 chore(pin) 按简报把 pin 升到开工时 rubash master 0e9f8d45,该形状自 #1829 起就在 master 上,任何升过 #1829 的 pin 都会撞上;[startup][posix] posix 交互壳在任何登录态下都不加载 generated loader(#590 修复旁发现) #603 的改动面(niubash-runtime shell.rs posix 分支 + 钉 + 文档)与此无关。
  • 修复归宿在 rubash 侧(一行去括号,job_builtins.rs:3559),本簇不越界改 rubash 工作树(AGENTS.md 红线)。rubash 侧修复合入后,本分支 pin 需再升一格(或由集成方处理);在此之前 CI 红属已知外因,本地门(无 -D warnings 口径)继续跑,结论写簇 REPORT。

@caomengxuan666

Copy link
Copy Markdown
Member Author

本地门证据(日志在簇 logs/,gates.done 落盘)

构建口径:单槽位、JOBS=1、RUSTFLAGS="-C debuginfo=0"、净化 env。

CI 红的归因见上一条评论(rubash e766471a 的 unused_parens 在 -D warnings 下为硬错误,堵所有升过 rubash#1829 的 pin)——rubash 侧修复合入后本分支 pin 需再升一格,CI 的 lib 全量判定届时补齐。本 PR 保持 draft,待主会话处置。

# Conflicts:
#	scripts/release/rubash-pin.json
Integration of PR #617 onto niubash master d7dcce5 (after #615 landed):
the pin moves from this branch's 0e9f8d45 to current rubash master
252ff19e (through rubash #1850/#1851/#1855/#1857, including the #1855
stacker target-gate that unbreaks the aarch64-unknown-linux-ohos
cross-target check). Root Cargo.lock refresh was performed against the
new pin's tree and verified a no-op (both merged branches had already
refreshed the lock to identical content; the stacker cfg-gate does not
change the lock's dependency representation) -- cargo check --workspace
--locked passes in the build slot.
@caomengxuan666

Copy link
Copy Markdown
Member Author

集成证据(#615 合并后接棒,2026-10-27)

PR #615 合并(master d7dcce57)后本 PR 冲突,集成已落地并推送:

  • 合并 commit 904bbdd:唯一文本冲突 = scripts/release/rubash-pin.json(两边各升一格 pin),解析取本分支较新的 0e9f8d45。自动合并的三个文件逐项核证双边保全:本分支自有 diff 对新 master 的净差与原分支 diff 逐 hunk 全等(shell.rs +19 / docs +10 与 4 行 / issue603 钉 +178);WIP: host signal family — REPL SIGINT discard classification, prompt $? and ^C echo (#610 #611 #600) #615 三面标记计数与 master 逐一全等(repl.rs:warn_unusable_engine_bindings 5、shared_ledger 3;shell.rs:note_exit_code_unwind 3);shell.rs 的 load_generated_plugin_loader 由 master 的 4 处变 5 处,新增的正是 posix 分支在 $ENV 前的单点插入(裁定位)。
  • pin commit a304216(独立 chore(pin)):升至 rubash master 252ff19e(含 #1855 stacker 目标门控)。根 Cargo.lock 刷新已在构建槽内对新 pin 树执行并核为无变更(两边合并分支早已把锁刷新至同一内容;cfg 门控不改变锁的依赖表示),cargo check --workspace --locked rc=0。
  • 本地门(构建槽、JOBS=1、净化 env、日志 + .done 在簇目录 logs/integ-*):build --locked rc=0;issue603 五钉 5/5;startup 族 [P2][startup] generated loader 启动时不经 validate() 即被 source——外来/截断文件照样执行 #586–[P2][startup] ShellInvocation 脚本路由缺 $PATH 查找与二进制拒绝,与直达路由/GNU 分叉 #591 共 27 钉全过零倒退;rustfmt 净、CR=0。
  • GitHub CI(run 40491913488,head a304216):cross-check(macos/ubuntu)、cross-target 全格(含 aarch64-unknown-linux-ohos 转绿——#1855 门控经本 pin 生效)、cross-target-smoke、API ledger 全过。build-and-test 的 lib = 646 过 / 8 败,8 条逐名与已裁定的 runner 环境集全等(7× plugins::sources/sync 的「git must be available / failed to run git」+ 1× shell::tests::execute_line_syncs_cd_before_following_windows_child_command 的 RUNNER~1 8.3 短名),集外零红。

PR 现 MERGEABLE,待主会话合并裁定。

# Conflicts:
#	scripts/release/rubash-pin.json
@caomengxuan666

Copy link
Copy Markdown
Member Author

集成证据·二轮(#618 合并后再次接棒,2026-10-27)

上一条证据(head a304216)后,niu PR #618 合并使 master 再前进至 87a3b70,本 PR 二次冲突,已再次集成并推送:

PR 现 MERGEABLE,待主会话合并裁定。

@caomengxuan666
caomengxuan666 marked this pull request as ready for review October 27, 2026 11:08
@caomengxuan666
caomengxuan666 merged commit 49b391b into master Oct 27, 2026
9 of 10 checks passed
caomengxuan666 added a commit that referenced this pull request Oct 27, 2026
caomengxuan666 added a commit that referenced this pull request Oct 27, 2026
…t statement (pathmatrix ruling (a)) (#619)

* chore(pin): bump rubash pin to ab2372f6 (master through rubash#1855) + refresh root Cargo.lock for stacker

Pin refresh on the namespace-bridge exclusion line (pathmatrix final
ruling 2026-10-27 item (a)). Rolls up the rubash master wave merged
since 8fffc99e; the lock delta is the stacker target gate
(rubash#1855): stacker 0.1.25 + psm + object + ar_archive_writer
enter the root lock.

The lock was bumped BY HAND (pure +42/-0): cargo update -p rubash
re-resolves the subtree and rewires windows-sys refs off 0.61.2,
which the CI comment on this file's workflow warns drops the patched
crate's target-specific windows-sys features (E0432 CreateFileW).
Verified with scripts/release/verify-rubash-pin.py against a clean
ab2372f6 checkout: matches the pin (v1.4.3).

The bridge exclusion itself (rubash PR #1856) lands on rubash master
separately and enters this pin with the next bump after it merges;
niubash CI compiles rubash master HEAD, so CI behaviour follows the
merge without waiting for the release pin lane.

* docs(path-contract): namespace bridges stand outside the translation boundary

windows-path-contract.md, Shell Namespace Ownership: state the
pathmatrix ruling (a) property — wsl and the OpenSSH client family
(ssh/scp/sftp) receive every argument byte-for-byte verbatim (no root
map, no drive-form rewrite, no /dev/null rewrite), because their argv
is interpreted inside another filesystem namespace. Points at the
Rubash pins (is_namespace_bridge_program, pathmatrix_bridge_*).

* chore(pin): bump rubash pin to a268db28 (master through rubash#1856) — integration refresh onto niubash master d7dcce5; root Cargo.lock unchanged (rubash deps identical across ab2372f6..a268db28)

* chore(pin): integration addendum — second merge-up onto niubash master 87a3b70 (after #618); pin unchanged at a268db28

* chore(pin): integration addendum 2 — third merge-up onto niubash master 49b391b (after #617); pin unchanged at a268db28

---------

Co-authored-by: 曹梦轩 <[email protected]>
@caomengxuan666
caomengxuan666 deleted the fix/603-posix-loader branch October 30, 2026 01:42
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.

[startup][posix] posix 交互壳在任何登录态下都不加载 generated loader(#590 修复旁发现)

1 participant