Skip to content
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

Virtual environment not detected by build scripts #84555

Closed
brno32 opened this issue Nov 6, 2023 · 0 comments · Fixed by #84593
Closed

Virtual environment not detected by build scripts #84555

brno32 opened this issue Nov 6, 2023 · 0 comments · Fixed by #84593

Comments

@brno32
Copy link
Contributor

brno32 commented Nov 6, 2023

Godot version

master

System information

Windows 10

Issue description

I've created a venv and installed scons inside of it. Afterwards, I run scons platform=windows vsproj=yes dev_build=yes to generate godot.sln.

Unfortunately the build button inside Visual Studio yields the following error:

Severity	Code	Description	Project	File	Line	Suppression State
Error	MSB3073	The command "echo Starting SCons && cmd /V /C set "plat=x86" ^& (if "x86"=="x64" (set "plat=x86_amd64")) ^& call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" !plat! ^& scons --directory="C:\Users\brno32\Repos\godot" platform=windows target=editor progress=no -j15 dev_build=yes" exited with code 1.	godot	C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.MakeFile.Targets	45	

This is because the alias scons is only available inside of my virtual environment, where I've installed it, and the command Visual Studio tries to run assumes it's been installed globally. I actually mentioned this in the documentation repo godotengine/godot-docs#7535, but I believe the code in methods.py could account for this.

For example, I have the following modification locally:

        scons_cmd = "scons"
        if os.path.exists("venv"):
            scons_cmd = r"venv\Scripts\scons.exe"
        env["MSVSBUILDCOM"] = module_configs.build_commandline(scons_cmd)
        env["MSVSREBUILDCOM"] = module_configs.build_commandline(
            f"{scons_cmd} vsproj=yes"
        )
        env["MSVSCLEANCOM"] = module_configs.build_commandline(f"{scons_cmd} --clean")

I'd be happy to work on this issue if we agree it's something that should be fixed.

Steps to reproduce

py -m venv venv
venv/Scripts/activate
pip install scons
scons platform=windows vsproj=yes dev_build=yes

open the solution, and hit build

Minimal reproduction project

N/A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants