You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Implementation partition in a .cpp file is rebuilt on every build and its BMI is never written #790
An implementation partition (module M:part;) placed in a .cpp file is recompiled on every mcpp build, including builds where nothing changed. The plan declares a BMI for the unit, but the compile step for a .cpp file never writes one, so ninja always sees a missing output.
Minimal project (mcpp 2026.10.8.1, LLVM 23.1.3, --target x86_64-linux-gnu, Linux x86_64):
Running mcpp build --target x86_64-linux-gnu --verbose three times: the first build compiles everything and the program prints 42. The second and third builds, with no edits in between, each run the same two steps again, [1/2] compiling src/api_impl.cpp and [2/2] linking.
but the compile command is a plain -c .../src/api_impl.cpp -o obj/api_impl.o without -fmodule-output, and pcm.cache/ only ever contains repro.pcm, repro-api.pcm and std.pcm. Because repro-api_impl.pcm never appears, the edge is always dirty.
If any unit imports the partition, the build fails instead. Adding import :api_impl; to src/repro.cppm gives
src/repro.cppm:4:9: fatal error: module 'repro:api_impl' not found
Renaming the file to src/api_impl.cppm makes both cases work, so the problem is limited to the .cpp spelling. I expected mcpp either to build a .cpp file that declares a partition as a module unit and write its BMI, or to refuse it with a message that names the file, the same way an unknown extension is refused. Right now it is accepted silently and the cost only shows up as a rebuild on every run.
Activity
2026.10.10.1: the workspace prefix carries the meaning, one writer pe…