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

CLI WASM Implementation #14

Closed
gnosed opened this issue May 18, 2022 · 3 comments
Closed

CLI WASM Implementation #14

gnosed opened this issue May 18, 2022 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@gnosed
Copy link

gnosed commented May 18, 2022

  • port the CLI rust implementation to WASM
@grarco
Copy link
Collaborator

grarco commented Jun 16, 2022

As of commit ac4e32a, the phase1-cli crate can't be compiled to target wasm32 because of a known socket2 issue. More specifically, this dependency is coming from two packages:

  • tokio
  • hyper

hyper, in turn, comes from:

  • reqwest
  • hyper-tls (again from reqwest)
  • rocket (from phase1-coordinator)

To compile for wasm we can :

  • disable the net feature of tokio which is the one pulling in socket2
  • remove the rocket dependency coming from phase1-coordinator (related to Refactor repo #12)
  • remove std features of reqwest which include hyper-tls (this could be impossible if we plan to use tls)

At this point the only dependency that would need socket2 is the tcp flag of hyper, but this one is disabled when compiling for target wasm32 and so shouldn't cause a problem.

Having done so, we should be able to compile the crate for wasm but we should test whether the removal of features has compromised the runtime functionality in any way

@grarco grarco self-assigned this Jun 16, 2022
@grarco grarco added the enhancement New feature or request label Jun 16, 2022
@grarco
Copy link
Collaborator

grarco commented Jun 20, 2022

Due to the new issue #27 it may now be impossible to rework the dependencies to successfully compile for a wasm target because of the strong requirement on hyper tcp flag coming from hyper-tls <- reqwest

@grarco
Copy link
Collaborator

grarco commented Jul 28, 2022

I'll close this issue. We cannot compile the client to wasm32 unless we remove the communication part with the server that relies on the socket2 crate which is preventing compilation.
That would mean exporting to a different crate the contribute_masp function to be compiled to wasm. After that, we would need to rewrite the entire contribute function from phase1.rs in the frontend and call the wasm compiled contribute_masp function from there

@grarco grarco closed this as not planned Won't fix, can't repro, duplicate, stale Jul 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants