From b7efd4d9d2f159ca25b3dd52d4ff24225538abb2 Mon Sep 17 00:00:00 2001 From: paulklint Date: Wed, 30 Oct 2024 23:01:51 +0100 Subject: [PATCH] Fixing issues regarding incrementality in the presence of libraries --- .../core/library/lang/rascalcore/check/CheckerCommon.rsc | 4 ++-- .../core/library/lang/rascalcore/check/Import.rsc | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/org/rascalmpl/core/library/lang/rascalcore/check/CheckerCommon.rsc b/src/org/rascalmpl/core/library/lang/rascalcore/check/CheckerCommon.rsc index 2a60e38b..1496cf18 100644 --- a/src/org/rascalmpl/core/library/lang/rascalcore/check/CheckerCommon.rsc +++ b/src/org/rascalmpl/core/library/lang/rascalcore/check/CheckerCommon.rsc @@ -229,7 +229,7 @@ ModuleStatus clearTModelCache(ModuleStatus ms){ } ModuleStatus removeTModel(str candidate, ModuleStatus ms){ - if(tpl_saved() notin ms.status[candidate]){ + if(tpl_saved() notin ms.status[candidate] && rsc_not_found() notin ms.status[candidate]){ pcfg = ms.pathConfig; if(ms.compilerConfig.verbose) println("Save before removing from cache "); tm = ms.tmodels[candidate]; @@ -291,11 +291,11 @@ tuple[bool, TModel, ModuleStatus] getTModelForModule(str qualifiedModuleName, Mo if(tpl.rascalTplVersion? && isValidRascalTplVersion(tpl.rascalTplVersion)){ tpl.convertedToPhysical = false; // temporary tpl = convertTModel2PhysicalLocs(tpl); + ms.tmodels[qualifiedModuleName] = tpl; mloc = getModuleLocation(qualifiedModuleName, pcfg); if(isModuleLocationInLibs(qualifiedModuleName, mloc, pcfg)){ ms.status[qualifiedModuleName] ? {} += rsc_not_found(); } - ms.tmodels[qualifiedModuleName] = tpl; ms.status[qualifiedModuleName] ? {} += {tpl_uptodate(), tpl_saved()}; if(qualifiedModuleName notin hardwired){ ms.tmodelLIFO = [qualifiedModuleName, *ms.tmodelLIFO]; diff --git a/src/org/rascalmpl/core/library/lang/rascalcore/check/Import.rsc b/src/org/rascalmpl/core/library/lang/rascalcore/check/Import.rsc index 231340ab..66f31523 100644 --- a/src/org/rascalmpl/core/library/lang/rascalcore/check/Import.rsc +++ b/src/org/rascalmpl/core/library/lang/rascalcore/check/Import.rsc @@ -98,7 +98,7 @@ ModuleStatus getImportAndExtendGraph(str qualifiedModuleName, ModuleStatus ms){ ms.status[qualifiedModuleName] += module_dependencies_extracted(); = getTModelForModule(qualifiedModuleName, ms); - if(found && rsc_not_found() notin ms.status[qualifiedModuleName]){ + if(found /*&& rsc_not_found() notin ms.status[qualifiedModuleName]*/){ allImportsAndExtendsValid = true; rel[str, PathRole] localImportsAndExtends = {}; @@ -161,8 +161,8 @@ ModuleStatus getImportAndExtendGraph(str qualifiedModuleName, ModuleStatus ms){ } } - else { - allImportsAndExtendsValid = false; + if(rsc_not_found() in ms.status[qualifiedModuleName]){ + return ms; } = getModuleParseTree(qualifiedModuleName, ms); @@ -332,7 +332,7 @@ rel[str,datetime,PathRole] makeBom(str qualifiedModuleName, set[str] imports, se + { }; } void updateBOM(str qualifiedModuleName, set[str] imports, set[str] extends, ModuleStatus ms){ - if(isModuleLocationInLibs(qualifiedModuleName, ms.moduleLocs[qualifiedModuleName], ms.pathConfig)){ + if(rsc_not_found() in ms.status[qualifiedModuleName]){ return; } = getTModelForModule(qualifiedModuleName, ms);