angelfish: Break build on partial updates

The hardcoded cargo hash could have been left unchanged on package
updates. By breaking the build explicitly we ensure partial updates
won't accidentally slip past us.

+14 -1
+14 -1
pkgs/applications/plasma-mobile/angelfish.nix
··· 17 , qtwebengine 18 , rustPlatform 19 , srcs 20 }: 21 22 mkDerivation rec { 23 pname = "angelfish"; 24 25 cargoDeps = rustPlatform.fetchCargoTarball { 26 src = srcs.angelfish.src; 27 name = "${pname}-${srcs.angelfish.version}"; 28 - sha256 = "1pbvw9hdzn3i97mahdy9y6jnjsmwmjs3lxfz7q6r9r10i8swbkak"; 29 }; 30 31 nativeBuildInputs = [
··· 17 , qtwebengine 18 , rustPlatform 19 , srcs 20 + 21 + # These must be updated in tandem with package updates. 22 + , cargoShaForVersion ? "21.08" 23 + , cargoSha256 ? "1pbvw9hdzn3i97mahdy9y6jnjsmwmjs3lxfz7q6r9r10i8swbkak" 24 }: 25 26 + # Guard against incomplete updates. 27 + # Values are provided as callPackage inputs to enable easier overrides through overlays. 28 + if cargoShaForVersion != srcs.angelfish.version 29 + then builtins.throw '' 30 + angelfish package update is incomplete. 31 + Hash for cargo dependencies is declared for version ${cargoShaForVersion}, but we're building ${srcs.angelfish.version}. 32 + Update the cargoSha256 and cargoShaForVersion for angelfish. 33 + '' else 34 + 35 mkDerivation rec { 36 pname = "angelfish"; 37 38 cargoDeps = rustPlatform.fetchCargoTarball { 39 src = srcs.angelfish.src; 40 name = "${pname}-${srcs.angelfish.version}"; 41 + sha256 = cargoSha256; 42 }; 43 44 nativeBuildInputs = [