diff --git a/src/compiler/c.rs b/src/compiler/c.rs index 4b0e96779..e5dc0d782 100644 --- a/src/compiler/c.rs +++ b/src/compiler/c.rs @@ -383,21 +383,23 @@ where // request. let preprocessor_cache_mode_config = storage.preprocessor_cache_mode_config(); // Disable preprocessor cache when doing distributed compilation - let mut preprocessor_key = - if !may_dist && preprocessor_cache_mode_config.use_preprocessor_cache_mode { - preprocessor_cache_entry_hash_key( - &executable_digest, - parsed_args.language, - &preprocessor_and_arch_args, - &extra_hashes, - &env_vars, - &absolute_input_path, - compiler.plusplus(), - preprocessor_cache_mode_config, - )? - } else { - None - }; + let mut preprocessor_key = if !may_dist + && preprocessor_cache_mode_config.use_preprocessor_cache_mode + && !parsed_args.too_hard_for_preprocessor_cache_mode + { + preprocessor_cache_entry_hash_key( + &executable_digest, + parsed_args.language, + &preprocessor_and_arch_args, + &extra_hashes, + &env_vars, + &absolute_input_path, + compiler.plusplus(), + preprocessor_cache_mode_config, + )? + } else { + None + }; if let Some(preprocessor_key) = &preprocessor_key { if cache_control == CacheControl::Default { if let Some(mut seekable) = storage diff --git a/src/compiler/gcc.rs b/src/compiler/gcc.rs index d845e9751..9a6e67a9d 100644 --- a/src/compiler/gcc.rs +++ b/src/compiler/gcc.rs @@ -350,6 +350,7 @@ where } Some(Output(p)) => output_arg = Some(p.clone()), Some(NeedDepTarget) => { + too_hard_for_preprocessor_cache_mode = true; need_explicit_dep_target = true; if let DepArgumentRequirePath::NotNeeded = need_explicit_dep_argument_path { need_explicit_dep_argument_path = DepArgumentRequirePath::Missing;