sapling/eden/mononoke/sshrelay/Cargo.toml

37 lines
2.0 KiB
TOML
Raw Normal View History

[package]
name = "sshrelay"
version = "0.1.0"
authors = ["Facebook"]
edition = "2018"
license = "GPLv2+"
[dependencies]
anyhow = "1.0"
mononoke: update to tokio 1.x Summary: NOTE: there is one final pre-requisite here, which is that we should default all Mononoke binaries to `--use-mysql-client` because the other SQL client implementations will break once this lands. That said, this is probably the right time to start reviewing. There's a lot going on here, but Tokio updates being what they are, it has to happen as just one diff (though I did try to minimize churn by modernizing a bunch of stuff in earlier diffs). Here's a detailed list of what is going on: - I had to add a number `cargo_toml_dir` for binaries in `eden/mononoke/TARGETS`, because we have to use 2 versions of Bytes concurrently at this time, and the two cannot co-exist in the same Cargo workspace. - Lots of little Tokio changes: - Stream abstractions moving to `tokio-stream` - `tokio::time::delay_for` became `tokio::time::sleep` - `tokio::sync::watch::Sender::send` became `tokio::sync::watch::Sender::broadcast` - `tokio::sync::Semaphore::acquire` returns a `Result` now. - `tokio::runtime::Runtime::block_on` no longer takes a `&mut self` (just a `&self`). - `Notify` grew a few more methods with different semantics. We only use this in tests, I used what seemed logical given the use case. - Runtime builders have changed quite a bit: - My `no_coop` patch is gone in Tokio 1.x, but it has a new `tokio::task::unconstrained` wrapper (also from me), which I included on `MononokeApi::new`. - Tokio now detects your logical CPUs, not physical CPUs, so we no longer need to use `num_cpus::get()` to figure it out. - Tokio 1.x now uses Bytes 1.x: - At the edges (i.e. streams returned to Hyper or emitted by RepoClient), we need to return Bytes 1.x. However, internally we still use Bytes 0.5 in some places (notably: Filestore). - In LFS, this means we make a copy. We used to do that a while ago anyway (in the other direction) and it was never a meaningful CPU cost, so I think this is fine. - In Mononoke Server it doesn't really matter because that still generates ... Bytes 0.1 anyway so there was a copy before from 0.1 to 0.5 and it's from 0.1 to 1.x. - In the very few places where we read stuff using Tokio from the outside world (historical import tools for LFS), we copy. - tokio-tls changed a lot, they removed all the convenience methods around connecting. This resulted in updates to: - How we listen in Mononoke Server & LFS - How we connect in hgcli. - Note: all this stuff has test coverage. - The child process API changed a little bit. We used to have a ChildWrapper around the hg sync job to make a Tokio 0.2.x child look more like a Tokio 1.x Child, so now we can just remove this. - Hyper changed their Websocket upgrade mechanism (you now need the whole `Request` to upgrade, whereas before that you needed just the `Body`, so I changed up our code a little bit in Mononoke's HTTP acceptor to defer splitting up the `Request` into parts until after we know whether we plan to upgrade it. - I removed the MySQL tests that didn't use mysql client, because we're leaving that behind and don't intend to support it on Tokio 1.x. Reviewed By: mitrandir77 Differential Revision: D26669620 fbshipit-source-id: acb6aff92e7f70a7a43f32cf758f252f330e60c9
2021-04-28 17:35:21 +03:00
bytes = { version = "1.0", features = ["serde"] }
bytes-old = { package = "bytes", version = "0.4", features = ["serde"] }
futures = "0.1.31"
futures_ext = { package = "futures_01_ext", version = "0.1.0", git = "https://github.com/facebookexperimental/rust-shed.git", branch = "master" }
maplit = "1.0"
netstring = { version = "0.1.0", git = "https://github.com/facebookexperimental/rust-shed.git", branch = "master" }
permission_checker = { version = "0.1.0", path = "../permission_checker" }
serde = { version = "1.0.126", features = ["derive", "rc"] }
serde_json = { version = "1.0", features = ["float_roundtrip"] }
session_id = { version = "0.1.0", path = "../server/session_id" }
tokio = { version = "1.7.1", features = ["full", "test-util"] }
mononoke: update to tokio 1.x Summary: NOTE: there is one final pre-requisite here, which is that we should default all Mononoke binaries to `--use-mysql-client` because the other SQL client implementations will break once this lands. That said, this is probably the right time to start reviewing. There's a lot going on here, but Tokio updates being what they are, it has to happen as just one diff (though I did try to minimize churn by modernizing a bunch of stuff in earlier diffs). Here's a detailed list of what is going on: - I had to add a number `cargo_toml_dir` for binaries in `eden/mononoke/TARGETS`, because we have to use 2 versions of Bytes concurrently at this time, and the two cannot co-exist in the same Cargo workspace. - Lots of little Tokio changes: - Stream abstractions moving to `tokio-stream` - `tokio::time::delay_for` became `tokio::time::sleep` - `tokio::sync::watch::Sender::send` became `tokio::sync::watch::Sender::broadcast` - `tokio::sync::Semaphore::acquire` returns a `Result` now. - `tokio::runtime::Runtime::block_on` no longer takes a `&mut self` (just a `&self`). - `Notify` grew a few more methods with different semantics. We only use this in tests, I used what seemed logical given the use case. - Runtime builders have changed quite a bit: - My `no_coop` patch is gone in Tokio 1.x, but it has a new `tokio::task::unconstrained` wrapper (also from me), which I included on `MononokeApi::new`. - Tokio now detects your logical CPUs, not physical CPUs, so we no longer need to use `num_cpus::get()` to figure it out. - Tokio 1.x now uses Bytes 1.x: - At the edges (i.e. streams returned to Hyper or emitted by RepoClient), we need to return Bytes 1.x. However, internally we still use Bytes 0.5 in some places (notably: Filestore). - In LFS, this means we make a copy. We used to do that a while ago anyway (in the other direction) and it was never a meaningful CPU cost, so I think this is fine. - In Mononoke Server it doesn't really matter because that still generates ... Bytes 0.1 anyway so there was a copy before from 0.1 to 0.5 and it's from 0.1 to 1.x. - In the very few places where we read stuff using Tokio from the outside world (historical import tools for LFS), we copy. - tokio-tls changed a lot, they removed all the convenience methods around connecting. This resulted in updates to: - How we listen in Mononoke Server & LFS - How we connect in hgcli. - Note: all this stuff has test coverage. - The child process API changed a little bit. We used to have a ChildWrapper around the hg sync job to make a Tokio 0.2.x child look more like a Tokio 1.x Child, so now we can just remove this. - Hyper changed their Websocket upgrade mechanism (you now need the whole `Request` to upgrade, whereas before that you needed just the `Body`, so I changed up our code a little bit in Mononoke's HTTP acceptor to defer splitting up the `Request` into parts until after we know whether we plan to upgrade it. - I removed the MySQL tests that didn't use mysql client, because we're leaving that behind and don't intend to support it on Tokio 1.x. Reviewed By: mitrandir77 Differential Revision: D26669620 fbshipit-source-id: acb6aff92e7f70a7a43f32cf758f252f330e60c9
2021-04-28 17:35:21 +03:00
tokio-util = { version = "0.6", features = ["full"] }
trust-dns-resolver = "0.20"
zstd = "=0.8.0+zstd.1.4.9"
zstd-safe = "=3.1.0+zstd.1.4.9"
[patch.crates-io]
chashmap = { git = "https://gitlab.redox-os.org/ahornby/chashmap", rev = "901ace2ca3cdbc2095adb1af111d211e254e2aae" }
lru-disk-cache = { git = "https://github.com/mozilla/sccache", rev = "033ebaae69beeb0ac04e8c35d6ff1103487bd9a3" }
mysql_common = { git = "https://github.com/iammxt/rust_mysql_common", rev = "0e4c86952f1e799960e736c0b2bb9d2a6d935bf1" }
object = { git = "https://github.com/andrewjcg/object", rev = "ddbae7208292a13a016e8952c256f69737c763ab" }
prost = { git = "https://github.com/gabrielrussoc/prost", branch = "protoc-runtime" }
prost-derive = { git = "https://github.com/gabrielrussoc/prost", branch = "protoc-runtime" }
prost-types = { git = "https://github.com/gabrielrussoc/prost", branch = "protoc-runtime" }
rustfilt = { git = "https://github.com/jsgf/rustfilt.git", rev = "8141fa7f1caee562ee8daffb2ddeca3d1f0d36e5" }
tokio-core = { git = "https://github.com/bolinfest/tokio-core", rev = "5f37aa3c627d56ee49154bc851d6930f5ab4398f" }
toml = { git = "https://github.com/jsgf/toml-rs", branch = "dotted-table-0.5.7" }