1 # This Source Code Form is subject to the terms of the Mozilla Public
2 # License, v. 2.0. If a copy of the MPL was not distributed with this
3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 from pathlib
import Path
9 from mach
.decorators
import Command
, CommandArgument
12 @Command("xpcshell", category
="misc", description
="Run the xpcshell binary")
14 "args", nargs
=argparse
.REMAINDER
, help="Arguments to provide to xpcshell"
16 def xpcshell(command_context
, args
):
17 dist_bin
= Path(command_context
.topobjdir
, "dist", "bin")
18 browser_dir
= dist_bin
/ "browser"
20 if sys
.platform
== "win32":
21 xpcshell
= dist_bin
/ "xpcshell.exe"
23 xpcshell
= dist_bin
/ "xpcshell"
33 # Disable the socket process (see https://bugzilla.mozilla.org/show_bug.cgi?id=1903631).
35 "MOZ_DISABLE_SOCKET_PROCESS": "1",
41 return command_context
.run_process(
44 ensure_exit_code
=False,