summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorJeremy Andrews <athenian200@outlook.com>2022-07-14 23:03:39 -0500
committerJeremy Andrews <athenian200@outlook.com>2022-07-14 23:03:39 -0500
commitdcb027a7184442e140aad1921a5f26fe9135c1da (patch)
tree7acb6b442d1e4c58e92dffd9029f002b700797ae /python
parent08c90e00b92c52216eb9a78f5d34fda72b92465e (diff)
downloaduxp-dcb027a7184442e140aad1921a5f26fe9135c1da.tar.gz
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.
Diffstat (limited to 'python')
-rw-r--r--python/mozbuild/mozbuild/mach_commands.py5
1 files changed, 5 insertions, 0 deletions
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: