0

I am trying to create a build directory on my Windows 10 Laptop using GN for Chromium source code. This is what I have done:

  1. Set a WIN TOOLCHAIN system environment variable and set it to 0
  2. Append C:\src\depot_tools to my system Path variable - C:\src\depot_tools\src is where the source code is
  3. Download a working GN.exe binary and place it in the same folder with GN.exe.sha1, which is in C:\src\depot_tools\src\buildtools\win

I try to run gn gen out\Default but then this keeps getting thrown-

    gn gen out\Default
Traceback (most recent call last):
  File "c:/src/depot_tools/src/build/vs_toolchain.py", line 493, in <module>
    sys.exit(main())
  File "c:/src/depot_tools/src/build/vs_toolchain.py", line 489, in main
    return commands[sys.argv[1]](*sys.argv[2:])
  File "c:/src/depot_tools/src/build/vs_toolchain.py", line 312, in CopyDlls
    _CopyRuntime(target_dir, runtime_dir, target_cpu, debug=True)
  File "c:/src/depot_tools/src/build/vs_toolchain.py", line 292, in _CopyRuntime
    suffix)
  File "c:/src/depot_tools/src/build/vs_toolchain.py", line 206, in _CopyUCRTRuntime
    _CopyRuntimeImpl(target, source)
  File "c:/src/depot_tools/src/build/vs_toolchain.py", line 193, in _CopyRuntimeImpl
    shutil.copy2(source, target)
  File "C:\src\depot_tools\win_tools-2_7_6_bin\python\bin\lib\shutil.py", line 130, in copy2
    copyfile(src, dst)
  File "C:\src\depot_tools\win_tools-2_7_6_bin\python\bin\lib\shutil.py", line 82, in copyfile
    with open(src, 'rb') as fsrc:
IOError: [Errno 2] No such file or directory: 'C:\\Windows\\Sysnative\\msvcp140d.dll'
ERROR at //build/toolchain/win/BUILD.gn:43:3: Script returned non-zero exit code.
  exec_script("../../vs_toolchain.py",
  ^----------
Current dir: c:/src/depot_tools/src/out/Default/
Command: C:/src/depot_tools/win_tools-2_7_6_bin/python/bin/python.exe -- c:/src/depot_tools/src/build/vs_toolchain.py copy_dlls c:/src/depot_tools/src/out/Default Debug x64
Returned 1 and printed out:

Copying C:\Windows\Sysnative\ucrtbase.dll to c:/src/depot_tools/src/out/Default\ucrtbase.dll...
Copying C:\Windows\Sysnative\msvcp140d.dll to c:/src/depot_tools/src/out/Default\msvcp140d.dll...

See //BUILD.gn:69:1: which caused the file to be included.
group("gn_all") {
^----------------
flash76
  • 382
  • 3
  • 23
  • did you run this set DEPOT_TOOLS_WIN_TOOLCHAIN=0? – Asesh Oct 22 '17 at 16:04
  • Looks like you don't have VS 2015 installed as it's searching for VC++ 2015 DLL file – Asesh Oct 22 '17 at 16:16
  • That's what I said, the WIN TOOLCHAIN var to 0. – flash76 Oct 22 '17 at 16:24
  • I'm using VS 2017, so should I install the Visual C++ compnent[s]? – flash76 Oct 22 '17 at 16:24
  • But it's trying to use VS 2015. If your repo is in sync with the latest version of Chromium then it should use VS 2017, by default. Not sure if it will work but try this: set GYP_MSVS_VERSION=2017 set GYP_MSVS_OVERRIDE_PATH=c:\Program Files (x86)\Microsoft Visual Studio 15.0 – Asesh Oct 22 '17 at 16:28
  • No need, It has worked, like you said-I went to VS Installer, selected Desktop Dev With C++ and checked "VC++ 2015.3 v140 toolset for desktop (x86,x64)"- Now I could gen the directory. Thanks for your help! – flash76 Oct 22 '17 at 17:15

0 Answers0