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

Apparent OS-path error compiling tools with VS2017 #7342

Open queenp opened 6 years ago

queenp commented 6 years ago

When running koch tools from a fresh install with VS2017/vcc enabled, linking commands emit the wrong OS path, resulting in failure to run vccexe.exe correctly.

LINK : fatal error LNK1104: cannot open file 'C:\Users\consultant\nim-0.18.0\bin/vccexe.exe' Error: execution of an external program failed: 'vccexe.exe --platform:amd64 /nologo /DEBUG /Zi /F33554432 /FeC:\Users\consultant\nim-0.18.0\bin/vccexe.exe

Full console output below

C:\Users\me\nim-0.18.0>"c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"


Visual Studio 2017 Developer Command Prompt v15.5.6 Copyright (c) 2017 Microsoft Corporation


[vcvarsall.bat] Environment initialized for: 'x64'

C:\Users\me\source>cd ..\nim-0.18.0

C:\Users\me\nim-0.18.0>koch tools bin\nim.exe c --noNimblePath -p:compiler -d:release -o:bin\nimsuggest.exe nimsuggest/nimsuggest.nim Hint: used config file 'C:\Users\consultant\nim-0.18.0\config\nim.cfg' [Conf] Hint: used config file 'C:\Users\consultant\nim-0.18.0\nimsuggest\nimsuggest.nim.cfg' [Conf] Hint: system [Processing] Hint: nimsuggest [Processing] Hint: strutils [Processing] Hint: parseutils [Processing] Hint: math [Processing] Hint: algorithm [Processing] Hint: os [Processing] Hint: times [Processing] Hint: winlean [Processing] Hint: dynlib [Processing] Hint: ospaths [Processing] Hint: parseopt [Processing] Hint: sequtils [Processing] Hint: macros [Processing] Hint: net [Processing] Hint: nativesockets [Processing] Hint: options [Processing] Hint: typetraits [Processing] Hint: sets [Processing] Hint: hashes [Processing] Hint: rdstdin [Processing] Hint: sexp [Processing] Hint: lexbase [Processing] Hint: streams [Processing] Hint: unicode [Processing] Hint: options [Processing] Hint: strtabs [Processing] Hint: osproc [Processing] Hint: cpuinfo [Processing] Hint: commands [Processing] Hint: msgs [Processing] Hint: tables [Processing] Hint: ropes [Processing] Hint: platform [Processing] Hint: terminal [Processing] Hint: strformat [Processing] Hint: colors [Processing] Hint: nversion [Processing] Hint: condsyms [Processing] Hint: idents [Processing] Hint: wordrecg [Processing] Hint: extccomp [Processing] Hint: sha1 [Processing] Hint: json [Processing] Hint: nimblecmd [Processing] Hint: modules [Processing] Hint: ast [Processing] Hint: intsets [Processing] Hint: idgen [Processing] Hint: astalgo [Processing] Hint: rodutils [Processing] Hint: magicsys [Processing] Hint: rodread [Processing] Hint: types [Processing] Hint: trees [Processing] Hint: lexer [Processing] Hint: nimlexbase [Processing] Hint: llstream [Processing] Hint: renderer [Processing] Hint: memfiles [Processing] Hint: cgendata [Processing] Hint: passes [Processing] Hint: nimsets [Processing] Hint: bitsets [Processing] Hint: syntaxes [Processing] Hint: parser [Processing] Hint: pbraces [Processing] Hint: filters [Processing] Hint: filter_tmpl [Processing] Hint: modulegraphs [Processing] Hint: rod [Processing] Hint: reorder [Processing] Hint: modulepaths [Processing] Hint: sighashes [Processing] Hint: md5 [Processing] Hint: ndi [Processing] Hint: sigmatch [Processing] Hint: semdata [Processing] Hint: treetab [Processing] Hint: vmdef [Processing] Hint: lookups [Processing] Hint: prettybase [Processing] Hint: semtypinst [Processing] Hint: parampatterns [Processing] Hint: pretty [Processing] Hint: docgen [Processing] Hint: rstast [Processing] Hint: rst [Processing] Hint: rstgen [Processing] Hint: highlite [Processing] Hint: sempass2 [Processing] Hint: guards [Processing] Hint: saturate [Processing] Hint: writetracking [Processing] Hint: xmltree [Processing] Hint: cgi [Processing] Hint: cookies [Processing] Hint: uri [Processing] Hint: typesrenderer [Processing] Hint: prefixmatches [Processing] Hint: sem [Processing] Hint: semfold [Processing] Hint: importer [Processing] Hint: procfind [Processing] Hint: pragmas [Processing] Hint: transf [Processing] Hint: cgmeth [Processing] Hint: lambdalifting [Processing] Hint: lowerings [Processing] Hint: destroyer [Processing] Hint: dfa [Processing] Hint: liftlocals [Processing] Hint: vm [Processing] Hint: vmgen [Processing] Hint: vmdeps [Processing] Hint: vmmarshal [Processing] Hint: gorgeimpl [Processing] Hint: evaltempl [Processing] Hint: aliases [Processing] Hint: patterns [Processing] Hint: semmacrosanity [Processing] Hint: semparallel [Processing] Hint: pluginsupport [Processing] Hint: active [Processing] Hint: locals [Processing] Hint: itersgen [Processing] Hint: passaux [Processing] Hint: nimconf [Processing] Hint: scriptconfig [Processing] Hint: [Link] cl.exe /nologo /DEBUG /Zi /F33554432 /FeC:\Users\consultant\nim-0.18.0\bin\nimsuggest.exe nimsuggest\nimcache\nimsuggest_nimsuggest.obj nimsuggest\nimcache\stdlib_system.obj nimsuggest\nimcache\stdlib_sharedlist.obj nimsuggest\nimcache\stdlib_locks.obj nimsuggest\nimcache\stdlib_strutils.obj nimsuggest\nimcache\stdlib_os.obj nimsuggest\nimcache\stdlib_parseopt.obj nimsuggest\nimcache\stdlib_parseutils.obj nimsuggest\nimcache\stdlib_sequtils.obj nimsuggest\nimcache\stdlib_net.obj nimsuggest\nimcache\stdlib_rdstdin.obj nimsuggest\nimcache\nimsuggest_sexp.obj nimsuggest\nimcache\stdlib_math.obj nimsuggest\nimcache\stdlib_algorithm.obj nimsuggest\nimcache\stdlib_times.obj nimsuggest\nimcache\stdlib_winlean.obj nimsuggest\nimcache\stdlib_dynlib.obj nimsuggest\nimcache\stdlib_ospaths.obj nimsuggest\nimcache\stdlib_macros.obj nimsuggest\nimcache\stdlib_nativesockets.obj nimsuggest\nimcache\stdlib_options.obj nimsuggest\nimcache\stdlib_typetraits.obj nimsuggest\nimcache\stdlib_sets.obj nimsuggest\nimcache\stdlib_hashes.obj nimsuggest\nimcache\stdlib_lexbase.obj nimsuggest\nimcache\stdlib_streams.obj nimsuggest\nimcache\stdlib_unicode.obj nimsuggest\nimcache\compiler_options.obj nimsuggest\nimcache\stdlib_strtabs.obj nimsuggest\nimcache\stdlib_osproc.obj nimsuggest\nimcache\stdlib_cpuinfo.obj nimsuggest\nimcache\compiler_commands.obj nimsuggest\nimcache\compiler_msgs.obj nimsuggest\nimcache\stdlib_tables.obj nimsuggest\nimcache\compiler_ropes.obj nimsuggest\nimcache\compiler_platform.obj nimsuggest\nimcache\stdlib_terminal.obj nimsuggest\nimcache\stdlib_strformat.obj nimsuggest\nimcache\stdlib_colors.obj nimsuggest\nimcache\compiler_nversion.obj nimsuggest\nimcache\compiler_condsyms.obj nimsuggest\nimcache\compiler_idents.obj nimsuggest\nimcache\compiler_wordrecg.obj nimsuggest\nimcache\compiler_extccomp.obj nimsuggest\nimcache\stdlib_sha1.obj nimsuggest\nimcache\stdlib_json.obj nimsuggest\nimcache\compiler_nimblecmd.obj nimsuggest\nimcache\compiler_modules.obj nimsuggest\nimcache\compiler_ast.obj nimsuggest\nimcache\compiler_astalgo.obj nimsuggest\nimcache\compiler_magicsys.obj nimsuggest\nimcache\compiler_rodread.obj nimsuggest\nimcache\compiler_cgendata.obj nimsuggest\nimcache\compiler_sigmatch.obj nimsuggest\nimcache\compiler_lexer.obj nimsuggest\nimcache\compiler_idgen.obj nimsuggest\nimcache\compiler_passes.obj nimsuggest\nimcache\compiler_syntaxes.obj nimsuggest\nimcache\compiler_llstream.obj nimsuggest\nimcache\compiler_modulegraphs.obj nimsuggest\nimcache\compiler_rod.obj nimsuggest\nimcache\stdlib_intsets.obj nimsuggest\nimcache\compiler_rodutils.obj nimsuggest\nimcache\compiler_types.obj nimsuggest\nimcache\stdlib_memfiles.obj nimsuggest\nimcache\compiler_trees.obj nimsuggest\nimcache\compiler_renderer.obj nimsuggest\nimcache\compiler_nimlexbase.obj nimsuggest\nimcache\compiler_sighashes.obj nimsuggest\nimcache\compiler_ndi.obj nimsuggest\nimcache\compiler_nimsets.obj nimsuggest\nimcache\compiler_reorder.obj nimsuggest\nimcache\compiler_bitsets.obj nimsuggest\nimcache\compiler_parser.obj nimsuggest\nimcache\compiler_pbraces.obj nimsuggest\nimcache\compiler_filters.obj nimsuggest\nimcache\compiler_filter_tmpl.obj nimsuggest\nimcache\compiler_modulepaths.obj nimsuggest\nimcache\stdlib_md5.obj nimsuggest\nimcache\compiler_semdata.obj nimsuggest\nimcache\compiler_lookups.obj nimsuggest\nimcache\compiler_semtypinst.obj nimsuggest\nimcache\compiler_parampatterns.obj nimsuggest\nimcache\compiler_treetab.obj nimsuggest\nimcache\compiler_vmdef.obj nimsuggest\nimcache\compiler_prettybase.obj nimsuggest\nimcache\compiler_pretty.obj nimsuggest\nimcache\compiler_docgen.obj nimsuggest\nimcache\compiler_sempass2.obj nimsuggest\nimcache\stdlib_xmltree.obj nimsuggest\nimcache\stdlib_cgi.obj nimsuggest\nimcache\compiler_typesrenderer.obj nimsuggest\nimcache\docutils_rstast.obj nimsuggest\nimcache\docutils_rst.obj nimsuggest\nimcache\docutils_rstgen.obj nimsuggest\nimcache\docutils_highlite.obj nimsuggest\nimcache\compiler_guards.obj nimsuggest\nimcache\compiler_writetracking.obj nimsuggest\nimcache\compiler_saturate.obj nimsuggest\nimcache\stdlib_cookies.obj nimsuggest\nimcache\stdlib_uri.obj nimsuggest\nimcache\compiler_prefixmatches.obj nimsuggest\nimcache\compiler_sem.obj nimsuggest\nimcache\compiler_semfold.obj nimsuggest\nimcache\compiler_importer.obj nimsuggest\nimcache\compiler_procfind.obj nimsuggest\nimcache\compiler_pragmas.obj nimsuggest\nimcache\compiler_transf.obj nimsuggest\nimcache\compiler_vm.obj nimsuggest\nimcache\compiler_aliases.obj nimsuggest\nimcache\compiler_cgmeth.obj nimsuggest\nimcache\compiler_lambdalifting.obj nimsuggest\nimcache\compiler_evaltempl.obj nimsuggest\nimcache\compiler_patterns.obj nimsuggest\nimcache\compiler_semmacrosanity.obj nimsuggest\nimcache\compiler_semparallel.obj nimsuggest\nimcache\compiler_lowerings.obj nimsuggest\nimcache\compiler_pluginsupport.obj nimsuggest\nimcache\compiler_destroyer.obj nimsuggest\nimcache\compiler_liftlocals.obj nimsuggest\nimcache\compiler_dfa.obj nimsuggest\nimcache\compiler_vmgen.obj nimsuggest\nimcache\compiler_vmdeps.obj nimsuggest\nimcache\compiler_vmmarshal.obj nimsuggest\nimcache\compiler_gorgeimpl.obj nimsuggest\nimcache\compiler_active.obj nimsuggest\nimcache\compiler_itersgen.obj nimsuggest\nimcache\compiler_locals.obj nimsuggest\nimcache\compiler_passaux.obj nimsuggest\nimcache\compiler_nimconf.obj nimsuggest\nimcache\compiler_scriptconfig.obj Hint: operation successful (102925 lines compiled; 5.221 sec total; 317.332MiB peakmem; Release Build) [SuccessX] bin\nim.exe c -d:release -o:bin\nimgrep.exe tools/nimgrep.nim Hint: used config file 'C:\Users\consultant\nim-0.18.0\config\nim.cfg' [Conf] Hint: used config file 'C:\Users\consultant\nim-0.18.0\tools\nimgrep.nim.cfg' [Conf] Hint: system [Processing] Hint: nimgrep [Processing] Hint: os [Processing] Hint: strutils [Processing] Hint: parseutils [Processing] Hint: math [Processing] Hint: algorithm [Processing] Hint: times [Processing] Hint: winlean [Processing] Hint: dynlib [Processing] Hint: ospaths [Processing] Hint: parseopt [Processing] Hint: pegs [Processing] Hint: unicode [Processing] Hint: re [Processing] Hint: pcre [Processing] Hint: rtarrays [Processing] Hint: terminal [Processing] Hint: macros [Processing] Hint: strformat [Processing] Hint: colors [Processing] Hint: tables [Processing] Hint: hashes [Processing] Hint: [Link] cl.exe /nologo /DEBUG /Zi /F33554432 /FeC:\Users\consultant\nim-0.18.0\bin\nimgrep.exe tools\nimcache\compiler_nimgrep.obj tools\nimcache\stdlib_system.obj tools\nimcache\stdlib_os.obj tools\nimcache\stdlib_strutils.obj tools\nimcache\stdlib_parseopt.obj tools\nimcache\stdlib_pegs.obj tools\nimcache\stdlib_re.obj tools\nimcache\stdlib_terminal.obj tools\nimcache\stdlib_parseutils.obj tools\nimcache\stdlib_math.obj tools\nimcache\stdlib_algorithm.obj tools\nimcache\stdlib_times.obj tools\nimcache\stdlib_winlean.obj tools\nimcache\stdlib_dynlib.obj tools\nimcache\stdlib_ospaths.obj tools\nimcache\stdlib_unicode.obj tools\nimcache\stdlib_pcre.obj tools\nimcache\stdlib_rtarrays.obj tools\nimcache\stdlib_macros.obj tools\nimcache\stdlib_strformat.obj tools\nimcache\stdlib_colors.obj tools\nimcache\stdlib_tables.obj tools\nimcache\stdlib_hashes.obj Hint: operation successful (35429 lines compiled; 1.076 sec total; 76.09MiB peakmem; Release Build) [SuccessX] bin\nim.exe c -o:bin/vccexe.exe tools/vccenv/vccexe Hint: used config file 'C:\Users\consultant\nim-0.18.0\config\nim.cfg' [Conf] Hint: system [Processing] Hint: vccexe [Processing] Hint: strutils [Processing] Hint: parseutils [Processing] Hint: math [Processing] Hint: algorithm [Processing] Hint: strtabs [Processing] Hint: hashes [Processing] Hint: os [Processing] Hint: times [Processing] Hint: winlean [Processing] Hint: dynlib [Processing] Hint: ospaths [Processing] Hint: osproc [Processing] Hint: streams [Processing] Hint: cpuinfo [Processing] Hint: vccenv [Processing] Hint: [Link] cl.exe /nologo /DEBUG /Zi /F33554432 /FeC:\Users\consultant\nim-0.18.0\bin/vccexe.exe tools\vccenv\nimcache\compiler_vccexe.obj tools\vccenv\nimcache\stdlib_system.obj tools\vccenv\nimcache\stdlib_strutils.obj tools\vccenv\nimcache\stdlib_strtabs.obj tools\vccenv\nimcache\stdlib_os.obj tools\vccenv\nimcache\stdlib_osproc.obj tools\vccenv\nimcache\compiler_vccenv.obj tools\vccenv\nimcache\stdlib_parseutils.obj tools\vccenv\nimcache\stdlib_math.obj tools\vccenv\nimcache\stdlib_algorithm.obj tools\vccenv\nimcache\stdlib_hashes.obj tools\vccenv\nimcache\stdlib_times.obj tools\vccenv\nimcache\stdlib_winlean.obj tools\vccenv\nimcache\stdlib_dynlib.obj tools\vccenv\nimcache\stdlib_ospaths.obj tools\vccenv\nimcache\stdlib_streams.obj tools\vccenv\nimcache\stdlib_cpuinfo.obj LINK : fatal error LNK1104: cannot open file 'C:\Users\consultant\nim-0.18.0\bin/vccexe.exe' Error: execution of an external program failed: 'vccexe.exe --platform:amd64 /nologo /DEBUG /Zi /F33554432 /FeC:\Users\consultant\nim-0.18.0\bin/vccexe.exe tools\vccenv\nimcache\compiler_vccexe.obj tools\vccenv\nimcache\stdlib_system.obj tools\vccenv\nimcache\stdlib_strutils.obj tools\vccenv\nimcache\stdlib_strtabs.obj tools\vccenv\nimcache\stdlib_os.obj tools\vccenv\nimcache\stdlib_osproc.obj tools\vccenv\nimcache\compiler_vccenv.obj tools\vccenv\nimcache\stdlib_parseutils.obj tools\vccenv\nimcache\stdlib_math.obj tools\vccenv\nimcache\stdlib_algorithm.obj tools\vccenv\nimcache\stdlib_hashes.obj tools\vccenv\nimcache\stdlib_times.obj tools\vccenv\nimcache\stdlib_winlean.obj tools\vccenv\nimcache\stdlib_dynlib.obj tools\vccenv\nimcache\stdlib_ospaths.obj tools\vccenv\nimcache\stdlib_streams.obj tools\vccenv\nimcache\stdlib_cpuinfo.obj ' FAILURE

ghost commented 6 years ago

Duplicate of, or atleast related to https://github.com/nim-lang/Nim/issues/6540?

cheatfate commented 6 years ago

vccexe uses environment variables to get path to bat files which will be used to setup properly environment state. VS2017 deprecated environment variables usage and establish COM interface for everybody who want to know actual installation path. Current version of vccexe did not support COM interface, so it did not work for VS2017.

ratiotile commented 5 years ago

The environment variable `` exist when the VS2017 developer command prompt is run. See https://github.com/nim-lang/Nim/issues/6540#issuecomment-437544915 and #9672. Although VS2017 support is currently broken again.