nim-lang / Nim

Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).
https://nim-lang.org
Other
16.55k stars 1.47k forks source link

nimscript: `setcommand` doesn't support absolute paths on Windows #4765

Closed nigredo-tori closed 7 years ago

nigredo-tori commented 8 years ago
import ospaths

--app:lib
--define:createNimRtl

let nimDir = findExe("nim").parentDir.parentDir
setcommand "c", nimDir / "lib" / "nimrtl.nim"

fails:

Error: cannot open 'c:\dev\tmp\c:\dev\nim\lib\nimrtl.nim'

The reason - code in compiler/scriptconfig.nim assumes canonicalizePath raises OSError on invalid paths. On Windows it does not.

Araq commented 7 years ago

Ok, so you found the reason. How about a PR?