Skip to content

Commit ae31fa4

Browse files
committed
ci(cross): do not restore target/ in the windows->linux job
The job builds twice — once for the host, then once for x86_64-linux-musl — and a cache-restored BMI tree makes the second build read std BMIs that no longer match what the dependency BMIs were compiled against: mcpplibs.cmdline: error: import 'std' has CRC mismatch GCC bakes a CRC of each imported module's BMI into the importer, so the two have to come from the same build round. A cache that restores one without the other is not a partial speedup, it is an unbuildable tree. Systematic, not flaky: it reproduced on rerun, and only in this job. The other two cross jobs cache ~/.mcpp and ~/.xlings but deliberately never target/ — this now follows the same convention. It stayed hidden until a PR touched neither mcpp.toml nor .xlings.json, since those two files key the sandbox cache; every earlier run had been a cold miss. That also means it would have reddened every subsequent PR, so it is fixed ahead of the B3 work rather than alongside it.
1 parent 7a6afff commit ae31fa4

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

.github/workflows/cross-build-test.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,25 @@ jobs:
307307
steps:
308308
- uses: actions/checkout@v4
309309
- uses: ./.github/actions/bootstrap-mcpp
310+
with:
311+
# Do NOT restore target/ in a cross job. This job builds twice — once
312+
# for the host, then once for x86_64-linux-musl — and a restored BMI
313+
# tree makes the second build read `std` BMIs that no longer match
314+
# what the dependency BMIs were compiled against:
315+
#
316+
# mcpplibs.cmdline: error: import 'std' has CRC mismatch
317+
#
318+
# GCC bakes a CRC of each imported module's BMI into the importer, so
319+
# the two have to come from the same build round; a cache that
320+
# restores one without the other is not a partial speedup, it is an
321+
# unbuildable tree. It reproduced on rerun, and only in this job —
322+
# the other two cross jobs below cache ~/.mcpp and ~/.xlings but
323+
# deliberately never target/, which is the convention this now follows.
324+
#
325+
# It stayed hidden until a PR touched neither mcpp.toml nor
326+
# .xlings.json: those two files key the sandbox cache, so every
327+
# earlier run had been a cold miss.
328+
cache-target: 'false'
310329

311330
- name: Build mcpp from source (self-host)
312331
shell: bash

0 commit comments

Comments
 (0)