-
Type:
Improvement
-
Resolution: Won't Fix
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Server Development Platform
-
None
-
None
-
None
-
None
-
None
-
None
-
None
It seems that some cases ccache experiences and error when running preprocessor with the command line args that come from icecream. This causes a large number of objects to always miss. By telling icecream not to use preprocessor we can fix the issue:
Two identical builds with a hot cache after rm -rf build:
time ninja -j400 -f opt.ninja install-all-meta real 7m52.245s user 33m34.861s sys 6m25.848s
Then with the ccache config change:
time ninja -j400 -f opt.ninja install-all-meta real 5m35.468s user 11m39.644s sys 2m47.040s
The change:
diff --git a/site_scons/site_tools/ccache.py b/site_scons/site_tools/ccache.py index dc7ca4cd1e3..7aab75d074f 100644 — a/site_scons/site_tools/ccache.py +++ b/site_scons/site_tools/ccache.py @@ -121,6 +121,13 @@ def generate(env): else: env["ENV"].pop("CCACHE_NOCPP2", None) env["ENV"]["CCACHE_CPP2"] = "1" + + if icecream_enabled: + env["ENV"].pop("CCACHE_NOCPP2", None) + env["ENV"]["CCACHE_CPP2"] = "true" + env["ENV"].pop("CCACHE_NODEPEND", None) + env["ENV"]["CCACHE_DEPEND"] = "true" + elif env.ToolchainIs("gcc"): if icecream_enabled and not env.get('CCACHE_EXTRAFILES_USE_SOURCE_PATHS', False): # Newer versions of Icecream will drop -fdirectives-only from