EspressoSystems / jellyfish

A Rust Implementation of the PLONK ZKP System and Extensions
https://jellyfish.docs.espressosys.com
MIT License
385 stars 93 forks source link

Code coverage script does not work #614

Closed philippecamacho closed 1 month ago

philippecamacho commented 1 month ago

The code coverage script mentioned in the README.md does not work.

> nix-shell:~/repositories/espressosys/jellyfish]$ ./scripts/test_coverage.sh 
++ IGNORED_FILES='--ignore **/errors.rs               --ignore **/src/bin/*               --ignore transactions/src/parameters.rs               --ignore transactions/src/bench_utils/*              '
++ export CARGO_INCREMENTAL=0
++ CARGO_INCREMENTAL=0
++ export 'RUSTFLAGS=-Zprofile -Ccodegen-units=1 -Copt-level=3 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests'
++ RUSTFLAGS='-Zprofile -Ccodegen-units=1 -Copt-level=3 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests'
++ export RUSTDOCFLAGS=
++ RUSTDOCFLAGS=
++ rm -vf './target/**/*.gcda'
++ cargo build --features 'test-srs, gadgets, bls, schnorr'
error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `rustc - --crate-name ___ --print=file-names -Zprofile -Ccodegen-units=1 -Copt-level=3 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=split-debuginfo --print=crate-name --print=cfg` (exit status: 1)
  --- stderr
  error: the option `Z` is only accepted on the nightly compiler

  help: consider switching to a nightly toolchain: `rustup default nightly`

  note: selecting a toolchain with `+toolchain` arguments require a rustup proxy; see <https://rust-lang.github.io/rustup/concepts/index.html>

  note: for more information about Rust's stability policy, see <https://doc.rust-lang.org/book/appendix-07-nightly-rust.html#unstable-features>

  error: 1 nightly option were parsed
philippecamacho commented 1 month ago

Thanks @mrain !!

philippecamacho commented 1 month ago

@mrain I still get an error:

> ./scripts/test_coverage.sh

+ IGNORED_FILES='--ignore **/errors.rs               --ignore **/src/bin/*               --ignore transactions/src/parameters.rs               --ignore transactions/src/bench_utils/*              '
+ export CARGO_INCREMENTAL=0
+ CARGO_INCREMENTAL=0
+ export 'RUSTFLAGS=-Zprofile -Ccodegen-units=1 -Copt-level=3 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests'
+ RUSTFLAGS='-Zprofile -Ccodegen-units=1 -Copt-level=3 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests'
+ export RUSTDOCFLAGS=
+ RUSTDOCFLAGS=
+ rm -vf './target/**/*.gcda'
+ cargo +nightly build --features 'test-srs, gadgets, bls, schnorr'
   Compiling proc-macro2 v1.0.69
   Compiling unicode-ident v1.0.12
   Compiling version_check v0.9.4
   Compiling autocfg v1.1.0
   Compiling serde v1.0.193
   Compiling rand_core v0.6.4
   Compiling typenum v1.17.0
   Compiling cfg-if v1.0.0
   Compiling subtle v2.5.0
   Compiling crossbeam-utils v0.8.16
   Compiling syn v1.0.109
   Compiling scopeguard v1.2.0
   Compiling rayon-core v1.12.1
   Compiling either v1.9.0
   Compiling ppv-lite86 v0.2.17
   Compiling paste v1.0.14
   Compiling zerocopy v0.7.26
   Compiling once_cell v1.18.0
   Compiling cpufeatures v0.2.11
   Compiling heck v0.4.1
   Compiling itertools v0.10.5
   Compiling crc-any v2.4.3
   Compiling base64 v0.22.0
   Compiling pin-project-lite v0.2.13
   Compiling tracing-core v0.1.32
   Compiling itertools v0.12.1
   Compiling rand_chacha v0.3.1
   Compiling allocator-api2 v0.2.16
   Compiling rand v0.8.5
   Compiling tracing v0.1.40
   Compiling generic-array v0.14.7
   Compiling ahash v0.8.6
   Compiling quote v1.0.33
   Compiling keccak v0.1.4
   Compiling memoffset v0.9.0
   Compiling crossbeam-epoch v0.9.15
   Compiling num-traits v0.2.17
   Compiling num-integer v0.1.45
   Compiling syn v2.0.39
   Compiling num-bigint v0.4.4
error[E0635]: unknown feature `stdsimd`
  --> /home/leloup/.cargo-nix/registry/src/index.crates.io-6f17d22bba15001f/ahash-0.8.6/src/lib.rs:99:42
   |
99 | #![cfg_attr(feature = "stdsimd", feature(stdsimd))]
   |                                          ^^^^^^^

   Compiling crossbeam-deque v0.8.3
   Compiling downcast-rs v1.2.0
For more information about this error, try `rustc --explain E0635`.
error: could not compile `ahash` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
mrain commented 1 month ago

@philippecamacho it works well on my side with ahash 0.8.11, maybe try cargo update first?

philippecamacho commented 1 month ago

@philippecamacho it works well on my side with ahash 0.8.11, maybe try cargo update first?

@mrain This worked thank you. I had to update flake.nix though to be able to run the script. See #621.