From 9672e37f07c18c6e16ef55f1644735421e564a83 Mon Sep 17 00:00:00 2001 From: Igor Matuszewski Date: Wed, 30 Jun 2021 00:00:47 +0200 Subject: [PATCH 1/5] WIP: Update jsonrpc crates to a patched version --- Cargo.lock | 158 ++++++++++++++++++++++++++++++++++------------------- Cargo.toml | 7 +++ 2 files changed, 110 insertions(+), 55 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0f21036656..21e5a104bd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -109,6 +109,12 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" +[[package]] +name = "bytes" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b700ce4376041dcd0a327fd0097c41095743c4c8af8887265942faf1100bd040" + [[package]] name = "bytesize" version = "1.0.1" @@ -130,7 +136,7 @@ dependencies = [ "crossbeam-utils 0.8.3", "curl", "curl-sys", - "env_logger 0.8.2", + "env_logger 0.8.4", "filetime", "flate2", "fwdansi", @@ -609,9 +615,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.8.2" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26ecb66b4bdca6c1409b40fb255eefc2bd4f6d135dab3c3124f80ffa2a9661e" +checksum = "a19187fea3ac7e84da7dacf48de0c45d63c6a76f9490dae389aead16c243fce3" dependencies = [ "atty", "humantime 2.1.0", @@ -678,9 +684,9 @@ dependencies = [ [[package]] name = "fst" -version = "0.4.5" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d79238883cf0307100b90aba4a755d8051a3182305dfe7f649a1e9dc0517006f" +checksum = "7ab85b9b05e3978cc9a9cf8fea7f01b494e1a09ed3037e16ba39edc7a29eb61a" [[package]] name = "fuchsia-zircon" @@ -1087,9 +1093,8 @@ checksum = "078e285eafdfb6c4b434e0d31e8cfcb5115b651496faca5749b88fafd4f23bfd" [[package]] name = "jsonrpc-client-transports" -version = "17.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15b6c6ad01c7354d60de493148c30ac8a82b759e22ae678c8705e9b8e0c566a4" +version = "17.1.0" +source = "git+https://github.com/paritytech/jsonrpc?branch=igor-tokio-1.0#89a594461e94e1063992c516950a82ea44b9ec63" dependencies = [ "derive_more", "futures 0.3.12", @@ -1100,17 +1105,18 @@ dependencies = [ "parity-tokio-ipc", "serde", "serde_json", - "tokio", + "tokio 1.7.1", "url 1.7.2", ] [[package]] name = "jsonrpc-core" -version = "17.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07569945133257ff557eb37b015497104cea61a2c9edaf126c1cbd6e8332397f" +version = "17.1.0" +source = "git+https://github.com/paritytech/jsonrpc?branch=igor-tokio-1.0#89a594461e94e1063992c516950a82ea44b9ec63" dependencies = [ "futures 0.3.12", + "futures-executor", + "futures-util", "log", "serde", "serde_derive", @@ -1119,9 +1125,8 @@ dependencies = [ [[package]] name = "jsonrpc-core-client" -version = "17.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ac9d56dc729912796637c30f475bbf834594607b27740dfea6e5fa7ba40d1f1" +version = "17.1.0" +source = "git+https://github.com/paritytech/jsonrpc?branch=igor-tokio-1.0#89a594461e94e1063992c516950a82ea44b9ec63" dependencies = [ "futures 0.3.12", "jsonrpc-client-transports", @@ -1129,9 +1134,8 @@ dependencies = [ [[package]] name = "jsonrpc-derive" -version = "17.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b68ba7e76e5c7796cfa4d2a30e83986550c34404c6d40551c902ca6f7bd4a137" +version = "17.1.0" +source = "git+https://github.com/paritytech/jsonrpc?branch=igor-tokio-1.0#89a594461e94e1063992c516950a82ea44b9ec63" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -1141,9 +1145,8 @@ dependencies = [ [[package]] name = "jsonrpc-ipc-server" -version = "17.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c4cd89e5ea7e7f0884e828fc35bb83591a371b92439675eae28efa66c24a97" +version = "17.1.0" +source = "git+https://github.com/paritytech/jsonrpc?branch=igor-tokio-1.0#89a594461e94e1063992c516950a82ea44b9ec63" dependencies = [ "futures 0.3.12", "jsonrpc-core", @@ -1156,9 +1159,8 @@ dependencies = [ [[package]] name = "jsonrpc-pubsub" -version = "17.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c48dbebce7a9c88ab272a4db7d6478aa4c6d9596e6c086366e89efc4e9ed89e" +version = "17.1.0" +source = "git+https://github.com/paritytech/jsonrpc?branch=igor-tokio-1.0#89a594461e94e1063992c516950a82ea44b9ec63" dependencies = [ "futures 0.3.12", "jsonrpc-core", @@ -1171,18 +1173,18 @@ dependencies = [ [[package]] name = "jsonrpc-server-utils" -version = "17.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4207cce738bf713a82525065b750a008f28351324f438f56b33d698ada95bb4" +version = "17.1.0" +source = "git+https://github.com/paritytech/jsonrpc?branch=igor-tokio-1.0#89a594461e94e1063992c516950a82ea44b9ec63" dependencies = [ - "bytes", + "bytes 1.0.1", "futures 0.3.12", "globset", "jsonrpc-core", "lazy_static", "log", - "tokio", - "tokio-util", + "tokio 1.7.1", + "tokio-stream", + "tokio-util 0.6.7", "unicase", ] @@ -1288,9 +1290,9 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d33c83e320715a1e7e0466a53db2238becb2e5c446deff5506abc81aeacc5ec4" dependencies = [ - "bytes", + "bytes 0.5.6", "serde_json", - "tokio-util", + "tokio-util 0.3.1", ] [[package]] @@ -1405,6 +1407,19 @@ dependencies = [ "winapi 0.2.8", ] +[[package]] +name = "mio" +version = "0.7.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c2bdb6314ec10835cd3293dd268473a835c02b7b352e788be788b3c6ca6bb16" +dependencies = [ + "libc", + "log", + "miow 0.3.6", + "ntapi", + "winapi 0.3.9", +] + [[package]] name = "mio-named-pipes" version = "0.1.7" @@ -1412,7 +1427,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0840c1c50fd55e521b247f949c241c9997709f23bd7f023b9762cd561e935656" dependencies = [ "log", - "mio", + "mio 0.6.23", "miow 0.3.6", "winapi 0.3.9", ] @@ -1425,7 +1440,7 @@ checksum = "afcb699eb26d4332647cc848492bbc15eafb26f08d0304550d5aa1f612e066f0" dependencies = [ "iovec", "libc", - "mio", + "mio 0.6.23", ] [[package]] @@ -1461,6 +1476,15 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "ntapi" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44" +dependencies = [ + "winapi 0.3.9", +] + [[package]] name = "num_cpus" version = "1.13.0" @@ -1534,16 +1558,13 @@ checksum = "dd20eec3dbe4376829cb7d80ae6ac45e0a766831dca50202ff2d40db46a8a024" [[package]] name = "parity-tokio-ipc" version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd7f6c69d7687501b2205fe51ade1d7b8797bb3aa141fe5bf13dd78c0483bc89" +source = "git+https://github.com/Xanewok/parity-tokio-ipc?branch=mio-07#d7ade0ecdcafab1cd75d7ec0718f707dc5a0418c" dependencies = [ "futures 0.3.12", "libc", "log", - "mio-named-pipes", - "miow 0.3.6", "rand 0.7.3", - "tokio", + "tokio 1.7.1", "winapi 0.3.9", ] @@ -1952,8 +1973,8 @@ dependencies = [ "serde_ignored", "serde_json", "tempfile", - "tokio", - "tokio-util", + "tokio 0.2.25", + "tokio-util 0.3.1", "toml", "url 2.2.0", "walkdir", @@ -2008,7 +2029,7 @@ dependencies = [ "rls-data", "rls-ipc", "serde", - "tokio", + "tokio 0.2.25", ] [[package]] @@ -2778,32 +2799,45 @@ version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6703a273949a90131b290be1fe7b039d0fc884aa1935860dfcbe056f28cd8092" dependencies = [ - "bytes", + "bytes 0.5.6", "futures-core", - "iovec", "lazy_static", "libc", "memchr", - "mio", + "mio 0.6.23", "mio-named-pipes", "mio-uds", - "num_cpus", "pin-project-lite 0.1.11", "signal-hook-registry", "slab", - "tokio-macros", "winapi 0.3.9", ] [[package]] -name = "tokio-macros" -version = "0.2.6" +name = "tokio" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e44da00bfc73a25f814cd8d7e57a68a5c31b74b3152a0a1d1f590c97ed06265a" +checksum = "5fb2ed024293bb19f7a5dc54fe83bf86532a44c12a2bb8ba40d64a4509395ca2" dependencies = [ - "proc-macro2", - "quote", - "syn", + "autocfg", + "bytes 1.0.1", + "libc", + "memchr", + "mio 0.7.13", + "num_cpus", + "pin-project-lite 0.2.4", + "winapi 0.3.9", +] + +[[package]] +name = "tokio-stream" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8864d706fdb3cc0843a49647ac892720dac98a6eeb818b77190592cf4994066" +dependencies = [ + "futures-core", + "pin-project-lite 0.2.4", + "tokio 1.7.1", ] [[package]] @@ -2812,12 +2846,26 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be8242891f2b6cbef26a2d7e8605133c2c554cd35b3e4948ea892d6d68436499" dependencies = [ - "bytes", + "bytes 0.5.6", "futures-core", "futures-sink", "log", "pin-project-lite 0.1.11", - "tokio", + "tokio 0.2.25", +] + +[[package]] +name = "tokio-util" +version = "0.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1caa0b0c8d94a049db56b5acf8cba99dc0623aab1b26d5b5f5e2d945846b3592" +dependencies = [ + "bytes 1.0.1", + "futures-core", + "futures-sink", + "log", + "pin-project-lite 0.2.4", + "tokio 1.7.1", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 26ac896ca9..5f05a20d55 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,6 +20,13 @@ name = "rls" test = false path = "rls/src/main.rs" +[patch.crates-io] +parity-tokio-ipc = { git = "https://github.com/Xanewok/parity-tokio-ipc", branch = "mio-07" } +jsonrpc-core = { git = "https://github.com/paritytech/jsonrpc", branch = "igor-tokio-1.0" } +jsonrpc-core-client = { git = "https://github.com/paritytech/jsonrpc", branch = "igor-tokio-1.0" } +jsonrpc-derive = { git = "https://github.com/paritytech/jsonrpc", branch = "igor-tokio-1.0" } +jsonrpc-ipc-server = { git = "https://github.com/paritytech/jsonrpc", branch = "igor-tokio-1.0" } + [dependencies] # FIXME: Release rls-analysis 0.18.2 to crates.io rls-analysis = { version = "0.18.2", path = "rls-analysis" } From d5cdd8a7a8218da8836e4c010a19531e46ef7228 Mon Sep 17 00:00:00 2001 From: Igor Matuszewski Date: Wed, 30 Jun 2021 00:24:54 +0200 Subject: [PATCH 2/5] WIP: Upgrade to Tokio 1.0 --- Cargo.lock | 277 ++++++-------------------- Cargo.toml | 7 +- rls-rustc/Cargo.toml | 2 +- rls-rustc/src/lib.rs | 2 +- tests/client.rs | 2 +- tests/support/client/child_process.rs | 6 +- tests/support/client/mod.rs | 13 +- 7 files changed, 73 insertions(+), 236 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 21e5a104bd..4a6b1b6280 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -32,7 +32,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] @@ -55,7 +55,7 @@ checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ "hermit-abi", "libc", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -103,12 +103,6 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72feb31ffc86498dacdbd0fcebb56138e7177a8cc5cea4516031d15ae85a742e" -[[package]] -name = "bytes" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" - [[package]] name = "bytes" version = "1.0.1" @@ -175,7 +169,7 @@ dependencies = [ "unicode-xid", "url 2.2.0", "walkdir", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -208,12 +202,12 @@ dependencies = [ "jobserver", "libc", "log", - "miow 0.3.6", + "miow", "same-file", "shell-escape", "tempfile", "walkdir", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -474,7 +468,7 @@ dependencies = [ "commoncrypto", "hex 0.3.2", "openssl", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -489,7 +483,7 @@ dependencies = [ "openssl-sys", "schannel", "socket2", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -505,7 +499,7 @@ dependencies = [ "openssl-sys", "pkg-config", "vcpkg", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -569,7 +563,7 @@ checksum = "03d86534ed367a67548dc68113a0f5db55432fdfbb6e6f9d77704397d95d5780" dependencies = [ "libc", "redox_users", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -635,7 +629,7 @@ dependencies = [ "cfg-if 1.0.0", "libc", "redox_syscall", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -688,22 +682,6 @@ version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ab85b9b05e3978cc9a9cf8fea7f01b494e1a09ed3037e16ba39edc7a29eb61a" -[[package]] -name = "fuchsia-zircon" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" -dependencies = [ - "bitflags", - "fuchsia-zircon-sys", -] - -[[package]] -name = "fuchsia-zircon-sys" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" - [[package]] name = "futures" version = "0.1.30" @@ -800,7 +778,7 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project-lite 0.2.4", + "pin-project-lite", "pin-utils", "proc-macro-hack", "proc-macro-nested", @@ -946,7 +924,7 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2456aef2e6b6a9784192ae780c0f15bc57df0e918585282325e8c8ac27737654" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] @@ -1043,15 +1021,6 @@ dependencies = [ "cfg-if 1.0.0", ] -[[package]] -name = "iovec" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" -dependencies = [ - "libc", -] - [[package]] name = "itertools" version = "0.8.2" @@ -1105,7 +1074,7 @@ dependencies = [ "parity-tokio-ipc", "serde", "serde_json", - "tokio 1.7.1", + "tokio", "url 1.7.2", ] @@ -1176,28 +1145,18 @@ name = "jsonrpc-server-utils" version = "17.1.0" source = "git+https://github.com/paritytech/jsonrpc?branch=igor-tokio-1.0#89a594461e94e1063992c516950a82ea44b9ec63" dependencies = [ - "bytes 1.0.1", + "bytes", "futures 0.3.12", "globset", "jsonrpc-core", "lazy_static", "log", - "tokio 1.7.1", + "tokio", "tokio-stream", - "tokio-util 0.6.7", + "tokio-util", "unicase", ] -[[package]] -name = "kernel32-sys" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" -dependencies = [ - "winapi 0.2.8", - "winapi-build", -] - [[package]] name = "lazy_static" version = "1.4.0" @@ -1286,13 +1245,13 @@ dependencies = [ [[package]] name = "lsp-codec" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d33c83e320715a1e7e0466a53db2238becb2e5c446deff5506abc81aeacc5ec4" +checksum = "aa939d0b62476a5a19fb7fcb423a5c6ce8c7e09b851d37531e2fe3e0e6d9d257" dependencies = [ - "bytes 0.5.6", + "bytes", "serde_json", - "tokio-util 0.3.1", + "tokio-util", ] [[package]] @@ -1388,25 +1347,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "mio" -version = "0.6.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4" -dependencies = [ - "cfg-if 0.1.10", - "fuchsia-zircon", - "fuchsia-zircon-sys", - "iovec", - "kernel32-sys", - "libc", - "log", - "miow 0.2.2", - "net2", - "slab", - "winapi 0.2.8", -] - [[package]] name = "mio" version = "0.7.13" @@ -1415,44 +1355,9 @@ checksum = "8c2bdb6314ec10835cd3293dd268473a835c02b7b352e788be788b3c6ca6bb16" dependencies = [ "libc", "log", - "miow 0.3.6", + "miow", "ntapi", - "winapi 0.3.9", -] - -[[package]] -name = "mio-named-pipes" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0840c1c50fd55e521b247f949c241c9997709f23bd7f023b9762cd561e935656" -dependencies = [ - "log", - "mio 0.6.23", - "miow 0.3.6", - "winapi 0.3.9", -] - -[[package]] -name = "mio-uds" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afcb699eb26d4332647cc848492bbc15eafb26f08d0304550d5aa1f612e066f0" -dependencies = [ - "iovec", - "libc", - "mio 0.6.23", -] - -[[package]] -name = "miow" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d" -dependencies = [ - "kernel32-sys", - "net2", - "winapi 0.2.8", - "ws2_32-sys", + "winapi", ] [[package]] @@ -1462,18 +1367,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a33c1b55807fbed163481b5ba66db4b2fa6cde694a5027be10fb724206c5897" dependencies = [ "socket2", - "winapi 0.3.9", -] - -[[package]] -name = "net2" -version = "0.2.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "391630d12b68002ae1e25e8f974306474966550ad82dac6886fb8910c19568ae" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -1482,7 +1376,7 @@ version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] @@ -1513,7 +1407,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13117407ca9d0caf3a0e74f97b490a7e64c0ae3aa90a8b7085544d0c37b6f3ae" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] @@ -1564,8 +1458,8 @@ dependencies = [ "libc", "log", "rand 0.7.3", - "tokio 1.7.1", - "winapi 0.3.9", + "tokio", + "winapi", ] [[package]] @@ -1590,7 +1484,7 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -1623,12 +1517,6 @@ dependencies = [ "ucd-trie", ] -[[package]] -name = "pin-project-lite" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c917123afa01924fc84bb20c4c03f004d9c38e5127e3c039bbf7f4b9c76a2f6b" - [[package]] name = "pin-project-lite" version = "0.2.4" @@ -1929,7 +1817,7 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] @@ -1973,8 +1861,9 @@ dependencies = [ "serde_ignored", "serde_json", "tempfile", - "tokio 0.2.25", - "tokio-util 0.3.1", + "tokio", + "tokio-stream", + "tokio-util", "toml", "url 2.2.0", "walkdir", @@ -2029,7 +1918,7 @@ dependencies = [ "rls-data", "rls-ipc", "serde", - "tokio 0.2.25", + "tokio", ] [[package]] @@ -2118,7 +2007,7 @@ dependencies = [ "stacker", "tempfile", "tracing", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -2138,7 +2027,7 @@ dependencies = [ "termize", "tracing", "unicode-width", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -2421,7 +2310,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75" dependencies = [ "lazy_static", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -2603,7 +2492,7 @@ checksum = "122e570113d28d773067fab24266b66753f6ea915758651696b6e35e49f88d6e" dependencies = [ "cfg-if 1.0.0", "libc", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -2622,7 +2511,7 @@ dependencies = [ "cfg-if 1.0.0", "libc", "psm", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -2708,7 +2597,7 @@ dependencies = [ "rand 0.8.3", "redox_syscall", "remove_dir_all", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -2718,7 +2607,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0863a3345e70f61d613eab32ee046ccd1bcc5f9105fe402c61fcd0c13eeb8b5" dependencies = [ "dirs", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -2737,7 +2626,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1706be6b564323ce7092f5f7e6b118a14c8ef7ed0e69c8c5329c914a9f101295" dependencies = [ "libc", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -2793,26 +2682,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" -[[package]] -name = "tokio" -version = "0.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6703a273949a90131b290be1fe7b039d0fc884aa1935860dfcbe056f28cd8092" -dependencies = [ - "bytes 0.5.6", - "futures-core", - "lazy_static", - "libc", - "memchr", - "mio 0.6.23", - "mio-named-pipes", - "mio-uds", - "pin-project-lite 0.1.11", - "signal-hook-registry", - "slab", - "winapi 0.3.9", -] - [[package]] name = "tokio" version = "1.7.1" @@ -2820,13 +2689,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5fb2ed024293bb19f7a5dc54fe83bf86532a44c12a2bb8ba40d64a4509395ca2" dependencies = [ "autocfg", - "bytes 1.0.1", + "bytes", "libc", "memchr", - "mio 0.7.13", + "mio", "num_cpus", - "pin-project-lite 0.2.4", - "winapi 0.3.9", + "once_cell", + "pin-project-lite", + "signal-hook-registry", + "winapi", ] [[package]] @@ -2836,22 +2707,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8864d706fdb3cc0843a49647ac892720dac98a6eeb818b77190592cf4994066" dependencies = [ "futures-core", - "pin-project-lite 0.2.4", - "tokio 1.7.1", -] - -[[package]] -name = "tokio-util" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be8242891f2b6cbef26a2d7e8605133c2c554cd35b3e4948ea892d6d68436499" -dependencies = [ - "bytes 0.5.6", - "futures-core", - "futures-sink", - "log", - "pin-project-lite 0.1.11", - "tokio 0.2.25", + "pin-project-lite", + "tokio", ] [[package]] @@ -2860,12 +2717,12 @@ version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1caa0b0c8d94a049db56b5acf8cba99dc0623aab1b26d5b5f5e2d945846b3592" dependencies = [ - "bytes 1.0.1", + "bytes", "futures-core", "futures-sink", "log", - "pin-project-lite 0.2.4", - "tokio 1.7.1", + "pin-project-lite", + "tokio", ] [[package]] @@ -2890,7 +2747,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7d40a22fd029e33300d8d89a5cc8ffce18bb7c587662f54629e94c9de5487f3" dependencies = [ "cfg-if 1.0.0", - "pin-project-lite 0.2.4", + "pin-project-lite", "tracing-attributes", "tracing-core", ] @@ -3042,7 +2899,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" dependencies = [ "same-file", - "winapi 0.3.9", + "winapi", "winapi-util", ] @@ -3058,12 +2915,6 @@ version = "0.10.2+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" -[[package]] -name = "winapi" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" - [[package]] name = "winapi" version = "0.3.9" @@ -3074,12 +2925,6 @@ dependencies = [ "winapi-x86_64-pc-windows-gnu", ] -[[package]] -name = "winapi-build" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" - [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" @@ -3092,7 +2937,7 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] @@ -3101,21 +2946,11 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "ws2_32-sys" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" -dependencies = [ - "winapi 0.2.8", - "winapi-build", -] - [[package]] name = "yansi-term" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe5c30ade05e61656247b2e334a031dfd0cc466fadef865bdcdea8d537951bf1" dependencies = [ - "winapi 0.3.9", + "winapi", ] diff --git a/Cargo.toml b/Cargo.toml index 5f05a20d55..61ada527b5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -75,9 +75,10 @@ rustc-workspace-hack = "1.0.0" [dev-dependencies] difference = "2" tempfile = "3" -lsp-codec = "0.2" -tokio = { version = "0.2", default-features = false, features = ["rt-core", "time", "io-util", "process", "rt-util"] } -tokio-util = { version = "0.3", default-features = false, features = ["codec"] } +lsp-codec = "0.3" +tokio = { version = "1", default-features = false, features = ["rt", "time", "io-util", "process"] } +tokio-util = { version = "0.6", default-features = false, features = ["codec"] } +tokio-stream = "0.1" futures = "0.3" [build-dependencies] diff --git a/rls-rustc/Cargo.toml b/rls-rustc/Cargo.toml index 8adee86dac..d7354d4e7d 100644 --- a/rls-rustc/Cargo.toml +++ b/rls-rustc/Cargo.toml @@ -13,7 +13,7 @@ env_logger = "0.7" log = "0.4" rand = "0.7" clippy_lints = { git = "https://github.com/rust-lang/rust-clippy", rev = "a55912c48e4ac08c0ac39a2d562b44699fa20d4d", optional = true } -tokio = { version = "0.2", optional = true } +tokio = { version = "1", optional = true } futures = { version = "0.3", optional = true } serde = { version = "1", features = ["derive"], optional = true } rls-data = { version = "0.19", optional = true } diff --git a/rls-rustc/src/lib.rs b/rls-rustc/src/lib.rs index 6ed166fef9..804d626948 100644 --- a/rls-rustc/src/lib.rs +++ b/rls-rustc/src/lib.rs @@ -27,7 +27,7 @@ mod ipc; pub fn run() -> Result<(), ()> { #[cfg(feature = "ipc")] - let mut rt = tokio::runtime::Runtime::new().unwrap(); + let rt = tokio::runtime::Runtime::new().unwrap(); #[cfg(feature = "clippy")] let clippy_preference = clippy::preference(); diff --git a/tests/client.rs b/tests/client.rs index 67d2afc33a..5ad7fc12c7 100644 --- a/tests/client.rs +++ b/tests/client.rs @@ -2147,7 +2147,7 @@ fn client_fail_uninitialized_request() { }, ); - rls.block_on(async { tokio::time::delay_for(Duration::from_secs(1)).await }).unwrap(); + rls.block_on(async { tokio::time::sleep(Duration::from_secs(1)).await }).unwrap(); let err = jsonrpc_core::Failure::deserialize(rls.messages().last().unwrap()).unwrap(); assert_eq!(err.id, jsonrpc_core::Id::Num(ID)); diff --git a/tests/support/client/child_process.rs b/tests/support/client/child_process.rs index c3ec088dde..2485e3713e 100644 --- a/tests/support/client/child_process.rs +++ b/tests/support/client/child_process.rs @@ -4,7 +4,7 @@ use std::process::{Command, Stdio}; use std::rc::Rc; use std::task::{Context, Poll}; -use tokio::io::{AsyncRead, AsyncWrite}; +use tokio::io::{AsyncRead, AsyncWrite, ReadBuf}; pub struct ChildProcess { stdin: tokio::process::ChildStdin, @@ -16,8 +16,8 @@ impl AsyncRead for ChildProcess { fn poll_read( mut self: Pin<&mut Self>, cx: &mut Context<'_>, - buf: &mut [u8], - ) -> Poll> { + buf: &mut ReadBuf<'_>, + ) -> Poll> { Pin::new(&mut self.stdout).poll_read(cx, buf) } } diff --git a/tests/support/client/mod.rs b/tests/support/client/mod.rs index ccdc56f098..7ede0a66d3 100644 --- a/tests/support/client/mod.rs +++ b/tests/support/client/mod.rs @@ -66,15 +66,16 @@ impl Project { } pub fn spawn_rls_async(&self) -> RlsHandle { - let rt = tokio::runtime::Builder::new() - .basic_scheduler() + let rt = tokio::runtime::Builder::new_current_thread() .enable_all() - .core_threads(1) + // .worker_threads(1) .build() .unwrap(); let cmd = self.rls_cmd(); - let process = rt.enter(|| ChildProcess::spawn_from_command(cmd).unwrap()); + let guard = rt.enter(); + let process = ChildProcess::spawn_from_command(cmd).unwrap(); + drop(guard); self.spawn_rls_with_params(rt, process) } @@ -97,7 +98,7 @@ impl Project { #[allow(clippy::unit_arg)] // We're interested in the side-effects of `process_msg`. local_set.spawn_local(async move { use futures::TryStreamExt; - use tokio::stream::StreamExt; + use tokio_stream::StreamExt; stream .timeout(rls_timeout()) @@ -178,7 +179,7 @@ impl RlsHandle { } /// Block on returned, associated future with a timeout. - pub fn block_on(&mut self, f: F) -> Result { + pub fn block_on(&mut self, f: F) -> Result { self.local_set .block_on(&mut self.runtime, async { tokio::time::timeout(rls_timeout(), f).await }) } From 674b272a596eac341207131cd62747391912a31f Mon Sep 17 00:00:00 2001 From: Igor Matuszewski Date: Tue, 24 Aug 2021 13:46:40 +0200 Subject: [PATCH 3/5] Use crates.io version for jsonrpc-* crates --- Cargo.lock | 40 ++++++++++++++++++++++++---------------- Cargo.toml | 9 +-------- rls-ipc/Cargo.toml | 8 ++++---- 3 files changed, 29 insertions(+), 28 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4a6b1b6280..288f2c0b50 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1062,8 +1062,9 @@ checksum = "078e285eafdfb6c4b434e0d31e8cfcb5115b651496faca5749b88fafd4f23bfd" [[package]] name = "jsonrpc-client-transports" -version = "17.1.0" -source = "git+https://github.com/paritytech/jsonrpc?branch=igor-tokio-1.0#89a594461e94e1063992c516950a82ea44b9ec63" +version = "18.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2b99d4207e2a04fb4581746903c2bb7eb376f88de9c699d0f3e10feeac0cd3a" dependencies = [ "derive_more", "futures 0.3.12", @@ -1080,8 +1081,9 @@ dependencies = [ [[package]] name = "jsonrpc-core" -version = "17.1.0" -source = "git+https://github.com/paritytech/jsonrpc?branch=igor-tokio-1.0#89a594461e94e1063992c516950a82ea44b9ec63" +version = "18.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14f7f76aef2d054868398427f6c54943cf3d1caa9a7ec7d0c38d69df97a965eb" dependencies = [ "futures 0.3.12", "futures-executor", @@ -1094,8 +1096,9 @@ dependencies = [ [[package]] name = "jsonrpc-core-client" -version = "17.1.0" -source = "git+https://github.com/paritytech/jsonrpc?branch=igor-tokio-1.0#89a594461e94e1063992c516950a82ea44b9ec63" +version = "18.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b51da17abecbdab3e3d4f26b01c5ec075e88d3abe3ab3b05dc9aa69392764ec0" dependencies = [ "futures 0.3.12", "jsonrpc-client-transports", @@ -1103,8 +1106,9 @@ dependencies = [ [[package]] name = "jsonrpc-derive" -version = "17.1.0" -source = "git+https://github.com/paritytech/jsonrpc?branch=igor-tokio-1.0#89a594461e94e1063992c516950a82ea44b9ec63" +version = "18.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b939a78fa820cdfcb7ee7484466746a7377760970f6f9c6fe19f9edcc8a38d2" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -1114,8 +1118,9 @@ dependencies = [ [[package]] name = "jsonrpc-ipc-server" -version = "17.1.0" -source = "git+https://github.com/paritytech/jsonrpc?branch=igor-tokio-1.0#89a594461e94e1063992c516950a82ea44b9ec63" +version = "18.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "382bb0206323ca7cda3dcd7e245cea86d37d02457a02a975e3378fb149a48845" dependencies = [ "futures 0.3.12", "jsonrpc-core", @@ -1128,8 +1133,9 @@ dependencies = [ [[package]] name = "jsonrpc-pubsub" -version = "17.1.0" -source = "git+https://github.com/paritytech/jsonrpc?branch=igor-tokio-1.0#89a594461e94e1063992c516950a82ea44b9ec63" +version = "18.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240f87695e6c6f62fb37f05c02c04953cf68d6408b8c1c89de85c7a0125b1011" dependencies = [ "futures 0.3.12", "jsonrpc-core", @@ -1142,8 +1148,9 @@ dependencies = [ [[package]] name = "jsonrpc-server-utils" -version = "17.1.0" -source = "git+https://github.com/paritytech/jsonrpc?branch=igor-tokio-1.0#89a594461e94e1063992c516950a82ea44b9ec63" +version = "18.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4fdea130485b572c39a460d50888beb00afb3e35de23ccd7fad8ff19f0e0d4" dependencies = [ "bytes", "futures 0.3.12", @@ -1451,8 +1458,9 @@ checksum = "dd20eec3dbe4376829cb7d80ae6ac45e0a766831dca50202ff2d40db46a8a024" [[package]] name = "parity-tokio-ipc" -version = "0.8.0" -source = "git+https://github.com/Xanewok/parity-tokio-ipc?branch=mio-07#d7ade0ecdcafab1cd75d7ec0718f707dc5a0418c" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9981e32fb75e004cc148f5fb70342f393830e0a4aa62e3cc93b50976218d42b6" dependencies = [ "futures 0.3.12", "libc", diff --git a/Cargo.toml b/Cargo.toml index 61ada527b5..672438cc7e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,13 +20,6 @@ name = "rls" test = false path = "rls/src/main.rs" -[patch.crates-io] -parity-tokio-ipc = { git = "https://github.com/Xanewok/parity-tokio-ipc", branch = "mio-07" } -jsonrpc-core = { git = "https://github.com/paritytech/jsonrpc", branch = "igor-tokio-1.0" } -jsonrpc-core-client = { git = "https://github.com/paritytech/jsonrpc", branch = "igor-tokio-1.0" } -jsonrpc-derive = { git = "https://github.com/paritytech/jsonrpc", branch = "igor-tokio-1.0" } -jsonrpc-ipc-server = { git = "https://github.com/paritytech/jsonrpc", branch = "igor-tokio-1.0" } - [dependencies] # FIXME: Release rls-analysis 0.18.2 to crates.io rls-analysis = { version = "0.18.2", path = "rls-analysis" } @@ -45,7 +38,7 @@ clippy_lints = { git = "https://github.com/rust-lang/rust-clippy", rev = "a55912 env_logger = "0.7" home = "0.5.1" itertools = "0.9" -jsonrpc-core = "17" +jsonrpc-core = "18" lsp-types = { version = "0.60", features = ["proposed"] } lazy_static = "1" log = "0.4" diff --git a/rls-ipc/Cargo.toml b/rls-ipc/Cargo.toml index 5b711c7c33..5a36bab267 100644 --- a/rls-ipc/Cargo.toml +++ b/rls-ipc/Cargo.toml @@ -9,10 +9,10 @@ repository = "https://github.com/rust-lang/rls" categories = ["development-tools"] [dependencies] -jsonrpc-core = "17" -jsonrpc-core-client = "17" -jsonrpc-derive = "17" -jsonrpc-ipc-server = { version = "17", optional = true } +jsonrpc-core = "18" +jsonrpc-core-client = "18" +jsonrpc-derive = "18" +jsonrpc-ipc-server = { version = "18", optional = true } rls-data = "0.19" serde = { version = "1.0", features = ["derive"] } From 3512cf8362e2fccecfbb2d1d8ac7df909d4efc87 Mon Sep 17 00:00:00 2001 From: Igor Matuszewski Date: Tue, 24 Aug 2021 13:54:59 +0200 Subject: [PATCH 4/5] Remove old code --- tests/support/client/mod.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/support/client/mod.rs b/tests/support/client/mod.rs index 7ede0a66d3..19781cf762 100644 --- a/tests/support/client/mod.rs +++ b/tests/support/client/mod.rs @@ -68,7 +68,6 @@ impl Project { pub fn spawn_rls_async(&self) -> RlsHandle { let rt = tokio::runtime::Builder::new_current_thread() .enable_all() - // .worker_threads(1) .build() .unwrap(); From f612dfd62d9c9dd017e5a223ffb76e96e84732d3 Mon Sep 17 00:00:00 2001 From: Igor Matuszewski Date: Tue, 24 Aug 2021 13:55:51 +0200 Subject: [PATCH 5/5] Reformat --- tests/support/client/mod.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/support/client/mod.rs b/tests/support/client/mod.rs index 19781cf762..cee9eec6ee 100644 --- a/tests/support/client/mod.rs +++ b/tests/support/client/mod.rs @@ -66,10 +66,7 @@ impl Project { } pub fn spawn_rls_async(&self) -> RlsHandle { - let rt = tokio::runtime::Builder::new_current_thread() - .enable_all() - .build() - .unwrap(); + let rt = tokio::runtime::Builder::new_current_thread().enable_all().build().unwrap(); let cmd = self.rls_cmd(); let guard = rt.enter();