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.27k stars 1.46k forks source link

nim-2.0.0: finish.exe couldn't finish its work #22403

Open geff10 opened 11 months ago

geff10 commented 11 months ago

error message: Could not patch 'config/nim.cfg' [Error] Reason: patch substring not found: #gcc.path = r"$nim\dist\mingw\bin"

I have mingw. I also tried to reinstall it through chocolatey, update it. Then download the .7z manually from Nim's page, then also through finish.exe

Araq commented 11 months ago

I tested this myself and it worked for me. Also my nim.cfg has this line.

geff10 commented 11 months ago

@Araq mine doesn't. Do you have any idea whose (which script's/module's/component's) responsibility is to put that line there? I would be glad if I could use Nim "out of the box" with minimal to no configuration.

geff10 commented 11 months ago

extra info: I try to use Nim in Windows 11 environment (but I assume you already figured it out)

Araq commented 11 months ago

Ping @ringabout can you reproduce this?

ringabout commented 11 months ago

secs

ringabout commented 11 months ago

Btw, you might as well try choosenim, which certainly works for me for the time being.

ringabout commented 11 months ago

Yeah, I can reproduce it. Let me check the config.

Could not patch 'config/nim.cfg' [Error] Reason: patch substring not found:

gcc.path = r"$nim\dist\mingw\bin"

ringabout commented 11 months ago

Yeah, the problem is that you might have run the finish.exe more than once. So the line in the config has been replaced by the actual path.

ringabout commented 11 months ago

It's just a warning. Should I add something to detect it by special comments and give a better warning or something?

geff10 commented 11 months ago

@ringabout not really just a warning, as Nim didn't work me at all (like if it weren't in the path variable unknown command). I put that line into the config, run finish.exe. It was successful. Now Nim starts, but now I get this error: [..path_to_code..]Hello.Nim(1, 9) Warning: imported and not used: 'strutils' [UnusedImport] CC: C:/programs/nim/nim-2.0.0/lib/system/exceptions.nim Error: invocation of external compiler program failed. The system cannot find the file specified. Additional info: Requested command not found: 'C:\programs\nim\nim-2.0.0\dist\mingw\bin\gcc.exe -c -w -fmax-errors=3 -mno-ms-bitfields -IC:\programs\nim\nim-2.0.0\lib -ID:[path] -o [userdirectorypath]\nimcache\Hello_d\@mC@c@sprograms@snim@snim-2.0.0@slib@ssystem@sexceptions.nim.c.o [userdirectorypath]\nimcache\Hello_d\@mC@c@sprograms@snim@snim-2.0.0@slib@ssystem@sexceptions.nim.c'. OS error: 2

ringabout commented 11 months ago

What about gcc -v? Does C:\programs\nim\nim-2.0.0\dist\mingw\bin\gcc.exe exist? DId you restart the computer to put path environment variables in effect?