From 8df6d2b8e2cf23e2cec5d8fc47eaa5157b862621 Mon Sep 17 00:00:00 2001 From: araq Date: Wed, 21 Jan 2026 14:38:13 +0100 Subject: [PATCH] progress --- compiler/deps.nim | 10 +++++----- compiler/modulegraphs.nim | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/compiler/deps.nim b/compiler/deps.nim index 7f3dfb797b..8c380926e4 100644 --- a/compiler/deps.nim +++ b/compiler/deps.nim @@ -223,9 +223,9 @@ proc traverseDeps(c: var DepContext; pair: FilePair; current: Node) = proc generateBuildFile(c: DepContext): string = ## Generate the .build.nif file for nifmake - createDir("nifcache") - result = "nifcache" / c.nodes[0].files[0].modname & ".build.nif" - #getNimcacheDir(c.config).string / c.nodes[0].files[0].modname & ".build.nif" + let nimcache = getNimcacheDir(c.config).string + createDir(nimcache) + result = nimcache / c.nodes[0].files[0].modname & ".build.nif" var b = nifbuilder.open(result) defer: b.close() @@ -250,7 +250,7 @@ proc generateBuildFile(c: DepContext): string = b.addSymbolDef "nim_m" b.addStrLit getAppFilename() b.addStrLit "m" - b.addStrLit "--nimcache:nifcache" + b.addStrLit "--nimcache:" & nimcache # Add search paths for p in c.config.searchPaths: b.addStrLit "--path:" & p.string @@ -265,7 +265,7 @@ proc generateBuildFile(c: DepContext): string = b.addSymbolDef "nim_nifc" b.addStrLit getAppFilename() b.addStrLit "nifc" - b.addStrLit "--nimcache:nifcache" + b.addStrLit "--nimcache:" & nimcache # Add search paths for p in c.config.searchPaths: b.addStrLit "--path:" & p.string diff --git a/compiler/modulegraphs.nim b/compiler/modulegraphs.nim index dda7f8a379..55f751cda7 100644 --- a/compiler/modulegraphs.nim +++ b/compiler/modulegraphs.nim @@ -379,7 +379,8 @@ proc loadCompilerProc*(g: ModuleGraph; name: string): PSym = if g.config.cmd in {cmdNifC, cmdM}: # First try system module (most compilerprocs are there) let systemFileIdx = g.config.m.systemFileIdx - if systemFileIdx != InvalidFileIdx: + if systemFileIdx != InvalidFileIdx and not g.withinSystem: + # Only try to load from NIF if the file exists (it may not during initial ic build) result = tryResolveCompilerProc(ast.program, name, systemFileIdx) if result != nil: strTableAdd(g.compilerprocs, result)