mirror of
https://github.com/servo/servo.git
synced 2025-08-26 23:58:20 +01:00
opts: Add a --force-ipc option (#38833)
Testing: servo.org loads properly with `./mach run -- -I` Fixes: https://github.com/servo/servo/issues/38823 Signed-off-by: Rahul Menon <menonrahul02@gmail.com>
This commit is contained in:
parent
f30be4e1ab
commit
e00f39d827
3 changed files with 8 additions and 1 deletions
|
@ -47,6 +47,10 @@ pub struct Opts {
|
||||||
/// Whether we're running in multiprocess mode.
|
/// Whether we're running in multiprocess mode.
|
||||||
pub multiprocess: bool,
|
pub multiprocess: bool,
|
||||||
|
|
||||||
|
/// Whether to force using ipc_channel instead of crossbeam_channel in singleprocess mode. Does
|
||||||
|
/// nothing in multiprocess mode.
|
||||||
|
pub force_ipc: bool,
|
||||||
|
|
||||||
/// Whether we want background hang monitor enabled or not
|
/// Whether we want background hang monitor enabled or not
|
||||||
pub background_hang_monitor: bool,
|
pub background_hang_monitor: bool,
|
||||||
|
|
||||||
|
@ -189,6 +193,7 @@ impl Default for Opts {
|
||||||
user_stylesheets: Vec::new(),
|
user_stylesheets: Vec::new(),
|
||||||
hard_fail: true,
|
hard_fail: true,
|
||||||
multiprocess: false,
|
multiprocess: false,
|
||||||
|
force_ipc: false,
|
||||||
background_hang_monitor: false,
|
background_hang_monitor: false,
|
||||||
random_pipeline_closure_probability: None,
|
random_pipeline_closure_probability: None,
|
||||||
random_pipeline_closure_seed: None,
|
random_pipeline_closure_seed: None,
|
||||||
|
|
|
@ -156,7 +156,7 @@ pub fn channel<T>() -> Option<(GenericSender<T>, GenericReceiver<T>)>
|
||||||
where
|
where
|
||||||
T: for<'de> Deserialize<'de> + Serialize,
|
T: for<'de> Deserialize<'de> + Serialize,
|
||||||
{
|
{
|
||||||
if servo_config::opts::get().multiprocess {
|
if servo_config::opts::get().multiprocess || servo_config::opts::get().force_ipc {
|
||||||
ipc_channel::ipc::channel()
|
ipc_channel::ipc::channel()
|
||||||
.map(|(tx, rx)| (GenericSender::Ipc(tx), GenericReceiver::Ipc(rx)))
|
.map(|(tx, rx)| (GenericSender::Ipc(tx), GenericReceiver::Ipc(rx)))
|
||||||
.ok()
|
.ok()
|
||||||
|
|
|
@ -284,6 +284,7 @@ pub(crate) fn parse_command_line_arguments(args: Vec<String>) -> ArgumentParsing
|
||||||
"1024x768",
|
"1024x768",
|
||||||
);
|
);
|
||||||
opts.optflag("M", "multiprocess", "Run in multiprocess mode");
|
opts.optflag("M", "multiprocess", "Run in multiprocess mode");
|
||||||
|
opts.optflag("I", "force-ipc", "Use ipc_channel in singleprocess mode");
|
||||||
opts.optflag("B", "bhm", "Background Hang Monitor enabled");
|
opts.optflag("B", "bhm", "Background Hang Monitor enabled");
|
||||||
opts.optflag("S", "sandbox", "Run in a sandbox if multiprocess");
|
opts.optflag("S", "sandbox", "Run in a sandbox if multiprocess");
|
||||||
opts.optopt(
|
opts.optopt(
|
||||||
|
@ -695,6 +696,7 @@ pub(crate) fn parse_command_line_arguments(args: Vec<String>) -> ArgumentParsing
|
||||||
user_stylesheets,
|
user_stylesheets,
|
||||||
hard_fail: opt_match.opt_present("f") && !opt_match.opt_present("F"),
|
hard_fail: opt_match.opt_present("f") && !opt_match.opt_present("F"),
|
||||||
multiprocess: opt_match.opt_present("M"),
|
multiprocess: opt_match.opt_present("M"),
|
||||||
|
force_ipc: opt_match.opt_present("I"),
|
||||||
background_hang_monitor: opt_match.opt_present("B"),
|
background_hang_monitor: opt_match.opt_present("B"),
|
||||||
sandbox: opt_match.opt_present("S"),
|
sandbox: opt_match.opt_present("S"),
|
||||||
random_pipeline_closure_probability,
|
random_pipeline_closure_probability,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue