cmake + xcode data race: cmake.check_cache
I use 3.21.2 and XCode 12.4. Steps to reproduce:
- Create XCode project with
cmake -GXcode
- Open project with XCode and build it
- Change something in project to cause
.xcodeproj
regeneration (for example edit CMakeLists.txt) and run build in XCode, it run ZERO_CHECK target detects project change and build was cancelled
Sometimes on step (3) cycle happens, because of XCode detects project change before
cmake
finish its job and so path/to/build/dir/CMakeFiles/cmake.check_cache
was deleted, but not recreated,
so when XCode indicated that build is "Cancelled" and I re-run build in XCode,
it again re-run cmake
via ZERO_CHECK, and again build cancelled before cmake.check_cache
was
created and so on.
I am able to reproduce this problem in 1/4-1/3 cases when I rebuild project with CMakeFiles.txt changes.
So it would be nice at the end of cmake
's job, when it prints:
Configuring done
Generating done
if cmake
write cmake.check_cache
and sync it to disk before "Generating done".
I will try to create small example to reproduce problem.
Edited by Evgeniy Dushistov