I'm compiling my app with ccache enabled. Everything works fine until I change my repo's branch to the one with bigger diff.
Flow:
- Compiling branch X for the first time (ccache cached everything) - compilation time about 3min
- Compiling branch X again (using cache created in previous step) compilation time about 9 sek
- Just changing to branch Y for 1 sek
- Changing back to branch X
- Compiling branch X again (ccache doesn't hit anymore, it caches files again) - compilation time about 3min
If I change to other branch with much smaller diff, ccache works ok.
I have no clue why it doesn't work in scenario above.
Here are options I'm using:
(default) absolute_paths_in_stderr = false
(default) base_dir =
(environment) cache_dir = /ccache
(default) compiler =
(default) compiler_check = mtime
(environment) compiler_type = clang
(default) compression = true
(default) compression_level = 0
(default) cpp_extension =
(environment) debug = true
(environment) debug_dir = /ccache/debug
(environment) depend_mode = true
(environment) direct_mode = true
(default) disable = false
(default) extra_files_to_hash =
(environment) file_clone = true
(default) hard_link = false
(default) hash_dir = true
(default) ignore_headers_in_manifest =
(default) ignore_options =
(environment) inode_cache = true
(default) keep_comments_cpp = false
(default) limit_multiple = 0.8
(environment) log_file = /ccache/ccache-log
(default) max_files = 0
(/ccache/config) max_size = 20.0G
(default) namespace =
(default) path =
(default) pch_external_checksum = false
(default) prefix_command =
(default) prefix_command_cpp =
(default) read_only = false
(default) read_only_direct = false
(default) recache = false
(default) reshare = false
(environment) run_second_cpp = true
(default) secondary_storage =
(environment) sloppiness = clang_index_store, include_file_ctime, include_file_mtime, ivfsoverlay, locale, modules, pch_defines, system_headers, time_macros
(default) stats = true
(default) stats_log =
(default) temporary_dir = /ccache/tmp
(default) umask =
Anyone has any idea what am I doing wrong ?
PS. It's probably because of that my .hpp
files timestamps changes during that branch switching, but isn't ccache resistant for such a timestamp change ? It's is obvious that during compilation without ccache after such a change program will have compile from scratch, but I think that ccache should help for that. Am I wrong ?