-
Notifications
You must be signed in to change notification settings - Fork 8
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 to Web Assemby is broken #13
Comments
This error is related to: Status of rust+C bindings for wasm targets I created a small test repository to replicate this error: https://github.com/phroi/blake2b-rs-wasm-test |
There are pure rust blake2b implementations, e.g. blake2b-simd (this one is also more performant using SIMD), blake2. |
Hey @sopium, glad to hear back on this issue! You are right, still the main underlying Issue is that this library is indirectly imported by ckb-sdk-rust and by most rust CKB codebase. By having this small bit non wasm compilable, all the rust CKB libraries that import directly or indirectly this library now are non wasm compilable. This means that most of rust CKB codebase is now not non wasm compilable due to this. That's why I would advice adding a fallback for the WASM target. Keep up the great work 💪 |
Seems that ckb-sdk-rust depends on blake2b-rs through ckb-hash. So we'd need to change ckb-hash to use a pure rust blake2b impl to support this. |
But ckb-hash uses blake2b-ref on wasm: [target.'cfg(target_arch = "wasm32")'.dependencies]
blake2b-ref = "0.2.0" I'll investigate further later. |
Thanks @sopium!! To be honest I opened this issue last October and now I'm using Lumos for doing this job. The situation may have changed in the meantime, please just double check on it to be sure. Thanks again, |
It's pulled in by sparse-merkle-tree, I've opened an issue there: |
Thanks for actually investigating this issue, good to know! 💪 |
Compiling any code that uses
blake2b-rs
with targetwasm32-unknown-unknown
fails with the following:The text was updated successfully, but these errors were encountered: