a16z / jolt

The simplest and most extensible zkVM. Fast and fully open source from a16z crypto and friends. ⚡
https://jolt.a16zcrypto.com
MIT License
587 stars 106 forks source link

Can we move criterion to dev-dependencies or use feature tag to make it possible to block related code? #345

Closed flyq closed 2 months ago

flyq commented 2 months ago

When try to compile jolt's verifier to wasm32, I meet this:

   Compiling criterion v0.5.1
For more information about this error, try `rustc --explain E0277`.
error: could not compile `iai-callgrind-runner` (lib) due to 12 previous errors
warning: build failed, waiting for other jobs to finish...
error: Rayon cannot be used when targeting wasi32. Try disabling default features.
  --> /Users/flyq/.cargo/registry/src/index.crates.io-6f17d22bba15001f/criterion-0.5.1/src/lib.rs:31:1
   |
31 | compile_error!("Rayon cannot be used when targeting wasi32. Try disabling default features.");
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: could not compile `criterion` (lib) due to 1 previous error

I tried forking jolt and deleting the relevant bench code to successfully compile it into wasm: https://github.com/flyq/jolt/commit/74b93dfe5f1fa9ad81a9196912a616bcddd1bb46

But the problem is that Jolt is developing very fast, so it needs to synchronize Jolt upstream to update frequently.

Can we move criterion to dev-dependencies or use feature tag to make it possible to block related code?

sragss commented 2 months ago

Sounds like a good idea.

moodlezoup commented 2 months ago

let's make it a dev-depedency @flyq can you make a PR?

flyq commented 2 months ago

https://github.com/a16z/jolt/pull/354