DaGenix / rust-crypto

A (mostly) pure-Rust implementation of various cryptographic algorithms.
Apache License 2.0
1.39k stars 295 forks source link

rustc-serialize dependency do not support wasm #469

Closed kongul closed 3 years ago

kongul commented 3 years ago

Hello! I'm trying to build encryption plugin for https://vector.dev/

As for 1 and 2 plugin should be written on rust and then compiled to WASM. I'm using your library to do the encoding. It works perfectly on pure rust, but it fail to compile into WASM with following error

Compiling rustc-serialize v0.3.24
error[E0046]: not all trait items implemented, missing: `encode`
    --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-serialize-0.3.24/src/serialize.rs:1358:1
     |
853  |     fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error>;
     |     ---------------------------------------------------------------- `encode` from trait
...
1358 | impl Encodable for path::Path {
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `encode` in implementation

error[E0046]: not all trait items implemented, missing: `decode`
    --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-serialize-0.3.24/src/serialize.rs:1382:1
     |
904  |     fn decode<D: Decoder>(d: &mut D) -> Result<Self, D::Error>;
     |     ----------------------------------------------------------- `decode` from trait
...
1382 | impl Decodable for path::PathBuf {
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `decode` in implementation

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0046`.
error: could not compile `rustc-serialize`.

Do you plan to stop using rustc-serialize and migrate to serde?

Or could you please assist me overcoming that issue?

newpavlov commented 3 years ago

This crate is unmaintained, it's strongly recommended to use other crates instead.

https://rustsec.org/advisories/RUSTSEC-2016-0005.html

kongul commented 3 years ago

Thank you!