Open nocturn9x opened 1 month ago
Related issues: https://github.com/nim-lang/Nim/issues/21534 https://github.com/nim-lang/Nim/issues/19558
A path created at compile time can be used at both compile time and run time. I have created new path library to workaround this issue: https://github.com/demotomohiro/pathX
Add a mention to the lib in the docs? 🤔
Description
The VM used for compile time evaluation does not appear to be using
hostOS
to pick which path style to use in functions likejoinPath()
(possiblytargetOS
is being used?). This is a problem I encountered while trying to cross compile my project for Windows while being on Linux: part of the code tries to statically read the contents of two JSON files into twoconst
s and fails because the path is incorrectNim Version
Nim Compiler Version 2.0.4 [Linux: amd64] Compiled at 2024-03-28 Copyright (c) 2006-2023 by Andreas Rumpf
git hash: b47747d31844c6bd9af4322efe55e24fefea544c active boot switches: -d:release
Current Output
Expected Output
Possible Solution
The nim compile time evaluator should use
hostOS
for picking the path separator to useAdditional Information
No response