risc0 / risc0

RISC Zero is a zero-knowledge verifiable general computing platform based on zk-STARKs and the RISC-V microarchitecture.

Home Page:https://risczero.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] unix/cmath.rs does not exist

marijanp opened this issue · comments

Bug Report

When building rust-src for the riscv32im-risc0-zkvm-elf target I get a file not found error due to this wrong path:

cmath.rs is not located in the unix directory, rather in the sys directory at the same level as pal here:

Steps to Reproduce

  1. Fetch the template
  2. go to methods/guest
  3. run cargo build -Z build-std --target riscv32im-risc0-zkvm-elf
error: couldn't read /nix/store/mhzd2fna42zfxdpdn0kr1zcnmrcck17p-rust-default-1.77.1/lib/rustlib/src/rust/library/std/src/sys/pal/zkvm/../unix/cmath.rs: No such file or directory (os error 2)
  --> /nix/store/mhzd2fna42zfxdpdn0kr1zcnmrcck17p-rust-default-1.77.1/lib/rustlib/src/rust/library/std/src/sys/pal/zkvm/mod.rs:16:1
   |
16 | pub mod cmath;

Expected behavior

Your Environment

  • risc0-zkvm version: 0.21.0
  • Rust version: 1.77.1
  • Platform/OS: Linux

I craeted a PR, I wonder whether it would be better to remove all the relative paths rust-lang/rust#123858

Thanks for the report: I actually have a patch in my erik/risc0-1.77.1 branch that addresses this. I see you fixed the cmath thing but there's another one so I'll follow up with that

@SchmErik how do you keep track of regressions for the zkvm target?

we maintain a fork of the upstream rust repo and once upstream releases, I update our fork to build the rust binaries and deal with regressions then. There are much better way of finding regressions than my current process though. Since my patch got merged, I'm going to close this. Thanks for the report!