-
-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't assume vcc availability on Windows #37
Comments
Thank you for the bug report! I will look into this soon and see if enumerating installed compilers is even possible on Windows. Any thoughts on how to do this would be appreciated! |
this is not a fix to fit every case. in case somebody use mingw, you can change line 133-146 in nimporter.py NIM_CLI_ARGS = [
'--opt:speed',
'--parallelBuild:0',
'--gc:refc',
'--threads:on',
'--app:lib',
'-d:release',
'-d:strip',
'-d:ssl',
# https://github.com/Pebaz/nimporter/issues/41
'--warning[ProveInit]:off',
] + (['--cc:vcc'] if 'MSC' in sys.version else []) to NIM_CLI_ARGS = [
'--opt:speed',
'--parallelBuild:0',
'--gc:refc',
'--threads:on',
'--app:lib',
'-d:release',
'-d:strip',
'-d:ssl',
'--passL:-static', # else, you need libgcc_s_seh-1.dll
# https://github.com/Pebaz/nimporter/issues/41
'--warning[ProveInit]:off',
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
OS: Windows 10 Version 2004 (Build 19041.572)
Python: Python 3.8.4 (tags/v3.8.4:dfa645a, Jul 13 2020, 16:46:45) [MSC v.1924 64 bit (AMD64)]
Nim: 1.4.0
C Compiler: gcc version 8.1.0 (i686-posix-dwarf-rev0, Built by MinGW-W64 project)
On Windows, nimporter doesn't work if the Visual Studio C Compiler is not installed. See the following stacktrace:
Alas, this stacktrace is not very meaningful. But the root cause is quite simple. The class
NimCompiler
in the filenimporter.py
defines a standard set of Nim cli args. On Windows (if sys.platform == 'win32'
) another option is added:--cc:vcc
. This is where the problem arises. IMO it is wrong to unconditionally assume the availability of vcc on Windows boxes. Nim could well be using gcc or tcc instead.Maybe you could check if vcc is at all installed before adding this cli argument?
The text was updated successfully, but these errors were encountered: