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

Expected enum rusoto_signature::region::Region, found enum Region #154

Open
jeremymcjunkin opened this issue Feb 2, 2021 · 3 comments
Open

Comments

@jeremymcjunkin
Copy link

Cargo.toml

[dependencies]
rusoto_core = "0.46"
dynomite = "0.10.0"

src/main.rs

use rusoto_core::Region;
use dynomite::{
  dynamodb::{
      DynamoDbClient
  },
};

fn main() {
  let client = DynamoDbClient::new(Region::default());
}
error[E0308]: mismatched types
 --> src/main.rs:9:36
  |
9 |   let client = DynamoDbClient::new(Region::default());
  |                                    ^^^^^^^^^^^^^^^^^ expected enum `rusoto_signature::region::Region`, found enum `Region`
  |
  = note: perhaps two different versions of crate `rusoto_signature` are being used?

error: aborting due to previous error

For more information about this error, try `rustc --explain E0308`.

🐛 Bug description

There seems to be a dependency version issue with dynomite and rusoto_core. Using code from the examples, pared down, does not compile because of mismatched types.

🤔 Expected Behavior

I expected this code to compile.

👟 Steps to reproduce

Create the Cargo.toml and main.rs that I have provided and run cargo check

🌍 Your environment

Ubuntu 20.04

dynomite version: 0.10

rustc version:
rustc 1.49.0 (e1884a8e3 2020-12-29)
cargo 1.49.0 (d00d64df9 2020-12-05)

@terrence2
Copy link

@jeremymcjunkin I just ran into this and tracked down the cause with cargo tree. Dynomite's master branch is pretty far ahead of 0.10, so you're going to want to crib from the examples under the 0.10 tag, not master. In particular, 0.10 is still using the 0.45 release of Rusoto, although there are some other changes as well.

@ci-brightai
Copy link

Thanks @terrence2 ,

I was able to get it to compile with
Cargo.toml

[dependencies]
dynomite = { version = "0.10.0", default_features = true }
rusoto_core_default = { package = "rusoto_core", version = "0.45", optional = true }

[features]
default = ["rusoto_core_default"]

src/main.rs

use rusoto_core_default::Region;

use dynomite::{
  dynamodb::{
      DynamoDbClient
  },
};

fn main() {
  let _client = DynamoDbClient::new(Region::default());
}

It's unclear to me why I needed to add

rusoto_core_default = { package = "rusoto_core", version = "0.45", optional = true }

[features]
default = ["rusoto_core_default"]

To pull in rusoto_core_default. Shouldn't

dynomite = { version = "0.10.0", default_features = true }

Pull rusoto_core_default because it's listed in the default features for dynomite?
https://github.com/softprops/dynomite/blob/v0.10.0/dynomite/Cargo.toml#L43

[features]
default = ["uuid", "chrono", "derive", "rusoto_core_default", "rusoto_dynamodb_default"]
rustls = ["uuid", "chrono", "derive", "rusoto_core_rustls", "rusoto_dynamodb_rustls"]
derive = ["dynomite-derive"]

@tdomhan
Copy link

tdomhan commented Feb 26, 2022

I had the same issue and switched to the master branch in Cargo.toml:
dynomite = { git = "https://github.com/softprops/dynomite.git" }

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

No branches or pull requests

4 participants