summary refs log tree commit diff stats
path: root/koch.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2019-07-11 21:36:23 +0200
committerGitHub <noreply@github.com>2019-07-11 21:36:23 +0200
commit3d88d06b32d1337fda45d419e9cd2ad845b74d5d (patch)
tree195ec50d46fe2cd4403e46286adb7829737bdbf1 /koch.nim
parentb8be1ccb855f8bde82ed1721e4231119ffa48e9f (diff)
downloadNim-3d88d06b32d1337fda45d419e9cd2ad845b74d5d.tar.gz
better run [feature] (#11709)
* track the checksums of all involved Nim files for smarter 'nim c -r' recompiles
* don't recompile unless necessary for 'nim c -r' [feature]
* [feature] koch boot uses a two step process in order to free the RAM before the GCC/Clang invocations
* fixes a serious regression
Diffstat (limited to 'koch.nim')
-rw-r--r--koch.nim8
1 files changed, 7 insertions, 1 deletions
diff --git a/koch.nim b/koch.nim
index 649bbf0f3..e3d197640 100644
--- a/koch.nim
+++ b/koch.nim
@@ -308,8 +308,14 @@ proc boot(args: string) =
         extraOption.add " -d:nimBoostrapCsources0_19_0"
         # remove this when csources get updated
 
-    exec "$# $# $# $# --nimcache:$# compiler" / "nim.nim" %
+    # in order to use less memory, we split the build into two steps:
+    # --compileOnly produces a $project.json file and does not run GCC/Clang.
+    # jsonbuild then uses the $project.json file to build the Nim binary.
+    exec "$# $# $# $# --nimcache:$# --compileOnly compiler" / "nim.nim" %
       [nimi, bootOptions, extraOption, args, smartNimcache]
+    exec "$# jsonscript --nimcache:$# compiler" / "nim.nim" %
+      [nimi, smartNimcache]
+
     if sameFileContent(output, i.thVersion):
       copyExe(output, finalDest)
       echo "executables are equal: SUCCESS!"