Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Failed to build when using rustls instead of OpenSSL in rusoto_core #50

Closed
Observer42 opened this issue Apr 16, 2019 · 3 comments · Fixed by #55
Closed

Failed to build when using rustls instead of OpenSSL in rusoto_core #50

Observer42 opened this issue Apr 16, 2019 · 3 comments · Fixed by #55

Comments

@Observer42
Copy link

Observer42 commented Apr 16, 2019

🐛 Bug description

Failed to build when using rustls instead of OpenSSL in rusoto_core
the error message is:

   Compiling rusoto_core v0.37.0
error[E0259]: the name `tls` is defined multiple times
  --> /home/yishengxu/.cargo/registry/src/github.heygears.com-1ecc6299db9ec823/rusoto_core-0.37.0/src/lib.rs:28:1
   |
26 | extern crate hyper_rustls as tls;
   | --------------------------------- previous import of the extern crate `tls` here
27 | #[cfg(feature = "native-tls")]
28 | extern crate hyper_tls as tls;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `tls` reimported here
   |
   = note: `tls` must be defined only once in the type namespace of this module
help: you can use `as` to change the binding name of the import
   |
28 | extern crate hyper_tls as other_tls;
   |

error[E0308]: mismatched types
   --> /home/yishengxu/.cargo/registry/src/github.heygears.com-1ecc6299db9ec823/rusoto_core-0.37.0/src/request.rs:328:13
    |
327 |         let connector = match HttpsConnector::new(4) {
    |                               ---------------------- this match expression has type `tls::HttpsConnector<hyper::client::HttpConnector>`
328 |             Ok(connector) => connector,
    |             ^^^^^^^^^^^^^ expected struct `tls::HttpsConnector`, found enum `std::result::Result`
    |
    = note: expected type `tls::HttpsConnector<hyper::client::HttpConnector>`
               found type `std::result::Result<_, _>`

error[E0308]: mismatched types
   --> /home/yishengxu/.cargo/registry/src/github.heygears.com-1ecc6299db9ec823/rusoto_core-0.37.0/src/request.rs:329:13
    |
327 |         let connector = match HttpsConnector::new(4) {
    |                               ---------------------- this match expression has type `tls::HttpsConnector<hyper::client::HttpConnector>`
328 |             Ok(connector) => connector,
329 |             Err(tls_error) => {
    |             ^^^^^^^^^^^^^^ expected struct `tls::HttpsConnector`, found enum `std::result::Result`
    |
    = note: expected type `tls::HttpsConnector<hyper::client::HttpConnector>`
               found type `std::result::Result<_, _>`

error[E0308]: mismatched types
   --> /home/yishengxu/.cargo/registry/src/github.heygears.com-1ecc6299db9ec823/rusoto_core-0.37.0/src/request.rs:346:13
    |
345 |         let connector = match HttpsConnector::new(4) {
    |                               ---------------------- this match expression has type `tls::HttpsConnector<hyper::client::HttpConnector>`
346 |             Ok(connector) => connector,
    |             ^^^^^^^^^^^^^ expected struct `tls::HttpsConnector`, found enum `std::result::Result`
    |
    = note: expected type `tls::HttpsConnector<hyper::client::HttpConnector>`
               found type `std::result::Result<_, _>`

error[E0308]: mismatched types
   --> /home/yishengxu/.cargo/registry/src/github.heygears.com-1ecc6299db9ec823/rusoto_core-0.37.0/src/request.rs:347:13
    |
345 |         let connector = match HttpsConnector::new(4) {
    |                               ---------------------- this match expression has type `tls::HttpsConnector<hyper::client::HttpConnector>`
346 |             Ok(connector) => connector,
347 |             Err(tls_error) => {
    |             ^^^^^^^^^^^^^^ expected struct `tls::HttpsConnector`, found enum `std::result::Result`
    |
    = note: expected type `tls::HttpsConnector<hyper::client::HttpConnector>`
               found type `std::result::Result<_, _>`

error: aborting due to 5 previous errors

Some errors occurred: E0259, E0308.
For more information about an error, try `rustc --explain E0259`.
error: Could not compile `rusoto_core`.

🤔 Expected Behavior

build without problem

👟 Steps to reproduce

  1. create a new cargo project
  2. add following dependencies to the project:
rusoto_core = {version = "0.37.0", default_features = false, features = ["rustls"]}
dynomite = "0.3"
  1. run cargo build

if I change dependencies to

rusoto_core = "0.37.0"
dynomite = "0.3"

or remove dynomite dependency
the build will not fail

🌍 Your environment

x86_64
ubuntu 18.04

dynomite version:
0.3.0

rustc version:
stable 1.34

@jeprojects
Copy link
Contributor

Same issue here.

@jeprojects
Copy link
Contributor

@softprops Any chance you could add a feature to dynomite to switch rusoto to use the rustls dependancy instead of the default openssl?

@softprops
Copy link
Owner

I think that may have the same effect for those using rusoto defaults.

Wouldn't they they run into the same issue if dynamite defaulted to rusttls and rusoto core defaulted to openssl?

It seems like the kind of thing where you'd want to opt in at the application level and have a way to use a non default consistently.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants