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

Add Wasm support to ec-gpu-gen #32

Closed

Conversation

samuelburnham
Copy link

@samuelburnham samuelburnham commented Sep 19, 2022

This PR allows the following command to build:

cargo build --target wasm32-unknown-unknown

It also supports the cuda feature, but not opencl due to its dependency on libc.

This would move bellperson's getrandom dependency to ec-gpu-gen, and at least in theory would allow the former to use CUDA on Wasm. In practice it doesn't yet work due to the fs2 dependency, but if it's useful maybe that can be fixed.

@vmx
Copy link
Contributor

vmx commented Sep 20, 2022

I don't think that's needed. When ec-gpu-gen is used as a dependency, it should just compile fine on the wasm32-unknown-unknown target. Am I missing something?

vmx added a commit that referenced this pull request Sep 20, 2022
Using resolver version 2 (which is default in Rust editiion 2021), it
is possible to run `cargo build --target wasm32-unknown-unknown` without
any failures. Note that even before this change it was possible when
`ec-gpu-gen` was used as a dependency, but with this change it becomes
more apparent.

The problem was that the `rand` dev-dependency was enabling the `std`
feature, which then led to `ff` pulling is `getrandom`, which has
problems to be compiled to `wasm32-unknown-unknown` without setting
the `js` feature.

Closes #32.
@vmx
Copy link
Contributor

vmx commented Sep 20, 2022

@samuelburnham I've created #33 to make things more apparent.

@vmx vmx closed this in #33 Sep 21, 2022
vmx added a commit that referenced this pull request Sep 21, 2022
Using resolver version 2 (which is default in Rust editiion 2021), it
is possible to run `cargo build --target wasm32-unknown-unknown` without
any failures. Note that even before this change it was possible when
`ec-gpu-gen` was used as a dependency, but with this change it becomes
more apparent.

The problem was that the `rand` dev-dependency was enabling the `std`
feature, which then led to `ff` pulling is `getrandom`, which has
problems to be compiled to `wasm32-unknown-unknown` without setting
the `js` feature.

BREAKING CHANGE: the workspace resolver was updated to v2

Closes #32.
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

Successfully merging this pull request may close these issues.

None yet

2 participants