summary refs log tree commit diff stats
path: root/koch.nim
diff options
context:
space:
mode:
authorTimothee Cour <timothee.cour2@gmail.com>2021-06-28 08:15:20 -0700
committerGitHub <noreply@github.com>2021-06-28 17:15:20 +0200
commitcb9496693a718cdb9ad8b764f82f524efe943bd2 (patch)
tree900c3c6326afa08fac231a71d7c704c14900fc86 /koch.nim
parent0be17f5d9c6b66a8f8dda83c9a3c77c61be3844d (diff)
downloadNim-cb9496693a718cdb9ad8b764f82f524efe943bd2.tar.gz
`./koch tools` now builds bin/nim_dbg, a debug version of nim (#18289)
Diffstat (limited to 'koch.nim')
-rw-r--r--koch.nim10
1 files changed, 8 insertions, 2 deletions
diff --git a/koch.nim b/koch.nim
index 6a0b7a0d3..d3957069b 100644
--- a/koch.nim
+++ b/koch.nim
@@ -215,8 +215,14 @@ proc buildTools(args: string = "") =
                  options = "-d:release " & args)
   when defined(windows): buildVccTool(args)
   bundleNimpretty(args)
-  nimCompileFold("Compile testament", "testament/testament.nim",
-                 options = "-d:release " & args)
+  nimCompileFold("Compile testament", "testament/testament.nim", options = "-d:release" & args)
+
+  # pre-packages a debug version of nim which can help in many cases investigate issuses
+  # withouth having to rebuild compiler.
+  # `-d:nimDebugUtils` only makes sense when temporarily editing/debugging compiler
+  # `-d:debug` should be changed to a flag that doesn't require re-compiling nim
+  # `--opt:speed` is a sensible default even for a debug build, it doesn't affect nim stacktraces
+  nimCompileFold("Compile nim_dbg", "compiler/nim.nim", options = "--opt:speed --stacktrace -d:debug --stacktraceMsgs -d:nimCompilerStacktraceHints" & args, outputName = "nim_dbg")
 
 proc nsis(latest: bool; args: string) =
   bundleNimbleExe(latest, args)