Skip to content

0.17.0 --- what this library does not supply is declared, and the declaration is asserted - #39

Merged
Sunrisepeak merged 7 commits into
mainfrom
absences-are-declared-and-asserted
Sep 20, 2026
Merged

Sunrisepeak merged 7 commits into
mainfrom
absences-are-declared-and-asserted

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

README 从这个移植开始就带着一张"缺席的设施"表,而没有任何东西在执行那段散文。它已经被推翻过一次:0.16.0 之前 SIG_IGN 对每个信号都被接受却一个都没安装,于是一个请求"不要被中断键结束"的程序被告知成功、然后被中断键结束。

改动

[c-abi.absent] 陈述每一项设施,以及它的缺席以什么形状到达程序:

form 含义
link 定义不在归档里,链接点名它。这是 openkal 能力模型对实现要求的形状(SPEC 0.14 §6.1 把运行期报告不支持称为缺陷)
enosys 定义存在,并报告它不能执行
accepted-no-effect 调用成功,而它被要求做的事有一部分没有做——正是 0.16.0 修掉的那个缺陷的形状

这个库供给的名字集合在这里不可枚举(POSIX 约一千二百个),枚举它正是 clause 3.3 记录下撤回的那个错误。例外是可枚举的,本次列了 21 项。

判据

tools/check-absent.sh 按每一行自己声明的方向对产物断言:link 的名字不得被定义,enosys 的名字必须被定义。

两个方向都查,因为只查 link 那一半的脚本,对一张把每一行都悄悄改成 enosys 的表同样通过——而那正是最要紧的那种改动。

CI 里那份手写的 withheld 清单被这个脚本取代:清单和清单文件是同一个事实的两份副本,而副本会在只编辑其中一份的那一刻起失效。该步骤还会翻转一行并要求脚本拒绝它——一个不会失败的检查什么都没断言

本机实测:

