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

Compilation issue in jsonrpsee (CPython 3.9 / rustc 1.56.0) #1

Open
RobinDavid opened this issue Nov 10, 2021 · 7 comments
Open

Compilation issue in jsonrpsee (CPython 3.9 / rustc 1.56.0) #1

RobinDavid opened this issue Nov 10, 2021 · 7 comments

Comments

@RobinDavid
Copy link

RobinDavid commented Nov 10, 2021

Dear all,

I have tried compiling py-subwasm-bindings but it fails. It fails both via pypi and using maturin.
I have CPython 3.9 and rustc 1.56.0 (i doubt it is the issue). When compiling I obtain the following errors:

[snip]
error[E0432]: unresolved imports `jsonrpsee::http_client::traits`, `jsonrpsee::http_client::Error`, `jsonrpsee::http_client::JsonValue`
   --> /home/robin/.cargo/git/checkouts/subwasm-72d453577728ad9c/30734e7/libs/wasm-loader/src/lib.rs:8:16
    |
  8 |     http_client::{traits::Client, Error, HttpClientBuilder, JsonValue},
    |                   ^^^^^^          ^^^^^                     ^^^^^^^^^ no `JsonValue` in `http_client`
    |                   |               |
    |                   |               no `Error` in `http_client`
    |                   could not find `traits` in `http_client`
  
  
  error[E0599]: no method named `request` found for struct `HttpClient` in the current scope
    --> /home/robin/.cargo/git/checkouts/subwasm-72d453577728ad9c/30734e7/libs/wasm-loader/src/lib.rs:45:24
     |
  45 |                 rt.block_on(client.request("state_getStorage", params.into()))
     |                                    ^^^^^^^ method not found in `HttpClient`
     |
    ::: /home/robin/.cargo/git/checkouts/jsonrpsee-5ae67701a3cedc92/6dac20d/types/src/traits.rs:41:14
     |
  41 |     async fn request<'a, R>(&self, method: &'a str, params: Option<ParamsSer<'a>>) -> Result<R, Error>
     |              ------- the method is available for `HttpClient` here
     |
     = help: items from traits can only be used if the trait is in scope
  help: the following trait is implemented but not in scope; perhaps add a `use` for it:
     |
  6  | use jsonrpsee::jsonrpsee_types::traits::Client;
     |
  
  
  error[E0599]: no method named `request` found for struct `WsClient` in the current scope
    --> /home/robin/.cargo/git/checkouts/subwasm-72d453577728ad9c/30734e7/libs/wasm-loader/src/lib.rs:50:24
     |
  50 |                 rt.block_on(client.request("state_getStorage", params.into()))
     |                                    ^^^^^^^ method not found in `WsClient`
     |
    ::: /home/robin/.cargo/git/checkouts/jsonrpsee-5ae67701a3cedc92/6dac20d/types/src/traits.rs:41:14
     |
  41 |     async fn request<'a, R>(&self, method: &'a str, params: Option<ParamsSer<'a>>) -> Result<R, Error>
     |              ------- the method is available for `WsClient` here
     |
     = help: items from traits can only be used if the trait is in scope
  help: the following trait is implemented but not in scope; perhaps add a `use` for it:
     |
  6  | use jsonrpsee::jsonrpsee_types::traits::Client;
     |
  
  
  error: aborting due to 3 previous errors
  
  
  Some errors have detailed explanations: E0432, E0599.
  
  For more information about an error, try `rustc --explain E0432`.
  
  Error: command ['maturin', 'pep517', 'build-wheel', '-i', '/usr/bin/python3'] returned non-zero exit status 1

It looks like the jsonrpsee interface have somehow changed, but as I am definitely not familiar with the project I don't really know.

Can you reproduce it, and do you have an idea of where it can be coming from ?

Robin

@niklasad1
Copy link

The problem is that subwasm is using latest master for jsonrpsee and v0.6.0 relied on old version that had many breaking changes.

So I suggest updating subwasm to a later version that will fix this I think

@RobinDavid
Copy link
Author

Hi @niklasad1! I read the issue you opened on subwasm. I am still confused, where the fix shall be done. I am not fimiliar with the code base, but is there anything I can do to help fixing this ?

@niklasad1
Copy link

py-subwasm-bindings needs to update these subwasm crates to 0.16.1 and it should be fine I guess

@RobinDavid
Copy link
Author

I have tried imply updating the Cargo.toml but it raises other issues:

error: no matching package found
searched package name: `sp-maybe-compressed-blob`
prerelease package needs to be specified explicitly
sp-maybe-compressed-blob = { version = "4.1.0-dev" }

So I guess there are few other tweaks to do.

@arjanz any ideas ?

arjanz added a commit that referenced this issue Nov 18, 2021
@arjanz
Copy link
Member

arjanz commented Nov 18, 2021

I forked subwasm and updated wasm-loader dependency sp-maybe-compressed-blob to 4.1.0-dev. This seems to resolve it for now, I will open a PR to subwasm

@niklasad1
Copy link

niklasad1 commented Nov 18, 2021

It's because 4.0.0-dev is the only one released on crates.io but you have to check in Cargo.lock what brings in "4.1.0-dev" I guess...

@arjanz
Copy link
Member

arjanz commented Nov 18, 2021

chevdor/subwasm#35

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

3 participants