Skip to content

Commit 67ab1dd

Browse files
committed
ci: supply openkal test tools through xlings
1 parent 3d90198 commit 67ab1dd

4 files changed

Lines changed: 114 additions & 49 deletions

File tree

‎.agents/docs/2026-10-08-llvm-2313-part2-execution-and-dependencies.md‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -671,3 +671,43 @@ lld-required-absent 拒绝没有变化。报告器在 iOS 的五个描述字段
671671
simulator 输出 sim(payload)。这些列不参与支持判定,记录其输出
672672
不构成 iOS 链接 glibc 的声明;实际 Apple 依赖以目标验收为准。
673673
基线注释明确这一边界,没有通过修改报告器扩大本次支持范围。
674+
675+
676+
## 29. 2026-10-08 生态 E2E 工具供应统一与非空宿主对照
677+
678+
维护者将后续合入顺序改为检查达标后先报告,由维护者 review 决定。
679+
索引 #938 已在此前明确授权下合入;mcpp #781 未合入、未发布。
680+
源码 `3d90198f` 的运行 37765253396 已通过四宿主构建、invariants、
681+
244 格扫描、三个目标系统执行及 ARM64 fresh-install。剩余生态
682+
E2E 停留在工具准备步骤超过 24 分钟,维护者确认实际日志为空。
683+
上一轮同一步骤为 44 秒;两次 33 MB qemu-riscv 下载分别为 2.2 秒
684+
和 1.4 秒。空输出不能证明具体阻塞在 APT 还是后续命令,不能以此
685+
声明 LLVM 或 openkal 回归,也不能把尚未执行的 E2E 计为通过。
686+
687+
该步骤原来只通过 xlings 安装 qemu-riscv;qemu-user 和用于宿主
688+
头文件对照的 mingw-w64 仍来自 APT。现有索引已提供
689+
qemu-user-aarch64@7.2.0、qemu-riscv@9.2.4-1 及 Linux 宿主的
690+
mingw-cross-gcc@16.1.0。工具供应改为三个具名 xlings 步骤,不再
691+
访问 APT。用户态与系统态模拟器分别安装到两个被调用的 home,
692+
安装作用域和激活版本显式指定;准备后的程序执行仍为准入条件。
693+
694+
索引中的 mingw-w64 是 Windows 载荷,不能用于 Linux 宿主。
695+
Linux 头文件对照使用独立 XLINGS_HOME 中的 mingw-cross-gcc,
696+
目录位于 MCPP_HOME 外。738 仅在自身进程内将该工具链 bin 加入
697+
PATH,不写入 /usr,不导出 GCC_ROOT,不将对照载荷混入被信任的
698+
图供应 store。Clang 无默认配置时能通过 PATH 找到这份真实头文件;
699+
正向控制要求实际预处理 io.h 并报告该 include 目录,才继续验证
700+
图供应命令的搜索目录。CI 除原 PASS 行外还要求正向控制成功行。
701+
702+
本地 LLVM 23.1.3 对照实测:未限制的驱动搜索独立 MinGW include
703+
并成功预处理 io.h;加 nostdlibinc 后该目录消失,io.h 不可找到。
704+
原实际图构建/CDB 隔离判据保留,不以模拟数据或成功退出代替。
705+
本批只改变测试供应与诊断,无引擎、工具链默认值、载荷或运行时
706+
功能改动。新头仍需实际生态 E2E 和最终 CI 成功,之后才交付合入
707+
报告。发布、CN/SubOS 消费及 latest 移动继续等待合入决定。
708+
709+
维护者确认运行卡住后,于 11:42 UTC 取消旧运行。最终为 54 成功、
710+
1 条件跳过、1 取消;准备步骤连续静默约 43 分钟,完整取消日志
711+
仍没有后续命令的实际输出。归档、已完成检查和实测矩阵保留,
712+
不将取消解释为功能通过或 LLVM 回归。工作流和覆盖检查的 25 个
713+
现有专项用例、本批 shell/YAML、版本关系及文档规范检查通过。

