Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Refactor to use new futures api #2612

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
766 changes: 709 additions & 57 deletions Cargo.lock

Large diffs are not rendered by default.

239 changes: 239 additions & 0 deletions build_extra/rust/BUILD.gn
Expand Up @@ -321,6 +321,236 @@ rust_rlib("futures_cpupool") {
]
}

rust_rlib("futures_preview") {
source_root = "$cargo_home/registry/src/github.com-1ecc6299db9ec823/futures-preview-0.3.0-alpha.17/src/lib.rs"
crate_name = "futures"
crate_version = "0.3.0-alpha.17"
features = [
"default",
"std",
"alloc",
"compat",
]
extern = [
{
label = ":futures_channel_preview"
crate_name = "futures_channel"
crate_type = "rlib"
crate_version = "0.3.0-alpha.17"
},
{
label = ":futures_core_preview"
crate_name = "futures_core"
crate_type = "rlib"
crate_version = "0.3.0-alpha.17"
},
{
label = ":futures_executor_preview"
crate_name = "futures_executor"
crate_type = "rlib"
crate_version = "0.3.0-alpha.17"
},
{
label = ":futures_io_preview"
crate_name = "futures_io"
crate_type = "rlib"
crate_version = "0.3.0-alpha.17"
},
{
label = ":futures_sink_preview"
crate_name = "futures_sink"
crate_type = "rlib"
crate_version = "0.3.0-alpha.17"
},
{
label = ":futures_util_preview"
crate_name = "futures_util"
crate_type = "rlib"
crate_version = "0.3.0-alpha.17"
},
]
args = [
"--cap-lints",
"allow",
]
}

rust_rlib("futures_channel_preview") {
source_root = "$cargo_home/registry/src/github.com-1ecc6299db9ec823/futures-channel-preview-0.3.0-alpha.17/src/lib.rs"
crate_name = "futures_channel"
crate_version = "0.3.0-alpha.17"
features = [
"default",
"std",
"alloc",
"sink",
]
extern = [
{
label = ":futures_core_preview"
crate_name = "futures_core"
crate_type = "rlib"
crate_version = "0.3.0-alpha.17"
},
{
label = ":futures_sink_preview"
crate_name = "futures_sink"
crate_type = "rlib"
crate_version = "0.3.0-alpha.17"
},
]
args = [
"--cap-lints",
"allow",
]
}

rust_rlib("futures_core_preview") {
source_root = "$cargo_home/registry/src/github.com-1ecc6299db9ec823/futures-core-preview-0.3.0-alpha.17/src/lib.rs"
crate_name = "futures_core"
crate_version = "0.3.0-alpha.17"
features = [
"default",
"std",
"alloc",
]
args = [
"--cap-lints",
"allow",
]
}

rust_rlib("futures_executor_preview") {
source_root = "$cargo_home/registry/src/github.com-1ecc6299db9ec823/futures-executor-preview-0.3.0-alpha.17/src/lib.rs"
crate_name = "futures_executor"
crate_version = "0.3.0-alpha.17"
features = [
"default",
"std",
"alloc",
]
extern_rlib = [ "num_cpus" ]
extern = [
{
label = ":futures_core_preview"
crate_name = "futures_core"
crate_type = "rlib"
crate_version = "0.3.0-alpha.17"
},
{
label = ":futures_sink_preview"
crate_name = "futures_sink"
crate_type = "rlib"
crate_version = "0.3.0-alpha.17"
},
{
label = ":futures_util_preview"
crate_name = "futures_util"
crate_type = "rlib"
crate_version = "0.3.0-alpha.17"
},
]
args = [
"--cap-lints",
"allow",
]
}

rust_rlib("futures_io_preview") {
source_root = "$cargo_home/registry/src/github.com-1ecc6299db9ec823/futures-io-preview-0.3.0-alpha.17/src/lib.rs"
crate_name = "futures_io"
crate_version = "0.3.0-alpha.17"
features = [
"default",
"std",
"alloc",
]
args = [
"--cap-lints",
"allow",
]
}

rust_rlib("futures_sink_preview") {
source_root = "$cargo_home/registry/src/github.com-1ecc6299db9ec823/futures-sink-preview-0.3.0-alpha.17/src/lib.rs"
crate_name = "futures_sink"
crate_version = "0.3.0-alpha.17"
features = [
"default",
"std",
"alloc",
]
extern = [
{
label = ":futures_core_preview"
crate_name = "futures_core"
crate_type = "rlib"
crate_version = "0.3.0-alpha.17"
},
]
args = [
"--cap-lints",
"allow",
]
}

