The way getNimLibPath was implemented (by me) worked for choosenim installs (windows or linux) or "native" nim installs on windows, but failed for "native" package manager installs of Nim on Linux, because nim is usually in /usr/bin while nimbase.h gets placed in /usr/lib/nim.
This PR implements elcritch's idea of using nim dump instead. I added some extra checks for robustness (check that what we're returning is actually a directory and that it contains a file named nimbase.h).
Background: https://forum.nim-lang.org/t/9895
The way
getNimLibPath
was implemented (by me) worked for choosenim installs (windows or linux) or "native" nim installs on windows, but failed for "native" package manager installs of Nim on Linux, becausenim
is usually in/usr/bin
whilenimbase.h
gets placed in/usr/lib/nim
.This PR implements elcritch's idea of using
nim dump
instead. I added some extra checks for robustness (check that what we're returning is actually a directory and that it contains a file named nimbase.h).