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

[Rust][Server] Upgrade hyper from 0.13 to 0.14, swagger-rs and tokio #11041

Closed

Conversation

Foorack
Copy link
Contributor

@Foorack Foorack commented Dec 5, 2021

This upgrades rust-server's following dependencies:

  • hyper from 0.13 to 0.14
  • swagger-rs from 5.0.2 to 6.1.0
  • tokio from 0.2 to 1.14

These upgrades are done in combination because they are cross-dependent upon each other, for example hyper depends on tokio 1.0 or higher.

Rust samples has bee regenerated.

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    ./mvnw clean package 
    ./bin/generate-samples.sh
    ./bin/utils/export_docs_generators.sh
    
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    For Windows users, please run the script in Git BASH.
  • File the PR against the correct branch: master (5.3.0), 6.0.x
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

@Foorack
Copy link
Contributor Author

Foorack commented Dec 5, 2021

Sorry, tagged the wrong people for the technical committee.

TC for Rust:
@frol @farcaller @richardwhiuk @paladinzh

@Foorack Foorack changed the title [Rust][Server] Upgrade hyper from 0.13 to 0.14, swagger-rs to 6.1.0 [Rust][Server] Upgrade hyper from 0.13 to 0.14, swagger-rs and tokio Dec 5, 2021
@wing328
Copy link
Member

wing328 commented Dec 17, 2021

The rust-server (petstore) tests failed:

error[E0277]: the trait bound `tokio::net::tcp::stream::TcpStream: tokio::io::async_write::AsyncWrite` is not satisfied
   --> output/no-example-v3/src/client/mod.rs:242:46
    |
242 |     pub fn try_new_https(base_path: &str) -> Result<Self, ClientInitError>
    |                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `tokio::io::async_write::AsyncWrite` is not implemented for `tokio::net::tcp::stream::TcpStream`
    |
help: trait impl with same name found
   --> /home/travis/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.14.0/src/io/async_write.rs:221:1
    |
221 | / impl<T: ?Sized + AsyncWrite + Unpin> AsyncWrite for &mut T {
222 | |     deref_async_write!();
223 | | }
    | |_^
    = note: perhaps two different versions of crate `tokio` are being used?
    = note: required because of the requirements on the impl of `hyper::service::Service<Uri>` for `hyper_openssl::HttpsConnector<HttpConnector>`
    = note: required because of the requirements on the impl of `hyper::client::connect::Connect` for `hyper_openssl::HttpsConnector<HttpConnector>`
    = note: 1 redundant requirement hidden
    = note: required because of the requirements on the impl of `hyper::service::Service<Request<Body>>` for `hyper::Client<hyper_openssl::HttpsConnector<HttpConnector>>`

error[E0277]: the trait bound `tokio::net::tcp::stream::TcpStream: hyper::client::connect::Connection` is not satisfied
   --> output/no-example-v3/src/client/mod.rs:242:46
    |
242 |     pub fn try_new_https(base_path: &str) -> Result<Self, ClientInitError>
    |                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `hyper::client::connect::Connection` is not implemented for `tokio::net::tcp::stream::TcpStream`
    |
help: trait impl with same name found
   --> /home/travis/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.16/src/client/connect/http.rs:360:1
    |
360 | / impl Connection for TcpStream {
361 | |     fn connected(&self) -> Connected {
362 | |         let connected = Connected::new();
363 | |         if let Ok(remote_addr) = self.peer_addr() {
...   |
368 | |     }
369 | | }
    | |_^
    = note: perhaps two different versions of crate `hyper` are being used?
    = note: required because of the requirements on the impl of `hyper::service::Service<Uri>` for `hyper_openssl::HttpsConnector<H

Ref: https://app.travis-ci.com/github/OpenAPITools/openapi-generator/builds/243628797

Can you please take a look when you've time?

To run the test locally, please execute mvn integration-test -f samples/server/petstore/rust-server/pom.xml

You will need to run the petstore server locally: https://github.com/OpenAPITools/openapi-generator/wiki/Integration-Tests#how-to-add-integration-tests-for-new-petstore-samples

@wing328 wing328 modified the milestones: 5.3.1, 5.4.0 Dec 29, 2021
@wing328 wing328 modified the milestones: 5.4.0, 6.0.0 Jan 31, 2022
@wing328
Copy link
Member

wing328 commented Feb 15, 2022

@Foorack am I doing anything wrong with my test? Are you able to repeat the issue locally?

We plan to release v6.0.0 (next major version) next month so it would be nice to include this change. Let me know if you need any help.

@wing328
Copy link
Member

wing328 commented Feb 15, 2022

Also when you've time, can you please PM me via Slack? https://join.slack.com/t/openapi-generator/shared_invite/zt-12jxxd7p2-XUeQM~4pzsU9x~eGLQqX2g

@Foorack
Copy link
Contributor Author

Foorack commented Feb 16, 2022

@Foorack am I doing anything wrong with my test? Are you able to repeat the issue locally?

We plan to release v6.0.0 (next major version) next month so it would be nice to include this change. Let me know if you need any help.

I will have time to look at this issue this weekend. Currently very busy with work on weekdays.

Also when you've time, can you please PM me via Slack? https://join.slack.com/t/openapi-generator/shared_invite/zt-12jxxd7p2-XUeQM~4pzsU9x~eGLQqX2g

No. I think I am already in there, but the fact that I don't know tells how much I use it. I don't have time to follow and sort the noise coming from a chat platform like Slack.

I am already in too many other platforms, and they steal enough of time. 🙂 I would very much prefer keeping the discussion here on GitHub. If I have done something wrong then I am very appreciative of feedback and criticism. If it is something which still cannot be published publicly then I am accessible via email.

@sransara
Copy link
Contributor

Hi @Foorack, I think there are couple more cross dependent packages that need version bumps (maybe the cause of of the issue @wing328 mentioned):

  • hyper-openssl package also needs a version bump to at-least 0.9.
  • hyper-tls to 0.5
  • tokio-tls (deprecated) to tokio-native-tls

@wing328
Copy link
Member

wing328 commented Mar 16, 2022

Closed via #11873

@wing328 wing328 closed this Mar 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants