chore: Remove ability to avoid 2nd call to preprocessor (run_second_cpp)
ccache before version 1.6 (2002) always sent precompiled source to the
compiler as an optimization to avoid running the preprocessor a second
time. ccache 1.6 (2002) introduced CCACHE_CPP2 to optionally disable
this optimization. This seemed to work well until mid 2010s when
compilers started to behave differently when compiling preprocessed and
non-preprocessed source code. Thus, ccache 3.3 (2016) flipped the
default to make the optimization opt-in via CCACHE_NOCPP2 (or
"run_second_cpp = false").
Fast forward to 2025:
- As far as I can tell, CCACHE_NOCPP2 is used by essentially nobody
which isn't surprising since it generally doesn't work well.
- The feature comes with increased code complexity. The most painful
part is that compiler arguments need to be carefully filtered and sent
to only the preprocessor, only the compiler or both, depending on
whether run_second_cpp is true or false. And it can be forced to true
in the middle of argument parsing when an argument that is
incompatible with "run_second_cpp = false" is found.
- There have been a non-trivial amount of bugs related to CCACHE_NOCPP2
during the years due to the added complexity and due to new compiler
behavior that is incompatible with the mode.a
- The depend mode is a more performant alternative to "run_second_cpp =
false" since ccache 3.6 (2019), though with different tradeoffs.
Thus it's time to make the code less complex and more maintainable:
remove the optimization to send the precompiled source code to the
compiler.
This opens up making argument juggling simpler and fixing bug #738.