From 4950951e349dec866a0b385e2a97ccd1b21828b7 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Fri, 17 May 2024 16:57:27 +0900 Subject: [PATCH 1/2] Disable preprocessor cache when doing distributed compilation At the moment, it doesn't work. --- src/compiler/c.rs | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/compiler/c.rs b/src/compiler/c.rs index 14f9e5d53..7bccc7032 100644 --- a/src/compiler/c.rs +++ b/src/compiler/c.rs @@ -382,20 +382,21 @@ 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 - }; + 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) = From 6b2c27dc58eefcff4bcd906864e71d39d2b138db Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Fri, 17 May 2024 16:35:01 +0200 Subject: [PATCH 2/2] document the change --- src/compiler/c.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/compiler/c.rs b/src/compiler/c.rs index 7bccc7032..9e8db55ed 100644 --- a/src/compiler/c.rs +++ b/src/compiler/c.rs @@ -382,6 +382,7 @@ where // Try to look for a cached preprocessing step for this compilation // 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(