Skip to content

Unable to compile with -Z build-std #1659

@illuzen

Description

@illuzen

Hello,

we are trying to use plonky2 in a substrate chain, and we have proofs verifying when tested in isolation, but we are unable to build the chain as a whole.

If we could compile plonky2 with cargo build -Z build-std --target wasm32-unknown-unknown that would solve our issues. Currently if you try that, you get

error[E0152]: duplicate lang item in crate `core`: `sized`
  |
  = note: the lang item is first defined in crate `core` (which `std` depends on)
  = note: first definition in `core` loaded from plonky2/target/wasm32-unknown-unknown/debug/deps/libcore-1bda2c0fe1509098.rlib,plonky2/target/wasm32-unknown-unknown/debug/deps/libcore-1bda2c0fe1509098.rmeta
  = note: second definition in `core` loaded from .rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/wasm32-unknown-unknown/lib/libcore-ca9fe48a49de91a5.rlib

For more information about this error, try `rustc --explain E0152`.
error: could not compile `plonky2` (bin "generate_constants") due to 1 previous error

Any suggestions?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions