Skip to content

Commit 3a32350

Browse files
committed
fix: 本机绝对路径又一次被提交进清单,而这次 CI 在「运行」那一步才说
程序建出来了(text 2494992,和本机一致),失败在运行:runner 指向 /home/speak/.mcpp/registry/... —— 一台机器上的绝对路径进了每台机器都读的文件。 ⚠️ 这是本生态里第二次,第一次在 conformance/mcpp.toml,两次的显形方式都一样: 别的仓库的 CI 挂在一条只存在于一台笔记本上的路径上。成因也一样:本机要跑就得 把名字换成装好的模拟器,而最顺手的做法就是改这一行。 清单改回裸名,并在旁边写下为什么它必须保持裸名。CI 那一步加了一条守卫:先断言 清单里还是裸名,再替换 —— 于是一个已经带着路径的 checkout 会**被告知**,而不是 得到一个路径套路径。
1 parent dd57c44 commit 3a32350

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,12 @@ jobs:
161161
set -euo pipefail
162162
cd examples/baremetal
163163
Q=$(ls -d "$HOME"/.mcpp/registry/data/xpkgs/xim-x-qemu-riscv/*/bin/qemu-system-riscv64 | head -1)
164+
# ⚠️ Anchored on the BARE NAME, so a checkout that already carries a
165+
# path is left alone rather than getting a path inside a path. The
166+
# manifest is required to carry the bare name; the note beside it says
167+
# why, and this is the step that relies on it.
168+
grep -q '"qemu-system-riscv64"' mcpp.toml \
169+
|| { echo "::error::the manifest no longer carries the bare emulator name"; exit 1; }
164170
sed -i "s|\"qemu-system-riscv64\"|\"$Q\"|" mcpp.toml
165171
mcpp run 2>&1 | tee out.log
166172
grep -q 'sorted: 2 4 7' out.log # containers + algorithms + the allocator

examples/baremetal/mcpp.toml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,21 @@ target = "riscv64-none-elf"
88
# No sysroot: there is no system to take headers or libraries from. The runner
99
# is the emulator with firmware, because `-bios default` is what supplies the
1010
# SBI this program's openkal implementation calls.
11+
#
12+
# ⚠️ THE EMULATOR IS NAMED WITHOUT A PATH AND MUST STAY THAT WAY.
13+
#
14+
# Running this locally means pointing the name at an installed emulator, and the
15+
# obvious way to do that is to edit this line. Doing so and committing puts one
16+
# machine's absolute path into a file every other machine reads — measured
17+
# twice in this ecosystem now, the first time in `conformance/mcpp.toml`, and
18+
# both times the way it showed was every other repository's CI failing on a path
19+
# that exists on exactly one laptop.
20+
#
21+
# The CI step that runs this rewrites the name in its own checkout and does not
22+
# commit; do the same locally, or put the emulator on PATH.
1123
[target.riscv64-none-elf]
1224
sysroot = ""
13-
runner = ["/home/speak/.mcpp/registry/data/xpkgs/xim-x-qemu-riscv/9.2.4-1/bin/qemu-system-riscv64", "-machine", "virt", "-nographic",
25+
runner = ["qemu-system-riscv64", "-machine", "virt", "-nographic",
1426
"-no-reboot", "-bios", "default", "-kernel"]
1527

1628
[dependencies]

0 commit comments

Comments
 (0)