AvaProtocol / substrate-simple-template

A simple template to bootstrap a Substrate node with BABE consensus
8 stars 18 forks source link

Deep dependency issue from jsonrpsee-http-client #2

Closed weezy20 closed 2 years ago

weezy20 commented 2 years ago

Hi I am trying to compile with rustc nightly 1.60 on my macbook an it seems like there's some error with this particular dependency.

unresolved import `crate::v2::error::JsonRpcErrorAlloc`
 --> /Users/turtle/.cargo/registry/src/github.com-1ecc6299db9ec823/jsonrpsee-http-client-0.2.0-alpha.6/src/client.rs:5:2
  |
5 |     error::JsonRpcErrorAlloc,
  |     ^^^^^^^-----------------
  |     |      |
  |     |      help: a similar name exists in the module: `JsonRpcError`
  |     no `JsonRpcErrorAlloc` in `v2::error`

error[E0599]: no variant or associated item named `TransportError` found for enum `jsonrpsee_types::Error` in the current scope
  --> /Users/turtle/.cargo/registry/src/github.com-1ecc6299db9ec823/jsonrpsee-http-client-0.2.0-alpha.6/src/client.rs:31:24
   |
31 |             .map_err(|e| Error::TransportError(Box::new(e)))?;
   |                                 ^^^^^^^^^^^^^^ variant or associated item not found in `jsonrpsee_types::Error`

error[E0599]: no variant or associated item named `TransportError` found for enum `jsonrpsee_types::Error` in the current scope
  --> /Users/turtle/.cargo/registry/src/github.com-1ecc6299db9ec823/jsonrpsee-http-client-0.2.0-alpha.6/src/client.rs:58:24
   |
58 |             .map_err(|e| Error::TransportError(Box::new(e)))
   |                                 ^^^^^^^^^^^^^^ variant or associated item not found in `jsonrpsee_types::Error`

error[E0599]: no variant or associated item named `TransportError` found for enum `jsonrpsee_types::Error` in the current scope
  --> /Users/turtle/.cargo/registry/src/github.com-1ecc6299db9ec823/jsonrpsee-http-client-0.2.0-alpha.6/src/client.rs:74:24
   |
74 |             .map_err(|e| Error::TransportError(Box::new(e)))?;
   |                                 ^^^^^^^^^^^^^^ variant or associated item not found in `jsonrpsee_types::Error`

error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
  --> /Users/turtle/.cargo/registry/src/github.com-1ecc6299db9ec823/jsonrpsee-http-client-0.2.0-alpha.6/src/client.rs:70:7
   |
70 |         let body = self
   |             ^^^^ doesn't have a size known at compile-time
   |
   = help: the trait `Sized` is not implemented for `[u8]`
   = note: all local variables must have a statically known size
   = help: unsized locals are gated as an unstable feature

error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
  --> /Users/turtle/.cargo/registry/src/github.com-1ecc6299db9ec823/jsonrpsee-http-client-0.2.0-alpha.6/src/client.rs:70:14
   |
70 |           let body = self
   |  ____________________^
71 | |             .transport
72 | |             .send_and_read_body(serde_json::to_string(&request).map_err(Error::ParseError)?)
73 | |             .await
74 | |             .map_err(|e| Error::TransportError(Box::new(e)))?;
   | |_____________________________________________________________^ doesn't have a size known at compile-time
   |
   = help: the trait `Sized` is not implemented for `[u8]`
   = note: all local variables must have a statically known size
   = help: unsized locals are gated as an unstable feature

error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
  --> /Users/turtle/.cargo/registry/src/github.com-1ecc6299db9ec823/jsonrpsee-http-client-0.2.0-alpha.6/src/client.rs:74:52
   |
74 |             .map_err(|e| Error::TransportError(Box::new(e)))?;
   |                                                             ^ doesn't have a size known at compile-time
   |
   = help: the trait `Sized` is not implemented for `[u8]`
note: required by a bound in `Break`
  --> /Users/turtle/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/ops/control_flow.rs:83:25
   |
83 | pub enum ControlFlow<B, C = ()> {
   |                         ^ required by this bound in `Break`

   Compiling libp2p v0.37.1
error[E0308]: mismatched types
  --> /Users/turtle/.cargo/registry/src/github.com-1ecc6299db9ec823/jsonrpsee-http-client-0.2.0-alpha.6/src/client.rs:84:38
   |
84 |         let response_id = parse_request_id(response.id)?;
   |                                            ^^^^^^^^^^^ expected enum `std::option::Option`, found enum `Id`
   |
   = note: expected enum `std::option::Option<&jsonrpsee_types::JsonRawValue>`
              found enum `Id<'_>`
note: return type inferred to be `std::option::Option<&jsonrpsee_types::JsonRawValue>` here
  --> /Users/turtle/.cargo/registry/src/github.com-1ecc6299db9ec823/jsonrpsee-http-client-0.2.0-alpha.6/src/client.rs:65:2
   |
65 | /     {
66 | |         // NOTE: `fetch_add` wraps on overflow which is intended.
67 | |         let id = self.request_id.fetch_add(1, Ordering::SeqCst);
68 | |         let request = JsonRpcCallSer::new(Id::Number(id), method, params);
...  |
90 | |         }
91 | |     }
   | |_____^

