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
Concurrent builds of the same configuration race in one build directory and both fail #839
Two mcpp build processes on the same project and the same configuration run two ninja instances in the same build directory (target/<triple>/<fingerprint>/). On a cold build they delete and overwrite each other's BMIs, and both fail.
This is the ordinary situation of an IDE building on save while a person (or a coding agent) runs mcpp build / mcpp run in a terminal.
Reproduction (mcpp 2026.10.24.1, gcc@16.1.0, Linux x86_64)
3 of 5 rounds: both processes exit 1, with errors such as
/tmp/lockexp/src/m6.cppm:1:8: error: failed to write compiled module: No such file or directory
m5: error: failed to read compiled module: No such file or directory
In the 2 rounds that pass, both processes compiled everything (the work is done twice). A following mcpp build recovers.
Not affected (measured)
Different configurations in parallel (mcpp build + mcpp build --release): different fingerprint directories, both succeed.
Rebuilding while a previously built program is still running under mcpp run: succeeds on Linux; the running process keeps the old file.
Read-only queries during a build (mcpp emit build-database --format json): succeed.
The global side already guards its shared state (index refresh: non-blocking file lock; BMI cache: per-entry lock + staged publish; toolchain install: per-version directory). The project build directory is the one shared mutable resource with no cross-process guard.
The fix is being designed together with related contract work (build pipeline split into plan / mutate / execute, lock held only for the mutate phase, per build directory); this issue records the defect and its reproduction.
Activity
2026.10.26.1: the control contract, concurrency, and one C++ runtime …