1

I have two guesses:

It compiled from the start, but uses CCACHE to go much quicker

It continues, by detecting which modules have been compiled

What would happen if I clear the CCACHE but not the OUT directory? Would it continue or restart?

Hamzah Malik
  • 2,540
  • 3
  • 28
  • 46

1 Answers1

1

There are multiple layers that matter here.

  • At the top-level, you have (at least that's my impression from briefly looking at the build system) a make-system (or something similar). Make builds specific 'targets' by invoking commands. If a target already exists and is up-to-date (the source files on which it is based are not newer than the created target), make will not invoke any commands
  • One command make can invoke is a compile command (optionally prefixed with 'ccache'). If the command, prefixed with ccache, is called, ccache will check its cache directory to see if there's anything it can reuse. If something's available, ccache will simply copy a file from its cache to the desired location. If nothing's available, ccache will invoke the compiler command (and fill its cache with the result afterwards).

If you clear the ccache cache directory, it means the make 'targets' still exist and are up-to-date. This means make will decide no recompilation is needed for those targets. In other words: it will continue, not restart. Ccache doesn't even come into the picture yet at this point.

Mathiasdm
  • 1,791
  • 14
  • 26
  • Say there are 100 targets and its compiled #20 wrongly because it was forced closed. When i ran again, it should jump to 20, then it would realize it wasnt compiled properly (or would it realize?) and then it would compile it again. Would it use CCACHE to compile again? Or not since the CCACHE is from a broken version? – Hamzah Malik Nov 25 '14 at 19:46
  • 1
    If you interrupt the compile, there (normally) shouldn't be an output file for #20. As a result, make will call the command again. Ccache will run and check its cache. If the cache is empty, the compiler will be called (and afterwards, the object file will be stored in the ccache cache). – Mathiasdm Nov 26 '14 at 06:54