diff options
author | Juan M Gómez <info@jmgomez.me> | 2024-06-10 15:17:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-10 16:17:02 +0200 |
commit | 1cbcbd9269e19838858a9b26d455590b753b85f8 (patch) | |
tree | d4f58eeab0390fcdcfd51f17cb9987326e7ba625 | |
parent | 56c95758b2777a36c8608a7b9950ba5ce8ce0b65 (diff) | |
download | Nim-1cbcbd9269e19838858a9b26d455590b753b85f8.tar.gz |
Fixes #23695: On Linux, "nimsuggest" crashes if Nim is installed in /usr/bin and the library in /usr/lib/nim (#23697)
(Not tested)
-rw-r--r-- | nimsuggest/nimsuggest.nim | 18 |
1 files 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 |