[m-rev.] diff: Fix update of timestamp cache by target file.

Peter Wang novalazy at gmail.com
Wed Dec 6 12:49:31 AEDT 2023


(I thought bug #569 was fixed by the change yesterday but it was not.)
-----

We introduced a cache of timestamps by target file in commit 4d4ef3e3a,
but when a target is made, only the timestamp for the main TargetFile
was invalidated, not the timestamps of other files that may also have
been touched, such as files for any nested submodules.

Fixes Mantis bug #569.

compiler/make.module_target.m:
    Delete the timestamps of all TouchedTargetFiles in
    record_made_target_given_maybe_touched_files,
    not only the main TargetFile.

diff --git a/compiler/make.module_target.m b/compiler/make.module_target.m
index ba05bb602..97c5b8253 100644
--- a/compiler/make.module_target.m
+++ b/compiler/make.module_target.m
@@ -820,7 +820,7 @@ record_made_target_given_maybe_touched_files(ProgressStream, Globals,
     ),
 
     TargetFileTimestamps0 = make_info_get_target_file_timestamps(!.Info),
-    version_hash_table.delete(TargetFile,
+    list.foldl(version_hash_table.delete, TouchedTargetFiles,
         TargetFileTimestamps0, TargetFileTimestamps),
     make_info_set_target_file_timestamps(TargetFileTimestamps, !Info).
 
-- 
2.42.0



More information about the reviews mailing list