Skip to content

Commit e772356

Browse files
committed
ci: drop the branch-built tool, and make the bare-metal step reach bare metal
删掉的那个步骤自己写着退出条件:「⇒ When #486 ships, delete this step and raise MCPP_VERSION」。#486 已于 2026-08-23 合入并随 2026.8.24.1 起发布, 而这个步骤还在从 `feat/import-std-capability` 分支构建 mcpp 并盖掉刚装好的那个。 后果不是「多跑一次构建」。日志里两行并排: Install mcpp mcpp 2026.8.24.3 The build tool, from the branch… mcpp 2026.8.21.3 ← 实际跑的是它 于是 `MCPP_VERSION` 这个变量对**被测的行为**不起作用,本 PR 把它移到 24.3 之后 CI 仍然用 21.3 跑,报出三层版的错误信息。两个 job 各一处,一并删除。 ── ⚠️ 并且那一步在测宿主,而它的名字说的是裸机 ────────────── `The same source on bare metal, with exceptions` 跑的是裸的 `mcpp run`。 这个清单**刻意没有 `[build] target`**(注释就写在第 5 行),所以裸的 `mcpp run` 构建的是**宿主**。四行断言两种跑法都会打印 —— 那是清单自己的 主张,不是巧合 —— 于是这一步在宿主构建上报绿,**一次都没有到过 OpenSBI**。 实测 2026-08-24:产物是 `target/x86_64-linux-gnu/…`。 改法两处: · `mcpp run --target riscv64-none-elf` · 加一条 `grep -q 'Boot HART'`,即固件自己的横幅 —— 这样一次没离开宿主 的运行**无法**靠打印那四行应用输出来满足本步骤 本机实测改后:OpenSBI 横幅出现,四行输出与宿主一致。
1 parent 81497c6 commit e772356

1 file changed

Lines changed: 12 additions & 75 deletions

File tree

.github/workflows/ci.yml