$ bash tools/check-absent.sh mcpp.toml target/*/*/obj/*.o
every [c-abi.absent] row agrees with the archive: 21 row(s)

$ # 把 mprotect 从 enosys 改成 link
mprotect is declared absent at the link and IS defined in the archive   rc=1
$ # 把 epoll_create 从 link 改成 enosys
epoll_create is declared to report its refusal and is NOT defined in the archive   rc=1

发布顺序(不可交换)

需要 mcpp 2026.9.20.1。 不认识某个键的引擎会拒绝整份清单而不是忽略该键,因此这个版本不能在索引 floor 抬起之前登记:

mcpp 2026.9.20.1 发布 → index.toml 抬 min_mcpp → 本版本登记

顺序颠倒会让每个低于 floor 的客户端完全加载不了这个包,那比没有这张表更坏。

Sunrisepeak and others added 2 commits September 20, 2026 18:40
…laration is asserted

README has carried a table of absent facilities since this port began, and
nothing executed it. It was contradicted once already: before 0.16.0 `SIG_IGN`
was accepted for every signal and installed for none, so a program that asked
not to be ended by the interrupt keystroke was told it had succeeded and was
ended by it.

`[c-abi.absent]` states each facility and the SHAPE in which its absence
reaches a program:

  link                 the definition is not in the archive; the link names it.
                       This is the shape openkal's capability model requires of
                       an implementation (SPEC 0.14 clause 6.1, which calls a
                       run-time report of unsupportedness a defect).
  enosys               the definition exists and reports that it cannot act.
  accepted-no-effect   the call succeeds and part of what it asked for is not
                       done --- the shape of the defect 0.16.0 repaired, named
                       so that "how many of these are there" has an answer.

The set of names this library DOES supply is not enumerable here: POSIX has
about twelve hundred, and enumerating it is the mistake clause 3.3 records
withdrawing. The exceptions are enumerable, and twenty-one of them are listed.

`tools/check-absent.sh` asserts every row against the objects this package
builds, in the direction that row states: a `link` name that is defined, or an
`enosys` name that is not, fails. Both directions are checked, because a
script that verified only the `link` rows would pass against a table that had
quietly moved every row to `enosys` --- the change that would matter most.

CI's hand-written withheld list is replaced by that script. The list and the
manifest were two copies of one fact, and a copy goes stale the first time
only one of them is edited. The step also flips one row and requires the
script to reject it, because a check that cannot fail asserts nothing.

REQUIRES mcpp 2026.9.20.1. An engine that does not know a key refuses the
whole manifest rather than ignoring it, so this version cannot be registered
before the index floor has moved.

Co-authored-by: Claude Code <noreply@anthropic.com>
…sured before the release

[c-abi.absent] needs an engine that knows the key. MCPP_SOURCE_REF exists for
exactly this, and the line is removed before this pull request merges --- the
final state is MCPP_VERSION at 2026.9.20.1 and this back to the repository
variable.

Co-authored-by: Claude Code <noreply@anthropic.com>
@Sunrisepeak

Copy link
Copy Markdown
Member Author

补充核验:Windows 目标上同样成立。

CI 的断言只跑在 Linux 原生行(这个 workflow 的矩阵三行都是 target: '')。手工交叉核验一次:

$ mcpp build --target x86_64-windows-gnu --toolchain llvm@22.1.8
$ NM=llvm-nm bash tools/check-absent.sh mcpp.toml $(find target -name '*.o')
every [c-abi.absent] row agrees with the archive: 21 row(s)

被排除的五个源文件(epoll / timerfd / eventfd / signalfd / inotify)是无条件排除的,所以这一点按构造在每个目标上都一样——这次核验的是「按构造」这句话本身。

Sunrisepeak and others added 5 commits September 20, 2026 19:43
sigaction, chmod and fchmodat are listed as `enosys`: each reports its refusal
for the inputs the README names, and the check asserts each is defined, which
is what `enosys` claims about the artefact.

"A mode given at creation" has no entry. It is about an argument of `open` and
`mkdir`, not about those calls --- they do what they are for and the mode is
what is not applied --- so an entry keyed on `open` would say the call is
absent, which is false and worse than no entry. The manifest keys on names, so
a facility narrower than a name stays in the README until the schema can say
it. Written down in both places rather than rounded off.

24 rows agree with the archive.

Co-authored-by: Claude Code <noreply@anthropic.com>
openkal-linux is 0.15.0 and openkal-windows is 0.10.0 since each began stating
which interfaces it provides. CI builds this package against the working trees
of those repositories and refuses a pin that names a different version, which
is the guard that caught this: 'Nothing is wrong with either; they are not in
step.'

Co-authored-by: Claude Code <noreply@anthropic.com>
`fork` is composed here from `openkal.space`, and the reference to it is weak:
a backend that provides the interface gets a working `fork`, one that does not
gets `ENOSYS`. openkal-linux provides it; openkal-windows declines it, and its
README gives the reason --- constructing the copy out of `CreateProcessW`
would be present, would look like the operation, and would not produce a copy
of the caller, which is the simulation clause 3.1 forbids.

Every row of `[c-abi.absent]` is unconditional, so `fork` written as `enosys`
would be false on Linux and omitting it is silent on Windows. Silence is the
lesser of the two and the row returns when the schema carries `targets`.
Written down beside the one already there, because a table that answered
either by rounding it off would be a table nobody could assert against --- the
state this one exists to leave.

Co-authored-by: Claude Code <noreply@anthropic.com>
…ex floor

mcpp ignores a top-level table it does not know and refuses an unknown MEMBER
of a table it does know. Written as `[c-abi].absent`, this file made every mcpp
below 2026.9.20.1 refuse the WHOLE manifest on every target -- measured against
the published 2026.9.18.3 archive on exactly this file, not reasoned about.

Everything the table does is diagnostic, so an engine that ignores it reports
the same raw link error it reports today. An engine that refused it would have
taken this package away entirely and forced `index.toml` to raise `min_mcpp`,
costing every client below that floor the whole index for a note they merely
would not receive.

The consequence for this release: 0.17.0 may be registered as soon as it is
tagged, with no floor move ahead of it. The comment above the table records
that, in place of the release-ordering it previously described.

tools/check-absent.sh reads the new spelling and still finds all 24 rows.
…sts on

The branch built mcpp from its own pull-request branch, because the first
spelling of the absence table was `[c-abi].absent` and that genuinely needed
an unreleased engine: nested, every older mcpp refused the whole manifest.

Top-level, it does not. The temporary MCPP_SOURCE_REF override is gone and
the engine pin stays at 2026.9.18.3 -- the release that predates the table --
because building green against it is the end-to-end evidence for what the
table's own comment claims: a client below 2026.9.20.1 keeps this package and
loses only the note. tools/check-absent.sh asserts the rows against the
OBJECTS and reads the manifest itself, so it needs nothing from the engine.

0.17.0 can therefore be tagged without waiting for mcpp 2026.9.20.1.
@Sunrisepeak
Sunrisepeak merged commit 43427c8 into main Sep 20, 2026
5 checks passed
@Sunrisepeak
Sunrisepeak deleted the absences-are-declared-and-asserted branch September 20, 2026 13:05
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