summary refs log tree commit diff stats
path: root/compiler/extccomp.nim
diff options
context:
space:
mode:
authoralaviss <alaviss@users.noreply.github.com>2019-03-04 15:09:14 +0700
committerAndreas Rumpf <rumpf_a@web.de>2019-03-04 09:09:14 +0100
commit8e126912135cb8964b4e22d1109867aa03a13319 (patch)
tree27e87540d87c377f8b4c5f164f92e288d818422d /compiler/extccomp.nim
parent65ad496fed0e928594749cb2456513bc47dab89e (diff)
downloadNim-8e126912135cb8964b4e22d1109867aa03a13319.tar.gz
compiler/extccomp: use getNimcacheDir for writing build instruction (#10772)
`conf.nimcacheDir` might be empty during build, which results in the
json build instructions being generated in the current directory. This
commit fixes the problem by using getNimcacheDir, which generates a
valid nimcacheDir should it be empty.

Fixes #10768
Diffstat (limited to 'compiler/extccomp.nim')
-rw-r--r--compiler/extccomp.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/extccomp.nim b/compiler/extccomp.nim
index 18a81ca96..5a1d33ade 100644
--- a/compiler/extccomp.nim
+++ b/compiler/extccomp.nim
@@ -969,7 +969,7 @@ proc writeJsonBuildInstructions*(conf: ConfigRef) =
 
   var buf = newStringOfCap(50)
 
-  let jsonFile = conf.nimcacheDir / RelativeFile(conf.projectName & ".json")
+  let jsonFile = conf.getNimcacheDir / RelativeFile(conf.projectName & ".json")
 
   var f: File
   if open(f, jsonFile.string, fmWrite):