feat: require an llvm-family compiler, and name the compiler-runtime layer - #2
Merged
Merged
Conversation
…eeds
这个包编译 729 个对象,其中 **498 个是 compiler-rt 的 builtins**、21 个是
libunwind 的、159 个 libcxx、51 个 libcxxabi。也就是说它最大的一块此前声明在
`mcpp:c++-abi` 名下 —— 而 `__udivti3` 及其同类是一个**纯 C 程序**需要的东西,
与 C++ 无关。
把 builtins 算作 C++ 运行时的一部分,等价于断言 C 程序不需要整数除法。
该断言已经产生过一次实测缺陷:一个交叉到 macOS 的 C 程序被问「有没有 C++
运行时」,答「没有」,链接行因而保留了编译器载荷自带的 libc++,
把一个 Linux 共享对象递给了 Mach-O 链接器。
provides = [..., "mcpp:compiler-runtime=compiler-rt"]
── requires ──────────────────────────────────────────────
libc++ 的源码、尤其它的 std 模块源,由 clang 编译。递给 gcc 的实测结果:
fatal error: __config: No such file or directory
该消息命名一个读者从未打开过的文件,以及一个 mcpp 从未作出的决定。
把需求写在包里,构建工具就能在编译任何东西之前拒绝这个组合,
并且能够指出族名,而不必把这条事实写进构建工具:
requires = ["mcpp:compiler=llvm"]
实测(mcpp 2026.8.24.2):
error: `openkal-llvm-runtime@0.1.1` requires the compiler to be `llvm`.
compiler gcc (16.1.0, payload)
required llvm (required by openkal-llvm-runtime@0.1.1)
Select that compiler — yours outranks mcpp's own default:
mcpp toolchain default llvm
── 兼容性 ────────────────────────────────────────────────
⚠️ 实测:**旧引擎(mcpp 2026.8.24.1)读带 `requires` 的清单构建成功** ——
TOML 侧忽略未知键。因此本次声明不要求使用者先升级。
`hosted-standard-library` 与 `mcpp:c++-abi=libc++` 两条拼写均保留。
engine: mcpp-community/mcpp#494
Sunrisepeak
force-pushed
the
feat/declare-compiler-runtime
branch
from
August 24, 2026 11:18
b3e0cdc to
5773e68
Compare
…layer⚠️ 实测:该层名在 2026.8.24.2 之前的每一个已发布构建工具上都让整份清单 加载失败 —— 不是「该层被忽略」,是这个包用不了: error: dependency 'openkal-llvm-runtime': mcpp.toml: error: `provides = ["mcpp:compiler-runtime=compiler-rt"]` names no capability mcpp knows. 那条拒绝本身已在 mcpp 2026.8.24.2 修掉(依赖的清单里出现未知层名改为警告并 忽略,根工程自己的仍然报错),但**修复不能追溯到已经发布出去的工具**。 本仓 CI 的 MCPP_VERSION 目前是 2026.8.19.4。 `requires = ["mcpp:compiler=llvm"]` 保留 —— 实测旧引擎忽略未知的 [package] 键, 因此这一半今天就能发。声明留在注释里,连同它的依据与解除条件。 engine: mcpp-community/mcpp#494
Sunrisepeak
force-pushed
the
feat/declare-compiler-runtime
branch
2 times, most recently
from
August 24, 2026 11:48
6f3cfee to
18ed0ac
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
这个包编译 729 个对象,其中 498 个是 compiler-rt 的 builtins、21 个 libunwind、159 个 libcxx、51 个 libcxxabi。也就是说它最大的一块此前声明在
mcpp:c++-abi名下 —— 而__udivti3及其同类是一个纯 C 程序需要的东西。provides增加mcpp:compiler-runtime=compiler-rtrequires = ["mcpp:compiler=llvm"]为什么 requires
libc++ 的源码、尤其它的 std 模块源由 clang 编译。递给 gcc 的实测结果是
—— 一个命名了读者从未打开过的文件、且不提任何 mcpp 决定的消息。声明之后:
兼容性
requires的清单构建成功 —— TOML 侧忽略未知键。本次声明不要求使用者先升级。hosted-standard-library与mcpp:c++-abi=libc++两条拼写均保留。Test plan
compiler-runtime compiler-rt (…, graph)engine: mcpp-community/mcpp#494