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

zcash_client_backend: unused tonic crate features prevent Wasm builds with feature lightwalletd-tonic #1269

Closed
willemolding opened this issue Mar 14, 2024 · 3 comments · Fixed by #1270

Comments

@willemolding
Copy link
Contributor

As a consumer of this crate we want to use the generated gRPC client within a Wasm environment. Currently this is not possible due to the transport feature of tonic being enabled by default and being incompatible with Wasm.

Currently there is no reason for having this feature enabled for the tonic and tonic-build dependencies for zcash_client_backend and it could be safely removed.

Removing it does change the public API of the crate though as it alters the code produced by the build script.

@zancas
Copy link
Contributor

zancas commented Mar 14, 2024

I am testing our dependency now.

@zancas
Copy link
Contributor

zancas commented Mar 14, 2024

To test the effect on our consuming code zingolib I cherry-picked your commit onto our fork of librustzcash. I then removed the proto directory as suggested by this comment:

https://github.com/zingolabs/librustzcash/blob/be312f86553cc85df11037d34356bbb1f579b2c3/zcash_client_backend/build.rs#L13

That produced this version of the gRPC service Rust language bindings:

https://github.com/zingolabs/librustzcash/blob/reduced_tonic_expt/zcash_client_backend/src/proto/service.rs

I then ran cargo check on zingolib dev branch (modified to point at the above-described version of lrz).

That produced this error:

error[E0432]: unresolved import `zcash_client_backend::proto::service::compact_tx_streamer_server`
  --> zingo-testutils/src/grpc_proxy.rs:10:9
   |
10 |         compact_tx_streamer_server::{CompactTxStreamer, CompactTxStreamerServer},
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^ could not find `compact_tx_streamer_server` in `service`

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

@AloeareV
Copy link
Contributor

AloeareV commented Mar 14, 2024

To test the effect on our consuming code zingolib I cherry-picked your commit onto our fork of librustzcash. I then removed the proto directory as suggested by this comment:

https://github.com/zingolabs/librustzcash/blob/be312f86553cc85df11037d34356bbb1f579b2c3/zcash_client_backend/build.rs#L13

That produced this version of the gRPC service Rust language bindings:

https://github.com/zingolabs/librustzcash/blob/reduced_tonic_expt/zcash_client_backend/src/proto/service.rs

I then ran cargo check on zingolib dev branch (modified to point at the above-described version of lrz).

That produced this error:

error[E0432]: unresolved import `zcash_client_backend::proto::service::compact_tx_streamer_server`
  --> zingo-testutils/src/grpc_proxy.rs:10:9
   |
10 |         compact_tx_streamer_server::{CompactTxStreamer, CompactTxStreamerServer},
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^ could not find `compact_tx_streamer_server` in `service`

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

It looks like the build script hasn't been run on our fork at all. I don't know how this ever worked, but it must be relying on the proto being built by the build script during compilation, which can't happen without the proto file.

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