plonky2 icon indicating copy to clipboard operation
plonky2 copied to clipboard

Unable to compile with -Z build-std

Open illuzen opened this issue 3 weeks ago • 7 comments

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?

illuzen avatar Jan 30 '25 12:01 illuzen