Skip to content

Commit 4155e4a

Browse files
committed
feat(toolchain): aarch64 Linux supports musl-gcc, and the rest is deferred in the open
`available_toolchain_indexes()` branched per OS and never per architecture, so an aarch64 Linux host was told llvm could be installed. Measured against the index and upstream on 2026-08-26: xlings-res/llvm 20.1.7 / 22.1.8 no linux-aarch64 asset llvm/llvm-project 20.1.7, 21.1.0 no linux-aarch64 asset llvm/llvm-project 19.1.7 has one, too old for `import std` so `mcpp toolchain install llvm 22.1.8` there is a 404 the list promised would work. `mingw-cross-gcc` is x86_64-only for the same reason and gets the same gate. What remains on that host is `musl-gcc`, which mcpp already routes gcc to on non-x86_64 Linux, and `ninja`. ⭐ This is a POLICY statement — which families mcpp supports on this host, the same kind of statement `tier` makes for a target row — not a copy of the index's coverage. The plan that retires it is .agents/docs/2026-08-26-aarch64-linux-ecosystem-closure.md §P1. ⚠️ AND ITS PREMISE IS RECHECKED EVERY RUN. `check_aarch64_llvm_deferral.sh` fails when its reason stops holding — the day an aarch64 llvm is published — and names the gate to remove. A deferral nobody rechecks is indistinguishable from a defect. Network trouble is not read as "it appeared": an unreadable asset list leaves the premise alone and says so.
1 parent adcb76d commit 4155e4a

4 files changed

Lines changed: 97 additions & 3 deletions

File tree

.agents/docs/2026-08-26-aarch64-linux-ecosystem-closure.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,26 @@ P0 ──┬── P1(llvm 构建)──┬── P3(索引接线)── P4(mcpp
198198
- **判据**:`xlings install llvm@22.1.8` 在 aarch64 上成功;
199199
失败时的消息点名架构。
200200
201-
### P4 — mcpp 对 aarch64 诚实
201+
### P4 — mcpp 对 aarch64 诚实(✅ 已落地)
202+
203+
⭐ **决定:aarch64 上先只支持 `musl-gcc`,其余显式标记延缓。**
204+
205+
- **P4.1 ✅** `available_toolchain_indexes()` 在非 x86_64 Linux 上不再列出
206+
`llvm` 与 `mingw-cross-gcc`。⚠️ 这是一句**政策陈述**(mcpp 在这台宿主上支持
207+
哪些族),不是索引数据的抄本 —— 与目标行的 `tier` 同类。
208+
- **P4.2 ✅ 延缓的前提每轮重测**:`.github/tools/check_aarch64_llvm_deferral.sh`
209+
查 `xlings-res/llvm` 的 20.1.7 / 22.1.8 是否出现了 `linux-aarch64` 资产。
210+
⚠️ **它在理由不再成立时变红**,与一般的检查方向相反。
211+
⚠️ 网络故障不得被读成「出现了」:读不到资产表就说读不到,保持前提不动。
212+
- **P4.3 ✅ 生态 e2e 的豁免按理由给**:298 在 aarch64 上跳过,理由是
213+
`llvm is not installed here`。按理由给而不是按宿主给,llvm 落地那天它自动
214+
从「跳过」变回「断言」,workflow 一行都不用改。
215+
216+
⚠️ **`host_can_serve()` 对裸机仍无条件 `true`** —— 那条理由(clang/lld 按构造
217+
就是交叉编译器)预设了 clang 在这台机器上存在。P4.1 的门让四个裸机行不再被
218+
列出,所以症状已经消失;这一处的**根因**留到 P1 之后再处理,因为届时它自然成立。
219+
220+
### P4-原文 — mcpp 对 aarch64 诚实
202221
203222
- **P4.1** `available_toolchain_indexes()` 目前按 OS 分支不问架构。
204223
⚠️ **不要把索引数据抄进 mcpp** —— 那正是会漂移的形状。
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/usr/bin/env bash
2+
# ⭐⭐ A DEFERRAL'S PREMISE, RECHECKED.
3+
#
4+
# `available_toolchain_indexes()` omits llvm on non-x86_64 Linux because no
5+
# linux-aarch64 llvm exists — not in xlings-res, and not upstream since 19.x.
6+
# That is a deferral, and a deferral nobody rechecks is indistinguishable from
7+
# a defect.
8+
#
9+
# ⚠️ THIS FAILS WHEN THE REASON STOPS HOLDING, which is the opposite of what a
10+
# check usually does. The day an aarch64 llvm is published, it goes red and
11+
# names the gate to remove — see
12+
# `.agents/docs/2026-08-26-aarch64-linux-ecosystem-closure.md` §P1.
13+
#
14+
# ⚠️ Network trouble must not be read as "it appeared". An unreadable asset list
15+
# leaves the premise alone and says so: a check that turns a flaky API into a
16+
# claim about the world is worse than no check.
17+
set -uo pipefail
18+
19+
fail=0
20+
for tag in 22.1.8 20.1.7; do
21+
names="$(curl -sSL --retry 3 --retry-all-errors --max-time 60 \
22+
"https://api.github.com/repos/xlings-res/llvm/releases/tags/$tag" 2>/dev/null \
23+
| grep -oE '"name"[[:space:]]*:[[:space:]]*"[^"]+"' \
24+
| sed -E 's/.*"([^"]+)"$/\1/')"
25+
if [ -z "$names" ]; then
26+
echo " ? $tag: could not read the asset list — premise left alone"
27+
continue
28+
fi
29+
if printf '%s\n' "$names" | grep -q 'linux-aarch64'; then
30+
echo "::error::xlings-res/llvm $tag now publishes a linux-aarch64 asset"
31+
echo " the deferral in available_toolchain_indexes() has outlived its reason"
32+
echo " see .agents/docs/2026-08-26-aarch64-linux-ecosystem-closure.md §P1"
33+
fail=1
34+
continue
35+
fi
36+
echo " ok $tag: still no linux-aarch64 asset"
37+
done
38+
[ "$fail" = 0 ] || exit 1
39+
echo "OK: the aarch64 llvm deferral still has its reason"

