Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-74908

ccache + icecream default config has issues

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None
    • Server Development Platform

    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
      

      Attachments

        Activity

          People

            backlog-server-devplatform [DO NOT ASSIGN] Backlog - Server Development Platform Team (SDP) (Inactive)
            daniel.moody@mongodb.com Daniel Moody
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: