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

ninja and SCons do not see each others ccache

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • ALL
    • Hide

      reproduced on master commit: 0662433ac038f4f3cf137a1be30ca245c180e990

      Repro system:
      Ubuntu 18.04 virtual workstation

      Steps to reproduce:

      1. Start with clean checkout and clean cache:
        git clean -xfd
        ccache -Cz
      2. build with scons
        /usr/bin/python3.8 "buildscripts/scons.py" CCACHE=ccache build/opt/mongo/db/global_settings.o
      3. delete the object file and set ccache to log:
        rm build/opt/mongo/db/global_settings.o
        export CCACHE_LOGFILE=scons_ccache.log
      4. build again
        /usr/bin/python3.8 "buildscripts/scons.py" CCACHE=ccache build/opt/mongo/db/global_settings.o
      5. now set the log file to something else:
        export CCACHE_LOGFILE=ninja_ccache.log
      6. generate ninja and build
        /usr/bin/python3.8 "buildscripts/scons.py" CCACHE=ccache --ninja --build-tools=next generate-ninja
        ninja build/opt/mongo/db/global_settings.o
      7. Now remove the file and cache log so we can minimize the log
        rm ninja_ccache.log
        rm build/opt/mongo/db/global_settings.o
        ninja build/opt/mongo/db/global_settings.o
      8. compare the log files.
      Show
      reproduced on master commit: 0662433ac038f4f3cf137a1be30ca245c180e990 Repro system: Ubuntu 18.04 virtual workstation Steps to reproduce: Start with clean checkout and clean cache: git clean -xfd ccache -Cz build with scons /usr/bin/python3.8 "buildscripts/scons.py" CCACHE=ccache build/opt/mongo/db/global_settings.o delete the object file and set ccache to log: rm build/opt/mongo/db/global_settings.o export CCACHE_LOGFILE=scons_ccache.log build again /usr/bin/python3.8 "buildscripts/scons.py" CCACHE=ccache build/opt/mongo/db/global_settings.o now set the log file to something else: export CCACHE_LOGFILE=ninja_ccache.log generate ninja and build /usr/bin/python3.8 "buildscripts/scons.py" CCACHE=ccache --ninja --build-tools=next generate-ninja ninja build/opt/mongo/db/global_settings.o Now remove the file and cache log so we can minimize the log rm ninja_ccache.log rm build/opt/mongo/db/global_settings.o ninja build/opt/mongo/db/global_settings.o compare the log files.
    • Dev Platform 2020-09-07

      When building first with SCons or ninja, then deleting the built object file, and then rebuilding with the opposing tool, SCons and ninja do not use each others ccache and instead will build and put the object file in ccache twice with different hashes.

       

      Attached log files show two cache hits, but with different hashes.

        1. ninja_ccache.log
          4 kB
          Daniel Moody
        2. scons_ccache.log
          3 kB
          Daniel Moody

            Assignee:
            ryan.egesdahl@mongodb.com Ryan Egesdahl (Inactive)
            Reporter:
            daniel.moody@mongodb.com Daniel Moody
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: