Skip to content

Commit ecdecff

Browse files
Bug 1920227 - Use firefox -xpcshell for mach xpcshell r=ahal
Differential Revision: https://phabricator.services.mozilla.com/D257559
1 parent 95bd99d commit ecdecff

File tree

1 file changed

+18
-20
lines changed

1 file changed

+18
-20
lines changed

js/xpconnect/mach_commands.py

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,30 @@
33
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
44

55
import argparse
6-
import sys
7-
from pathlib import Path
86

97
from mach.decorators import Command, CommandArgument
108

119

12-
@Command("xpcshell", category="misc", description="Run the xpcshell binary")
10+
@Command(
11+
"xpcshell",
12+
category="misc",
13+
description="Run the xpcshell binary",
14+
)
15+
@CommandArgument(
16+
"--app",
17+
help="The path to the Firefox binary (default: the binary in $TOPOBJDIR)",
18+
dest="firefox_bin",
19+
)
1320
@CommandArgument(
14-
"args", nargs=argparse.REMAINDER, help="Arguments to provide to xpcshell"
21+
"args",
22+
nargs=argparse.REMAINDER,
23+
help="Arguments to provide to xpcshell",
1524
)
16-
def xpcshell(command_context, args):
17-
dist_bin = Path(command_context.topobjdir, "dist", "bin")
18-
browser_dir = dist_bin / "browser"
19-
20-
if sys.platform == "win32":
21-
xpcshell = dist_bin / "xpcshell.exe"
22-
else:
23-
xpcshell = dist_bin / "xpcshell"
24-
25-
command = [
26-
str(xpcshell),
27-
"-g",
28-
str(dist_bin),
29-
"-a",
30-
str(browser_dir),
31-
]
25+
def xpcshell(command_context, *, firefox_bin, args):
26+
if not firefox_bin:
27+
firefox_bin = command_context.get_binary_path("app")
28+
29+
command = [str(firefox_bin), "-xpcshell"]
3230

3331
# Disable the socket process (see https://bugzilla.mozilla.org/show_bug.cgi?id=1903631).
3432
env = {

0 commit comments

Comments
 (0)