CI: Touch build.ninja after cache hit to prevent ninja re-running cmake libeigen/eigen!2428 Co-authored-by: Rasmus Munk Larsen <rmlarsen@gmail.com>
diff --git a/ci/scripts/build.linux.script.sh b/ci/scripts/build.linux.script.sh index 32ecbd4..e1a6efe 100755 --- a/ci/scripts/build.linux.script.sh +++ b/ci/scripts/build.linux.script.sh
@@ -27,6 +27,11 @@ if [[ -s build.ninja && -f .cmake_config_hash && \ "$(cat .cmake_config_hash)" == "${config_hash}" ]]; then echo "Cached build directory is valid (cmake args unchanged), skipping configure." + # Touch build.ninja so ninja does not re-run cmake. The fresh git checkout + # gives all source files the current timestamp, which is newer than the + # cached build.ninja. Ninja's built-in cmake re-run rule triggers on that + # timestamp comparison, defeating the cache skip above. + touch build.ninja else cmake ${cmake_args} ${rootdir} echo "${config_hash}" > .cmake_config_hash