Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(152)

Unified Diff: win_toolchain/get_toolchain_if_necessary.py

Issue 1825163003: Enable crash dump collection on builders (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Set DontShowUI to suppress WER dialog Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: win_toolchain/get_toolchain_if_necessary.py
diff --git a/win_toolchain/get_toolchain_if_necessary.py b/win_toolchain/get_toolchain_if_necessary.py
index dbfb0eb0e29857da8eb3f9ef4bedb797f64b42f4..bd44afe5bf86aa2b394235de1749be5ccc6b174b 100755
--- a/win_toolchain/get_toolchain_if_necessary.py
+++ b/win_toolchain/get_toolchain_if_necessary.py
@@ -357,6 +357,27 @@ def InstallUniversalCRTIfNeeded(abs_target_dir):
return
+def EnableCrashDumpCollection():
+ """Tell Windows Error Reporting to record crash dumps so that we can diagnose
+ linker crashes and other toolchain failures. Documented at:
+ https://msdn.microsoft.com/en-us/library/windows/desktop/bb787181.aspx
+ """
+ if sys.platform == 'win32' and os.environ.get('CHROME_HEADLESS') == '1':
+ key_name = r'SOFTWARE\Microsoft\Windows\Windows Error Reporting'
+ try:
+ key = winreg.CreateKey(winreg.HKEY_LOCAL_MACHINE, key_name)
+ # Merely creating LocalDumps is sufficient to enable the defaults.
+ winreg.CreateKey(key, "LocalDumps")
+ # Disable the WER UI, as documented here:
+ # https://msdn.microsoft.com/en-us/library/windows/desktop/bb513638.aspx
+ winreg.SetValueEx(key, "DontShowUI", 0, winreg.REG_DWORD, 1)
+ # Trap OSError instead of WindowsError so pylint will succeed on Linux.
+ # Catching errors is important because some build machines are not elevated
+ # and writing to HKLM requires elevation.
+ except OSError:
+ pass
+
+
def main():
parser = optparse.OptionParser(description=sys.modules[__name__].__doc__)
parser.add_option('--output-json', metavar='FILE',
@@ -471,6 +492,8 @@ def main():
shutil.copyfile(os.path.join(target_dir, '..', 'data.json'),
options.output_json)
+ EnableCrashDumpCollection()
+
if os.environ.get('GYP_MSVS_VERSION') == '2015':
InstallUniversalCRTIfNeeded(abs_toolchain_target_dir)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698