# WinuxCmd v2.0.0 — Release Notes (draft) > **Draft for the 2.0 freeze (2026-11-14).** Publish at the tag, not before. > Before publishing: re-run `bash rust2/gate/run-gate.sh`, refresh > `DOCS/2.0-inventory.tsv`, freeze the assets, and fill the artifact names > and SHA-256 values. See `DOCS/2.0-MASTER-PLAN.md` §5.S. --- ## English **WinuxCmd 2.0 moves the command core from C++ to a library-form Rust implementation — same 176 commands, same Windows-native multicall binary, same help surface — with GNU behavior as the contract.** There is no new runtime to install: the Rust code is a static library folded into `winuxcmd.exe` by the same link. One image, one CRT, no DLL boundary. ### What changed - **50 applets are now Rust** (the list is `WINUXCMD_RUST2_COMMANDS` in `CMakeLists.txt`; the per-command state is `DOCS/2.0-inventory.tsv`). 32 more have a green differential gate and are queued for the 2.0.x wiring waves. Commands still on the 1.x core behave exactly as in 1.2.1. - **Commands are library functions**: injected stdin/stdout/stderr, explicit cwd and environment, no process-global mutable state, and a returned status instead of `exit()`. A panicking command becomes status 125 at the ABI boundary; it never unwinds into the dispatcher. - **Streaming stdin (ABI v2)**: incremental input through a pull callback, with GNU's 124 for a host-stopped read. No whole-buffer copy at the ABI layer. - **`winux-regex`**: a std-only BRE/ERE engine with backreferences and POSIX leftmost-longest. `grep -P` keeps its existing pinned PCRE2 face; Perl syntax is not reimplemented. - **I18N foundation**: stable message keys, English fallbacks in source, and translations injected per invocation from the separately published catalog (`WINUX_LANG`). English-only builds are the default. ### Behavior changes you may notice Read **[DOCS/2.0-MIGRATION.md](2.0-MIGRATION.md)** before upgrading scripts. The short list: - **Retired 1.x extensions** (GNU has no such option, or treats it as data): `echo -u/--upper`, `echo -r/--repeat`, `fold -c`, `fmt -m/-P/-x/-X/-T`, `numfmt --unit-separator/-M/-l` and the `Z/Y/R/Q` suffixes as 1.x accepted them. Each has a GNU citation in the migration guide §3. - **Corrected 1.x deviations**: `ln -s` no longer absolutizes the target and creates real symlinks where the OS allows; `stat -c %C` returns 0; `rmdir -p` drops the trailing slash; `touch` accepts the space-separated `-d` form and rejects the 1.x `-t .99` stamp; digest/`rev` operands are literal; `expand`/`unexpand` accept `-4,8`; `false --help` keeps status 1. - **`sort`** is a GNU `sort.c` port and is markedly faster (12x plain on the 64 MiB NTFS benchmark vs the 1.x C++ sort); `-R` is deterministic. - **Platform subsets are unchanged and documented**: NTFS mode bits, POSIX ownership, SELinux, FIFOs, and symlink privileges (migration guide §6). - **Open file-operation gaps** (#1639–#1657) are 1.x bugs tracked for the Rust rewrites, not 2.0 regressions. ### Verification - Three-way differential gate: Rust product vs GNU oracle (WSL coreutils 9.4 / findutils 4.9.0 / util-linux 2.39.3 / Debian hostname 3.23) vs the 1.x exe. Case tables are generated (`rust2/gate/gen-cases.py`); every row is `strict`, `exit`, `win` or `note`, and every `note` has a registry entry. Results and the per-wave ledger narrative: `rust2/GATE-REPORT.md`. - Command wiring passes three gates: GNU oracle byte equality, the full ctest failure set unchanged from the pre-wiring baseline, and an old-vs-new exe byte matrix with every divergence explained. - Windows subsets are gated as `win`/`exit` rows against the 1.x value model; they are recorded, not silently skipped. ### Artifacts and integrity Assets are frozen at publication and will not be replaced in place. Download from this release only, and verify against `SHA256SUMS`. | asset | contents | |---|---| | `WinuxCmd--x64-setup.exe` | Inno Setup installer (x64), default edition | | `WinuxCmd--arm64-setup.exe` | Inno Setup installer (ARM64), default edition | | `WinuxCmd--win-x64.zip` | portable x64 tree | | `WinuxCmd--win-arm64.zip` | portable ARM64 tree | | `WinuxCmd--win--full.*` | full edition, standalone only (not wpm-indexed) | | `SHA256SUMS` | SHA-256 of every published asset | The default edition is the wpm-indexed artifact. The full edition adds entry links for the shell-builtin shadow names (`[`, `env`, `false`, `kill`, `test`, `time`, `true`); the commands themselves exist in both editions. ### Licenses and source WinuxCmd is MIT (`LICENSE`). PCRE2 remains a statically linked, pinned native dependency (pcre2-10.47, SHA-256 pinned in `CMakeLists.txt`); its license text ships with the source tree and the PCRE2 project is at . GNU coreutils/findutils/util-linux are behavioral references, not bundled code. --- ## 中文 **WinuxCmd 2.0 把命令核心从 C++ 主体换成库形态的 Rust 实现:命令集仍是 176 个,仍是同一个 Windows 原生 multicall 可执行文件,`--help` 品牌文案 不变,行为契约以 GNU 为准。** 不需要安装任何新运行时:Rust 代码是静态库,和 `winuxcmd.exe` 在同一次 链接里合成一个镜像、一套 CRT,没有 DLL 边界。 ### 变化 - **50 个 applet 已换成 Rust**(名单见 `CMakeLists.txt` 的 `WINUXCMD_RUST2_COMMANDS`,逐命令状态见 `DOCS/2.0-inventory.tsv`)。 另有 32 个库已就绪、差分门全绿,排在 2.0.x 的接线波次;仍在 1.x 核心上 的命令行为与 1.2.1 完全一致。 - **命令即库函数**:stdin/stdout/stderr 显式注入,cwd 与环境显式传入, 无进程级可变全局状态,返回状态码而不是 `exit()`。命令 panic 在 ABI 边界转成状态 125,不会把栈展开进调度器。 - **流式 stdin(ABI v2)**:拉取式回调按需读入;宿主停止喂入映射为 GNU 的 124。ABI 层不再整块复制 stdin。 - **`winux-regex`**:std-only 的 BRE/ERE 引擎,支持反引用与 POSIX leftmost-longest。`grep -P` 保留既有 PCRE2 面,不重写 Perl 语法。 - **I18N 基础**:消息稳定 key + 源码英文 fallback,译文按调用从独立发布的 catalog 注入(`WINUX_LANG`);默认英文构建。 ### 可能注意到的行为变化 升级脚本前请读 **[DOCS/2.0-MIGRATION.md](2.0-MIGRATION.md)**。要点: - **1.x 私有扩展退役**(GNU 没有该选项,或把它当数据): `echo -u/--upper`、`echo -r/--repeat`、`fold -c`、 `fmt -m/-P/-x/-X/-T`、`numfmt --unit-separator/-M/-l` 以及 1.x 接受的 `Z/Y/R/Q` 后缀。每条 GNU 依据见迁移指南 §3。 - **修正 1.x 偏差**:`ln -s` 不再把链接目标绝对化,并在系统允许时创建真 符号链接;`stat -c %C` 返回 0;`rmdir -p` 不再带尾斜杠;`touch` 接受 空格分隔的 `-d` 形式、拒绝 1.x 的 `-t .99`;digest/`rev` 操作数按字面 处理;`expand`/`unexpand` 接受 `-4,8`;`false --help` 保持状态 1。 - **`sort`** 是 GNU `sort.c` 移植,明显更快(64 MiB NTFS 基准为 1.x C++ 的 12 倍,纯排序);`-R` 为确定性顺序。 - **平台子集不变且有文档**:NTFS 权限位、POSIX 属主、SELinux、FIFO、 符号链接特权(迁移指南 §6)。 - **未关闭的文件操作差异**(#1639–#1657)是 1.x 遗留 bug,按 Rust 重写 跟踪,不是 2.0 回归。 ### 验证 - 三方差分门:Rust 产品 / GNU oracle(WSL coreutils 9.4、findutils 4.9.0、 util-linux 2.39.3、Debian hostname 3.23)/ 1.x 旧 exe。用例表由 `rust2/gate/gen-cases.py` 生成,每行分类为 `strict`/`exit`/`win`/`note`, `note` 必须在 `note-registry.tsv` 有登记。结果与逐波记录见 `rust2/GATE-REPORT.md`。 - 每个命令的三重门:GNU oracle 逐字节、ctest 失败集与接线前基线一致、 新旧 exe 逐字节矩阵且每条差异有说明。 - Windows 子集以 `win`/`exit` 行对 1.x 值模型设门,记录在案而不是静默 跳过。 ### 产物与完整性 发布资产定版后不原地替换;只从本 Release 下载,并按 `SHA256SUMS` 校验。 资产表同英文部分。 默认版是 wpm 索引的产物;full 版额外物化 shell 内建同名命令的入口链接 (`[`、`env`、`false`、`kill`、`test`、`time`、`true`),命令本体两版 都有。 ### 许可证与源码 WinuxCmd 为 MIT(`LICENSE`)。PCRE2 仍是静态链接、钉死版本的既有原生 依赖(pcre2-10.47,SHA-256 见 `CMakeLists.txt`),许可证文本随源码树 分发,项目主页 。GNU coreutils/findutils/ util-linux 仅作行为参照,不随包分发其代码。