nim-lang / Nim

Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).
https://nim-lang.org
Other
16.55k stars 1.47k forks source link

Provide hints when nim.cfg is not found #11370

Open FedericoCeratto opened 5 years ago

FedericoCeratto commented 5 years ago

When nim.cfg is not found (e.g. it's still /etc/nim.cfg) the compiler fails to find the stdlib:

nim c -r mytest.nim
Hint: system [Processing]
Hint: mytest [Processing]
mytest.nim(1, 8) Error: cannot open file: tables

A hint or warning would be nice:

Hint: no config files found. It is recommended to create '/etc/nim/nim.cfg'

FedericoCeratto commented 5 years ago

cc @Michal-Szczepaniak

ringabout commented 3 years ago

Now you got a warning

D:\QQPCmgr\Desktop\Nim>nim c -r ttest.nim
Hint: used config file 'C:\Users\blue\.choosenim\toolchains\nim-#devel\config\config.nims' [Conf]
Hint: used config file 'D:\QQPCmgr\Desktop\Nim\ttest.nim.cfg' [Conf]
Warning: JSON processing failed: cannot open: C:\Users\blue\.choosenim\toolchains\nim-#devel\config\nim.cfg
....
D:\QQPCmgr\Desktop\Nim\ttest.nim(1, 8) Error: cannot open file: tables
timotheecour commented 3 years ago

Now you got a waring

what does nim c -r -f ttest.nim give?

(asking because the warning may depend on whether -f is passed)