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.23k stars 1.47k forks source link

nimsuggest doesn't work with nim-lang/Nim #18985

Closed MaskRay closed 2 years ago

MaskRay commented 2 years ago

Example

% cd ~/Dev/Nim   # latest devel
% nimsuggest compiler/semexprs.nim
Hint: used config file '/home/maskray/.choosenim/toolchains/nim-1.4.8/config/nim.cfg' [Conf]
Hint: used config file '/home/maskray/.choosenim/toolchains/nim-1.4.8/config/config.nims' [Conf]
Hint: used config file '/home/maskray/Dev/Nim/compiler/nim.cfg' [Conf]
SIGSEGV: Illegal storage access. (Attempt to read from nil?)

Expected Output

It doesn't crash, so nimlsp can work on the compiler itself (https://github.com/PMunch/nimlsp/issues/95)

Additional Information

% choosenim -v           
choosenim v0.8.2 (2021-10-05 20:21:40) [linux/amd64]
% nim -v   
Nim Compiler Version 1.4.8 [Linux: amd64]
Compiled at 2021-05-25
Copyright (c) 2006-2021 by Andreas Rumpf

git hash: 44e653a9314e1b8503f0fa4a8a34c3380b26fff3
active boot switches: -d:release
% nimsuggest -v
Nim Compiler Version 1.4.8 [Linux: amd64]
Compiled at 2021-05-25
Copyright (c) 2006-2021 by Andreas Rumpf

git hash: 44e653a9314e1b8503f0fa4a8a34c3380b26fff3
active boot switches: -d:release -d:danger --gc:markAndSweep
ringabout commented 2 years ago

Hello @MaskRay, thanks for reporting the issue. Could you try it again with nightly build version using choosenim devel command? After I switched from Nim 1.4.8 to devel, it worked.

image

ringabout commented 2 years ago

Hello @MaskRay, I hope https://github.com/nim-lang/Nim/pull/18988 can fix this issue.