Summary
Under the llvm toolchain, editing a file that a module interface pulls in via a purview #include (e.g. opencv-m's src/core.cppm doing #include "matx_ops.inc" after export module) does not retrigger the module interface rebuild: the next mcpp build/mcpp test reuses the stale BMI, so importers compile against the old surface. Reproduced twice in one session (opencv-m feat/vendor-single-repo, mcpp 0.0.101, llvm 20.1.7):
- edit
src/matx_ops.inc (purview-included by src/core.cppm)
mcpp test → prints Compiling opencv v0.0.7 (.) but target/<fp>/pcm.cache/opencv.core.pcm mtime predates the edit and its contents lack the new code (verified by grepping the pcm for a newly-added identifier)
touch src/core.cppm && mcpp test → correct rebuild
This looks like the #235 family (purview textual #include → depfile tracking), which was fixed for the gcc path in 0.0.97 — the clang path seems to miss the same edge (different depfile/scanner flow?). gcc 16.1.0 in the same repo/session picked up .inc edits correctly.
Repro sketch
mcpp toolchain default llvm@20.1.7
# module interface with a purview include:
# export module x; #include "ops.inc"
mcpp build # cold, fine
echo '// change' >> ops.inc
mcpp build # BUG: x.pcm not rebuilt (mtime/content stale)
Workaround: touch the including .cppm. Harmless for CI (cold builds) but dangerous locally — during the clang debugging session in #256 it silently served a stale BMI and cost a misdiagnosis round.
Environment: mcpp 0.0.101, linux x86_64, llvm 20.1.7 from mcpp toolchain install.
Summary
Under the llvm toolchain, editing a file that a module interface pulls in via a purview
#include(e.g. opencv-m'ssrc/core.cppmdoing#include "matx_ops.inc"afterexport module) does not retrigger the module interface rebuild: the nextmcpp build/mcpp testreuses the stale BMI, so importers compile against the old surface. Reproduced twice in one session (opencv-mfeat/vendor-single-repo, mcpp 0.0.101, llvm 20.1.7):src/matx_ops.inc(purview-included bysrc/core.cppm)mcpp test→ printsCompiling opencv v0.0.7 (.)buttarget/<fp>/pcm.cache/opencv.core.pcmmtime predates the edit and its contents lack the new code (verified by grepping the pcm for a newly-added identifier)touch src/core.cppm && mcpp test→ correct rebuildThis looks like the #235 family (purview textual
#include→ depfile tracking), which was fixed for the gcc path in 0.0.97 — the clang path seems to miss the same edge (different depfile/scanner flow?). gcc 16.1.0 in the same repo/session picked up.incedits correctly.Repro sketch
Workaround:
touchthe including.cppm. Harmless for CI (cold builds) but dangerous locally — during the clang debugging session in #256 it silently served a stale BMI and cost a misdiagnosis round.Environment: mcpp 0.0.101, linux x86_64, llvm 20.1.7 from
mcpp toolchain install.