diff options
author | Emery Hemingway <ehmry@posteo.net> | 2021-09-30 11:27:38 +0200 |
---|---|---|
committer | Emery Hemingway <ehmry@posteo.net> | 2021-10-19 12:50:30 +0200 |
commit | 3cfbadec99c6da8c64767a31055361f95ac3ebe5 (patch) | |
tree | 1d1952bf45a512298d1f26c0dad57c42017da06f /pkgs/development | |
parent | a323570a264da96a0b0bcc1c9aa017794acdc752 (diff) |
nim: patch compiler to emit native file/line info format
Diffstat (limited to 'pkgs/development')
-rw-r--r-- | pkgs/development/compilers/nim/default.nix | 2 | ||||
-rw-r--r-- | pkgs/development/compilers/nim/toLocation.patch | 20 |
2 files changed, 21 insertions, 1 deletions
diff --git a/pkgs/development/compilers/nim/default.nix b/pkgs/development/compilers/nim/default.nix index 16896c8b6c050..2fe6f6edbfdc2 100644 --- a/pkgs/development/compilers/nim/default.nix +++ b/pkgs/development/compilers/nim/default.nix @@ -114,7 +114,7 @@ in { ./nixbuild.patch # Load libraries at runtime by absolute path - ]; + ] ++ lib.optional (!stdenv.hostPlatform.isWindows) ./toLocation.patch; configurePhase = '' runHook preConfigure diff --git a/pkgs/development/compilers/nim/toLocation.patch b/pkgs/development/compilers/nim/toLocation.patch new file mode 100644 index 0000000000000..1cfa15fad6e5f --- /dev/null +++ b/pkgs/development/compilers/nim/toLocation.patch @@ -0,0 +1,20 @@ +diff --git a/lib/std/private/miscdollars.nim b/lib/std/private/miscdollars.nim +index a41cf1bc1..5b92c696a 100644 +--- a/lib/std/private/miscdollars.nim ++++ b/lib/std/private/miscdollars.nim +@@ -4,12 +4,12 @@ template toLocation*(result: var string, file: string | cstring, line: int, col: + # it can be done in a single place. + result.add file + if line > 0: +- result.add "(" ++ result.add ':' + # simplify this after moving moving `include strmantle` above import assertions` + when declared(addInt): result.addInt line + else: result.add $line + if col > 0: +- result.add ", " ++ result.add ':' + when declared(addInt): result.addInt col + else: result.add $col +- result.add ")" ++ result.add ':' |