[SERVER-74908] ccache + icecream default config has issues Created: 15/Mar/23  Updated: 16/Oct/23  Resolved: 16/Oct/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Daniel Moody Assignee: [DO NOT ASSIGN] Backlog - Server Development Platform Team (SDP) (Inactive)
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Server Development Platform
Participants:

 Description   

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


Generated at Thu Feb 08 06:28:51 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.