From 1a88e2a18bc54cbea743ccb526cbd691312577a4 Mon Sep 17 00:00:00 2001 From: Simon Hafner Date: Wed, 28 Jan 2015 13:19:34 -0600 Subject: koch temp has 125 exit code for git bisect --- koch.nim | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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) -- cgit 1.4.1-2-gfad0 From fb1f15476fb3414763adb9abb05cb428fabf0484 Mon Sep 17 00:00:00 2001 From: Simon Hafner Date: Wed, 28 Jan 2015 13:33:47 -0600 Subject: added documentation about koch temp and the 125 exit code --- doc/intern.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc/intern.txt b/doc/intern.txt index d9da863f5..76139f672 100644 --- a/doc/intern.txt +++ b/doc/intern.txt @@ -145,6 +145,16 @@ 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`` 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 =========================== -- cgit 1.4.1-2-gfad0 From de77700067c5973e41681ef24819cd453a7622ad Mon Sep 17 00:00:00 2001 From: Simon Hafner Date: Sat, 31 Jan 2015 18:28:32 -0600 Subject: added note about creating stacktraces --- doc/intern.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/intern.txt b/doc/intern.txt index 76139f672..a103703d7 100644 --- a/doc/intern.txt +++ b/doc/intern.txt @@ -149,6 +149,9 @@ 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.:: -- cgit 1.4.1-2-gfad0