diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2015-02-01 01:38:06 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2015-02-01 01:38:06 +0100 |
commit | fa166dc42da4b171fd45800ef9cc6197fb34dff7 (patch) | |
tree | 8a98418a5d7f06e6c712b8196e141d6e704a4c2c | |
parent | f6131f412a89f7b7cb2a501fa23235a9259c165e (diff) | |
parent | de77700067c5973e41681ef24819cd453a7622ad (diff) | |
download | Nim-fa166dc42da4b171fd45800ef9cc6197fb34dff7.tar.gz |
Merge pull request #2026 from reactormonk/koch-temp-125-exit-code
Koch temp 125 exit code
-rw-r--r-- | doc/intern.txt | 13 | ||||
-rw-r--r-- | koch.nim | 8 |
2 files changed, 18 insertions, 3 deletions
diff --git a/doc/intern.txt b/doc/intern.txt index d9da863f5..a103703d7 100644 --- a/doc/intern.txt +++ b/doc/intern.txt @@ -145,6 +145,19 @@ are also lots of procs that aid in debugging: # why does it process temp.nim here? writeStackTrace() +To create a new compiler for each run, use ``koch temp``:: + + ./koch temp c /tmp/test.nim + +``koch temp`` creates a debug build of the compiler, which is useful +to create stacktraces for compiler debugging. + +``koch temp`` returns 125 as the exit code in case the compiler +compilation fails. This exit code tells ``git bisect`` to skip the +current commit.:: + + git bisect start bad-commit good-commit + git bisect ./koch -r c test-source.nim The compiler's architecture =========================== diff --git a/koch.nim b/koch.nim index 432b9ff3d..bc7631bcc 100644 --- a/koch.nim +++ b/koch.nim @@ -77,9 +77,9 @@ proc findNim(): string = # assume there is a symlink to the exe or something: return nim -proc exec(cmd: string) = +proc exec(cmd: string, errorcode: int = QuitFailure) = echo(cmd) - if execShellCmd(cmd) != 0: quit("FAILURE") + if execShellCmd(cmd) != 0: quit("FAILURE", errorcode) proc tryExec(cmd: string): bool = echo(cmd) @@ -341,7 +341,9 @@ proc tests(args: string) = proc temp(args: string) = var output = "compiler" / "nim".exe var finalDest = "bin" / "nim_temp".exe - exec("nim c compiler" / "nim") + # 125 is the magic number to tell git bisect to skip the current + # commit. + exec("nim c compiler" / "nim", 125) copyExe(output, finalDest) if args.len > 0: exec(finalDest & " " & args) |