recc should make it easier to work with inputs that aren't specified in generated makefile deps

Compile commands can have inputs that aren't present in the makefile rules generated with the -M flag. Some (non-exhaustive) examples:

  • If the input contains __has_include(<foo.h>) but does not subsequently #include <foo.h>, then foo.h needs to exist somewhere in the include path. Similarly for __has_include_next. These were previously clang extensions, but are included in the C++17 standard (IIRC). This is tricky to handle without a custom preprocessor :(
  • Non-source input files specified on the command line, eg -fprofile-use=foo, clang's -fsanitize-blacklist=blacklist_file.txt flag, or clang plugins.
  • Non-source input files specified in environment variables, eg TSAN_OPTIONS' external_symbolizer_path setting (though perhaps this is considered part of the toolchain and not an input).

As far as I can tell there are only two methods to manually specify inputs with recc, but both are rather inconvenient:

  • RECC_DEPS_OVERRIDE - you need to enumerate all inputs (even those present in the generated makefile rules).
  • RECC_DEPS_DIRECTORY_OVERRIDE - if the parent directory containing all the inputs has a large subtree, you need to upload lots of unnecessary files.

It would be good if there was something like a RECC_IMPLICIT_DEPS variable, which lets you specify a list of files and/or directories that should be uploaded in addition to those automatically discovered. And it would be helpful to document a list of known situations that this is likely to help with.