From 2fa51477614945505251fc407b63f6e7575d2fa9 Mon Sep 17 00:00:00 2001 From: kazk Date: Wed, 9 Sep 2020 21:08:10 -0700 Subject: [PATCH 1/4] Update smol to 1.0 and async-net to 1.2 --- Cargo.lock | 222 ++++++++++++++++++++++++++++++++++++---------------- Cargo.toml | 4 +- src/main.rs | 2 +- 3 files changed, 158 insertions(+), 70 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 132c5c8..3d9aa6d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9,6 +9,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "arc-swap" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d25d88fd6b8041580a654f9d0c581a047baee2b3efee13275f2fc392fc75034" + [[package]] name = "argh" version = "0.1.3" @@ -38,11 +44,21 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1ba68f4276a778591e36a0c348a269888f3a177c8d2054969389e3b59611ff5" +[[package]] +name = "async-barrier" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06293698675eb72e1155867e5982f199d6b6c230dca35bc5ffd9852f470c22a" +dependencies = [ + "async-mutex", + "event-listener", +] + [[package]] name = "async-channel" -version = "1.4.0" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43de69555a39d52918e2bc33a408d3c0a86c829b212d898f4ca25d21a6387478" +checksum = "21279cfaa4f47df10b1816007e738ca3747ef2ee53ffc51cdbf57a8bb266fee3" dependencies = [ "concurrent-queue", "event-listener", @@ -51,45 +67,114 @@ dependencies = [ [[package]] name = "async-executor" -version = "0.1.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90f47c78ea98277cb1f5e6f60ba4fc762f5eafe9f6511bc2f7dfd8b75c225650" +checksum = "62f049075ec7a47ee59ed2e3013026e26e66b7430b1f2276c1e6ad9d5cfbff8f" dependencies = [ - "async-io", + "async-task", + "concurrent-queue", + "fastrand", + "futures-lite", + "once_cell", +] + +[[package]] +name = "async-fs" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3361d088d288026af2cb21b9d9b8444bf0ba73bce56a4fc4b5742ba88f82ee74" +dependencies = [ + "blocking", "futures-lite", - "multitask", - "parking", - "scoped-tls", - "waker-fn", ] [[package]] name = "async-io" -version = "0.1.9" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a679dff790f7943b4ddd12cf2d00cdadf3db0cb3a370eb2c77723343354e147" +checksum = "c59a2cdfa8ad60643ec249f7cdbd6a9b0163c07cbd3f2b79e07d2c267ac81a70" dependencies = [ "cfg-if", "concurrent-queue", + "fastrand", "futures-lite", "libc", + "log", "once_cell", "parking", + "polling", "socket2", "vec-arena", + "waker-fn", "wepoll-sys-stjepang", "winapi", ] +[[package]] +name = "async-lock" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b123db9bf64e4c4840d5b1985fdb4f69fbe50a4fc95e895d11ff49931ce9802" +dependencies = [ + "async-barrier", + "async-mutex", + "async-rwlock", + "async-semaphore", +] + +[[package]] +name = "async-mutex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66941c2577c4fa351e4ce5fdde8f86c69b88d623f3b955be1bc7362a23434632" +dependencies = [ + "event-listener", +] + [[package]] name = "async-net" -version = "0.1.2" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9c1d358c27ba114eab4330c50d21879ad0e6af192f01dba6fec1ab3b1e03d90" +dependencies = [ + "async-io", + "blocking", + "futures-lite", +] + +[[package]] +name = "async-process" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "556790e2ea8d562a416bed6d04c4e92f949a1d5c4c724544c30d25f063b84b03" +checksum = "0bb915df28b8309139bd9c9c700d84c20e5c21385d05378caa84912332d0f6a1" dependencies = [ "async-io", "blocking", + "cfg-if", + "event-listener", "futures-lite", + "once_cell", + "signal-hook", + "winapi", +] + +[[package]] +name = "async-rwlock" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f8978b5ae008b5177da07a1bf1bfbe428f9bdb970c3fca0e92ed1c1930d7f34" +dependencies = [ + "async-mutex", + "event-listener", +] + +[[package]] +name = "async-semaphore" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66d2be5973230861689460806b8db059bbd8bcb507cabaa71646ae89f5b2f2ee" +dependencies = [ + "event-listener", ] [[package]] @@ -151,12 +236,13 @@ dependencies = [ [[package]] name = "blocking" -version = "0.5.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76e94bf99b692f54c9d05f97454d3faf11134523fe5b180564a3fb6ed63bcc0a" +checksum = "2640778f8053e72c11f621b0a5175a0560a269282aa98ed85107773ab8e2a556" dependencies = [ "async-channel", "atomic-waker", + "fastrand", "futures-lite", "once_cell", "waker-fn", @@ -216,12 +302,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "easy-parallel" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dd4afd79212583ff429b913ad6605242ed7eec277e950b1438f300748f948f4" - [[package]] name = "env_logger" version = "0.7.1" @@ -237,15 +317,15 @@ dependencies = [ [[package]] name = "event-listener" -version = "2.3.2" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68082183f458867ce7cddea16d4df4443c1537112c0c09c450dedc09daf5c719" +checksum = "e1cd41440ae7e4734bbd42302f63eaba892afc93a3912dad84006247f0dedb0e" [[package]] name = "fastrand" -version = "1.3.3" +version = "1.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36a9cb09840f81cd211e435d00a4e487edd263dc3c8ff815c32dd76ad668ebed" +checksum = "5c85295147490b8fcf2ea3d104080a105a8b2c63f9c319e82c02d8e952388919" [[package]] name = "fnv" @@ -303,9 +383,9 @@ checksum = "de27142b013a8e869c14957e6d2edeef89e97c289e69d042ee3a49acd8b51789" [[package]] name = "futures-lite" -version = "0.1.10" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbe71459749b2e8e66fb95df721b22fa08661ad384a0c5b519e11d3893b4692a" +checksum = "ba659a67bd5ac00896b31e1f4095174134a31e448893d73256f1d51b81abbd62" dependencies = [ "fastrand", "futures-core", @@ -480,9 +560,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.74" +version = "0.2.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2f02823cf78b754822df5f7f268fb59822e7296276d3e069d8e8cb26a14bd10" +checksum = "755456fae044e6fa1ebbbd1b3e902ae19e73097ed4ed87bb79934a867c007bc3" [[package]] name = "log" @@ -540,17 +620,6 @@ version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" -[[package]] -name = "multitask" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c09c35271e7dcdb5f709779111f2c8e8ab8e06c1b587c1c6a9e179d865aaa5b4" -dependencies = [ - "async-task", - "concurrent-queue", - "fastrand", -] - [[package]] name = "nom" version = "5.1.2" @@ -561,21 +630,11 @@ dependencies = [ "version_check", ] -[[package]] -name = "num_cpus" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" -dependencies = [ - "hermit-abi", - "libc", -] - [[package]] name = "once_cell" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b631f7e854af39a1739f401cf34a8a013dfe09eac4fa4dba91e9768bd28168d" +checksum = "260e51e7efe62b592207e9e13a68e43692a7a279171d6ba57abd208bf23645ad" [[package]] name = "opaque-debug" @@ -585,9 +644,9 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "parking" -version = "1.0.6" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cb300f271742d4a2a66c01b6b2fa0c83dfebd2e0bf11addb879a3547b4ed87c" +checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" [[package]] name = "percent-encoding" @@ -627,6 +686,19 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "polling" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0835fa5f9af34c170eb38638ae6bc88e1b11ecdd0b968c9d9de8e343450385eb" +dependencies = [ + "cfg-if", + "libc", + "log", + "wepoll-sys-stjepang", + "winapi", +] + [[package]] name = "ppv-lite86" version = "0.2.8" @@ -740,12 +812,6 @@ version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" -[[package]] -name = "scoped-tls" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" - [[package]] name = "serde" version = "1.0.115" @@ -801,6 +867,26 @@ dependencies = [ "opaque-debug", ] +[[package]] +name = "signal-hook" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "604508c1418b99dfe1925ca9224829bb2a8a9a04dda655cc01fcad46f4ab05ed" +dependencies = [ + "libc", + "signal-hook-registry", +] + +[[package]] +name = "signal-hook-registry" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e12110bc539e657a646068aaf5eb5b63af9d0c1f7b29c97113fad80e15f035" +dependencies = [ + "arc-swap", + "libc", +] + [[package]] name = "slab" version = "0.4.2" @@ -809,18 +895,20 @@ checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" [[package]] name = "smol" -version = "0.3.3" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67583f4ccc13bbb105a0752058d8ad66c47753d85445952809bcaca891954f83" +checksum = "1ee895b9f862d88d6bad9d82f6ce727710d177338e697057a691ea684800d4a6" dependencies = [ "async-channel", "async-executor", + "async-fs", "async-io", + "async-lock", + "async-net", + "async-process", "blocking", - "cfg-if", - "easy-parallel", "futures-lite", - "num_cpus", + "once_cell", ] [[package]] @@ -945,9 +1033,9 @@ checksum = "05e42f7c18b8f902290b009cde6d651262f956c98bc51bca4cd1d511c9cd85c7" [[package]] name = "vec-arena" -version = "0.5.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17dfb54bf57c9043f4616cb03dab30eff012cc26631b797d8354b916708db919" +checksum = "eafc1b9b2dfc6f5529177b62cf806484db55b32dc7c9658a118e11bbeb33061d" [[package]] name = "version_check" diff --git a/Cargo.toml b/Cargo.toml index e56dff1..35dd942 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ categories = ["command-line-utilities"] [dependencies] argh = "0.1" -async-net = "0.1" +async-net = "1.2" async-tungstenite = "0.8" bytes = "0.5" futures-io = "0.3" @@ -25,7 +25,7 @@ lsp-types = "0.79" nom = { version = "5.1", default-features = false, features = ["std"] } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" -smol = "0.3" +smol = "1.0" env_logger = "0.7" [dev-dependencies] diff --git a/src/main.rs b/src/main.rs index 62a4950..590839f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -47,7 +47,7 @@ fn main() -> Result<(), Box> { Duration::from_secs(NO_TIMEOUT) }; - smol::run(async { + smol::block_on(async { let addr = format!("127.0.0.1:{}", opts.port); let listener = TcpListener::bind(&addr).await.expect("Failed to bind"); log::info!("Listening on: {}", addr); From d2a8435c3b6a2f2d6e345ab07f605b90afa6b1d2 Mon Sep 17 00:00:00 2001 From: kazk Date: Wed, 9 Sep 2020 21:20:25 -0700 Subject: [PATCH 2/4] Update lsp-types to 0.80 --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3d9aa6d..7f571c6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -575,9 +575,9 @@ dependencies = [ [[package]] name = "lsp-types" -version = "0.79.0" +version = "0.80.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f1f86677fdbe8df5f88b99131b1424e50aad27bbe3e5900d221bc414bd72e9b" +checksum = "f4265e2715bdacbb4dad029fce525e420cd66dc0af24ff9cb996a8ab48ac92ef" dependencies = [ "base64", "bitflags", diff --git a/Cargo.toml b/Cargo.toml index 35dd942..30dbff6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,7 @@ futures-timer = "3.0" futures-util = "0.3" futures_codec = "0.4" log = "0.4" -lsp-types = "0.79" +lsp-types = "0.80" nom = { version = "5.1", default-features = false, features = ["std"] } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" From 6c720cd666d958dfa9e67eed46ddf9eeea45a82e Mon Sep 17 00:00:00 2001 From: kazk Date: Wed, 9 Sep 2020 21:23:33 -0700 Subject: [PATCH 3/4] Update transitive dependencies --- Cargo.lock | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7f571c6..1beb4f0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -268,9 +268,9 @@ checksum = "631ae5198c9be5e753e5cc215e1bd73c2b466a3565173db433f52bb9d3e66dba" [[package]] name = "cc" -version = "1.0.58" +version = "1.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a06fb2e53271d7c279ec1efea6ab691c35a2ae67ec0d91d7acec0caf13b518" +checksum = "66120af515773fb005778dc07c261bd201ec8ce50bd6e7144c927753fe013381" [[package]] name = "cfg-if" @@ -701,9 +701,9 @@ dependencies = [ [[package]] name = "ppv-lite86" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "237a5ed80e274dbc66f86bd59c1e25edc039660be53194b5fe0a482e0f2612ea" +checksum = "c36fa947111f5c62a733b652544dd0016a43ce89619538a8ef92724a6f501a20" [[package]] name = "proc-macro-hack" @@ -719,9 +719,9 @@ checksum = "eba180dafb9038b050a4c280019bbedf9f2467b61e5d892dcad585bb57aadc5a" [[package]] name = "proc-macro2" -version = "1.0.19" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04f5f085b5d71e2188cb8271e5da0161ad52c3f227a661a3c135fdf28e258b12" +checksum = "36e28516df94f3dd551a587da5357459d9b36d945a7c37c3557928c1c2ff2a2c" dependencies = [ "unicode-xid", ] @@ -913,9 +913,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.3.12" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03088793f677dce356f3ccc2edb1b314ad191ab702a5de3faf49304f7e104918" +checksum = "b1fa70dc5c8104ec096f4fe7ede7a221d35ae13dcd19ba1ad9a81d2cab9a1c44" dependencies = [ "cfg-if", "libc", @@ -925,9 +925,9 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.38" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e69abc24912995b3038597a7a593be5053eb0fb44f3cc5beec0deb421790c1f4" +checksum = "963f7d3cc59b59b9325165add223142bbf1df27655d07789f109896d353d8350" dependencies = [ "proc-macro2", "quote", @@ -954,9 +954,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53953d2d3a5ad81d9f844a32f14ebb121f50b650cd59d0ee2a07cf13c617efed" +checksum = "238ce071d267c5710f9d31451efec16c5ee22de34df17cc05e56cbc92e967117" [[package]] name = "tungstenite" @@ -1045,9 +1045,9 @@ checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" [[package]] name = "waker-fn" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9571542c2ce85ce642e6b58b3364da2fb53526360dfb7c211add4f5c23105ff7" +checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" [[package]] name = "wasi" From e16be4b82efa8567df7ffcdb1fb79c47decd4bfa Mon Sep 17 00:00:00 2001 From: kazk Date: Wed, 9 Sep 2020 21:24:07 -0700 Subject: [PATCH 4/4] v0.1.1 - Update dependencies --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1beb4f0..b150952 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -589,7 +589,7 @@ dependencies = [ [[package]] name = "lsp-ws-proxy" -version = "0.1.0" +version = "0.1.1" dependencies = [ "argh", "async-net", diff --git a/Cargo.toml b/Cargo.toml index 30dbff6..f13c5cd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lsp-ws-proxy" -version = "0.1.0" +version = "0.1.1" authors = ["kazk "] edition = "2018" license = "MIT"