fixes #12663 staticRead now creates a dependency for rebuilds (#12731) [backport]

* fix #12663 staticRead
* address comments
This commit is contained in:
Timothee Cour 2019-11-25 05:44:13 -08:00 • committed by Andreas Rumpf
commit dfe5d115fb
2 changed files with 15 additions and 12 deletions

View file

@ -8,6 +8,7 @@
#
import ast, types, msgs, os, options, idents, lineinfos
from pathutils import AbsoluteFile
proc opSlurp*(file: string, info: TLineInfo, module: PSym; conf: ConfigRef): string =
try:
@ -17,6 +18,7 @@ proc opSlurp*(file: string, info: TLineInfo, module: PSym; conf: ConfigRef): str
result = readFile(filename)
# we produce a fake include statement for every slurped filename, so that
# the module dependencies are accurate:
discard conf.fileInfoIdx(AbsoluteFile filename)
appendToModule(module, newNode(nkIncludeStmt, info, @[
newStrNode(nkStrLit, filename)]))
except IOError: