From d3f2c8e7834616e48fbe7cef9286029361b043c5 Mon Sep 17 00:00:00 2001 From: Kimmo Kinnunen Date: Thu, 26 Apr 2018 11:17:43 +0300 Subject: [PATCH] win_toolchain: Add another source dir for dbghelp.dll when packaging the toolchain It appears that newer VS 2017 installers install CppUnitFramework in different way. My version VS 15.6.6. The problem is that normal users do not seem to be able to download the VS 15.3.2 that Chromium suggests and this script was probably originally tested with. I installed: vs_professional__428566190.xxx.exe --add Microsoft.VisualStudio.Workload.NativeDesktop --add Microsoft.VisualStudio.Component.Debugger.JustInTime --add Microsoft.VisualStudio.Component.Graphics.Tools --add Microsoft.VisualStudio.Component.Graphics.Win81 --add Microsoft.VisualStudio.Component.NuGet --add Microsoft.VisualStudio.Component.Static.Analysis.Tools --add Microsoft.VisualStudio.Component.VC.ATL --add Microsoft.VisualStudio.Component.VC.DiagnosticTools --add Microsoft.VisualStudio.Component.VC.TestAdapterForGoogleTest --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.Windows10SDK.15063.Desktop --add Microsoft.VisualStudio.Component.Windows10SDK.15063.UWP --add Microsoft.VisualStudio.Component.Windows10SDK.15063.UWP.Native Go to apps -> Windows sdk 15063 Modify -> Change Select Debugging tools for Windows Ended up with VS 15.6.6 and Windows SDK 10.0.15063.673 Packaged with: python %HOME%\depot_tools\win_toolchain\package_from_installed.py -w 10.0.15063.0 2017 Bug: 834656 Change-Id: I5e6bf6a5f94a28d5ba81a3c8cd79e37028b9429b Reviewed-on: https://chromium-review.googlesource.com/1018470 Reviewed-by: Scott Graham Commit-Queue: Scott Graham --- win_toolchain/package_from_installed.py | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/win_toolchain/package_from_installed.py b/win_toolchain/package_from_installed.py index fe6e50d22..d4baee333 100644 --- a/win_toolchain/package_from_installed.py +++ b/win_toolchain/package_from_installed.py @@ -198,13 +198,20 @@ def BuildFileList(override_dir): # The recommended fix is to copy dbghelp.dll from the VS install instead, # as done here: if VS_VERSION == '2017' and combined.endswith('dbghelp.dll'): - good_dbghelp_path = os.path.join(vs_path, 'Common7', 'IDE', - 'CommonExtensions', 'Microsoft', 'TestWindow', - 'Extensions', 'CppUnitFramework') - if combined.count('\\x64\\') > 0: - combined = os.path.join(good_dbghelp_path, 'x64', 'dbghelp.dll') - else: - combined = os.path.join(good_dbghelp_path, 'dbghelp.dll') + prefix_path = os.path.join(vs_path, 'Common7', 'IDE', + 'CommonExtensions', 'Microsoft', + 'TestWindow', 'Extensions') + arch_dir = 'x64' if combined.count('\\x64\\') > 0 else '' + good_dbghelp_path_candidates = [ + os.path.join(prefix_path, 'CppUnitFramework', arch_dir, + 'dbghelp.dll'), + os.path.join(prefix_path, 'Cpp', arch_dir, 'dbghelp.dll') + ] + combined = good_dbghelp_path_candidates[0] + for c in good_dbghelp_path_candidates: + if os.path.exists(c): + combined = c + break result.append((combined, to)) # Copy the x86 ucrt DLLs to all directories with 32-bit binaries that are