Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] No such file or directory #1569

Closed
rakanalh opened this issue Mar 19, 2024 · 3 comments
Closed

[BUG] No such file or directory #1569

rakanalh opened this issue Mar 19, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@rakanalh
Copy link

rakanalh commented Mar 19, 2024

Bug Report

I am using Nixos. However, for the purpose of being able to build sovereign-sdk, and because this crate depends on rustup being present (nixos can install rust with nix-shell without rustup), i installed rustup and have a rusup installation of the rust toolchain.
Now, i have executed:

cargo binstall --force -y cargo-risczero && cargo risczero install

The latter step AFAIU would install a custom toolchain specifically for risc0. However, when trying to build the demo rollup in sovereign-sdk:

cargo build --bins
   Compiling sov-modules-api v0.3.0 (/home/rakan/Code/Rust/sovereign-sdk/module-system/sov-modules-api)
   Compiling risc0-circuit-recursion v0.19.1
   Compiling risc0 v0.3.0 (/home/rakan/Code/Rust/sovereign-sdk/examples/demo-rollup/provers/risc0)
error: failed to run custom build command for `risc0-circuit-recursion v0.19.1`

Caused by:
  process didn't exit successfully: `/home/rakan/Code/Rust/sovereign-sdk/target/debug/build/risc0-circuit-recursion-ed6dd89a50b932ab/build-script-build` (exit status: 101)
  --- stderr
  Downloading https://github.com/risc0/risc0/raw/505295b963c97db2afffe58f4b0cb4721e396b90/risc0/circuit/recursion/src/recursion_zkr.zip
  thread 'main' panicked at /home/rakan/.cargo/registry/src/index.crates.io-6f17d22bba15001f/risc0-circuit-recursion-0.19.1/build.rs:72:51:
  called `Result::unwrap()` on an `Err` value: Download(/home/rakan/Code/Rust/sovereign-sdk/target/debug/build/risc0-circuit-recursion-5e3c417694435cf2/out/recursion_zkr.zip: (verification: unverified):
  )
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
sov-demo-prover-guest-celestia: Starting build for riscv32im-risc0-zkvm-elfild)
sov-demo-prover-guest-celestia: error: could not execute process `/home/rakan/.rustup/toolchains/risc0/bin/rustc -vV` (never executed)
sov-demo-prover-guest-celestia:
sov-demo-prover-guest-celestia: Caused by:
sov-demo-prover-guest-celestia:   No such file or directory (os error 2)
error: failed to run custom build command for `risc0 v0.3.0 (/home/rakan/Code/Rust/sovereign-sdk/examples/demo-rollup/provers/risc0)`

Caused by:
  process didn't exit successfully: `/home/rakan/Code/Rust/sovereign-sdk/target/debug/build/risc0-a19e980724198905/build-script-build` (exit status: 101)
  --- stdout
  Building guest package risc0.sov-demo-prover-guest-celestia
  cargo:rerun-if-env-changed=RISC0_SKIP_BUILD
  Using rustc: /home/rakan/.rustup/toolchains/risc0/bin/rustc
  cargo:rerun-if-env-changed=RISC0_RUST_SRC
  Building guest package: cargo build --target riscv32im-risc0-zkvm-elf
  cargo:rerun-if-env-changed=RISC0_BUILD_DEBUG

Which means that i do have a rustc compiler downloaded with cargo riskzero install.

➜ rustup toolchain list
stable-x86_64-unknown-linux-gnu (override)
risc0 (default)

The rustc binary, however, does not seem to execute:

➜ ls -l /home/rakan/.rustup/toolchains/risc0/bin/rustc
.rwxr-xr-x 17k rakan  8 Feb 22:17 /home/rakan/.rustup/toolchains/risc0/bin/rustc
➜ /home/rakan/.rustup/toolchains/risc0/bin/rustc
zsh: no such file or directory: /home/rakan/.rustup/toolchains/risc0/bin/rustc

Steps to Reproduce

  1. Using nixos, install rustup globally
  2. git clone https://github.com/Sovereign-Labs/sovereign-sdk.git
  3. cd examples/demo-rollup
  4. cargo build --bins (as in the readme)

Expected behavior

The rustc binary downloaded should run as expected.

Your Environment

  • risc0-zkvm version:
  • Rust version:
➜ rustc --version
rustc 1.76.0 (07dca489a 2024-02-04)
  • Platform/OS:
Linux nixos 6.1.81 #1-NixOS SMP PREEMPT_DYNAMIC Wed Mar  6 14:45:20 UTC 2024 x86_64 GNU/Linux

Additional context

@rakanalh rakanalh added the bug Something isn't working label Mar 19, 2024
Copy link

linear bot commented Mar 19, 2024

@rakanalh
Copy link
Author

According to NixOS/nixpkgs#107375 (comment),

This is because NixOS avoids global state and therefore doesn't install the binary interpreter ld-linux.so and generally libraries to the default locations as on other Linux distribution. This means that dynamically linked binaries built elsewhere won't run out of the box

Looking into https://github.com/risc0/risc0/tree/main/risc0/cargo-risczero, apparently i can use the cargo risczero build-toolchain to build the toolchain for my host which is what i am currently doing.

However, my question is why do need a specific toolchain that is downloaded from this repo and not downloadable from rustup in this case?

@rakanalh
Copy link
Author

build-toolchain subcommand worked fine. Closing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant