chore: simplify zerokit cargoHash fix (#3899)

Replacing the whole package is unnecessary. Just hash can be fixed.

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2026-05-21 22:46:10 +02:00 committed by GitHub
parent 29a77dcf4d
commit 5ff734aa56
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -74,35 +74,14 @@
let
pkgs = pkgsFor system;
# zerokit's nix/default.nix hardcodes a cargoHash that is stale for
# our pinned nixpkgs on a cold runner (the status.im substituter is
# untrusted here, so the cargo-vendor FOD is recomputed). v2.0.2 did
# NOT fix this for consumers — its committed hash is the old v2.0.1
# value while v2.0.2's Cargo.lock changed. Rebuild librln here from
# the pinned zerokit source with the correct cargoHash. Keep the
# version + cargoHash in sync with the zerokit input rev.
rustToolchain = pkgs.rust-bin.stable.latest.default;
zerokitRln = pkgs.rustPlatform.buildRustPackage {
pname = "zerokit";
version = "2.0.2";
src = zerokit;
cargo = rustToolchain;
rustc = rustToolchain;
cargoHash = "sha256-PNwEdZLgGQPqQDrEK2hsQtSybVfBbD6xn4K47fPFJUU=";
nativeBuildInputs = [ pkgs.rust-cbindgen ];
doCheck = false;
buildPhase = ''
export CARGO_HOME=$TMPDIR/cargo
cargo build --lib --release --manifest-path rln/Cargo.toml
'';
installPhase = ''
set -eu
mkdir -p $out/lib $out/include
find target -type f -name 'librln.*' -not -path '*/deps/*' \
-exec cp -v '{}' "$out/lib/" \;
cbindgen ./rln -l c > "$out/include/rln.h"
'';
};
# HACK: Fix for stale cargoHash in 2.0.2 release.
zerokitRln = zerokit.packages.${system}.rln.overrideAttrs (old: {
cargoDeps = old.cargoDeps.overrideAttrs (oldCargoDeps: {
vendorStaging = oldCargoDeps.vendorStaging.overrideAttrs (_: {
outputHash = "sha256-PNwEdZLgGQPqQDrEK2hsQtSybVfBbD6xn4K47fPFJUU=";
});
});
});
liblogosdelivery = pkgs.callPackage ./nix/default.nix {
inherit pkgs;