Skip to content

Problem to build godot vsproject on SCons 4.8.0 #94090

Closed
@SavFox

Description

@SavFox

Tested versions

4.2.2-stable

System information

Windows 10 - Python 3.12.2 - Visual Studio Comunity 2022 ver. 17.9.2 - SCons v4.8.0.7

Issue description

You get the error if attempt to build Godot on this version SCons.

Found MSVC version 14.3, arch x86_64
Building for platform "windows", architecture "x86_64", target "editor".
AttributeError: 'str' object has no attribute 'get':
  File "D:\dev\godot\SConstruct", line 989:
    methods.generate_vs_project(env, ARGUMENTS, env["vsproj_name"])
  File "D:\dev\godot\methods.py", line 780:
    batch_file = find_visual_c_batch_file(env)
  File "D:\dev\godot\methods.py", line 731:
    product_dir = find_vc_pdir(env, msvc_version)
  File "D:\home\python3.11\Lib\site-packages\SCons\Tool\MSCommon\vc.py", line 1733:
    frozen_binary, _ = _VSWhereExecutable.vswhere_freeze_env(env)
  File "D:\home\python3.11\Lib\site-packages\SCons\Tool\MSCommon\vc.py", line 1209:
    elif not env.get('VSWHERE'):

This happen by on new SCons versions his change find_vc_pdir function arguments (in my mind).
The function accept msvc_version, env but your script call the function with params env, msvc_version

Function declaration on \python_root\Lib\site-packages\SCons\Tool\MSCommon\vc.py - 1714 line.

def find_vc_pdir(msvc_version, env=None):

Function call on \godot_root\methods.py - 731 line.

product_dir = find_vc_pdir(env, msvc_version)

I check it on SCons 4.6.0. On this version SCons have right function.
Function declaration on \python_root\Lib\site-packages\SCons\Tool\MSCommon\vc.py - 857 line (SCons 4.6.0).

def find_vc_pdir(env, msvc_version):

Maybe it's me, but I think it's a bug.
Thank for your working.

Steps to reproduce

  1. Install Visual Studio Comunity 2022.
  2. Install Python 3.12.2 from offical site.
  3. Use command pip install scons to install SCons (v4.8.0.7 actual now).
  4. Use command scons platform=windows vsproj=yes to build the project.

Minimal reproduction project (MRP)

Build i'snt get to the project stage.

Metadata

Metadata

Assignees

Type

No type

Projects

  • Status

    Bad

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions