Skip to content

docs: add Platform Support page (status matrix, HarmonyOS, uname behavior) - #225

Merged
caomengxuan666 merged 1 commit into
masterfrom
docs/platform-support
Oct 9, 2026
Merged

caomengxuan666 merged 1 commit into
masterfrom
docs/platform-support

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

背景

这两周平台面扩了两次:musl 进了 cross-target-smoke,HarmonyOS 进了 cross-target-check。但"'哪个平台能用、能用是什么意思'没有一份统一说明——信息散在 docs/release.md、CI 注释和几个 PR 讨论里。

这个 PR 新增 docs/src/platform-support.md,把平台契约收成一份。

内容

1. 状态矩阵

每个平台的 build / smoke-gated / released 三态。新增的两条腿都在里面:

Platform Build Smoke-gated Released
Linux x86_64 (musl) ✅ ✅ cross-target-smoke ⬜
HarmonyOS PC (aarch64-linux-ohos) ✅ ⬜ ⬜

(省去 Windows/macOS/glibc 那几行)

并解释了为什么 musl 能跑完整 smoke,而 ohos 只能 check——静态 musl 二进制能在 glibc runner 上原生跑,HarmonyOS 没有可用运行时。

2. HarmonyOS 为什么便宜

  • rustc --print cfg --target aarch64-unknown-linux-ohos → target_os = "linux"、target_family = "unix"
  • Tier 2 with host tools → check-only 不需要 OpenHarmony SDK
  • 唯一编译阻塞点:rubash 的 libc::__rlimit_resource_t(glibc-only typedef),已由 rubash#449 修掉

3. uname 在鸿蒙上的行为(这是之前挂着的验收项之一)

identity.rs 在 unix 下读 uname(2) 并原样打印 utsname,没有硬编码。所以:

Field OpenHarmony(Linux 内核) HarmonyOS(华为内核)
uname -s Linux 华为内核自己的名字
uname -m aarch64 aarch64

结论:不需要改代码,需要的是把这个行为定义清楚——文档里写明"这是刻意的,诚实来源是内核而不是编译期常量",并附一句"除非有具体消费者需要,否则不要加 HarmonyOS 专用分支"。

4. 鸿蒙 PC vs 鸿蒙手机(另一个验收项)

明确写成两个产品而不是一次移植:

鸿蒙 PC 鸿蒙手机
fork/exec 不限制 受限——普通应用不能直接建进程,需在配置里申明每个进程并在上架时逐进程审核
打包 tarball,与 Linux 腿同形 HAP bundle
分发 直接下载 应用商店审核

依据是华为官方 FAQ faqs-ability-112。因为 Niubash 的 unix 侧是 fork+exec 模型(fd/unix.rs 的 Command::new + pre_exec),所以 PC 是普通移植、手机是另一个项目,且卡在一个我们控制不了的审核环节。

5. Windows-only 边界

列清哪些东西按 cfg 永远不会出现在非 Windows 路径上(winuxcmd / wpm、ConPTY journey、Windows 路径翻译)。

改动面

文件 改动
docs/src/platform-support.md 新增
docs/src/SUMMARY.md +1 行(mdbook create-missing = false,新页面必须登记)

验证

  • SUMMARY.md 的链接加在 Roadmap 之前,与全书顺序一致
  • 文中所有平台事实都来自本次实测(rustc --print cfg、cross-target-smoke 的 CI 通过记录、uname 内建源码)或官方来源(Rust 平台支持表、华为 FAQ),没有推断

…vior)

Niubash now has enough platforms that "which ones work, and what does
'work' mean" needs one page rather than scattered claims. Add
docs/src/platform-support.md:

- a status matrix over every platform: build / smoke-gated / released,
  including the two legs added this week (musl via cross-target-smoke,
  HarmonyOS via cross-target-check)
- what "smoke-gated" means, and why musl can carry the full gate while
  ohos is check-only (no HarmonyOS runtime on GitHub runners)
- HarmonyOS: why the port is cheap (target_os = "linux", target_family =
  "unix", Tier 2 with host tools), and the one blocker found and fixed
  (rubash#449, the glibc-only __rlimit_resource_t typedef)
- HarmonyOS PC vs HarmonyOS phone as two separate products: PC is
  unrestricted, phone restricts fork and needs per-process declaration +
  review (Huawei FAQ faqs-ability-112), and Niubash's unix side is
  fork+exec, so the phone form factor is a project, not a flag
- uname behavior on HarmonyOS: identity.rs reads uname(2) and prints
  utsname verbatim, so sysname is Linux on OpenHarmony and the Huawei
  kernel name on HarmonyOS -- documented as intended, with a note not to
  add a special-case branch
- the Windows-only surface that must not leak onto non-Windows paths

SUMMARY.md: link the new page before Roadmap.
@caomengxuan666
caomengxuan666 merged commit d306960 into master Oct 9, 2026
8 of 9 checks passed
@caomengxuan666
caomengxuan666 deleted the docs/platform-support branch October 10, 2026 01:25
caomengxuan666 added a commit that referenced this pull request Oct 13, 2026
…1.4.0 section (#326)

- The [Unreleased] entries (#284/#287, #293-#304, #313) move into
  [1.4.0]; [Unreleased] is empty again.
- Newly recorded (today's wave): Git Bash compatible factory default
  prompt (#292, headline), WT-form shortcuts (#290/#211), the paste
  burst trailing-Enter fix (#308/#291), self-update SHA256 + release
  pinning (#311/#312), managed-block convergence (#324), completion
  tables/NIU_COMPDEFS/NIU_ENV probe (#305-#307), -s on-demand stdin
  (rubash#586 host half), bash/rbash invocation faces (#321/#322).
- Older gaps recorded: closed-stdout pipe contract (#245/#286), history
  session-end write-back (#265), sh POSIX contract (#262), PWD persona
  alignment (#283), one-shot fast path (#270), --cwd-state (#272),
  --encoded-command (#271), REPL-command highlighting (#281), docs
  passes (#255/#225/#226/#227), MSRV (#267), easter-egg prune (#264).

CHANGELOG-only change; no version claims.
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