Problem with building chromium in Windows 10

3,155 views
Skip to first unread message

晨小巫

unread,
Aug 5, 2017, 4:43:29 AM8/5/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

If there is any difference, at first, I use vs2017 but not vs2015. Buf at last, because I can't build using vs2017(even I followed some tutorial about it), so I downloaded and installed the vs2015.

After that , I have successfully run the command 'gn gen out/Default'

But when I run 'ninja -C out\Default chrome', there is a new problem again = =. I'm sorry that I can't show you the output about it. Because when i see the output and found it seems is because the 15063 Windows SDK, so I uninstalled it.
(I both installed the 14393 Windows SDK and the 15063 Windows SDK, the tutorial in "https://chromium.googlesource.com/chromium/src/+/master/docs/windows_build_instructions.md" said it's OK, but ...)

And now, when I run 'ninja -C out\Default chrome', the output is as follow:

ninja -C out\Default chrome
ninja
: Entering directory `out\Default'
[1/1] Regenerating ninja files
FAILED: build.ninja
D:/win_src/chromium/src/buildtools/win/gn.exe --root=D:/win_src/chromium/src -q gen .
Traceback (most recent call last):
  File "D:/win_src/chromium/src/build/vs_toolchain.py", line 454, in <module>
    sys.exit(main())
  File "D:/win_src/chromium/src/build/vs_toolchain.py", line 450, in main
    return commands[sys.argv[1]](*sys.argv[2:])
  File "D:/win_src/chromium/src/build/vs_toolchain.py", line 425, in GetToolchainDir
    runtime_dll_dirs = SetEnvironmentAndGetRuntimeDllDirs()
  File "D:/win_src/chromium/src/build/vs_toolchain.py", line 44, in SetEnvironmentAndGetRuntimeDllDirs
    Update()
  File "D:/win_src/chromium/src/build/vs_toolchain.py", line 397, in Update
    subprocess.check_call(get_toolchain_args)
  File "D:\win_src\depot_tools\win_tools-2_7_6_bin\python\bin\lib\subprocess.py", line 540, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['D:\\win_src\\depot_tools\\win_tools-2_7_6_bin\\python\\bin\\python.exe', 'D:\\win_src\\chromium\\src\\third_party\\depot_tools\\win_toolchain\\get_toolchain_if_necessary.py', '--output-json', 'D:\\win_src\\chromium\\src\\build\\win_toolchain.json', 'f53e4598951162bad6330f7a167486c7ae5db1e5']' returned non-zero exit status 1
ERROR at //build/config/win/visual_studio_version.gni:27:7: Script returned non-zero exit code.
      exec_script("../../vs_toolchain.py", [ "get_toolchain_dir" ], "scope")
      ^----------
Current dir: D:/win_src/chromium/src/out/Default/
Command: D:/win_src/depot_tools/win_tools-2_7_6_bin/python/bin/python.exe -- D:/win_src/chromium/src/build/vs_toolchain.py get_toolchain_dir
Returned 1 and printed out:








Please follow the instructions at https://www.chromium.org/developers/how-tos/build-instructions-windows






See //third_party/angle/gni/angle.gni:20:3: whence it was imported.
  import("//build/config/win/visual_studio_version.gni")
  ^----------------------------------------------------
See //third_party/angle/src/tests/BUILD.gn:7:1: whence it was imported.
import("//third_party/angle/gni/angle.gni")
^-----------------------------------------
See //BUILD.gn:205:7: which caused the file to be included.
      "//third_party/angle/src/tests:angle_end2end_tests",
      ^--------------------------------------------------
ninja: error: rebuilding 'build.ninja': subcommand failed'


I'm confusing, so I want to try to sync. But when I run 'gclient sync', the output is as follow:

 gclient sync
Syncing projects: 100% (84/84), done.
________ running
'D:\win_src\depot_tools\win_tools-2_7_6_bin\python\bin\python.exe src/build/landmines.py' in 'D:\win_src\chromium'


Please follow the instructions at https://www.chromium.org/developers/how-tos/build-instructions-windows

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 "D:\win_src\chromium\src\build\gyp_environment.py", line 30, in SetEnvironment
    vs_toolchain
.SetEnvironmentAndGetRuntimeDllDirs()
 
File "D:\win_src\chromium\src\build\vs_toolchain.py", line 44, in SetEnvironmentAndGetRuntimeDllDirs
   
Update()
 
File "D:\win_src\chromium\src\build\vs_toolchain.py", line 397, in Update
    subprocess
.check_call(get_toolchain_args)
 
File "D:\win_src\depot_tools\win_tools-2_7_6_bin\python\bin\lib\subprocess.py", line 540, in check_call
   
raise CalledProcessError(retcode, cmd)
subprocess
.CalledProcessError: Command '['D:\\win_src\\depot_tools\\win_tools-2_7_6_bin\\python\\bin\\python.exe', 'D:\\win_src\\chromium\\src\\third_party\\depot_tools\\win_toolchain\\get_toolchain_if_necessary.py', '--output-json', 'D:\\win_src\\chromium\\src\\build\\win_toolchain.json', 'f53e4598951162bad6330f7a167486c7ae5db1e5']' returned non-zero exit status 1
Error: Command 'D:\\win_src\\depot_tools\\win_tools-2_7_6_bin\\python\\bin\\python.exe src/build/landmines.py' returned non-zero exit status 1 in D:\win_src\chromium
Hook ''D:\win_src\depot_tools\win_tools-2_7_6_bin\python\bin\python.exe' src/build/landmines.py' took 17.10 secs


This is the problem I encountered, someone can help me? Thank you QAQ

> Here's some of my computer information might be useful:

1. Now it still have two Windows SDK(even after I unstalled 15063), these are 14393.33 and 14393.795(And both with the debugging tools)

2. I installed vs2015 and vs2017 both.(And both in the default location)

3. This is my system environment variables:

晨小巫

unread,
Aug 5, 2017, 7:32:26 AM8/5/17
to Chromium-dev
I tried to search this problem in Google, but can't  find anything about it. To check the error message, but the script doesn't make sense for me.

so....someone can help me?

Nico Weber

unread,
Aug 5, 2017, 11:11:06 AM8/5/17
to cifang...@hotmail.com, Chromium-dev
What happens if you manually run `python build\vs_toolchain.py update`?

On Aug 5, 2017 7:32 AM, "晨小巫" <cifang...@hotmail.com> wrote:
I tried to search this problem in Google, but can't  find anything about it. To check the error message, but the script doesn't make sense for me.

so....someone can help me?

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/44e94dbb-59f8-48e9-8b11-b807c9e885a9%40chromium.org.

晨小巫

unread,
Aug 5, 2017, 11:31:49 AM8/5/17
to Chromium-dev, cifang...@hotmail.com
Same as previous....

python .\build\vs_toolchain.py update





Traceback (most recent call last):
  File ".\build\vs_toolchain.py", line 454, in <module>
    sys.exit(main())
  File ".\build\vs_toolchain.py", line 450, in main
    return commands[sys.argv[1]](*sys.argv[2:])
  File ".\build\vs_toolchain.py", line 397, in Update
    subprocess.check_call(get_toolchain_args)
  File "D:\win_src\depot_tools\win_tools-2_7_6_bin\python\bin\lib\subprocess.py", line 540, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['D:\\win_src\\depot_tools\\win_tools-2_7_6_bin\\python\\bin\\python.exe', 'D:\\win_src\\chromium\\src\\third_party\\depot_tools\\win_toolchain\\get_toolchain_if_necessary.py', '--output-json', 'D:\\win_src\\chromium\\src\\build\\win_toolchain.json', 'f53e4598951162bad6330f7a167486c7ae5db1e5']' returned non-zero exit status 1



在 2017年8月5日星期六 UTC+8下午11:11:06,Nico Weber写道:

Nico Weber

unread,
Aug 5, 2017, 11:40:26 AM8/5/17
to cifang...@hotmail.com, Chromium-dev
Can you add a print statement in `vs_toolchain.py", line 397` to see which command it's trying and failing to run?

晨小巫

unread,
Aug 5, 2017, 12:09:16 PM8/5/17
to Chromium-dev, cifang...@hotmail.com
I add a "print get_toolchain_args" before it, the output is:
 python .\build\vs_toolchain.py update
['D:\\win_src\\depot_tools\\win_tools-2_7_6_bin\\python\\bin\\python.exe', 'D:\\win_src\\chromium\\src\\third_party\\depot_tools\\win_toolchain\\get_toolchain_if_necessary.py', '--output-json', 'D:\\win_src\\chromium\\src\\build\\win_toolchain.json', 'f53e4598951162bad6330f7a167486c7ae5db1e5']





Traceback (most recent call last):
  File ".\build\vs_toolchain.py", line 456, in <module>
    sys.exit(main())
  File ".\build\vs_toolchain.py", line 452, in main
    return commands[sys.argv[1]](*sys.argv[2:])
  File ".\build\vs_toolchain.py", line 399, in Update
    subprocess.check_call(get_toolchain_args)
  File "D:\win_src\depot_tools\win_tools-2_7_6_bin\python\bin\lib\subprocess.py", line 540, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['D:\\win_src\\depot_tools\\win_tools-2_7_6_bin\\python\\bin\\python.exe', 'D:\\win_src\\chromium\\src\\third_party\\depot_tools\\win_toolchain\\get_toolchain_if_necessary.py', '--output-json', 'D:\\win_src\\chromium\\src\\build\\win_toolchain.json', 'f53e4598951162bad6330f7a167486c7ae5db1e5']' returned non-zero exit status 1

I tried to run this command (python .\third_party\depot_tools\win_toolchain\get_toolchain_if_necessary.py --output-json .\build\win_toolchain.json f53e4598951162bad6330f7a167486c7ae5db1e5"), it just return "Please follow the instructions at https://www.chromium.org/developers/how-tos/build-instructions-windows"....

Nico Weber

unread,
Aug 5, 2017, 3:35:52 PM8/5/17
to cifang...@hotmail.com, Chromium-dev
Can you look through that script and check what it's trying to do? On the Google corporate network, it downloads msvc. Else, I believe it checks if msvc is already installed somehow. I guess that check fails in your system for some reason.

晨小巫

unread,
Aug 7, 2017, 7:02:21 AM8/7/17
to Chromium-dev, cifang...@hotmail.com
I checked that script and don't know why this script should run...

Run this script is because can't find json file of win_toolchain, but this script will create a dir vs_files(for vs2013, it create vs2013_files), and then check if there are some json file in this dir....WTF? How you can find a file in a dir you just create? And when it found it can't find any file, it just exit and return error.....

Thanks for your help...Do you know if there is any other place can i get help about it? I decided to re-install the vs2015 and windows kit if can't find how to solve it= =

bruce...@chromium.org

unread,
Aug 7, 2017, 2:05:41 PM8/7/17
to Chromium-dev, cifang...@hotmail.com
Make sure you have set DEPOT_TOOLS_WIN_TOOLCHAIN to 0. That is:

set DEPOT_TOOLS_WIN_TOOLCHAIN=0

That tells gclient to use the installed version of VS 2015 instead of trying to download a pre-packaged version that is available only to Google employees.

Once that is set the script will try to run vcvarsall.bat, from src\build\toolchain\win\setup_toolchain.py. The default location for vcvarsall.bat is in C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC. While you should not need to run it manually, running it manually is a good way to check whether your install is correct.

It is possible that when you installed VS 2015 you failed to install the C++ toolchain - check that.

Also, you can build Chromium with VS 2017. I do it. Just set GYP_MSVS_VERSION=2017. And Chromium will now happily build with the 15063 SDK (as of a few weeks ago). We support everything!

Note that when I say that you can build Chromium with VS 2017 this mostly refers to the linker and a few other tools - clang-cl is the compiler we use by default.

kenny leung

unread,
Aug 10, 2017, 9:40:20 AM8/10/17
to Chromium-dev
gclient sync 失败,很有可能是代理没设置好
然后再看看DEPOT_TOOLS_WIN_TOOLCHAIN这个环境变量是否设为0了。

晨小巫

unread,
Aug 10, 2017, 9:43:52 PM8/10/17
to Chromium-dev, cifang...@hotmail.com
Thank you!
I checked DEPOT_TOOLS_WIN_TOOTCHAIN in script(print it) and found it is still 1 even after I run "set DEPOT_TOOLS_WIN_TOOLCHAIN=0". I thought I had changed the value of it, but obviously not. So I changed it in the script and now everything is ok~

About building with vs2017, I have tried it. After i run "set GYP_MSVS_VERSION=2017", it still can't build(And that time I checked the value and it is indeed 2017). Maybe I‘ll try again after to determine where there is a problem in the end. 

晨小巫

unread,
Aug 10, 2017, 9:46:33 PM8/10/17
to Chromium-dev
是DEPOT_TOOLS_WIN_TOOLCHAIN的问题,我以为我已经设成功了,但并没有...在脚本里改掉之后就ok了...
(后来我确认了一下好像必须重新开一个powershell才可以)

王关飞

unread,
Nov 9, 2017, 4:33:59 AM11/9/17
to Chromium-dev, cifang...@hotmail.com
你好,我最近也在编译这个,为了实现可以播放MP4,请问你编译好了吗?

在 2017年8月11日星期五 UTC+8上午9:46:33,晨小巫写道:
Reply all
Reply to author
Forward
0 new messages