Lines changed: 12 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -107,61 +107,6 @@ jobs:
107107
xlings install xim:qemu-riscv -y
108108
XLINGS_HOME="$HOME/.mcpp/registry" xlings install xim:qemu-riscv -y
109109
110-
# ⚠️ THE BUILD TOOL IS BUILT FROM A BRANCH, AND THAT IS TEMPORARY.
111-
#
112-
# This step needs four decisions that no released mcpp makes yet, each of
113-
# which belongs to the tool rather than to this package:
114-
#
115-
# `import std` is gated on whether a package PROVIDES a standard
116-
# library for the target rather than on whether the target is
117-
# freestanding; a package may carry its own std module source;
118-
# `-fno-exceptions` / `-fno-rtti` / `-ffreestanding` come off when the
119-
# graph supplies a C++ runtime built for the target; and unwind tables
120-
# go on, because the compiler turns them off for this kind of target
121-
# and a partial set of tables stops the walk rather than degrading it.
122-
#
123-
# They are on mcpp-community/mcpp#486. Until that is released this job
124-
# builds the tool the same way every other dependency here is taken —
125-
# from the branch — so the criterion below is actually enforced instead
126-
# of being a comment saying it was verified once on a laptop.
127-
#
128-
# ⇒ When #486 ships, delete this step and raise MCPP_VERSION.
129-
- name: The build tool, from the branch that has what this needs
130-
if: matrix.toolchain == 'llvm@22.1.8'
131-
run: |
132-
set -euo pipefail
133-
git clone --depth 1 -b feat/import-std-capability \
134-
https://github.com/mcpp-community/mcpp "$RUNNER_TEMP/mcpp-src"
135-
cd "$RUNNER_TEMP/mcpp-src"
136-
# ⚠️ THE CLONE CARRIES A WORKSPACE PIN, AND IT NAMES A VERSION THE
137-
# INDEX NO LONGER HAS.
138-
#
139-
# xlings: version '2026.8.17.1' not found for 'mcpp'
140-
# available: 2026.8.19.4
141-
#
142-
# `.xlings.json` at a repository root says which mcpp a build in that
143-
# tree uses, and mcpp's own bootstrap pin does not move when mcpp is
144-
# released — it is the version that was current when the pin was last
145-
# touched. Cloning the branch therefore imports a pin that is only
146-
# valid inside that repository's own CI, where the same file selects
147-
# what gets installed.
148-
#
149-
# Rewriting it to the version this job already installed is what makes
150-
# the two agree. It changes nothing about what is being tested: the
151-
# pin selects the tool that BUILDS mcpp, and what is under test is the
152-
# mcpp that comes out.
153-
printf '{\n "workspace": {\n "mcpp": "%s"\n }\n}\n' "$MCPP_VERSION" > .xlings.json
154-
# ⚠️ `--dev` AND NOT `--release`. What is under test is a set of
155-
# decisions the tool makes about compile flags; an optimisation level
156-
# changes none of them. Measured: the release self-build took over
157-
# half an hour of a sixty-minute job on a two-core runner, which is
158-
# most of the budget spent on something the test does not observe.
159-
mcpp build --dev
160-
BUILT=$(find target -type f -name mcpp -perm -u+x | head -1)
161-
[ -n "$BUILT" ] || { echo "::error::mcpp did not build"; exit 1; }
162-
echo "$(cd "$(dirname "$BUILT")" && pwd)" >> "$GITHUB_PATH"
163-
"$BUILT" --version
164-
165110
- name: The same source on bare metal, with exceptions
166111
if: matrix.toolchain == 'llvm@22.1.8'
167112
run: |
@@ -175,7 +120,18 @@ jobs:
175120
grep -q '"qemu-system-riscv64"' mcpp.toml \
176121
|| { echo "::error::the manifest no longer carries the bare emulator name"; exit 1; }
177122
sed -i "s|\"qemu-system-riscv64\"|\"$Q\"|" mcpp.toml
178-
mcpp run 2>&1 | tee out.log
123+
# ⚠️ `--target riscv64-none-elf`, AND THE FLAG IS THE WHOLE STEP.
124+
#
125+
# This manifest carries no `[build] target`, so a bare `mcpp run`
126+
# builds for the HOST and passes — the four lines below appear either
127+
# way, which is the manifest's own claim and not an accident. A step
128+
# named "on bare metal" that omits the flag therefore reports green
129+
# over a host build and has never once reached OpenSBI. Measured
130+
# 2026-08-24: the artefact was `target/x86_64-linux-gnu/…`.
131+
mcpp run --target riscv64-none-elf 2>&1 | tee out.log
132+
# The emulator's own banner, so a run that never left the host cannot
133+
# satisfy this step by printing the four application lines.
134+
grep -q 'Boot HART' out.log # firmware ran; this is OpenSBI
179135
grep -q 'sorted: 2 4 7' out.log # containers + algorithms + the allocator
180136
grep -q 'caught: 42' out.log # the unwinder found the handler
181137
grep -q 'unwound: true' out.log # ⭐ and ran a destructor on the way
@@ -398,25 +354,6 @@ jobs:
398354
mcpp toolchain install llvm 22.1.8
399355
mcpp toolchain default 'llvm@22.1.8'
400356
401-
# ⚠️ Same temporary step as the Linux job: the decisions this exercises are
402-
# on mcpp#486 and not in any release. When that ships, this goes and
403-
# MCPP_VERSION rises. See the long note in the `runtime` job.
404-
- name: The build tool, from the branch that has what this needs
405-
run: |
406-
set -euo pipefail
407-
git clone --depth 1 -b feat/import-std-capability \
408-
https://github.com/mcpp-community/mcpp "$RUNNER_TEMP/mcpp-src"
409-
cd "$RUNNER_TEMP/mcpp-src"
410-
printf '{\n "workspace": {\n "mcpp": "%s"\n }\n}\n' "$MCPP_VERSION" > .xlings.json
411-
mcpp build --dev
412-
# ⚠️ Named exactly, and `-perm` is not used. On Windows every file
413-
# reads as executable, so a permission test selects nothing useful;
414-
# `mcpp.exe` is the name there and `mcpp` everywhere else.
415-
BUILT=$(find target -type f \( -name 'mcpp' -o -name 'mcpp.exe' \) | head -1)
416-
[ -n "$BUILT" ] || { echo "::error::mcpp did not build"; exit 1; }
417-
echo "$(cd "$(dirname "$BUILT")" && pwd)" >> "$GITHUB_PATH"
418-
"$BUILT" --version
419-
420357
- name: Every target, from this host
421358
run: |
422359
set -euo pipefail

0 commit comments

Comments
 (0)