keep CLI units current during rebuilds

This commit is contained in:
udo
2026-07-13 14:20:29 +00:00
parent 97ecc6edd6
commit cd2fa163e6
4 changed files with 19 additions and 7 deletions
+2 -1
View File
@@ -850,7 +850,8 @@ SharedUnit* compiler_get_shared_unit_internal(Request* context, String file_name
SharedUnit* su = new SharedUnit();
setup_unit_paths(context, su, file_name);
int fdlock = compiler_open_lock_file(su->wasm_name + ".lock", "shared-unit:" + file_name, !force_recompile);
bool can_serve_stale = !force_recompile && compiler_request_can_serve_stale_artifact(context);
int fdlock = compiler_open_lock_file(su->wasm_name + ".lock", "shared-unit:" + file_name, can_serve_stale);
if(fdlock == -2 && file_exists(su->wasm_name))
{
auto state = inspect_shared_unit_filesystem(context, su);
+1 -1
View File
@@ -100,7 +100,7 @@ static bool wasm_artifact_exists(Request* context, const String& entry_unit)
// metadata mismatches, which can leave stale wasm with old imports.
bool source_missing = false;
if(compiler_unit_needs_recompile(context, entry_unit, &source_missing))
return(compiler_request_can_serve_stale_artifact(context) || compiler_unit_compile_in_progress(context, entry_unit));
return(compiler_request_can_serve_stale_artifact(context));
if(source_missing)
return(false);
return(true);