Skip to content

Commit

Permalink
Disable preprocessor cache with -MD and friends (#2195)
Browse files Browse the repository at this point in the history
Also hook up too_hard_for_preprocessor_cache_mode, because it wasn't.
  • Loading branch information
glandium authored Jun 6, 2024
1 parent 808e8fb commit f80ba73
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
32 changes: 17 additions & 15 deletions src/compiler/c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/compiler/gcc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f80ba73

Please sign in to comment.