rust_rlib("futures_util_preview") {
source_root = "$cargo_home/registry/src/github.com-1ecc6299db9ec823/futures-util-preview-0.3.0-alpha.17/src/lib.rs"
crate_name = "futures_util"
crate_version = "0.3.0-alpha.17"
features = [
"default",
"std",
"alloc",
"sink",
"io",
"channel",
"compat",
]
extern_rlib = [
"futures",
"slab",
"pin_utils",
"memchr",
]
extern = [
{
label = ":futures"
crate_name = "futures"
crate_type = "rlib"
extern_alias = "futures_01"
},
{
label = ":futures_channel_preview"
crate_name = "futures_channel"
crate_type = "rlib"
crate_version = "0.3.0-alpha.17"
},
{
label = ":futures_core_preview"
crate_name = "futures_core"
crate_type = "rlib"
crate_version = "0.3.0-alpha.17"
},
{
label = ":futures_io_preview"
crate_name = "futures_io"
crate_type = "rlib"
crate_version = "0.3.0-alpha.17"
},
{
label = ":futures_sink_preview"
crate_name = "futures_sink"
crate_type = "rlib"
crate_version = "0.3.0-alpha.17"
},
]
args = [
"--cap-lints",
"allow",
]
}

rust_rlib("h2") {
edition = "2015"
source_root = "$cargo_home/registry/src/github.com-1ecc6299db9ec823/h2-0.1.23/src/lib.rs"
Expand Down Expand Up @@ -764,6 +994,15 @@ rust_rlib("percent_encoding") {
]
}

rust_rlib("pin_utils") {
edition = "2015"
source_root = "$cargo_home/registry/src/github.com-1ecc6299db9ec823/pin-utils-0.1.0-alpha.4/src/lib.rs"
args = [
"--cap-lints",
"allow",
]
}

rust_rlib("proc_macro2") {
edition = "2015"
source_root = "$cargo_home/registry/src/github.com-1ecc6299db9ec823/proc-macro2-0.4.30/src/lib.rs"
Expand Down
7 changes: 6 additions & 1 deletion build_extra/rust/rust.gni
Expand Up @@ -150,6 +150,11 @@ template("_rust_crate") {
label = info.label
crate_name = info.crate_name
crate_type = info.crate_type
extern_name = info.crate_name

if (defined(info.extern_alias)) {
extern_name = info.extern_alias
}

if (!defined(info.crate_version)) {
crate_suffix = ""
Expand Down Expand Up @@ -293,7 +298,7 @@ template("_rust_crate") {
foreach(info, extern_outputs) {
args += [
"--extern",
info.crate_name + "=" + rebase_path(info.out_path, root_build_dir),
info.extern_name + "=" + rebase_path(info.out_path, root_build_dir),
]
sources += [ info.out_path ]
deps += [ info.label ]
Expand Down
7 changes: 6 additions & 1 deletion cli/BUILD.gn
Expand Up @@ -18,14 +18,19 @@ main_extern = [
crate_name = "serde_derive"
crate_type = "proc_macro"
},
{
label = "//build_extra/rust:futures_preview"
crate_name = "futures"
crate_type = "rlib"
crate_version = "0.3.0-alpha.17"
},
]
main_extern_rlib = [
"ansi_term",
"atty",
"clap",
"dirs",
"flatbuffers",
"futures",
"fwdansi",
"http",
"hyper",
Expand Down
16 changes: 8 additions & 8 deletions cli/Cargo.toml
Expand Up @@ -23,7 +23,8 @@ atty = "0.2.11"
clap = "2.33.0"
dirs = "2.0.1"
flatbuffers = "0.6.0"
futures = "0.1.27"
futures-preview = { version = "0.3.0-alpha.17", features = ["compat"] }
futures_01 = { package = "futures", version = "0.1.28" }
http = "0.1.17"
hyper = "0.12.30"
hyper-rustls = "0.16.1"
Expand All @@ -43,13 +44,12 @@ serde_json = { version = "1.0.39", features = [ "preserve_order" ] }
source-map-mappings = "0.5.0"
tempfile = "3.0.8"
termcolor = "1.0.4"
tokio = "0.1.21"
tokio-executor = "0.1.7"
tokio-fs = "0.1.6"
tokio-io = "0.1.12"
tokio-process = "0.2.3"
tokio-rustls = "0.9.3"
tokio-threadpool = "0.1.14"
tokio = { version = "0.2.0", git = "https://github.com/tokio-rs/tokio", rev = "0d99ddd4f4adfb3ee099a5eefaea529200afcbd1" }
tokio-executor = { version = "0.2.0", git = "https://github.com/tokio-rs/tokio", rev = "0d99ddd4f4adfb3ee099a5eefaea529200afcbd1" }
tokio-fs = { version = "0.2.0", git = "https://github.com/tokio-rs/tokio", rev = "0d99ddd4f4adfb3ee099a5eefaea529200afcbd1" }
tokio-io = { version = "0.2.0", git = "https://github.com/tokio-rs/tokio", rev = "0d99ddd4f4adfb3ee099a5eefaea529200afcbd1" }
tokio-process = { version = "0.2.0", git = "https://github.com/afinch7/tokio-process", rev = "320b8b9bfe77c195a15d14e3f293ade438b7d5c5" }
tokio-threadpool = { version = "0.2.0", git = "https://github.com/tokio-rs/tokio", rev = "0d99ddd4f4adfb3ee099a5eefaea529200afcbd1" }
url = "1.7.2"
utime = "0.2.1"

Expand Down