Closed genotrance closed 5 years ago
maybe related:
nim e main.nim
fails with a really bad error msg when extension is wrong (nim instead of nims):
./bin/nim e --skipUserCfg $timn_D/tests/nim/all/t0538.nim
Hint: used config file '/Users/timothee/git_clone/nim/Nim_devel/config/nim.cfg' [Conf]
Hint: used config file '/Users/timothee/git_clone/nim/timn/nim.cfg' [Conf]
Hint: used config file '/Users/timothee/git_clone/nim/Nim_devel/config/config.nims' [Conf]
Hint: system [Processing]
Hint: widestrs [Processing]
Hint: io [Processing]
Hint: stdin [Processing]
(1, 57) Error: undeclared identifier: '//'
passing --verbosity:3
is equally unhelpful
Just to clarify again - the way I found the issue is not the typical use case. Fact is that if you run nim e
with a bad filename, you get an unrelated error and it isn't clear what happened. You can also recreate the issue by deleting the file at runtime.
(1, 21) Error: undeclared identifier: 'a'
suggests that there's a problem in the file contents, not that the file doesn't even exist or got deleted during execution.
Similar to @timotheecour's report, .nim
extension is not support for nim e
but you don't get a helpful error.
Should be fixed by https://github.com/nim-lang/Nim/pull/11961
Similar to how batch files die if the file gets modified or deleted during execution.
If you have a nimscript file
a.nims
with:Running this script gives random error about filename. This affected nimble's nocompiler feature (removing compiler from nimble). As noted by @andreaferretti in https://github.com/nim-lang/nimble/pull/635#issuecomment-488645566, since nimble is being called recursively, the nims file copied by parent process gets deleted by child process.
I am fixing this in nimble separately (don't delete if you didn't copy it in the first place) but it seems this might bite others as well. The use case might not be too common but interesting to document at the very least.
Error (with stack trace) is: