Improve error messages when C++ compiler or Debuggers aren't installed |
|||
Issue description
VS 2015 defaults to not installing the C++ compiler. This is unexpected by most developers and leads to this message when a developer first tries to create a Chromium output directory:
F:\Desktop\chromium\src>gn gen out/Default
Traceback (most recent call last):
File "F:/Desktop/chromium/src/build/toolchain/win/setup_toolchain.py", line 214, in <module>
main()
File "F:/Desktop/chromium/src/build/toolchain/win/setup_toolchain.py", line 179, in main
env = _LoadToolchainEnv(cpu, win_sdk_path)
File "F:/Desktop/chromium/src/build/toolchain/win/setup_toolchain.py", line 140, in _LoadToolchainEnv
script_path)
Exception: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat is missing - make sure VC++ tools are installed.
ERROR at //build/toolchain/win/BUILD.gn:366:22: Script returned non-zero exit code.
x64_toolchain_data = exec_script("setup_toolchain.py",
Similarly, when installing VC++ 2015 *parts* of the Windows SDK are installed, but not the Debuggers component. This is currently required, but the error message is cryptic:
F:\Desktop\chromium\src>gn gen out/Default
Traceback (most recent call last):
File "F:/Desktop/chromium/src/build/vs_toolchain.py", line 457, in <module>
sys.exit(main())
File "F:/Desktop/chromium/src/build/vs_toolchain.py", line 453, in main
return commands[sys.argv[1]](*sys.argv[2:])
File "F:/Desktop/chromium/src/build/vs_toolchain.py", line 323, in CopyDlls _CopyDebugger(target_dir, target_cpu)
File "F:/Desktop/chromium/src/build/vs_toolchain.py", line 343, in _CopyDebugger
_CopyRuntimeImpl(target_path, full_path)
File "F:/Desktop/chromium/src/build/vs_toolchain.py", line 200, in _CopyRuntimeImpl
shutil.copy2(source, target)
File "F:\Desktop\depot_tools\python276_bin\lib\shutil.py", line 130, in copy2 copyfile(src, dst)
File "F:\Desktop\depot_tools\python276_bin\lib\shutil.py", line 82, in copyfile
with open(src, 'rb') as fsrc:
IOError: [Errno 2] No such file or directory: 'C:\\Program Files (x86)\\WindowsKits\\10\\Debuggers\\x64\\cdb.exe'
ERROR at //build/toolchain/win/BUILD.gn:39:3: Script returned non-zero exit code.
exec_script("../../vs_toolchain.py",
^----------
Current dir: F:/Desktop/chromium/src/out/Default/
Command: F:/Desktop/depot_tools/python276_bin/python.exe -- F:/Desktop/chromium/src/build/vs_toolchain.py copy_dlls F:/Desktop/chromium/src/out/Default Debug x64
Returned 1 and printed out:
Copying C:\Windows\Sysnative\msvcp140.dll to F:/Desktop/chromium/src/out/Default\msvcp140.dll...
Copying C:\Windows\Sysnative\vccorlib140.dll to F:/Desktop/chromium/src/out/Default\vccorlib140.dll...
Copying C:\Windows\Sysnative\vcruntime140.dll to F:/Desktop/chromium/src/out/Default\vcruntime140.dll...
Copying C:\Windows\Sysnative\ucrtbase.dll to F:/Desktop/chromium/src/out/Default\ucrtbase.dll...
Copying C:\Windows\Sysnative\msvcp140d.dll to F:/Desktop/chromium/src/out/Default\msvcp140d.dll...
Copying C:\Windows\Sysnative\vccorlib140d.dll to F:/Desktop/chromium/src/out/Default\vccorlib140d.dll...
Copying C:\Windows\Sysnative\vcruntime140d.dll to F:/Desktop/chromium/src/out/Default\vcruntime140d.dll...
Copying C:\Windows\Sysnative\ucrtbased.dll to F:/Desktop/chromium/src/out/Default\ucrtbased.dll...
Copying C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\cdb.exe to F:/Desktop/chromium/src/out/Default\cdb.exe...
See //BUILD.gn:73:1: which caused the file to be included.
group("gn_all") {
In both cases the code could specifically detect these cases, explain the likely cause, and give the usual steps to fix the problem.
,
Mar 19 2017
Note I have both VS2015 and VS2017 installed, and I tried modifying VS2017 to install Win10 SDK and all seemingly relevant debugger tools but none installed cdb.exe. I had to install the full WDK to get cdb.exe.
,
Mar 20 2017
Thanks for the information - it's tedious to test all the install variants so it's good to get some data points to guide how to phrase the instructions and the error messages.
,
Mar 20 2017
,
Mar 20 2017
Thanks for looking at this, it seems possible/likely (?) that there is some optional install with VS2017 that will both install the 2015 toolchain and cdb.exe. On 2015 toolchain, I saw the option to add it to the VS 2017 install but I haven't tried it yet. Since I had already gone ahead and installed VS 2015, I'd need to uninstall that, then add the 2015 toolchain to VS 2017, and then see if it works. And I figure it's possible that it would, but that my overall Windows install is tainted somehow from the previous VS 2015 install, so it would be a data point, but not definitive. On cdb.exe, I did later modify VS 2017 install and add the four or so debugging/tools-specific line items and the Win10 SDK, but none of those seemed to add cdb.exe binary. So they may have been installed in a different directory, or not at all, for whatever reason.
,
May 1 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/6c3d410ea272423ac277dc3f3e3def6490dfd6dc commit 6c3d410ea272423ac277dc3f3e3def6490dfd6dc Author: brucedawson <brucedawson@chromium.org> Date: Mon May 01 20:27:19 2017 Improve error message when debuggers not installed When building Chrome we require that you have the "Debugging tools for Windows" feature of the Windows 10 SDK installed. The error messages when this non-default component is not installed are a bit cryptic. This adds a more explicit error message. The new error message looks like this: >gn gen out\debug Traceback (most recent call last): File "c:/src/chromium4/src/build/vs_toolchain.py", line 448, in <module> sys.exit(main()) File "c:/src/chromium4/src/build/vs_toolchain.py", line 444, in main return commands[sys.argv[1]](*sys.argv[2:]) File "c:/src/chromium4/src/build/vs_toolchain.py", line 309, in CopyDlls _CopyDebugger(target_dir, target_cpu) File "c:/src/chromium4/src/build/vs_toolchain.py", line 331, in _CopyDebugger '10 SDK.' % full_path) Exception: dbghelp.dll not found in "C:\Program Files (x86)\Windows Kits\10\Debuggers\x86\dbghelp.dll" You must install the "Debugging Tools for Windows" feature from the Windows 10 SDK. ERROR at //build/toolchain/win/BUILD.gn:39:3: Script returned non-zero exit code. exec_script("../../vs_toolchain.py", ^---------- Current dir: c:/src/chromium4/src/out/debug/ Command: C:/src/depot_tools/python276_bin/python.exe -- c:/src/chromium4/src/build/vs_toolchain.py copy_dlls c:/src/chromium4/src/out/debug Debug x86 Returned 1. See //BUILD.gn:65:1: which caused the file to be included. group("gn_all") { ^---------------- R=wkorman@chromium.org BUG= 702697 Review-Url: https://codereview.chromium.org/2853083002 Cr-Commit-Position: refs/heads/master@{#468397} [modify] https://crrev.com/6c3d410ea272423ac277dc3f3e3def6490dfd6dc/build/vs_toolchain.py
,
May 1 2017
Good enough? Fixed? The process will get simpler when Microsoft ships a fixed version of the 15063 SDK.
,
May 1 2017
FWIW I think it's much better (I hit the previous error and had to figure out what I was doing wrong, this says what's wrong).
,
May 1 2017
New error in debugger info looks good to me. This bug also mentions re: clarifying the compiler tools warning message, is that essentially the same/covered by the above change or is something else warranted there?
,
May 1 2017
The current message for when the compilers aren't installed is: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat is missing - make sure VC++ tools are installed. I can't think of a way to improve that. I'm not sure what I had in mind when I included that in the original bug report.
,
May 1 2017
Seems good enough. Feel like maybe we meant to link to actual url, or give specific versions seen vs. needed, but adding that is fragile per our earlier discussions. Can see how folks do with this. Thanks again for following up on these items.
,
May 26 2017
FYI, I met same message as topic starter. I've reinstalled Windows SDK 14393 with all checked components and it helped. |
|||
►
Sign in to add a comment |
|||
Comment 1 by wkorman@chromium.org
, Mar 19 2017