Skip to content

Commit

Permalink
build: hook up tokio-process and dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
piscisaureus committed Nov 3, 2018
1 parent edd12b9 commit 020743d
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 4 deletions.
1 change: 1 addition & 0 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
92 changes: 88 additions & 4 deletions build_extra/rust/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -113,22 +113,24 @@ rust_crate("winapi") {
"basetsd",
"cfg",
"cfgmgr32",
"consoleapi",
"combaseapi",
"consoleapi",
"errhandlingapi",
"excpt",
"fileapi",
"guiddef",
"handleapi",
"in6addr",
"inaddr",
"ioapiset",
"knownfolders",
"ktmtypes",
"libloaderapi",
"lsalookup",
"minwinbase",
"minwindef",
"mstcpip",
"namedpipeapi",
"ntdef",
"ntsecapi",
"ntstatus",
Expand All @@ -148,7 +150,9 @@ rust_crate("winapi") {
"sspi",
"std",
"subauth",
"synchapi",
"sysinfoapi",
"threadpoollegacyapiset",
"timezoneapi",
"unknwnbase",
"vadefs",
Expand All @@ -157,8 +161,8 @@ rust_crate("winapi") {
"wincon",
"wincred",
"windef",
"wingdi",
"winerror",
"wingdi",
"winnt",
"winreg",
"winsock2",
Expand Down Expand Up @@ -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 = [
Expand All @@ -235,14 +243,18 @@ rust_crate("mio") {
":lazycell",
":libc",
":log",
":miow",
":net2",
":slab",
]

# 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"
Expand All @@ -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",
Expand Down Expand Up @@ -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",
]
}
}
1 change: 1 addition & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 020743d

Please sign in to comment.