diff --git a/BUILD.gn b/BUILD.gn index c3c18107dda464..6ea4ba56a00b6e 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -68,6 +68,7 @@ main_extern = [ "$rust_build:tokio_executor", "$rust_build:tokio_fs", "$rust_build:tokio_io", + "$rust_build:tokio_process", "$rust_build:tokio_threadpool", "$rust_build:url", "//build_extra/flatbuffers/rust:flatbuffers", diff --git a/Cargo.toml b/Cargo.toml index a06dd54779507c..a46622becae0ce 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,5 +29,6 @@ tokio = "0.1.11" tokio-executor = "0.1.5" tokio-fs = "0.1.3" tokio-io = "0.1.8" +tokio-process = "0.2.3" tokio-threadpool = "0.1.6" url = "1.7.1" diff --git a/build_extra/rust/BUILD.gn b/build_extra/rust/BUILD.gn index 56e0aaa96f1c68..7d82e364751a4c 100644 --- a/build_extra/rust/BUILD.gn +++ b/build_extra/rust/BUILD.gn @@ -113,8 +113,8 @@ rust_crate("winapi") { "basetsd", "cfg", "cfgmgr32", - "consoleapi", "combaseapi", + "consoleapi", "errhandlingapi", "excpt", "fileapi", @@ -122,6 +122,7 @@ rust_crate("winapi") { "handleapi", "in6addr", "inaddr", + "ioapiset", "knownfolders", "ktmtypes", "libloaderapi", @@ -129,6 +130,7 @@ rust_crate("winapi") { "minwinbase", "minwindef", "mstcpip", + "namedpipeapi", "ntdef", "ntsecapi", "ntstatus", @@ -148,7 +150,9 @@ rust_crate("winapi") { "sspi", "std", "subauth", + "synchapi", "sysinfoapi", + "threadpoollegacyapiset", "timezoneapi", "unknwnbase", "vadefs", @@ -157,8 +161,8 @@ rust_crate("winapi") { "wincon", "wincred", "windef", - "wingdi", "winerror", + "wingdi", "winnt", "winreg", "winsock2", @@ -223,6 +227,10 @@ rust_crate("futures") { ] } +# TODO: 'mio' currently pulls in dozen of outdated winapi related dependencies. +# 'miow' has already moved past that, and patches to solve this for Mio's have +# been available in mio's v0.7 branch, but there are no signs that a release +# might be coming soon. We should consider floating these patches. rust_crate("mio") { source_root = "$registry_github/mio-0.6.15/src/lib.rs" features = [ @@ -235,7 +243,6 @@ rust_crate("mio") { ":lazycell", ":libc", ":log", - ":miow", ":net2", ":slab", ] @@ -243,6 +250,11 @@ rust_crate("mio") { # TODO: Upgrade to a current version of the 'winapi' crate. # See https://github.com/denoland/deno/issues/484. extern_version = [ + { + label = ":miow-0.2.1" + crate_name = "miow" + crate_version = "0.2.1" + }, { label = ":winapi-0.2" crate_name = "winapi" @@ -260,7 +272,8 @@ rust_crate("mio_uds") { ] } -rust_crate("miow") { +# Outdated version of 'miow' - see comments by the 'mio' crate. +rust_crate("miow_0.2.1") { source_root = "$registry_github/miow-0.2.1/src/lib.rs" extern = [ ":kernel32", @@ -944,3 +957,74 @@ rust_crate("getopts") { source_root = "$registry_github/getopts-0.2.18/src/lib.rs" extern = [ ":unicode_width" ] } + +rust_crate("arc_swap") { + source_root = "$registry_github/arc_swap-0.3.4/src/lib.rs" +} + +rust_crate("mio_named_pipes") { + source_root = "$registry_github/mio_named_pipes-0.1.6/src/lib.rs" + extern = [ + ":log", + ":mio", + ":miow", + ":winapi", + ] +} + +rust_crate("miow") { + source_root = "$registry_github/miow-0.3.3/src/lib.rs" + extern = [ + ":socket2", + ":winapi", + ] +} + +rust_crate("signal_hook") { + source_root = "$registry_github/signal_hook-0.1.5/src/lib.rs" + extern = [ + ":arc_swap", + ":libc", + ] +} + +rust_crate("socket2") { + source_root = "$registry_github/socket2-0.3.8/src/lib.rs" + extern = [ ":winapi" ] +} + +rust_crate("tokio_signal") { + source_root = "$registry_github/tokio_signal-0.2.6/src/lib.rs" + extern = [ + ":futures", + ":libc", + ":mio", + ":mio_uds", + ":signal_hook", + "tokio_executor", + "tokio_io", + "tokio_reactor", + ] +} + +rust_crate("tokio_process") { + source_root = "$registry_github/tokio_process-0.2.3/src/lib.rs" + extern = [ + ":futures", + ":mio", + ":tokio_io", + ":tokio_reactor", + ] + + if (is_win) { + extern += [ + ":mio_named_pipes", + ":winapi", + ] + } else { + extern += [ + ":libc", + ":tokio_signal", + ] + } +} diff --git a/src/main.rs b/src/main.rs index 0defa68385c208..23e685513afd51 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,6 +13,7 @@ extern crate tokio; extern crate tokio_executor; extern crate tokio_fs; extern crate tokio_io; +extern crate tokio_process; extern crate tokio_threadpool; extern crate url;