Skip to content

Commit f0c1c73

Browse files
committed
chore(pkgs/risc0): Update to latest version (2025-02-12)
RISC0 have diverged from using the same Rust version for host and guest building. Also, they have transformed rzup into a library, which is used to find the rust executable path.
1 parent 8d9b29d commit f0c1c73

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

packages/risc0/default.nix

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
{
22
risc0-rust,
3+
rust-bin,
34
craneLib-nightly,
45
fetchurl,
56
fetchFromGitHub,
7+
fetchGitHubFile,
68
installSourceAndCargo,
79
autoPatchelfHook,
810
pkg-config,
@@ -14,16 +16,16 @@ let
1416
# https://github.com/risc0/risc0/blob/main/risc0/circuit/recursion/build.rs
1517
recursion-zkr =
1618
let
17-
hash' = "ffc503386276f809137161f18d2f3ddcba3bb4b2d8b5d893b2c5d94b35afaf47";
19+
hash' = "a1a9a1938e3143aecd995b8f20a93f3e1efb31d8b276dfa59acb9401bd2b36be";
1820
in
1921
fetchurl rec {
2022
url = "https://risc0-artifacts.s3.us-west-2.amazonaws.com/zkr/${hash'}.zip";
21-
hash = "sha256-/8UDOGJ2+AkTcWHxjS893Lo7tLLYtdiTssXZSzWvr0c=";
23+
hash = "sha256-oamhk44xQ67NmVuPIKk/Ph77Mdiydt+lmsuUAb0rNr4=";
2224
};
2325

2426
commonArgs = rec {
2527
pname = "risc0";
26-
version = "unstable-2024-12-21";
28+
version = "unstable-2025-02-12";
2729

2830
nativeBuildInputs = [
2931
autoPatchelfHook
@@ -34,12 +36,16 @@ let
3436
src = fetchFromGitHub {
3537
owner = "risc0";
3638
repo = "risc0";
37-
rev = "3e042891fbad365fb1db7b17bd4afbb5e6fea99e";
38-
hash = "sha256-wX8d44eGq1VxWMAduqPs8IMRMhcKcLuKKFhnRSQZeBc=";
39+
rev = "f84f52be2b948ad121112329ab08e1722f839ebf";
40+
hash = "sha256-8L35VByENIEC/su3lVTDo4Gnec7b6l68S86FLkHS2uU=";
3941
};
4042
};
4143

42-
rust-toolchain = risc0-rust;
44+
rust-toolchain = rust-bin.fromRustupToolchainFile(fetchGitHubFile {
45+
inherit (commonArgs.src) owner repo rev;
46+
file = "rust-toolchain.toml";
47+
hash = "sha256-n7Jr8rkovVQ98/KNvSg9EG9JZmKWD7DTaXTbpDJKA0Q=";
48+
});
4349
craneLib = craneLib-nightly.overrideToolchain rust-toolchain;
4450
cargoArtifacts = craneLib.buildDepsOnly commonArgs;
4551
in
@@ -52,8 +58,7 @@ craneLib.buildPackage (
5258
postPatch = ''
5359
# Replace usages of `Command::new("rustup")` with the correct value
5460
# which should be used
55-
sed -i '82,89d;90ilet path_raw = Some("${rust-toolchain}");' risc0/cargo-risczero/src/toolchain.rs
56-
sed -i '410,417d;663,681d;418ilet rustc = "${rust-toolchain}/bin/rustc";' risc0/build/src/lib.rs
61+
sed -i '27d;28iPathBuf::from(r"${risc0-rust}")' rzup/src/paths.rs
5762
# Fix starter template
5863
sed -i 's|{{ risc0_build }}|path = "'$out'"|' risc0/cargo-risczero/templates/rust-starter/methods/Cargo-toml
5964
sed -i 's|{{ risc0_zkvm }}|path = "'$out'"|' risc0/cargo-risczero/templates/rust-starter/host/Cargo-toml

0 commit comments

Comments
 (0)