Invalidate component freshness by source generation

This commit is contained in:
udo
2026-07-17 23:14:42 +00:00
parent 075ce0bc07
commit e176ff09d9
5 changed files with 68 additions and 3 deletions
+7
View File
@@ -1263,6 +1263,7 @@ void run_proactive_compiler()
{
auto tracked_units = compiler_list_known_units(&background_context);
StringList existing_units;
bool source_generation_changed = false;
for(auto& file_name : tracked_units)
{
@@ -1271,9 +1272,13 @@ void run_proactive_compiler()
bool retry_allowed = (retry_it == retry_after.end() || time_precise() >= retry_it->second);
bool needs_compile = compiler_unit_needs_recompile(&background_context, file_name, &source_missing);
if(needs_compile && retry_allowed)
{
proactive_compile_queue_push(compile_queue, file_name);
source_generation_changed = true;
}
if(source_missing)
{
source_generation_changed = true;
printf("(i) proactive compiler forget removed unit %s\n", file_name.c_str());
retry_after.erase(file_name);
continue;
@@ -1283,6 +1288,8 @@ void run_proactive_compiler()
if(existing_units.size() != tracked_units.size())
compiler_set_known_units(&background_context, existing_units);
if(source_generation_changed)
compiler_mark_source_generation(&background_context);
next_scan_at = time_precise() + check_interval;
}