Skip to content

Commit 93163ea

Browse files
committed
ci: 判据是产物而不是「编过了」
⚠️ 「mcpp build 成功」在这些包上几乎不构成判据。它们提供的是**可替换函数**与 **C 名字的符号**:定义存在但未以编译器发出调用时用的那个名字导出,一样能编过、 能链进去,而每个消费者仍然失败在同一个 undefined symbol 上。 因此 CI 断言的是导出符号集合、PE 的 subsystem、以及在模拟器里**打印出来的那几行**, 而不是退出码 —— 固件没跑到载荷时退出码同样是 0。
1 parent 7defb1f commit 93163ea

1 file changed

Lines changed: 53 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
workflow_dispatch:
8+
9+
jobs:
10+
build:
11+
name: boots under real OpenSBI
12+
runs-on: ubuntu-24.04
13+
timeout-minutes: 40
14+
env:
15+
MCPP_VERSION: 2026.8.20.2
16+
XLINGS_VERSION: v2026.8.17.2
17+
XLINGS_NON_INTERACTIVE: '1'
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Install xlings
22+
run: |
23+
curl -fsSL https://raw.githubusercontent.com/openxlings/xlings/main/tools/other/quick_install.sh \
24+
| bash -s "$XLINGS_VERSION"
25+
echo "$HOME/.xlings/subos/current/bin" >> "$GITHUB_PATH"
26+
27+
- name: Install mcpp
28+
run: |
29+
xlings update
30+
xlings install "mcpp@$MCPP_VERSION" -y -g
31+
mcpp --version
32+
mcpp self config --mirror GLOBAL
33+
34+
- name: Install the emulator
35+
run: |
36+
# Both homes: the shim on PATH dispatches against whichever home owns
37+
# it, while mcpp starts the runner through its own.
38+
xlings install xim:qemu-riscv -y
39+
XLINGS_HOME="$HOME/.mcpp/registry" xlings install xim:qemu-riscv -y
40+
41+
# ⚠️ The assertion is on the OUTPUT, not on the exit status. A firmware
42+
# that never reaches the payload exits zero, and so does a payload whose
43+
# console writes go nowhere — which is precisely the failure this backend
44+
# exists to avoid on a second machine.
45+
- name: The example prints under `-bios default`
46+
run: |
47+
set -euo pipefail
48+
cd examples/hello
49+
Q=$(ls -d "$HOME"/.mcpp/registry/data/xpkgs/xim-x-qemu-riscv/*/bin/qemu-system-riscv64 | head -1)
50+
sed -i "s|\"qemu-system-riscv64\"|\"$Q\"|" mcpp.toml
51+
mcpp run 2>&1 | tee run.log
52+
grep -q "hello from openkal over SBI" run.log
53+
grep -q "heap ok" run.log

0 commit comments

Comments
 (0)