error[E0599]: no variant or associated item named `TransportError` found for enum `jsonrpsee_types::Error` in the current scope
   --> /Users/turtle/.cargo/registry/src/github.com-1ecc6299db9ec823/jsonrpsee-http-client-0.2.0-alpha.6/src/client.rs:113:24
    |
113 |             .map_err(|e| Error::TransportError(Box::new(e)))?;
    |                                 ^^^^^^^^^^^^^^ variant or associated item not found in `jsonrpsee_types::Error`

error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
   --> /Users/turtle/.cargo/registry/src/github.com-1ecc6299db9ec823/jsonrpsee-http-client-0.2.0-alpha.6/src/client.rs:109:7
    |
109 |         let body = self
    |             ^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `Sized` is not implemented for `[u8]`
    = note: all local variables must have a statically known size
    = help: unsized locals are gated as an unstable feature

error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
   --> /Users/turtle/.cargo/registry/src/github.com-1ecc6299db9ec823/jsonrpsee-http-client-0.2.0-alpha.6/src/client.rs:109:14
    |
109 |           let body = self
    |  ____________________^
110 | |             .transport
111 | |             .send_and_read_body(serde_json::to_string(&batch_request).map_err(Error::ParseError)?)
112 | |             .await
113 | |             .map_err(|e| Error::TransportError(Box::new(e)))?;
    | |_____________________________________________________________^ doesn't have a size known at compile-time
    |
    = help: the trait `Sized` is not implemented for `[u8]`
    = note: all local variables must have a statically known size
    = help: unsized locals are gated as an unstable feature

error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
   --> /Users/turtle/.cargo/registry/src/github.com-1ecc6299db9ec823/jsonrpsee-http-client-0.2.0-alpha.6/src/client.rs:113:52
    |
113 |             .map_err(|e| Error::TransportError(Box::new(e)))?;
    |                                                             ^ doesn't have a size known at compile-time
    |
    = help: the trait `Sized` is not implemented for `[u8]`
note: required by a bound in `Break`
   --> /Users/turtle/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/ops/control_flow.rs:83:25
    |
83  | pub enum ControlFlow<B, C = ()> {
    |                         ^ required by this bound in `Break`

error[E0308]: mismatched types
   --> /Users/turtle/.cargo/registry/src/github.com-1ecc6299db9ec823/jsonrpsee-http-client-0.2.0-alpha.6/src/client.rs:126:39
    |
126 |             let response_id = parse_request_id(rp.id)?;
    |                                                ^^^^^ expected enum `std::option::Option`, found enum `Id`
    |
    = note: expected enum `std::option::Option<&jsonrpsee_types::JsonRawValue>`
               found enum `Id<'_>`
note: return type inferred to be `std::option::Option<&jsonrpsee_types::JsonRawValue>` here
   --> /Users/turtle/.cargo/registry/src/github.com-1ecc6299db9ec823/jsonrpsee-http-client-0.2.0-alpha.6/src/client.rs:96:2
    |
96  | /     {
97  | |         let mut batch_request = Vec::with_capacity(batch.len());
98  | |         // NOTE(niklasad1): `ID` is not necessarily monotonically increasing.
99  | |         let mut ordered_requests = Vec::with_capacity(batch.len());
...   |
133 | |         Ok(responses)
134 | |     }
    | |_____^

Some errors have detailed explanations: E0277, E0308, E0432, E0599.
For more information about an error, try `rustc --explain E0277`.
error: could not compile `jsonrpsee-http-client` due to 13 previous errors
weezy20 commented 2 years ago

If I try to include the Cargo.lock file in the git repo, I get another issue :

error: failed to download `parity-db v0.2.3`

Caused by:
  unable to get packages from source

Caused by:
  failed to parse manifest at `/Users/turtle/.cargo/registry/src/github.com-1ecc6299db9ec823/parity-db-0.2.3/Cargo.toml`

Caused by:
  failed to parse the version requirement `0.11 ` for dependency `parking_lot`

Caused by:
  expected comma after minor version number, found '\t'
niklasad1 commented 2 years ago

See https://github.com/paritytech/jsonrpsee/issues/352 how to fix that sorry about that