‎.github/workflows/openkal-cross.yml‎

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -606,40 +606,38 @@ jobs:
606606
# the shim on PATH dispatches against whichever home owns it, so an
607607
# emulator installed only in the ambient one answers "not installed" when
608608
# mcpp asks.
609-
- name: Install the emulators, and this host's mingw-w64 (#662)
609+
- name: Install the AArch64 user emulator with xlings
610610
run: |
611611
set -euo pipefail
612-
# The runner image carries third-party apt lists (Google Chrome
613-
# among them) that this job does not use, and a transient
614-
# `Hash Sum mismatch` on one of them fails the whole update -- which
615-
# killed two cross-build jobs in setup, before a single byte was
616-
# compiled. Dropping the lists this job has no use for is what makes
617-
# the step's failure mean something about this job.
618-
#
619-
# BY CONTENT, NOT BY FILENAME. The first attempt removed
620-
# `google-chrome.list` and the update failed on the same URL: on
621-
# ubuntu-24.04 the runner writes deb822 `.sources` files, so the
622-
# name was a guess and the guess was wrong.
623-
sudo grep -rlE 'dl[.]google[.]com|packages[.]microsoft[.]com' \
624-
/etc/apt/sources.list.d/ 2>/dev/null | xargs -r sudo rm -f
625-
# `mingw-w64` (the distro package, NOT `mingw-cross-gcc`) is what
626-
# 738's `mingw-host-headers` capability probes for
627-
# (`/usr/x86_64-w64-mingw32/include`). The assertion it gates --
628-
# clang's own driver no longer searches the host once a graph
629-
# package supplies the target's C library -- has no discriminating
630-
# power without a host copy to have leaked in in the first place;
631-
# this is the one runner in the fleet that installs it for that
632-
# reason (run_all.sh's capability probe, and the design doc's note
633-
# on `# requires:` gates CI never satisfies on its own).
634-
sudo apt-get update -qq && sudo apt-get install -y -qq qemu-user mingw-w64
635-
"$XLINGS_BIN" install xim:qemu-riscv -y
612+
"$XLINGS_BIN" install xim:qemu-user-aarch64@7.2.0 -g -y -u
613+
XLINGS_HOME="${MCPP_HOME:-$HOME/.mcpp}/registry" \
614+
"$XLINGS_BIN" install xim:qemu-user-aarch64@7.2.0 -g -y -u
615+
qemu-aarch64-static --version
616+
617+
- name: Install the RISC-V system emulator with xlings
618+
run: |
619+
set -euo pipefail
620+
"$XLINGS_BIN" install xim:qemu-riscv@9.2.4-1 -g -y -u
636621
XLINGS_HOME="${MCPP_HOME:-$HOME/.mcpp}/registry" \
637-
"$XLINGS_BIN" install xim:qemu-riscv -y
638-
# Reachable AND runnable, asserted before the tests: without this the
639-
# scripts would simply skip and say so in a line nobody reads.
640-
qemu-aarch64 --version | head -1
641-
"$XLINGS_BIN" run qemu-system-riscv64 --version 2>/dev/null | head -1 \
642-
|| command -v qemu-system-riscv64
622+
"$XLINGS_BIN" install xim:qemu-riscv@9.2.4-1 -g -y -u
623+
"$XLINGS_BIN" run qemu-system-riscv64 --version
624+
625+
- name: Install the separate host MinGW header fixture with xlings
626+
run: |
627+
set -euo pipefail
628+
source tests/e2e/_toolchain_env.sh
629+
# This store stays outside MCPP_HOME. Test 738 first proves that
630+
# unrestricted Clang finds its headers through PATH, then proves
631+
# that the graph-supplied C library closes that host search.
632+
export XLINGS_HOME="$RUNNER_TEMP/openkal-host-mingw"
633+
mkdir -p "$XLINGS_HOME"
634+
cd "$XLINGS_HOME"
635+
"$XLINGS_BIN" config --mirror GLOBAL
636+
"$XLINGS_BIN" install "xim:mingw-cross-gcc@$MINGW_CROSS_VERSION" -g -y
637+
host_root="$XLINGS_HOME/data/xpkgs/xim-x-mingw-cross-gcc/$MINGW_CROSS_VERSION"
638+
test -f "$host_root/x86_64-w64-mingw32/include/io.h"
639+
test -x "$host_root/bin/x86_64-w64-mingw32-gcc"
640+
echo "MCPP_E2E_HOST_MINGW_ROOT=$host_root" >> "$GITHUB_ENV"
643641
644642
- name: The scripts
645643
run: |
@@ -707,6 +705,8 @@ jobs:
707705
"OK: the list answers what can be built, not what has a payload" || fail=1
708706
check 738_a_graph_supplied_target_closes_the_hosts_own_search.sh \
709707
"PASS: 738 a graph-supplied target closes the host's own search" || fail=1
708+
check 738_a_graph_supplied_target_closes_the_hosts_own_search.sh \
709+
"ok: unprotected clang finds the separate host MinGW headers" || fail=1
710710
# mcpp#696, the link-side twin of 738: both legs, because the one
711711
# that separates the engines is the refusal, and a skip of either
712712
# prints the final line all the same.

‎tests/e2e/738_a_graph_supplied_target_closes_the_hosts_own_search.sh‎

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,49 @@ source "$(dirname "${BASH_SOURCE[0]}")/_toolchain_env.sh"
3232
# that never had it -- the search list would end at the compiler's own
3333
# resource directory before AND after this fix, for an unrelated reason.
3434
#
35-
# `# requires: llvm` is why this test does not run through the ordinary
36-
# sharded suite at all -- `llvm` is never in run_all.sh's detected CAPS on
37-
# any shard (nothing there installs a toolchain), so every script declaring
38-
# it is invoked DIRECTLY, with the capability installed first and its PASS
39-
# line demanded, the same way openkal-cross.yml's `ecosystem-e2e` job
40-
# already runs 285-294: it installs the distro `mingw-w64` package there
41-
# specifically so `mingw-host-headers` holds and this test is not a
42-
# guaranteed skip.
35+
# The dedicated CI job supplies an xlings-managed MinGW fixture in a
36+
# separate store. An unrestricted driver must first find those headers;
37+
# only then can their absence from graph-supplied commands prove isolation.
38+
# Ordinary suites can still use the distro's host MinGW prefix.
4339
set -e
4440

4541
MCPP="${MCPP:-mcpp}"
4642
TMP=$(mktemp -d)
4743
trap 'rm -rf "$TMP"' EXIT
4844
fail() { echo "FAIL: $1"; [ -n "${2:-}" ] && cat "$2"; exit 1; }
4945

46+
# PATH exposes a genuine host cross toolchain, outside the store whose
47+
# include paths the graph is allowed to use. Do not export GCC_ROOT: it is
48+
# a compiler control variable, not a fixture label.
49+
if [ -n "${MCPP_E2E_HOST_MINGW_ROOT:-}" ]; then
50+
export PATH="$MCPP_E2E_HOST_MINGW_ROOT/bin:$PATH"
51+
python3 - "$LLVM_ROOT/bin/clang" "$MCPP_E2E_HOST_MINGW_ROOT" "${MCPP_HOME:-$HOME/.mcpp}" <<'PYCONTROL'
52+
from pathlib import Path
53+
import subprocess, sys
54+
compiler, root, home = sys.argv[1], Path(sys.argv[2]).resolve(), Path(sys.argv[3]).resolve()
55+
if root.is_relative_to(home):
56+
sys.exit("FAIL: the host MinGW fixture must be outside MCPP_HOME")
57+
include = (root / "x86_64-w64-mingw32/include").resolve()
58+
if not (include / "io.h").is_file():
59+
sys.exit("FAIL: the separate host MinGW headers are absent")
60+
r = subprocess.run([compiler, "--no-default-config", "--target=x86_64-w64-windows-gnu",
61+
"-E", "-v", "-x", "c", "-"], input="#include <io.h>\n",
62+
capture_output=True, text=True)
63+
searched, capture = [], False
64+
for line in r.stderr.splitlines():
65+
if "search starts here" in line:
66+
capture = True
67+
elif "End of search list" in line:
68+
capture = False
69+
elif capture:
70+
searched.append(Path(line.strip()).resolve())
71+
if r.returncode != 0 or include not in searched:
72+
print(r.stderr)
73+
sys.exit("FAIL: unrestricted Clang did not find the host MinGW fixture")
74+
print("ok: unprotected clang finds the separate host MinGW headers")
75+
PYCONTROL
76+
fi
77+
5078
mkdir -p "$TMP/app/src"
5179
cd "$TMP/app"
5280

‎tests/e2e/run_all.sh‎

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -93,16 +93,13 @@ case "$OS" in
9393
if ls "${MCPP_HOME}"/registry/data/xpkgs/xim-x-llvm/*/bin/clang++ 2>/dev/null | head -1 | grep -q .; then
9494
CAPS+=(llvm)
9595
fi
96-
# mingw-host-headers: this Linux HOST's own mingw-w64 headers
97-
# (`apt install mingw-w64`, distro package). Distinct from both
98-
# `mingw-cross` above (an xim-managed cross GCC) and `mingw` below (a
99-
# Windows-hosted payload) — this is a plain probe for
100-
# `/usr/x86_64-w64-mingw32/include`, the exact directory #662's
101-
# isolation criterion has to prove clang no longer searches once a
102-
# graph package supplies the target's C library. The criterion has NO
103-
# discriminating power without it: a host that never had these headers
104-
# would pass the same assertion before the fix and after it.
105-
[[ -d /usr/x86_64-w64-mingw32/include ]] && CAPS+=(mingw-host-headers)
96+
# Host MinGW headers can come from a distro prefix or the dedicated
97+
# xlings fixture outside MCPP_HOME. Test 738 proves that unrestricted
98+
# Clang finds the latter before checking graph isolation.
99+
if [[ -d /usr/x86_64-w64-mingw32/include ]] \
100+
|| [[ -n "${MCPP_E2E_HOST_MINGW_ROOT:-}" && -f "$MCPP_E2E_HOST_MINGW_ROOT/x86_64-w64-mingw32/include/io.h" ]]; then
101+
CAPS+=(mingw-host-headers)
102+
fi
106103
# wine: run cross-built Windows PE artifacts on the Linux host.
107104
command -v wine &>/dev/null && CAPS+=(wine)
108105
# qemu-riscv: the emulator a bare-metal riscv artifact runs in

0 commit comments

Comments
 (0)