From 2718685833c8a7ad26d5e0f81b9c5c0a4c15e46c Mon Sep 17 00:00:00 2001 From: Marco Castelluccio Date: Tue, 1 Oct 2019 00:41:59 +0000 Subject: [PATCH] servo: Merge #14270 - Disable the debugger on Android until mio works on Android (from larsbergstrom:disable_android_debugger); r=nox r? nox The recent change to `ws-rs` introduced a dependency on `mio`, which depends on `nix`, which does not build on Android (https://github.com/nix-rust/nix/issues/313). I've disabled the debugger in this change. Fixes #14171 cc mmatyas --- - [ ] `./mach build -d` does not report any errors - [ ] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ Source-Repo: https://github.com/servo/servo Source-Revision: 9c6f6ebf3e789c251f34d865a4a713988ba81cdb UltraBlame original commit: 9d91cefb5476e1da0840406029ce219d3d99aef1 --- servo/components/debugger/Cargo.toml | 2 ++ servo/components/debugger/lib.rs | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/servo/components/debugger/Cargo.toml b/servo/components/debugger/Cargo.toml index 413e17b3dc209..e9b097e5963ef 100644 --- a/servo/components/debugger/Cargo.toml +++ b/servo/components/debugger/Cargo.toml @@ -13,4 +13,6 @@ crate_type = ["rlib"] [dependencies] log = "0.3.5" util = {path = "../util"} + +[target.'cfg(not(target_os = "android"))'.dependencies] ws = "0.5.3" diff --git a/servo/components/debugger/lib.rs b/servo/components/debugger/lib.rs index b9d7069afec4e..b65ce86ee9b7d 100644 --- a/servo/components/debugger/lib.rs +++ b/servo/components/debugger/lib.rs @@ -5,11 +5,13 @@ #[macro_use] extern crate log; extern crate util; +#[cfg(not(target_os = "android"))] extern crate ws; use std::sync::mpsc; use std::sync::mpsc::channel; use util::thread::spawn_named; +#[cfg(not(target_os = "android"))] use ws::{Builder, CloseCode, Handler, Handshake}; enum Message { @@ -18,10 +20,12 @@ enum Message { pub struct Sender(mpsc::Sender); +#[cfg(not(target_os = "android"))] struct Connection { sender: ws::Sender } +#[cfg(not(target_os = "android"))] impl Handler for Connection { fn on_open(&mut self, _: Handshake) -> ws::Result<()> { debug!("Connection opened."); @@ -37,6 +41,7 @@ impl Handler for Connection { } } +#[cfg(not(target_os = "android"))] pub fn start_server(port: u16) -> Sender { debug!("Starting server."); let (sender, receiver) = channel(); @@ -60,6 +65,12 @@ pub fn start_server(port: u16) -> Sender { Sender(sender) } +#[cfg(target_os = "android")] +pub fn start_server(_: u16) -> Sender { + panic!("Debugger is not supported on Android"); +} + +#[cfg(not(target_os = "android"))] pub fn shutdown_server(sender: &Sender) { debug!("Shutting down server."); let &Sender(ref sender) = sender; @@ -67,3 +78,8 @@ pub fn shutdown_server(sender: &Sender) { warn!("Failed to shut down server."); } } + +#[cfg(target_os = "android")] +pub fn shutdown_server(_: &Sender) { + panic!("Debugger is not supported on Android"); +}