git.iko.soy/typeable/nixpkgs
on master help sign in
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.

commit88fe1fe9ec34a05bc262fb5b30dd1b77dd88ac0b authorSamuel Dionne-Riel <samuel@dionne-riel.com> dateMon 18 Oct 2021, 16:23 (5 years ago) parent74134f7
1 file changed+14−1
pkgs/applications/plasma-mobile/angelfish.nix+14−1
pkgs/applications/plasma-mobile/angelfish.nix+14−1
@@ -17,15 +17,28 @@
1717, qtwebengine
1818, rustPlatform
1919, srcs
20+
21+# These must be updated in tandem with package updates.
22+, cargoShaForVersion ? "21.08"
23+, cargoSha256 ? "1pbvw9hdzn3i97mahdy9y6jnjsmwmjs3lxfz7q6r9r10i8swbkak"
2024}:
2125
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+
2235mkDerivation rec {
2336 pname = "angelfish";
2437
2538 cargoDeps = rustPlatform.fetchCargoTarball {
2639 src = srcs.angelfish.src;
2740 name = "${pname}-${srcs.angelfish.version}";
28− sha256 = "1pbvw9hdzn3i97mahdy9y6jnjsmwmjs3lxfz7q6r9r10i8swbkak";
41+ sha256 = cargoSha256;
2942 };
3043
3144 nativeBuildInputs = [