After
c7c0837a23fe9dc79613bf3dd4ddd8d91c58d541, update_manifest_file can
be called erroneously if the direct mode is disabled when there has been
a preprocessed hit.
Fix this by asserting that update_manifest_file is only called when
direct mode is enabled, fixing the call site and adding the test case
that should already have existed.
Fixes #935.
return;
}
+ ASSERT(ctx.config.direct_mode());
+
MTR_SCOPE("manifest", "manifest_put");
// See comment in get_file_hash_index for why saving of timestamps is forced
// If we can return from cache at this point then do.
const auto found = from_cache(ctx, FromCacheCallMode::cpp, *result_key);
if (found) {
- if (manifest_key && put_result_in_manifest) {
+ if (ctx.config.direct_mode() && manifest_key && put_result_in_manifest) {
update_manifest_file(ctx, *manifest_key, *result_key);
}
return Statistic::preprocessed_cache_hit;
expect_stat preprocessed_cache_hit 1
expect_stat cache_miss 1
+ $CCACHE_COMPILE -c time_h.c
+ expect_stat direct_cache_hit 0
+ expect_stat preprocessed_cache_hit 2
+ expect_stat cache_miss 1
+
# -------------------------------------------------------------------------
TEST "__TIME__ in source file ignored if sloppy"