From 1cbcbd9269e19838858a9b26d455590b753b85f8 Mon Sep 17 00:00:00 2001 From: Juan M Gómez Date: Mon, 10 Jun 2024 15:17:02 +0100 Subject: Fixes #23695: On Linux, "nimsuggest" crashes if Nim is installed in /usr/bin and the library in /usr/lib/nim (#23697) (Not tested) --- nimsuggest/nimsuggest.nim | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/nimsuggest/nimsuggest.nim b/nimsuggest/nimsuggest.nim index 41dccb270..ee05f97a0 100644 --- a/nimsuggest/nimsuggest.nim +++ b/nimsuggest/nimsuggest.nim @@ -759,15 +759,7 @@ proc handleCmdLine(cache: IdentCache; conf: ConfigRef) = if gMode != mstdin: conf.writelnHook = proc (msg: string) = discard - # Find Nim's prefix dir. - let binaryPath = findExe("nim") - if binaryPath == "": - raise newException(IOError, - "Cannot find Nim standard library: Nim compiler not in PATH") - conf.prefixDir = AbsoluteDir binaryPath.splitPath().head.parentDir() - if not dirExists(conf.prefixDir / RelativeDir"lib"): - conf.prefixDir = AbsoluteDir"" - + conf.prefixDir = conf.getPrefixDir() #msgs.writelnHook = proc (line: string) = log(line) myLog("START " & conf.projectFull.string) @@ -1341,13 +1333,7 @@ else: conf.writelnHook = proc (msg: string) = discard # Find Nim's prefix dir. if nimPath == "": - let binaryPath = findExe("nim") - if binaryPath == "": - raise newException(IOError, - "Cannot find Nim standard library: Nim compiler not in PATH") - conf.prefixDir = AbsoluteDir binaryPath.splitPath().head.parentDir() - if not dirExists(conf.prefixDir / RelativeDir"lib"): - conf.prefixDir = AbsoluteDir"" + conf.prefixDir = conf.getPrefixDir() else: conf.prefixDir = AbsoluteDir nimPath -- cgit 1.4.1-2-gfad0 im/stats/tests/template/tlt.nim?h=devel'>stats
path: root/tests/template/tlt.nim
blob: 75c7dd9919718b8a5f37832cf5d5006181cc7a5d (plain) (blame)
1
2
3
4
5
6
7