From 7a32b49687a699fe10b54fa977b486345d1b4464 Mon Sep 17 00:00:00 2001 From: wxt <3264117476@qq.com> Date: Wed, 6 Nov 2024 12:29:44 +0800 Subject: [PATCH 1/4] cargo-risczero: move to by-name --- .../default.nix => by-name/ca/cargo-risczero/package.nix} | 0 pkgs/top-level/all-packages.nix | 1 - 2 files changed, 1 deletion(-) rename pkgs/{development/tools/rust/cargo-risczero/default.nix => by-name/ca/cargo-risczero/package.nix} (100%) diff --git a/pkgs/development/tools/rust/cargo-risczero/default.nix b/pkgs/by-name/ca/cargo-risczero/package.nix similarity index 100% rename from pkgs/development/tools/rust/cargo-risczero/default.nix rename to pkgs/by-name/ca/cargo-risczero/package.nix diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1ff8d00276752..85b85f03f56fa 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -15471,7 +15471,6 @@ with pkgs; inherit (darwin.apple_sdk.frameworks) Security; }; cargo-readme = callPackage ../development/tools/rust/cargo-readme { }; - cargo-risczero = callPackage ../development/tools/rust/cargo-risczero { }; cargo-run-bin = callPackage ../development/tools/rust/cargo-run-bin {}; cargo-semver-checks = callPackage ../development/tools/rust/cargo-semver-checks { }; From 8d9209e6d7ccbb37458a5304a8e840c18c445f04 Mon Sep 17 00:00:00 2001 From: wxt <3264117476@qq.com> Date: Wed, 6 Nov 2024 12:30:49 +0800 Subject: [PATCH 2/4] cargo-risczero: nixfmt --- pkgs/by-name/ca/cargo-risczero/package.nix | 27 ++++++++++++---------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/pkgs/by-name/ca/cargo-risczero/package.nix b/pkgs/by-name/ca/cargo-risczero/package.nix index bf61c32cf7782..b453cff8fc5e0 100644 --- a/pkgs/by-name/ca/cargo-risczero/package.nix +++ b/pkgs/by-name/ca/cargo-risczero/package.nix @@ -1,10 +1,11 @@ -{ lib -, stdenv -, fetchCrate -, rustPlatform -, pkg-config -, openssl -, darwin +{ + lib, + stdenv, + fetchCrate, + rustPlatform, + pkg-config, + openssl, + darwin, }: rustPlatform.buildRustPackage rec { @@ -22,11 +23,13 @@ rustPlatform.buildRustPackage rec { pkg-config ]; - buildInputs = [ - openssl - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ - darwin.apple_sdk.frameworks.Security - ]; + buildInputs = + [ + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + darwin.apple_sdk.frameworks.Security + ]; # The tests require network access which is not available in sandboxed Nix builds. doCheck = false; From 37261f87d59c63db0aef819773bf0e229d79e0b9 Mon Sep 17 00:00:00 2001 From: wxt <3264117476@qq.com> Date: Wed, 6 Nov 2024 12:32:10 +0800 Subject: [PATCH 3/4] cargo-risczero: add passthru.updateScript --- pkgs/by-name/ca/cargo-risczero/package.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/ca/cargo-risczero/package.nix b/pkgs/by-name/ca/cargo-risczero/package.nix index b453cff8fc5e0..522db664d61cd 100644 --- a/pkgs/by-name/ca/cargo-risczero/package.nix +++ b/pkgs/by-name/ca/cargo-risczero/package.nix @@ -6,6 +6,7 @@ pkg-config, openssl, darwin, + nix-update-script, }: rustPlatform.buildRustPackage rec { @@ -34,11 +35,13 @@ rustPlatform.buildRustPackage rec { # The tests require network access which is not available in sandboxed Nix builds. doCheck = false; - meta = with lib; { + passthru.updateScript = nix-update-script { }; + + meta = { description = "Cargo extension to help create, manage, and test RISC Zero projects"; mainProgram = "cargo-risczero"; homepage = "https://risczero.com"; - license = with licenses; [ asl20 ]; - maintainers = with maintainers; [ cameronfyfe ]; + license = with lib.licenses; [ asl20 ]; + maintainers = with lib.maintainers; [ cameronfyfe ]; }; } From 20a0bfb3aefdefc6dd06cbd3d1f0daa3dca053a5 Mon Sep 17 00:00:00 2001 From: wxt <3264117476@qq.com> Date: Wed, 6 Nov 2024 12:45:45 +0800 Subject: [PATCH 4/4] cargo-risczero: 0.17.0 -> 1.1.2 --- pkgs/by-name/ca/cargo-risczero/package.nix | 29 ++++++++++++++-------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/pkgs/by-name/ca/cargo-risczero/package.nix b/pkgs/by-name/ca/cargo-risczero/package.nix index 522db664d61cd..38f4d6c5d4fca 100644 --- a/pkgs/by-name/ca/cargo-risczero/package.nix +++ b/pkgs/by-name/ca/cargo-risczero/package.nix @@ -2,35 +2,42 @@ lib, stdenv, fetchCrate, + fetchurl, rustPlatform, pkg-config, openssl, - darwin, nix-update-script, }: rustPlatform.buildRustPackage rec { pname = "cargo-risczero"; - version = "0.17.0"; + version = "1.1.2"; src = fetchCrate { inherit pname version; - hash = "sha256-UXCZ4l45zcyn2AnfDW6dNdEnXCWL2waNwDTbermgS6M="; + hash = "sha256-YZ3yhj1VLxl3Fg/yWhqrZXxIQ7oK6Gdo0NU39oDvoo8="; }; - cargoHash = "sha256-KkV+ZQAPegbeZKj3ixDSFQEyKwkKeMYceSc27xGtQms="; + src-recursion-hash = "28e4eeff7a8f73d27408d99a1e3e8842c79a5f4353e5117ec0b7ffaa7c193612"; # That is from cargoDeps/risc0-circuit-recursion/build.rs + + src-recursion = fetchurl { + url = "https://risc0-artifacts.s3.us-west-2.amazonaws.com/zkr/${src-recursion-hash}.zip"; + hash = "sha256-KOTu/3qPc9J0CNmaHj6IQseaX0NT5RF+wLf/qnwZNhI="; # This hash should be the same as src-recuresion-hash + }; + + env = { + RECURSION_SRC_PATH = src-recursion; + }; + + cargoHash = "sha256-pNgnUtKn2w5rWbgDi0MHZCm9nYPgESL3g7EMaYwoSq4="; nativeBuildInputs = [ pkg-config ]; - buildInputs = - [ - openssl - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - darwin.apple_sdk.frameworks.Security - ]; + buildInputs = [ + openssl + ]; # The tests require network access which is not available in sandboxed Nix builds. doCheck = false;