fixes #11758 [nobackport]
This commit is contained in:
parent
d40872bf9b
commit
745669ac25
1 changed files with 7 additions and 1 deletions
|
|
@ -949,6 +949,8 @@ proc callCCompiler*(conf: ConfigRef) =
|
||||||
#from json import escapeJson
|
#from json import escapeJson
|
||||||
import json, std / sha1
|
import json, std / sha1
|
||||||
|
|
||||||
|
template hashNimExe(): string = $secureHashFile(os.getAppFilename())
|
||||||
|
|
||||||
proc writeJsonBuildInstructions*(conf: ConfigRef) =
|
proc writeJsonBuildInstructions*(conf: ConfigRef) =
|
||||||
template lit(x: untyped) = f.write x
|
template lit(x: untyped) = f.write x
|
||||||
template str(x: untyped) =
|
template str(x: untyped) =
|
||||||
|
|
@ -1028,7 +1030,9 @@ proc writeJsonBuildInstructions*(conf: ConfigRef) =
|
||||||
str conf.commandLine
|
str conf.commandLine
|
||||||
lit ",\L\"nimfiles\":[\L"
|
lit ",\L\"nimfiles\":[\L"
|
||||||
nimfiles(conf, f)
|
nimfiles(conf, f)
|
||||||
lit "]\L"
|
lit "],\L\"nimexe\": \L"
|
||||||
|
str hashNimExe()
|
||||||
|
lit "\L"
|
||||||
|
|
||||||
lit "\L}\L"
|
lit "\L}\L"
|
||||||
close(f)
|
close(f)
|
||||||
|
|
@ -1045,6 +1049,8 @@ proc changeDetectedViaJsonBuildInstructions*(conf: ConfigRef; projectfile: Absol
|
||||||
let oldCmdLine = data["cmdline"].getStr
|
let oldCmdLine = data["cmdline"].getStr
|
||||||
if conf.commandLine != oldCmdLine:
|
if conf.commandLine != oldCmdLine:
|
||||||
return true
|
return true
|
||||||
|
if hashNimExe() != data["nimexe"].getStr:
|
||||||
|
return true
|
||||||
let nimfilesPairs = data["nimfiles"]
|
let nimfilesPairs = data["nimfiles"]
|
||||||
doAssert nimfilesPairs.kind == JArray
|
doAssert nimfilesPairs.kind == JArray
|
||||||
for p in nimfilesPairs:
|
for p in nimfilesPairs:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue