I'm having a weird problem when compiling a Nim program from VSCode's internal terminal. Compilation starts normally then stops at a random moment with:
Error: unhandled exception: Unknown IO Error [IOError]
Apparently this is a Nim error message. It appears in the compiler output sometimes at the weirdest moment, like this:Hint: tError: unhandled exception: Unknown IO Error [IOError]
The compilation still goes to the end once in a while, but this is unpredictable (and frustrating).
This only happens on my Windows 10 machine (on Linux it runs fine). It started to happen right after I updated the OS to its latest version (1709). Compiling the same Nim program from another terminal (git-bash) still works.
I've tried to reinstall VSCode and Nim (from the git repository) but the error is still there.
I've generated a debug compiler with
koch boot -d:debug --debuginfo --stackTrace:on
I could reproduce the same error many times (with non deterministic behaviour). The stack trace always ends like this:
modules.nim(180) compileModule
passes.nim(182) processModule
passes.nim(112) openPasses
passaux.nim(20) verboseOpen
msgs.nim(951) rawMessage
msgs.nim(815) rawMessage
sysio.nim(68) checkErr
sysio.nim(60) raiseEIO
system.nim(2809) sysFatal
Error: unhandled exception: Unknown IO Error [IOError]
or like this:
modules.nim(180) compileModule
passes.nim(221) processModule
passes.nim(128) closePasses
sem.nim(577) myClose
lookups.nim(73) closeScope
lookups.nim(175) ensureNoMissingOrUnusedSymbols
msgs.nim(1044) message
msgs.nim(815) liMessage
sysio.nim(68) checkErr
sysio.nim(60) raiseEIO
system.nim(2809) sysFatal
Error: unhandled exception: Unknown IO Error [IOError]
I've got the same problem on my work laptop. It seems like it only happens within VSCode after its been open for a while. Compiling in a console works fine from what I can tell.
If I hammer the compile button a few times it'll go through eventually.
It should work now.