Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable preprocessor cache with -MD and friends #2195

Merged
merged 1 commit into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you please add a log entry here ? might be hard to debug otherwise for people who might want to use it

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would need to mention what specifically makes it too hard for the preprocessor cache, though, otherwise the log is not going to be useful (like cannot_cache!). Maybe more of a followup?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in #2197. I'll rebase this one when that one is merged.

};
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
Loading