* fix #12293 findNimStdLibCompileTime should not break with nimble install compiler * address comment to unblock PR
This commit is contained in:
parent
69cc1ddc4d
commit
b11ff518fa
1 changed files with 5 additions and 2 deletions
|
|
@ -81,6 +81,9 @@ proc findNimStdLib*(): string =
|
||||||
## Returns "" on failure.
|
## Returns "" on failure.
|
||||||
try:
|
try:
|
||||||
let nimexe = os.findExe("nim")
|
let nimexe = os.findExe("nim")
|
||||||
|
# this can't work with choosenim shims, refs https://github.com/dom96/choosenim/issues/189
|
||||||
|
# it'd need `nim dump --dump.format:json . | jq -r .libpath`
|
||||||
|
# which we should simplify as `nim dump --key:libpath`
|
||||||
if nimexe.len == 0: return ""
|
if nimexe.len == 0: return ""
|
||||||
result = nimexe.splitPath()[0] /../ "lib"
|
result = nimexe.splitPath()[0] /../ "lib"
|
||||||
if not fileExists(result / "system.nim"):
|
if not fileExists(result / "system.nim"):
|
||||||
|
|
@ -93,8 +96,8 @@ proc findNimStdLib*(): string =
|
||||||
proc findNimStdLibCompileTime*(): string =
|
proc findNimStdLibCompileTime*(): string =
|
||||||
## Same as ``findNimStdLib`` but uses source files used at compile time,
|
## Same as ``findNimStdLib`` but uses source files used at compile time,
|
||||||
## and asserts on error.
|
## and asserts on error.
|
||||||
const sourcePath = currentSourcePath()
|
const exe = getCurrentCompilerExe()
|
||||||
result = sourcePath.parentDir.parentDir / "lib"
|
result = exe.splitFile.dir.parentDir / "lib"
|
||||||
doAssert fileExists(result / "system.nim"), "result:" & result
|
doAssert fileExists(result / "system.nim"), "result:" & result
|
||||||
|
|
||||||
proc createInterpreter*(scriptName: string;
|
proc createInterpreter*(scriptName: string;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue