Skip to content

Commit 42eb89e

Browse files
Follow openkal 0.8, and record why the five new interfaces are absent (#11)
* ci: 把引导阶段绑定指名的 glibc 载荷装给它(过渡步骤) `xim:glibc` 的 `latest` 从 `2.44` 移到了 `2.44.2`。载荷目录按请求**解析成**的版本 命名,而 RuntimeBinding 带的是**声明的**版本 —— 而一个已发布的 mcpp vendor 进自己 沙箱的那份 xlings 仍然声明 `2.44`。于是干净机器装出 `2.44.2`,工具链 fixup 要 `2.44`,构建在编译任何东西之前就停住: error: selected RuntimeBinding glibc@2.44 requires payload '.../xpkgs/xim-x-glibc/2.44', but it is not installed ⚠️ 在每一台**新**机器上出现,在任何已存在的机器上都不出现 —— 所以开发机看不见。 索引的 `pkgs/g/glibc.lua` 把这次失败逐字记着,并给出规则: 「The index is DATA and the client is a PROGRAM: the consumer ships first。」 ## ⚠️ 我先试过 bump xlings,撤回了 把 `XLINGS_VERSION` 提到 2026.8.27.1 会让**沙箱里那份** xlings 被换掉 (mcpp 的 `acquire_xlings_binary` 在 pin 前移时更新它),绑定于是**前移**到 `glibc@2.44.2`,而已经装好的是 `2.44` —— 请求比已装的**更新**。那是更糟的一侧: 接受一个更旧的载荷去回答更新的请求,等于静默用上索引明说 「IT IS NOT THE ONE TO INSTALL」的那份(带 mcpp#484 的 preload 缺陷)。 ⇒ 保持 xlings 不动,把缺的那个载荷直接装上。 ⭐ 待 mcpp 2026.8.27.1(mcpp-community/mcpp#515)发布后移除:它接受 「版本精化了请求」的已装载荷,从它引导就不需要这一步。 * Follow openkal 0.8, and record why the five new interfaces are absent This machine provides none of them, and each absence has a reason rather than being an omission: no network for net and datagram, no memory management unit to copy an address space with for space, no second execution context to bound a wait against for timeout, and a console whose settings the firmware does not expose for terminal. Clause 6.1 makes an interface an implementation does not provide absent at the link, so a program requiring one is refused when it is built rather than when it runs. The README states this beside the reasons already recorded for fs, process and task, so that a reader asking why finds the answer where the other answers are. * examples: name openkal the way this repository does mcpp refuses a graph in which one package reaches a dependency by version and another by git: dependency 'mcpplibs.openkal' is requested as both a version dep (by 'hello') and a git dep (by 'mcpplibs.openkal-<this>@path'). Pick one. That is the right refusal --- two forms can name two different trees --- and it means an example inside a repository must follow that repository's own declaration while a change spanning repositories is in flight. The example named a released version while the package beside it followed a branch. * Name the released specification and the released engine openkal 0.8.0 is published and resolvable from the index, so the manifest names it by version rather than by branch --- including the example's, where a branch would hand a reader a reference that moves. The engine pin moves to mcpp 2026.8.27.1 and the repository variable MCPP_SOURCE_REF is cleared, so what this repository tests is the engine a user installs. --------- Co-authored-by: speak-agent <x.d2learn.org@gmail.com>
1 parent 435b578 commit 42eb89e

4 files changed

Lines changed: 84 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
runs-on: ubuntu-24.04
2020
timeout-minutes: 40
2121
env:
22-
MCPP_VERSION: 2026.8.26.2
22+
MCPP_VERSION: 2026.8.27.1
2323
XLINGS_VERSION: v2026.8.17.2
2424
XLINGS_NON_INTERACTIVE: '1'
2525
# The branch of the specification this backend is verified against. It
@@ -78,6 +78,34 @@ jobs:
7878
echo "the index has not caught up yet (attempt $attempt of 6); waiting 60s"
7979
sleep 60
8080
done
81+
# ⚠️⚠️ TRANSITION: GIVE THE BOOTSTRAP THE glibc ITS BINDING NAMES.
82+
#
83+
# `xim:glibc`'s `latest` moved from `2.44` to `2.44.2`. A payload
84+
# directory is named after the version a request RESOLVED to, while a
85+
# RuntimeBinding carries the version that was DECLARED — and the xlings
86+
# a released mcpp vendors into its own sandbox still declares `2.44`.
87+
# So a clean machine installs `2.44.2`, the toolchain fixup asks for
88+
# `2.44`, and the build stops before anything is compiled:
89+
#
90+
# error: selected RuntimeBinding glibc@2.44 requires payload
91+
# '…/xpkgs/xim-x-glibc/2.44', but it is not installed
92+
#
93+
# ⚠️ On every NEW machine and on none that already existed, which is why
94+
# it is invisible from a developer's own. Measured on `main` as readily
95+
# as on any branch — the index records the same failure verbatim in
96+
# `pkgs/g/glibc.lua` and states the rule it broke: "The index is DATA
97+
# and the client is a PROGRAM: the consumer ships first."
98+
#
99+
# ⭐ REMOVE THIS once a released mcpp resolves it. `mcpp 2026.8.27.1`
100+
# accepts an installed payload whose version REFINES the requested one
101+
# (`payload_dir_for_version`), so a bootstrap from it needs nothing
102+
# here. Until then the missing payload is simply installed.
103+
if [ -x "$HOME/.mcpp/registry/bin/xlings" ]; then
104+
XLINGS_HOME="$HOME/.mcpp/registry" XLINGS_NON_INTERACTIVE=1 \
105+
"$HOME/.mcpp/registry/bin/xlings" install glibc@2.44 -y -g \
106+
>/dev/null 2>&1 || true
107+
echo "glibc payloads present: $(ls "$HOME/.mcpp/registry/data/xpkgs/xim-x-glibc" 2>/dev/null | tr '\n' ' ')"
108+
fi
81109
mcpp --version
82110
mcpp self config --mirror GLOBAL
83111
# ⭐⭐ CROSS-VALIDATION: BUILD THE mcpp UNDER REVIEW AND USE THAT ONE.
@@ -246,7 +274,7 @@ jobs:
246274
run:
247275
shell: bash
248276
env:
249-
MCPP_VERSION: 2026.8.26.2
277+
MCPP_VERSION: 2026.8.27.1
250278
XLINGS_VERSION: v2026.8.17.2
251279
XLINGS_NON_INTERACTIVE: '1'
252280
steps:
@@ -307,6 +335,34 @@ jobs:
307335
echo "the index has not caught up yet (attempt $attempt of 6); waiting 60s"
308336
sleep 60
309337
done
338+
# ⚠️⚠️ TRANSITION: GIVE THE BOOTSTRAP THE glibc ITS BINDING NAMES.
339+
#
340+
# `xim:glibc`'s `latest` moved from `2.44` to `2.44.2`. A payload
341+
# directory is named after the version a request RESOLVED to, while a
342+
# RuntimeBinding carries the version that was DECLARED — and the xlings
343+
# a released mcpp vendors into its own sandbox still declares `2.44`.
344+
# So a clean machine installs `2.44.2`, the toolchain fixup asks for
345+
# `2.44`, and the build stops before anything is compiled:
346+
#
347+
# error: selected RuntimeBinding glibc@2.44 requires payload
348+
# '…/xpkgs/xim-x-glibc/2.44', but it is not installed
349+
#
350+
# ⚠️ On every NEW machine and on none that already existed, which is why
351+
# it is invisible from a developer's own. Measured on `main` as readily
352+
# as on any branch — the index records the same failure verbatim in
353+
# `pkgs/g/glibc.lua` and states the rule it broke: "The index is DATA
354+
# and the client is a PROGRAM: the consumer ships first."
355+
#
356+
# ⭐ REMOVE THIS once a released mcpp resolves it. `mcpp 2026.8.27.1`
357+
# accepts an installed payload whose version REFINES the requested one
358+
# (`payload_dir_for_version`), so a bootstrap from it needs nothing
359+
# here. Until then the missing payload is simply installed.
360+
if [ -x "$HOME/.mcpp/registry/bin/xlings" ]; then
361+
XLINGS_HOME="$HOME/.mcpp/registry" XLINGS_NON_INTERACTIVE=1 \
362+
"$HOME/.mcpp/registry/bin/xlings" install glibc@2.44 -y -g \
363+
>/dev/null 2>&1 || true
364+
echo "glibc payloads present: $(ls "$HOME/.mcpp/registry/data/xpkgs/xim-x-glibc" 2>/dev/null | tr '\n' ' ')"
365+
fi
310366
mcpp --version
311367
mcpp self config --mirror GLOBAL
312368
# ⭐⭐ CROSS-VALIDATION: BUILD THE mcpp UNDER REVIEW AND USE THAT ONE.

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,19 @@ scheduler, and clause 6.2 says the remedy for an operation that cannot be
3131
provided is that its absence be expressed by its absence rather than by a
3232
run-time refusal.
3333

34+
The five interfaces version 0.8 adds are absent for the same reason and by the
35+
same rule. This machine has no network, so `net` and `datagram` are not provided.
36+
It has no memory management unit to copy an address space with, so `space` is
37+
not. It has no second execution context to bound a wait against, so `timeout` is
38+
not: an operation here either completes or does not, and a bound upon it would
39+
report an expiry that could never occur. `terminal` is absent because the console
40+
is a serial line whose settings this firmware does not expose; a stream is
41+
reported as interactive and nothing acts upon that fact.
42+
43+
None of the five is a deviation. Clause 6.1 makes an interface an implementation
44+
does not provide absent at the link, so a program requiring one is refused when
45+
it is built rather than when it runs.
46+
3447
⚠️ **`time` used to be on that list, with a reason, and the reason was wrong.**
3548

3649
It read: SBI can arm a timer interrupt, which is a mechanism for a kernel rather

examples/hello/mcpp.toml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,15 @@ runner = ["qemu-system-riscv64", "-machine", "virt", "-nographic",
1313
"-no-reboot", "-bios", "default", "-kernel"]
1414

1515
[dependencies]
16-
openkal = "0.7.0"
16+
# ⚠️ THE FORM MUST MATCH THE ONE THE IMPLEMENTATION USES, not merely the
17+
# version. mcpp refuses a graph in which one package reaches a dependency by
18+
# version and another by git:
19+
#
20+
# dependency 'mcpplibs.openkal' is requested as both a version dep
21+
# (by 'hello') and a git dep (by 'mcpplibs.openkal-opensbi@path').
22+
#
23+
# That is the right refusal --- two forms can name two different trees --- and
24+
# it means an example inside a repository follows that repository's own
25+
# declaration while a change is in flight.
26+
openkal = "0.8.0"
1727
openkal-opensbi = { path = "../.." }

mcpp.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
[package]
1515
namespace = "mcpplibs"
1616
name = "openkal-opensbi"
17-
version = "0.1.5"
17+
version = "0.2.0"
1818
description = "An implementation of openkal on the RISC-V Supervisor Binary Interface, portable across every machine whose firmware provides one"
1919
license = "Apache-2.0"
2020

@@ -33,7 +33,7 @@ repo = "https://github.com/mcpplibs/openkal-opensbi"
3333
# The contract, not an implementation of it. Declaring it turns a version
3434
# mismatch into a resolution-time message rather than a link-time one.
3535
[dependencies]
36-
openkal = "0.7.0"
36+
openkal = "0.8.0"
3737

3838
# ⭐ WHAT RECEIVES CONTROL, WHICH IS A STATEMENT ABOUT THE PROGRAM.
3939
#

0 commit comments

Comments
 (0)