4

Whenever I try build WebRTC for Windows, I get this error when running gclient runhooks:

    ________ running 'C:\path\to\depot_tools\python276_bin\python.exe src/build
/landmines.py' in 'C:\path\to\webrtc\src\chromium' Please follow the instructions
at http://www.chromium.org/developers/how-tos/bui ld-instructions-windows
Traceback (most recent call last):
File "src/build/landmines.py", line 215, in <module> 
    sys.exit(main())
File "src/build/landmines.py", line 202, in main
    gyp_environment.SetEnvironment()
File "C:\path\to\webrtc\src\chromium\src\build\gyp_environment.py", line 33, in
SetEnvironment
    vs_toolchain.SetEnvironmentAndGetRuntimeDllDirs()
File "C:\path\to\webrtc\src\chromium\src\build\vs_toolchain.py", line 34, in
SetEnvironmentAndGetRuntimeDllDirs
    Update()
File "C:\path\to\webrtc\src\chromium\src\build\vs_toolchain.py", line 179, in
Update
    subprocess.check_call(get_toolchain_args)
File "C:\path\to\depot_tools\python276_bin\lib\subprocess.py", line 540, in
check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['C:\\path\\to\\depot_tools\\python276_bin\\python.exe',
'C:\\path\\to\\depot_tools\\win_toolchain\\get_toolchain_if_necessary.py', '--output-json',
'C:\\path\\to\\webrtc\\src\\chromium\\src\\build\\win_toolchain.json', 
'ee7d718ec60c2dc5d255bbe325909c2021a7efef']' returned non-zero exit status 1
Error: Command C:\path\to\depot_tools\python276_bin\python.exe src/build/landmines.py returned non-zero exit status 1 in C:\path\to\webrtc\src\chromium
Hook ''C:\path\to\depot_tools\python276_bin\python.exe' src/build/landmines.py' took 68.55 secs
Error: Command C:\path\to\depot_tools\python276_bin\python.exe - u src/sync_chromium.py --target-revision 271c6cca48a6cef32c0f3add3b17b700707deec 5 returned non-zero exit status 2 in C:\path\to\webrtc
Hook ''C:\path\to\depot_tools\python276_bin\python.exe' -u src/sync_chromium.py --target-revision 271c6cca48a6cef32c0f3add3b17b700707deec5' took 3842.34 secs

I'm using 64-bit Windows 7 with VS 2013 installed. I've already tried setting the following variables:

GYP_DEFINES='windows_sdk_path="C:\path\to\windows\sdk" platform=win component=shared_library'
DEPOT_TOOLS_WIN_TOOLCHAIN=0
GYP_GENERATORS=msvs
GYP_MSVS_VERSION=2013

Attempting to build chromium also gives the same error. Fetching with nohooks works fine, it's just when I try gclient sync or runhooks that the error occurs. I've also tried building with ninja, and that fails as well. I've got all SDKs and such all up to date. Any help with this would be greatly appreciated.

  • Chromium is now 64bit only and Visual Studio can't be used to compile, only debug. See my answer below as to what your envirnment variables should be. Mark if it worked – 537mfb Jan 16 '15 at 17:15

1 Answers1

9

I have found this possible solution at Google Code

as per braveyao@webrtc.org's sugestion

Supporting msvs is not the focus of Chromium. You can try ninja which should always work. Also you could try to set the "GYP_GENERATORS=msvs-ninja,ninja". Then you could build with ninja and debug with VS2013.

Also, chromium is now 64bit only so you need to change GYP_DEFINES aswell

so your envirnment variables should be:

GYP_DEFINES=target_arch=x64
DEPOT_TOOLS_WIN_TOOLCHAIN=0
GYP_GENERATORS=msvs-ninja,ninja
GYP_MSVS_VERSION=2013

Of course replace 2013 if that's not the version of Visual Studio you have installed

you may need to delete what you already have downloaded and do a fresh fetch webrtc after that change if you thinkered with it

I should also add that the Windows must be english version (it's ok if you after install some other language pack but it must be originally english) - i have a PT-PT version at home and that one always gives an error with some python file when running gclient sync - at work though i originally had english version and installed the PT-PT language pack but it works fine

This is what worked for me. Does that work for you?

537mfb
  • 1,374
  • 1
  • 16
  • 32
  • 1
    That seems to have worked fine. I had already tried setting GYP_GENERATORS but I didn't know about the 64-bit thing. Thanks for your help, I spent weeks on that. – PropaneAccessories Jan 19 '15 at 01:05
  • glad it helped - just added new stuff i found to the answer above – 537mfb Jan 19 '15 at 09:31
  • Thanks so much 537mfb! you are a lifesaver! I spent way too long trying to get that to work haha – amartin7211 Mar 31 '16 at 19:50
  • @amartin7211 - Glad it helped – 537mfb Apr 01 '16 at 14:07
  • Thank you so much. As a sidenote,I find it immeasurably absurd that in the year 2020 there is still no single, complete, and accurate set of instructions for building WinRTC in Windows. This was one piece of the puzzle that you solved. – Emperor Eto Jul 03 '20 at 21:44
  • @PeterMoore I'm surprised they still don't have a better solution for this after all this time, but I'm glad this helped you out – 537mfb Jul 05 '20 at 01:11
  • @537mfb FWIW I didn't get much further after this. I could never get WebRTC to compile using Visual C++ and be stable (i.e. not crash every 30 seconds for some random heap or stack corruption problem). Currently I'm using the CLANG build process and thank goodness Visual Studio 2019 now works with CLANG, so I've been able to use WebRTC and have it be stable. Google just seems to hate Visual C++. – Emperor Eto Jul 07 '20 at 21:42