Skip to content

Commit

Permalink
fix #13412 nim now recompiles for stdin input; SuccessX now configura…
Browse files Browse the repository at this point in the history
…ble; can show whether it recompiled (#13506)

* fix #13412 nim now recompiles for stdin input; SuccessX now indicates whether it recompiled
  • Loading branch information
timotheecour authored Mar 19, 2020
1 parent a17e87b commit 1f20424
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions compiler/extccomp.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion compiler/lineinfos.nim
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const
warnCycleCreated: "$1",
warnUser: "$1",
hintSuccess: "operation successful: $#",
# keep in sync with `pegSuccess` see testament.nim
# keep in sync with `testament.isSuccess`
hintSuccessX: "$loc LOC; $sec sec; $mem; $build build; proj: $project; out: $output",
hintCC: "CC: $1",
hintLineTooLong: "line too long",
Expand Down

0 comments on commit 1f20424

Please sign in to comment.