Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade tower_http 0.4 => 0.6.2 + features trace + fs
Summary: This upgrade is necessary to work with the newer version of axum used in my gateway service. ## Why can't you just upgrade `tower_http` globally? **I believe the primary blocker is upgrading rust 3p's `http` to 1: https://fb.workplace.com/groups/rust.language/permalink/26264445149844085/** `tower_http 0.62` is incompatible with `tonic_web 0.9.2`, which is used by the `enkaku` tool. Enkaku has these dependencies: tonic <- tonic_web (implements tower::Service using OLD `http` crate) <- `tower_http::CorsLayer` (implements tower::Service using NEW http crate) I tried in vain to come up with some kind of an adapter. I was able to convince a bunch of the code in `fbcode/enkaku/http/src/cors.rs` to compile, but I'm unable to do anything with the trait errors in `grpc.rs`. This is what my error looks like: ``` error[E0277]: the trait bound `tower_http::cors::Cors<GrpcWebService<Routes>>: tonic::codegen::Service<http::Request<tonic::transport::Body>>` is not satisfied --> fbcode/enkaku/http/src/grpc.rs:37:18 | 37 | .serve_with_incoming(TcpListenerStream::new(listener)), | ^^^^^^^^^^^^^^^^^^^ the trait `tonic::codegen::Service<http::Request<tonic::transport::Body>>` is not implemented for `tower_http::cors::Cors<GrpcWebService<Routes>>` | = help: the trait `tonic::codegen::Service<http::request::Request<ReqBody>>` is implemented for `tower_http::cors::Cors<S>` error[E0277]: the trait bound `tower_http::cors::Cors<GrpcWebService<Routes>>: tonic::codegen::Service<http::Request<tonic::transport::Body>>` is not satisfied --> fbcode/enkaku/http/src/grpc.rs:29:9 | 29 | tokio::spawn( | ^^^^^^^^^^^^ the trait `tonic::codegen::Service<http::Request<tonic::transport::Body>>` is not implemented for `tower_http::cors::Cors<GrpcWebService<Routes>>` | = help: the trait `tonic::codegen::Service<http::request::Request<ReqBody>>` is implemented for `tower_http::cors::Cors<S>` note: required by a bound in `Router::<L>::serve_with_incoming` --> third-party/rust/vendor/tonic-0.9.2/src/transport/server/mod.rs:629:5 ``` Reviewed By: dtolnay Differential Revision: D66669629 fbshipit-source-id: c8c3e97d58599b1b8c2e93d3bd406617ccbe0a62
- Loading branch information