From 5f2b5c801c279a55aec140b7b1be6a5bf4e60b5c Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Tue, 21 May 2024 16:11:19 +0900 Subject: [PATCH] Disable preprocessor cache when doing distributed compilation (#2173) --- src/compiler/c.rs | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/src/compiler/c.rs b/src/compiler/c.rs index 14f9e5d53..9e8db55ed 100644 --- a/src/compiler/c.rs +++ b/src/compiler/c.rs @@ -382,20 +382,22 @@ where // Try to look for a cached preprocessing step for this compilation // request. let preprocessor_cache_mode_config = storage.preprocessor_cache_mode_config(); - let mut preprocessor_key = if 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 - }; + // 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 + }; if let Some(preprocessor_key) = &preprocessor_key { if cache_control == CacheControl::Default { if let Some(mut seekable) =