.github/workflows/ci-target-matrix.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,13 @@ jobs:
8888
done
8989
[ "$fail" = 0 ] || exit 1
9090
91+
# ⚠️ A DEFERRAL NOBODY RECHECKS IS INDISTINGUISHABLE FROM A DEFECT. This
92+
# step fails when its reason STOPS holding — the day an aarch64 llvm is
93+
# published — which is the opposite of what a check usually does.
94+
- name: The aarch64 llvm deferral still has its reason
95+
if: matrix.host == 'linux-aarch64'
96+
run: bash .github/tools/check_aarch64_llvm_deferral.sh
97+
9198
- name: Each invariant RAN
9299
run: |
93100
set -euo pipefail

src/toolchain/registry.cppm

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -640,11 +640,39 @@ bool host_can_serve(const triple::Triple& target) {
640640
}
641641

642642
std::vector<AvailableIndex> available_toolchain_indexes() {
643+
// ⚠️⚠️ NOT EVERY FAMILY EXISTS FOR EVERY (OS, ARCH), AND THIS LIST USED TO
644+
// SAY OTHERWISE.
645+
//
646+
// The branches below are per-OS and there were none per-ARCH, so an aarch64
647+
// Linux host was told llvm could be installed. Measured 2026-08-26 against
648+
// the index and upstream:
649+
//
650+
// xlings-res/llvm 20.1.7 / 22.1.8 no linux-aarch64 asset
651+
// llvm/llvm-project 20.1.7, 21.1.0 no linux-aarch64 asset
652+
// llvm/llvm-project 19.1.7 has one — too old for `import std`
653+
//
654+
// so `mcpp toolchain install llvm 22.1.8` there is a 404 that this list
655+
// promised would work. Same family as the rest of this release: a table
656+
// that answers a narrower question than the one it is asked.
657+
//
658+
// ⭐ THIS IS A POLICY STATEMENT, NOT A COPY OF THE INDEX. It says which
659+
// families mcpp SUPPORTS on this host — the same kind of statement `tier`
660+
// makes for a target row — and the plan that retires it is
661+
// `.agents/docs/2026-08-26-aarch64-linux-ecosystem-closure.md` §P1.
662+
//
663+
// ⚠️ AND ITS PREMISE IS ASSERTED IN CI, so it cannot outlive its reason.
664+
// `ci-target-matrix.yml`'s aarch64 job checks that no linux-aarch64 llvm
665+
// asset has appeared; the day one does, that step reds and names this
666+
// gate. A deferral nobody rechecks is indistinguishable from a defect.
667+
const bool linuxNonX86 =
668+
mcpp::platform::is_linux && mcpp::platform::host_arch != "x86_64";
669+
643670
std::vector<AvailableIndex> out{
644671
{ "gcc", Family::Gcc },
645672
{ "musl-gcc", Family::Gcc },
646-
{ mcpp::toolchain::llvm::package_name(), Family::Llvm },
647673
};
674+
if (!linuxNonX86)
675+
out.push_back({ mcpp::toolchain::llvm::package_name(), Family::Llvm });
648676
// The Windows-PE gcc payload is host-split at the distribution layer
649677
// (§4.3); each host lists the package it would actually install.
650678
if constexpr (mcpp::platform::is_windows) {
@@ -660,7 +688,8 @@ std::vector<AvailableIndex> available_toolchain_indexes() {
660688
out.push_back({ std::string(mcpp::platform::host_arch) + "-linux-musl-gcc",
661689
Family::Gcc });
662690
} else if constexpr (mcpp::platform::is_linux) {
663-
out.push_back({ "mingw-cross-gcc", Family::Gcc });
691+
// Same gate: `mingw-cross-gcc` publishes x86_64 only.
692+
if (!linuxNonX86) out.push_back({ "mingw-cross-gcc", Family::Gcc });
664693
}
665694
return out;
666695
}

0 commit comments

Comments
 (0)