Open Bug 907497 Opened 11 years ago Updated 2 years ago

"mach resource-usage" fails on OS X

Categories

(Firefox Build System :: General, defect)

x86
macOS
defect

Tracking

(Not tracked)

People

(Reporter: heycam, Unassigned)

Details

Attachments

(3 files)

When I run "./mach resource-usage" I get this:

  $ ./mach resource-usage
  70:78: execution error: File firefox wasn’t found. (-43)

If I run it with "--browser firefox" I don't get the error, but it also doesn't open up the browser.  "--browser safari" does manage to open Safari.
Did it not print the "'Please open <url> in a browser" message?

This is most weird. We're catching all exceptions in the Python code to open the web browser. If this error is coming from Python and isn't an exception, that seems like a bug in the Python standard library!

Search for "resource_usage" in python/mozbuild/mozbuild/mach_commands.py and try changing the default value for the "browser" argument to None (not a string - just the keyword None).
Flags: needinfo?(cam)
(In reply to Gregory Szorc [:gps] from comment #1)
> Did it not print the "'Please open <url> in a browser" message?

No, though it still did say "Hit CTRL+c to stop server.".

> This is most weird. We're catching all exceptions in the Python code to open
> the web browser. If this error is coming from Python and isn't an exception,
> that seems like a bug in the Python standard library!
> 
> Search for "resource_usage" in python/mozbuild/mozbuild/mach_commands.py and
> try changing the default value for the "browser" argument to None (not a
> string - just the keyword None).

For the @CommandArgument?  (Since the actual function argument to resource_usage is already None.)

That worked, and opened a new tab in my already running Firefox.
Flags: needinfo?(cam)
(In reply to Gregory Szorc [:gps] from comment #1)
> Search for "resource_usage" in python/mozbuild/mozbuild/mach_commands.py and
> try changing the default value for the "browser" argument to None (not a
> string - just the keyword None).

I was about to post a patch to do just that, on the reasoning that the webbrowser module can probably do a better job of picking a browser.

(Since I have both Beta and Nightly installed, but run Nightly, the current code makes Beta launch (but stop at the profile-in-use error) at the same time Nightly loads the page...)
I was also going through the installation from the source on mac and wanted to use resource-usage. I also got the same error.

I pointed the python to my custom installation of Python from Source and found that on mac os webbrowser.get(browser) will never throw an exception, even if the browser is not found.

While webbrowser.get(browser).open_new_tab(server.url) returns False when it fails to open the tab. I have fixed this locally and will be sending a patch for the same.
Component: mach → Build Config
Product: Core → Firefox Build System
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: