Build chromium in windows failed because can't find Visual Studio Version 2017(from GYP_MSVS_VERSION)

2,690 views
Skip to first unread message

johnhou

unread,
Dec 2, 2017, 7:05:09 AM12/2/17
to Chromium-dev
Hi, everyone.

I tried to build chromium in my Windows 10.And of course, I followed the instructions at https://chromium.googlesource.com/chromium/src/+/master/docs/windows_build_instructions.md

and i had installed VS 2017  successfully.

I also set Environment variables DEPOT_TOOLS_WIN_TOOLCHAIN = 0, GYP_MSVS_VERSION = 2017

but i still get below error message when i run `gclient runhooks`,



________ running
'vpython.bat src/build/landmines.py' in 'G:\workspace\chromium'
Traceback (most recent call last):
 
File "src/build/landmines.py", line 148, in <module>
    sys
.exit(main())
 
File "src/build/landmines.py", line 135, in main
    gyp_environment
.SetEnvironment()
 
File "G:\workspace\chromium\src\build\gyp_environment.py", line 30, in SetEnvironment
    vs_toolchain
.SetEnvironmentAndGetRuntimeDllDirs()
 
File "G:\workspace\chromium\src\build\vs_toolchain.py", line 85, in SetEnvironmentAndGetRuntimeDllDirs
    os
.environ['GYP_MSVS_OVERRIDE_PATH'] = DetectVisualStudioPath()
 
File "G:\workspace\chromium\src\build\vs_toolchain.py", line 174, in DetectVisualStudioPath
   
' not found.') % (version_as_year))
Exception: Visual Studio Version 2017 (from GYP_MSVS_VERSION) not found.
Error: Command 'vpython.bat src/build/landmines.py' returned non-zero exit status 1 in G:\workspace\chromium

Is there any idea about it ?

johnhou

unread,
Dec 2, 2017, 7:43:44 AM12/2/17
to Chromium-dev
finally, i add bellow code in src/build/vs_toolchain.py at line 160

r'E:\Program Files (x86)\Microsoft Visual Studio\2017\Professional'

the path where my vs2017 located. now i can run `gclient runhooks` successfully. but i still don't know why can not find installed vs2017 automatically.

在 2017年12月2日星期六 UTC+8下午8:05:09,johnhou写道:

bruce...@chromium.org

unread,
Dec 4, 2017, 12:50:30 AM12/4/17
to Chromium-dev
With VS 2017 Microsoft stopped setting environment variables to indicate where VS was installed. Nobody has bothered to write the necessary code to track down copies of VS that aren't installed in the default location.

I'm glad you found the right place to modify the script to get past this. A better long-term solution is to set this environment variable:

    set vs2017_install=E:\Program Files (x86)\Microsoft Visual Studio\2017\Professional

If you want to create a patch so that the Chromium build system can properly find VS 2017 I'd be happy to review it.

Note that you don't have to set GYP_MSVS_VERSION - VS 2017 has been the default for a little while now.
Reply all
Reply to author
Forward
0 new messages