mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-05 01:23:24 -08:00
[CI] Re-assert the ccache timestamp sloppiness after configure
CMakeLists.txt sets sloppiness=pch_defines,time_macros at configure time, and ccache --set-config replaces the whole list rather than extending it. Setting the four entries before cmake would therefore leave the build with only two, so the entries CI needs have to be written after the configure step and before the build. The mtime and ctime entries cover files created during the build itself: moc/uic/rcc output and protobuf headers are generated after ccache starts, so without them every TU that includes one is read as a race and never cached. Checked-out sources are older than the compile that follows them and do not trip the check.
This commit is contained in:
parent
ed119cc940
commit
ce0746d77f
1 changed files with 15 additions and 3 deletions
|
|
@ -185,9 +185,6 @@ if [[ $MAKE_COVERAGE ]]; then
|
|||
fi
|
||||
if [[ $USE_CCACHE ]]; then
|
||||
flags+=("-DUSE_CCACHE=1")
|
||||
# PCH-aware caching is required or ccache refuses to cache any TU that
|
||||
# consumes a precompiled header, silently recompiling everything on every run.
|
||||
ccache --set-config sloppiness=pch_defines,time_macros
|
||||
if [[ $CCACHE_SIZE ]]; then
|
||||
# note, this setting persists after running the script
|
||||
ccache --max-size "$CCACHE_SIZE"
|
||||
|
|
@ -378,6 +375,21 @@ echo "Running cmake with flags: ${flags[*]}"
|
|||
cmake .. "${flags[@]}"
|
||||
echo "::endgroup::"
|
||||
|
||||
if [[ $USE_CCACHE ]]; then
|
||||
# PCH-aware caching is required or ccache refuses to cache any TU that consumes a
|
||||
# precompiled header, silently recompiling everything on every run. The mtime and ctime
|
||||
# entries cover files created during the build itself: the moc/uic/rcc output and the
|
||||
# protobuf headers are generated after ccache starts, so without them every TU including
|
||||
# one is read as a race and never cached. Checked-out sources are older than the compile
|
||||
# that follows them and do not trip the check.
|
||||
#
|
||||
# This has to run after configure: CMakeLists.txt sets sloppiness=pch_defines,time_macros
|
||||
# at configure time, and --set-config replaces the whole list rather than extending it, so
|
||||
# setting it earlier would leave the build below with two entries. Re-asserting all four
|
||||
# here is what actually reaches the compiler; the order is the point.
|
||||
ccache --set-config sloppiness=pch_defines,time_macros,include_file_mtime,include_file_ctime
|
||||
fi
|
||||
|
||||
echo "::group::Build project"
|
||||
cpuinfo
|
||||
echo "Running cmake --build with flags: ${buildflags[*]}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue