Closed danwhitford closed 3 years ago
Oh, that's a great point. The only thing I'm wondering about is whether import posix_utils
should be behind a when defined(posix)
(I suppose the module is just empty on non posix systems, but I haven't checked).
Otherwise, thanks a lot for this!
edit: I should add: I fear the CI might still be broken on devel, cause choosenim
was/is stuck on an old Nim devel version. I kept wanting to go and replace choosenim, but haven't done so so far unfortunately.
Oh, that's a great point. The only thing I'm wondering about is whether
import posix_utils
should be behind awhen defined(posix)
(I suppose the module is just empty on non posix systems, but I haven't checked).
That makes sense, I'm pretty new to nim and hadn't seen that pattern before but looks sensible. I have updated.
Just checked travis btw and it seems like choosenim is finally pulling a devel version with the infinite recursion bug fixed. So CI passes for this PR now.
Problem I had a couple of issues with the check for running under WSL
/proc/version
file does not exist on all Posixes, notably not on MacOS. This was causing the program to crash with anOSError
Fix Using
uname()
fromposix_tools
should be more portable for other Posixes and will not crash if the file doesn't exist. Also added check forwindows
andWindows
!I hope it's OK to create a PR without an issue first. Happy to create one if you prefer.