Open Bug 1371179 Opened 7 years ago Updated 2 years ago

|mach run --debug| fails with "AttributeError: 'RunProgram' object has no attribute 'debuggerInfo'" with MozillaBuild 3.0

Categories

(Firefox Build System :: General, enhancement)

enhancement

Tracking

(Not tracked)

People

(Reporter: xidorn, Unassigned)

Details

I don't know what happens, but I guess it may be related to my recent switch to MSVC 2017.
So I think the issue is that mozdebug.get_default_debugger_name() fails to locate the debugger because no debugger is in PATH when open from start-shell.bat directly.
Blocks: vs2017
Summary: |mach run --debug| fails with "AttributeError: 'RunProgram' object has no attribute 'debuggerInfo'" → |mach run --debug| fails with "AttributeError: 'RunProgram' object has no attribute 'debuggerInfo'" for VS2017
Component: mach → Build Config
I also faced the same problem since I updated mozilla-build. Then I re-used old mozilla-build, I did not see the problem.
Looks like this is broken by the most recent mozilla-build. A change in path handling means that devenv.exe is no longer on the path, so when get_default_debugger_name searches for a debugger it can't find one. There's also a lack of graceful handling around this error path in the python code.
I'm not familiar with if the moz.configure[1] code can interact with the mozdebug[2] code, if at all. My thought is mozdebug can't reach any of the moz.configure code, which means it can't easily grab the Visual Studio directory from the congfig, then use that to search for the debugger. :ted.mielczarek, are you familiar with this? Do you have any thoughts as to the best way to address this? Is there somewhere that moz.configure and mozdebug could share the code to hunt for Visual Studio?

(correction to my previous comment, it's get_debugger_info which will search and fail to find the debugger)

[1]: https://searchfox.org/mozilla-central/source/build/moz.configure/toolchain.configure#429
[2]: https://searchfox.org/mozilla-central/source/testing/mozbase/mozdebug/mozdebug/mozdebug.py
Flags: needinfo?(ted)
No longer blocks: vs2017
Summary: |mach run --debug| fails with "AttributeError: 'RunProgram' object has no attribute 'debuggerInfo'" for VS2017 → |mach run --debug| fails with "AttributeError: 'RunProgram' object has no attribute 'debuggerInfo'" with MozillaBuild 3.0
Oh, that's a bummer. We could put a check for devenv.exe in moz.configure (probably in windows.configure) and either make mach commands pass that down, or have mozdebug conditionally import the buildconfig module and pull it out, something like:
try:
  import buildconfig
  devenv = buildconfig.substs.get('DEVENV')
except ImportError:
  devenv = None
Flags: needinfo?(ted)
Product: Core → Firefox Build System
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.