-
Notifications
You must be signed in to change notification settings - Fork 120
Debugging the Nim compiler
Mamy Ratsimbazafy edited this page Apr 25, 2019
·
1 revision
Due to Nimbus sometimes using niche features of the Nim compiler, we might encounter compiler crashes or semantic check errors with no clue how to proceed forward and a lot of difficulty to create a minimal test case.
2 strategies to kickstart an investigation are available. The first one is to compile a Nim compiler with stack traces enabled.
- Clone Nim and build
koch
as in the Nim readme. - Create a temporary Nim compiler with stacktraces, for example to debug https://github.com/status-im/nimbus/issues/322, this is the command to reproduce the bug:
./koch temp c -r -o:build/gascosts ../../Status/nimbus/tests/all_tests.nim # Replace by your own path
You can use git bisect to narrow down the offending commit. Usually only koch boot -d:release
is needed to rebuild bin/nim
but sometimes you need to re-bootstrap the koch
and potentially the csources