diff options
author | ringabout <43030857+ringabout@users.noreply.github.com> | 2024-10-01 14:11:07 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-01 08:11:07 +0200 |
commit | 0e1df88f7ebb97a807a4d3d3a3d8d49b6e15c4fd (patch) | |
tree | 9ba01dfeee0ef951c21d69aee49a1e6a70355797 | |
parent | a5f46a72ba7ce074c2b32f25eaac35bba6dbe744 (diff) | |
download | Nim-0e1df88f7ebb97a807a4d3d3a3d8d49b6e15c4fd.tar.gz |
check fileExists for outputFile (#24211)
ref https://github.com/nim-lang/Nim/commit/a5f46a72ba7ce074c2b32f25eaac35bba6dbe744#commitcomment-147402726
-rw-r--r-- | compiler/extccomp.nim | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/extccomp.nim b/compiler/extccomp.nim index e66746fbb..ce25da773 100644 --- a/compiler/extccomp.nim +++ b/compiler/extccomp.nim @@ -1048,7 +1048,8 @@ proc writeJsonBuildInstructions*(conf: ConfigRef; deps: StringTableRef) = bcache.depfiles.add (path, $secureHashFile(path)) bcache.nimexe = hashNimExe() - bcache.outputLastModificationTime = $getLastModificationTime(bcache.outputFile) + if fileExists(bcache.outputFile): + bcache.outputLastModificationTime = $getLastModificationTime(bcache.outputFile) conf.jsonBuildFile = conf.jsonBuildInstructionsFile conf.jsonBuildFile.string.writeFile(bcache.toJson.pretty) |