Skip to content

fix(packaging): ship env.exe in the default edition (Refs #1622) - #1627

Merged
caomengxuan666 merged 2 commits into
mainfrom
fix/1622-default-edition-env-link
Nov 14, 2026
Merged

caomengxuan666 merged 2 commits into
mainfrom
fix/1622-default-edition-env-link

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

根因

niubash #1002:分发的 niugit 捆绑里没有 env.exe,#!/usr/bin/env bash 的
git hook 全部无法 spawn(no 'env' found on PATH)。断点不在 niubash 打包面,
而在 WinuxCmd 默认版的分发清单:

src/core/dispatcher.cppm 的 kFullOnlyCommandNames 把 env 列为 full-only
命令,wpm links rebuild 在默认版跳过它(src/commands/wpm.cpp:728),
link_sweep_names() / retire_edition_links 也按同一清单清理它,所以默认版
永远不产出 usr/bin/env.exe。

这是误归类:其余六个([、test、true、false、kill、time)确为 bash
内建/保留字(test.def:23,105;colon.def:35,44;kill.def:23;parse.y:2374),
而 env 不是内建——bash-5.3 的 builtins/*.def 里没有 $BUILTIN env
(GNU coreutils 的 env 是外部命令;rubash #3451 同样确认 GNU 无 env.def)。

修法

  • src/core/dispatcher.cppm:kFullOnlyCommandNames 7 → 6,删 "env",
    并在 1.2.0 打包:默认版剥离 7 个宿主语义命令名 + full 版分版(正名/wpm 口径定版) #1438 注释里留一行说明(env 不在清单的理由)。command_names()、
    link_sweep_names()、retire_edition_links 都读这一份清单,无需他改。
  • 回归钉 tests/unit/wpm/wpm_unit_test.cpp:
    wpm_links_rebuild_creates_env_hardlink_in_default_edition——默认版
    wpm links rebuild 后 usr/bin/env.exe 存在且与 winuxcmd.exe 同 inode,
    其余六个 full-only 链接仍不存在。

验收

本 PR 删除了什么

  • 无产品代码删除。仅从 kFullOnlyCommandNames 删 "env" 一个条目;
    retire_edition_links 不再清理既有安装里的 env.exe(该链接从此为
    默认版正常产物)。

UNVERIFIED-BY-CAPTAIN

  • 队长复核未完成;本 PR 为草稿,勿合入。

@caomengxuan666

Copy link
Copy Markdown
Member Author

队长复核:PASS(可合入)

头 16c653f(2 提交:17c1e0e7 修法 + 16c653f 注释-only),基底 68d2917 = live tip,交集 ∅。

已核实(队长一手核过腿日志与 CI):

  • 只读面:单清单机制 census-clean(command_names / link_sweep_names / retire_edition_links 同读 kFullOnlyCommandNames);GNU 锚点:bash-5.3 builtins/ 无 env.def。
  • L7 基底 fail-first(X299):新钉 overlay 到基底树 0/1,exit 1,断言 wpm_unit_test.cpp:574–575(env.exe 不存在)——符合预期。
  • 头(X299):新钉 1/1,exit 0;全套 wpm.* 89/89,exit 0;双边构建 RC=0,tarball sha256 两端一致。
  • 新头 CI 全绿:run 43563419594 + 43563419609,11 pass + 4 skipping(均为 PR 常态 skipping),零红;x64 default(含 ctest)28m23s pass。

合入注记:正文 UNVERIFIED-BY-CAPTAIN 一节作废,合入体按 #3524 前例换已核实腿结果(PR 正文不改);Refs #1622,合入后由队长手动关闭 #1622;与 #1628 零共享文件,可任意顺序合入。N1(非阻塞):新钉无 edition guard,若 ctest 日后在 full-edition job 开启,六个 EXPECT_FALSE 按设计失败——合入后另记一笔。

@caomengxuan666
caomengxuan666 marked this pull request as ready for review November 14, 2026 06:45
@caomengxuan666
caomengxuan666 merged commit 7a15855 into main Nov 14, 2026
15 checks passed
caomengxuan666 added a commit that referenced this pull request Nov 14, 2026
…historical snapshot (#1629)

The checkpoint section records the acceptance state as audited by the
lead review: current main had 50 commands wired (not the historical
76/42 numbers), A1/tail/ABI-v3 are not accepted yet, I18N is an
acceptance prerequisite, and the safety record for preserve-root
(chmod/chgrp/chown) blocks wiring until the listed gates pass.

Captain addendum records same-day movement: #1627 merged, PRs
#1624/#1625/#1626/#1628 open, and the fix/batch-1595-1616-1617 trio.
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