From 49df65c58ca06dbed840b4072479f85702efa0d6 Mon Sep 17 00:00:00 2001 From: araq Date: Wed, 26 Nov 2025 18:32:27 +0100 Subject: [PATCH] progress --- compiler/ast2nif.nim | 4 ++++ compiler/modulegraphs.nim | 2 ++ 2 files changed, 6 insertions(+) diff --git a/compiler/ast2nif.nim b/compiler/ast2nif.nim index c2929de614..6d28f2987a 100644 --- a/compiler/ast2nif.nim +++ b/compiler/ast2nif.nim @@ -951,6 +951,10 @@ proc populateInterfaceTablesFromIndex(c: var DecodeContext; module: FileIndex; if sym != nil: strTableAdd(interfHidden, sym) +proc toNifFilename*(conf: ConfigRef; f: FileIndex): string = + let suffix = moduleSuffix(conf, f) + result = toGeneratedFile(conf, AbsoluteFile(suffix), ".nif").string + proc loadNifModule*(c: var DecodeContext; f: FileIndex; interf, interfHidden: var TStrTable): PNode = let suffix = moduleSuffix(c.infos.config, f) let modFile = toGeneratedFile(c.infos.config, AbsoluteFile(suffix), ".nif").string diff --git a/compiler/modulegraphs.nim b/compiler/modulegraphs.nim index 585a88f4eb..bd92e4d86f 100644 --- a/compiler/modulegraphs.nim +++ b/compiler/modulegraphs.nim @@ -753,6 +753,8 @@ when not defined(nimKochBootstrap): ## Loads module from NIF file when optCompress is enabled. # loadNifModule will check if the file exists internally + if not fileExists(toNifFilename(g.config, fileIdx)): + return nil # Create module symbol let filename = AbsoluteFile toFullPath(g.config, fileIdx)