From dcb027a7184442e140aad1921a5f26fe9135c1da Mon Sep 17 00:00:00 2001 From: Jeremy Andrews Date: Thu, 14 Jul 2022 23:03:39 -0500 Subject: Issue #1956 - Allow debugger to work on newer MSVC. Newer MSVC was failing to find the devenv executable for ./mach run --debug This isn't the prettiest solution, but at least it's better than just relying on a hardcoded path. --- python/mozbuild/mozbuild/mach_commands.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/python/mozbuild/mozbuild/mach_commands.py b/python/mozbuild/mozbuild/mach_commands.py index 4f58a2a33d..6616b24931 100644 --- a/python/mozbuild/mozbuild/mach_commands.py +++ b/python/mozbuild/mozbuild/mach_commands.py @@ -1245,6 +1245,11 @@ class RunProgram(MachCommandBase): if debug or debugger or debugparams: if 'INSIDE_EMACS' in os.environ: self.log_manager.terminal_handler.setLevel(logging.WARNING) + # vswhere tells us the exact path of the "devenv.exe" debug executable, but our build machinery + # insists on searching the PATH for it regardless. Just work around it rather than overhauling mozdebug. + if sys.platform.startswith('win'): + tempvar = subprocess.check_output(['vswhere', '-property', 'installationPath']) + os.environ["PATH"] += os.pathsep + tempvar.replace("\\", "\\").strip() + "\\Common7\\IDE" import mozdebug if not debugger: -- cgit v1.2.3