Closed PMunch closed 1 year ago
Add --path:"$nim"
so it uses the Nim compiler's lib that you're compiling with, requires "compiler"
is tedious to maintain since it does not force the api to match the compiler version.
why not use mImport like nimlsp does.
macro mImport(path: static[string]): untyped =
result = newNimNode(nnkStmtList)
result.add(quote do:
import `path`
)
I think this might be related to this issue: https://github.com/PMunch/ratel/issues/12
@PMunch yea it's probably related, I still just dont like any of the possible solutions. Guess I need to grow up and just choose one.
This is a problem for NimLSP as well. In fact it's a problem for any package that tries to use the Nim compiler. The fact that the compiler
package doesn't actually work to build things with the compiler is a shame.
Closed by https://github.com/beef331/nimscripter/commit/a76d785bf1d4aea064a5f08066949ba063f5fbe3 (v1.0.21) apparently one can do import "$nim"/compiler/module
See this PR for reference. https://github.com/nim-lang/Nim/pull/21662/files
Just added nimscripter as a dependency to my package and noticed that it failed to build with the error:
Adding
requires "compiler"
fixes it, but shouldn't this be done in nimscripter instead?