You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The VM used for compile time evaluation does not appear to be using hostOS to pick which path style to use in functions like joinPath() (possibly targetOS 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 two consts and fails because the path is incorrect
import os
funcbuildPath: string {.compileTime.} =result=joinPath(currentSourcePath().parentDir(), "resources")
const x =buildPath()
echo x
Nim Version
Nim Compiler Version 2.0.4 [Linux: amd64]
Compiled at 2024-03-28
Copyright (c) 2006-2023 by Andreas Rumpf
git hash: b47747d
active boot switches: -d:release
Current Output
\home\nocturn9x\heimdall\resources
Expected Output
/home/nocturn9x/heimdall/resources
Possible Solution
The nim compile time evaluator should use hostOS for picking the path separator to use
Additional Information
No response
The text was updated successfully, but these errors were encountered:
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
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: b47747d
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
The text was updated successfully, but these errors were encountered: