Skip to content

rust-crypto breaks cargo build --target wasm32-wasi #1758

@MikeCamel

Description

@MikeCamel

Following instructions from here:https://github.com/bytecodealliance/wasmtime/blob/master/docs/WASI-tutorial.md

  • What are the steps to reproduce the issue?
    Add the following to Cargo.toml:
[dependencies]
rust-crypto = "0.2.36"
  • What do you expect to happen? What does actually happen? Does it panic, and
    if so, with which assertion?
    I expect a normal compilation ("cargo build" works fine with no "--target")
    This is what I get:
[mbursell@redz1 test-n-try]$ cargo build --target wasm32-wasi --verbose
       Fresh gcc v0.3.55
       Fresh rand v0.4.6
   Compiling rustc-serialize v0.3.24
     Running `rustc --crate-name rustc_serialize /home/mbursell/.cargo/registry/src/gitlite.zycloud.tk-1ecc6299db9ec823/rustc-serialize-0.3.24/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C debuginfo=2 -C metadata=81dd7fcdc8fa060f -C extra-filename=-81dd7fcdc8fa060f --out-dir /home/mbursell/work/programming/rust/projects/test-n-try/target/wasm32-wasi/debug/deps --target wasm32-wasi -L dependency=/home/mbursell/work/programming/rust/projects/test-n-try/target/wasm32-wasi/debug/deps -L dependency=/home/mbursell/work/programming/rust/projects/test-n-try/target/debug/deps --cap-lints allow`
   Compiling rust-crypto v0.2.36
       Fresh libc v0.2.71
       Fresh rand v0.3.23
       Fresh time v0.1.43
     Running `rustc --crate-name build_script_build /home/mbursell/.cargo/registry/src/gitlite.zycloud.tk-1ecc6299db9ec823/rust-crypto-0.2.36/build.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=7f2ee95fb96eec39 -C extra-filename=-7f2ee95fb96eec39 --out-dir /home/mbursell/work/programming/rust/projects/test-n-try/target/debug/build/rust-crypto-7f2ee95fb96eec39 -L dependency=/home/mbursell/work/programming/rust/projects/test-n-try/target/debug/deps --extern gcc=/home/mbursell/work/programming/rust/projects/test-n-try/target/debug/deps/libgcc-4bc2c35f0d7340fa.rlib --cap-lints allow`
     Running `/home/mbursell/work/programming/rust/projects/test-n-try/target/debug/build/rust-crypto-7f2ee95fb96eec39/build-script-build`
error[E0046]: not all trait items implemented, missing: `encode`
    --> /home/mbursell/.cargo/registry/src/gitlite.zycloud.tk-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`
    --> /home/mbursell/.cargo/registry/src/gitlite.zycloud.tk-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`.

Caused by:
  process didn't exit successfully: `rustc --crate-name rustc_serialize /home/mbursell/.cargo/registry/src/gitlite.zycloud.tk-1ecc6299db9ec823/rustc-serialize-0.3.24/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C debuginfo=2 -C metadata=81dd7fcdc8fa060f -C extra-filename=-81dd7fcdc8fa060f --out-dir /home/mbursell/work/programming/rust/projects/test-n-try/target/wasm32-wasi/debug/deps --target wasm32-wasi -L dependency=/home/mbursell/work/programming/rust/projects/test-n-try/target/wasm32-wasi/debug/deps -L dependency=/home/mbursell/work/programming/rust/projects/test-n-try/target/debug/deps --cap-lints allow` (exit code: 1)

  • Which Wasmtime version / commit hash / branch are you using?
[mbursell@redz1 test-n-try]$ rustup show
Default host: x86_64-unknown-linux-gnu
rustup home:  /home/mbursell/.rustup

installed targets for active toolchain
--------------------------------------

wasm32-wasi
x86_64-unknown-linux-gnu

active toolchain
----------------

stable-x86_64-unknown-linux-gnu (default)
rustc 1.43.1 (8d69840ab 2020-05-04)


  • If relevant, can you include some extra information about your environment?
    (Rust version, operating system, architecture...)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIncorrect behavior in the current implementation that needs fixing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions