Godot: SCons doesn't work with VS 2019-pre3

Created on 26 Feb 2019  Â·  7Comments  Â·  Source: godotengine/godot

So, I tried to build godot from src code under Windows 10 (x64). I have Python 3.7.2 and scons --version is:
SCons by Steven Knight et al.:
script: v3.0.4.3a41ed6b288cee8d085373ad7fa02894e1903864, 2019-01-20 22:51:36, by bdeegan on kufra
engine: v3.0.4.3a41ed6b288cee8d085373ad7fa02894e1903864, 2019-01-20 22:51:36, by bdeegan on kufra
engine path: ['c:\python37\lib\site-packages\scons\SCons']
Copyright (c) 2001 - 2019 The SCons Foundation

I also have VS 2019-pre3. I go to x64 native tools prompt and I go to D:\godot (my source root dir) and I type 'scons platform=windows' the command returns

D:\godot>scons platform=windows
scons: Reading SConscript files ...
IndexError: list index out of range:
  File "D:\godot\SConstruct", line 65:
    env_base = Environment(tools=custom_tools)
  File "c:\python37\lib\site-packages\scons\SCons\Environment.py", line 982:
    apply_tools(self, tools, toolpath)
  File "c:\python37\lib\site-packages\scons\SCons\Environment.py", line 107:
    env.Tool(tool)
  File "c:\python37\lib\site-packages\scons\SCons\Environment.py", line 1789:
    tool(self)
  File "c:\python37\lib\site-packages\scons\SCons\Tool\__init__.py", line 296:
    self.generate(env, *args, **kw)
  File "c:\python37\lib\site-packages\scons\SCons\Tool\default.py", line 40:
    for t in SCons.Tool.tool_list(env['PLATFORM'], env):
  File "c:\python37\lib\site-packages\scons\SCons\Tool\__init__.py", line 1266:
    c_compiler = FindTool(c_compilers, env) or c_compilers[0]
  File "c:\python37\lib\site-packages\scons\SCons\Tool\__init__.py", line 1169:
    if t.exists(env):
  File "c:\python37\lib\site-packages\scons\SCons\Tool\msvc.py", line 292:
    return msvc_exists(env)
  File "c:\python37\lib\site-packages\scons\SCons\Tool\MSCommon\vc.py", line 759:
    vcs = cached_get_installed_vcs(env)
  File "c:\python37\lib\site-packages\scons\SCons\Tool\MSCommon\vc.py", line 524:
    ret = get_installed_vcs(env)
  File "c:\python37\lib\site-packages\scons\SCons\Tool\MSCommon\vc.py", line 535:
    VC_DIR = find_vc_pdir(ver)
  File "c:\python37\lib\site-packages\scons\SCons\Tool\MSCommon\vc.py", line 344:
    comps = find_vc_pdir_vswhere(msvc_version)
  File "c:\python37\lib\site-packages\scons\SCons\Tool\MSCommon\vc.py", line 306:
    vc_pdir = os.path.join(vsdir[0], 'VC')

D:\godot>

What is wrong with dumb scons? pls help me

bug buildsystem

Most helpful comment

What is wrong with dumb scons? pls help me

I don't see the need to be disrespectful of any project.

What is likely wrong is that you're using a pre-release version of a compiler toolchain which is known for breaking compatibility with every single release, so it's likely that SCons does not support VS 2019's new "standard" yet. So you can use the current stable version of Visual Studio, or politely notify the SCons developers that their buildsystem doesn't seem to support VS 2019-pre3.

All 7 comments

What is wrong with dumb scons? pls help me

I don't see the need to be disrespectful of any project.

What is likely wrong is that you're using a pre-release version of a compiler toolchain which is known for breaking compatibility with every single release, so it's likely that SCons does not support VS 2019's new "standard" yet. So you can use the current stable version of Visual Studio, or politely notify the SCons developers that their buildsystem doesn't seem to support VS 2019-pre3.

Yes. Pre-release versions of VS are not supported currently.

Can you run the following command on your system and paste the results

"c:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -products "*" -property installationPath -all -prerelease

Yes. Insulting a product and then asking for help.. Not really productive..
(I'm the SCons project co-manager)

Yes, the command "c:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -products "*" -property installationPath -all -prerelease works and the output will be:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community
C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview

I tried to build with MSVC 2017 and it works, so the problem is that the SCons doesn't work with MSVC 2019. The problem is not in SConstruct file, its in SCons python files in python scripts folder

Yes. SCons only supports up to VS2017.
If you check the CHANGES.txt you'll we explicitly list when we support new versions.

Also the call SCons uses to find MSVS/MSVC installs via vswhere doesn't add "-prerelease".
(We typically only support release versions)

But if you add the -prerelease flag to this line in SCons/Tool/MSCommon/vc.py
vswhere_cmd = [vswhere_path, '-products', '*', '-version', msvc_version, '-property', 'installationPath']

Then add the version to this array in same file around line 193: I think the version is 16.0.
_VCVER_TO_PRODUCT_DIR = {
'14.1' : [
(SCons.Util.HKEY_LOCAL_MACHINE, r'')], # Visual Studio 2017 doesn't set this registry key anymore

That should allow SCons to see vs 2019 preview and select it.

After you've made the above changes.
In the shell you're running scons in,
set SCONS_MSCOMMON_DEBUG=
And please post that log file here.

So after doing these steps, I ran scons platform=windows from VS 2019-PRE3 x64 Native tools prompt. And Godot started build without problems. Thanks for these steps to get godot building using VS 2019.

Also MSVC 2019 compilers should be added into vc.py file by default. VS 2019 is coming in a few months , it should be supported.

Anyways thx, I got godot to build

Glad that worked.

On Thu, Feb 28, 2019 at 12:25 PM CatMaster983 notifications@github.com
wrote:

So after doing these steps, I ran scons platform=windows from VS
2019-PRE3 x64 Native tools prompt. And Godot started build without
problems. Thanks for these steps to get godot building using VS 2019.

Also MSVC 2019 compilers should be added into vc.py file by default. VS
2019 is coming in a few months , it should be supported.

Anyways thx, I got godot to build

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/godotengine/godot/issues/26296#issuecomment-468360864,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAFBNEE1bJtw-eZ2sTJQUxwIqCnmGGQZks5vSBEDgaJpZM4bRk3z
.

Yep, its fixed for vs2019.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

timoschwarzer picture timoschwarzer  Â·  3Comments

mefihl picture mefihl  Â·  3Comments

RebelliousX picture RebelliousX  Â·  3Comments

RayKoopa picture RayKoopa  Â·  3Comments

SleepProgger picture SleepProgger  Â·  3Comments