-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Added a few useful os calls to VM #7440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
These are dangerous. # yay, produces a binary that only runs on my machine
const myresource = getCurrentDir() / "file.txt"
discard readFile(myresource) |
|
Agreed, but they are are useful in the right context as well. Is it a question of documenting the procs accurately to avoid such scenarios or do we want to prevent adding them to the VM altogether? |
|
Maybe these should be called |
|
I'm working on a It works fine if the module file is in the same directory as the application that uses it but fails if it's a nimble module since There's no way for nimdeps to figure out the path to any file that's relative to the build directory since it isn't known at compile time today. Further, using absolute paths makes the module useless as a general purpose nimble library that can be leveraged by any user. This is one example of needing this functionality in the VM. I'm thinking there's other good reasons to need to know the current directory during compile time. |
The current diretory is not the build directory. What we need is |
|
Is there any other place in the compiler where the working directory gets changed during compile time? |
|
@genotrance |
|
Based on discussion, removed Retained |
|
Added to changelog under "Compiler changes" |
Consolidated wrappers by making them a bit generic rather than adding more for each new module/param/return combo.
Added the following procs since they are useful at compile time:-
Added test cases for all os and ospath VM ops.