Skip to content

Commit 01f551b

Browse files
committed
ci: 冷机上目标 C 库是惰性安装的,构建要跑两遍
三个仓库的失败共享同一条根因,而报错都指向头文件、没有一处指向真正 没发生的那件事: inttypes.h:24:15: fatal error: 'inttypes.h' file not found riscv_virt_rt.cppm:9:10: fatal error: 'stdio.h' file not found mcpp 是在**构建过程中**从目标行安装目标 C 库的。于是一台从没为这个 triple 构建过的机器,第一遍就会去编译需要那些头的源码,而它们还不存在; 第二遍就有了。mcpp 自己对同类情形的措辞是「expected on the first build in a fresh MCPP_HOME; a second build resolves it」。 所以预热是**两遍,第一遍允许失败**。⚠️ 刻意不用 \`xlings install xim:picolibc-riscv\`:那会让目标世界绕过引擎自己的安装 而存在,而那条安装出回归时,这些仓库正好就再也发现不了。预热构建走的是 它,手工安装则是替换掉它。 portability 矩阵的每一行都是一台从没构建过这个目标的机器,所以那里同样 要两遍——单遍时它报出来的「可移植性失败」其实是冷机失败。
1 parent 3878340 commit 01f551b

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,4 +172,11 @@ jobs:
172172
173173
- name: The backend cross-builds
174174
run: |
175+
# ⚠️ TWICE, AND THE FIRST IS ALLOWED TO FAIL — every row of this
176+
# matrix is a machine that has never targeted this triple, which is
177+
# precisely where mcpp's lazy install of the target C library shows.
178+
# The first build compiles sources needing its headers before they
179+
# exist; the second has them. A single build here reported a
180+
# portability failure that was really a cold-machine one.
181+
mcpp build --target riscv64-none-elf || true
175182
mcpp build --target riscv64-none-elf

0 commit comments

Comments
 (0)