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

The dependency bug #352

Closed
fewensa opened this issue May 31, 2021 · 4 comments
Closed

The dependency bug #352

fewensa opened this issue May 31, 2021 · 4 comments

Comments

@fewensa
Copy link

fewensa commented May 31, 2021

jsonrpsee-types = { path = "../types", version = "0.2.0-alpha.7" }

There need change to

jsonrpsee-types = { path = "../types", version = "=0.2.0-alpha.7" }

Documents:

https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#caret-requirements

For example:

Now, the parity-bridges-common use 0.2.0-alpha.6

https://github.com/paritytech/parity-bridges-common/blob/643f10db48314e2b366f323e176b8b42024a4a2e/relays/client-substrate/Cargo.toml#L12-L13

If I create a new project dependency to parity-bridge-common/relays/client-substrate, According to cargo's rules, will have such a dependency

decode-test v0.1.0 (/dev/decode-test)
└── relay-substrate-client v0.1.0 (https://github.com/paritytech/parity-bridges-common?rev=66e1508127ff5104d3d18f9bbf9ea9997055d1d5#66e15081)
    ├── jsonrpsee-ws-client v0.2.0-alpha.6
    │   ├── jsonrpsee-types v0.2.0-alpha.7

Next, such an error will occur

error[E0432]: unresolved import `jsonrpsee_types::v2::parse_request_id`
 --> d:/opt/scoop/persist/rustup/.cargo\registry\src\github.com-1ecc6299db9ec823\jsonrpsee-ws-client-0.2.0-alpha.6\src\helpers.rs:5:5
  |
5 | use jsonrpsee_types::v2::parse_request_id;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `parse_request_id` in `v2`

error[E0432]: unresolved import `jsonrpsee_types::v2::error::JsonRpcErrorAlloc`
 --> d:/opt/scoop/persist/rustup/.cargo\registry\src\github.com-1ecc6299db9ec823\jsonrpsee-ws-client-0.2.0-alpha.6\src\helpers.rs:8:23
  |
8 | use jsonrpsee_types::{v2::error::JsonRpcErrorAlloc, Error, RequestMessage};
  |                       ^^^^^^^^^^^-----------------
  |                       |          |
  |                       |          help: a similar name exists in the module: `JsonRpcError`
  |                       no `JsonRpcErrorAlloc` in `v2::error`
@niklasad1
Copy link
Member

yeah, you are correct meanwhile just do cargo update -p jsonrpsee-types --precise 0.2.0-alpha.6

@niklasad1
Copy link
Member

Closed by #353 but it will take a while until a new version if published.

@fewensa
Copy link
Author

fewensa commented Jun 6, 2021

The new release tag have same question.

jsonrpsee-types = { path = "../types", version = "0.2.0" }

@niklasad1
Copy link
Member

niklasad1 commented Jun 6, 2021

No, because 0.2.0 is released then we will have to respect semver and fetching a later version such as 0.2.1 should still work as it's backward compatible with all 0.2.x versions.

jsonrpsee should be flexible enough for users can manually select which version of jsonrpsee via their Cargo.lock and not pinning specific versions of the internal crates.

Does that make sense to you?

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

2 participants