fix #13412 nim now recompiles for stdin input; SuccessX now configurable; can show whether it recompiled (#13506)

* fix #13412 nim now recompiles for stdin input; SuccessX now indicates whether it recompiled
This commit is contained in:
Timothee Cour 2020-03-19 02:39:18 -07:00 • committed by GitHub
commit 1f2042411a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View file

@ -1064,6 +1064,9 @@ proc writeJsonBuildInstructions*(conf: ConfigRef) =
lit ",\L\"extraCmds\": "
lit $(%* conf.extraCmds)
lit ",\L\"stdinInput\": "
lit $(%* conf.projectIsStdin)
if optRun in conf.globalOptions or isDefined(conf, "nimBetterRun"):
lit ",\L\"cmdline\": "
str conf.commandLine
@ -1090,6 +1093,13 @@ proc changeDetectedViaJsonBuildInstructions*(conf: ConfigRef; projectfile: Absol
return true
if hashNimExe() != data["nimexe"].getStr:
return true
if not data.hasKey("stdinInput"): return true
let stdinInput = data["stdinInput"].getBool
if conf.projectIsStdin or stdinInput:
# could optimize by returning false if stdin input was the same,
# but I'm not sure how to get full stding input
return true
let depfilesPairs = data["depfiles"]
doAssert depfilesPairs.kind == JArray
for p in depfilesPairs: