diff options
author | nicoo <nicoo@mur.at> | 2023-09-14 17:30:52 +0000 |
---|---|---|
committer | nicoo <nicoo@mur.at> | 2023-10-25 23:14:16 +0000 |
commit | 1cabb1c445f8d535f66fa949362b973832f2ea2f (patch) | |
tree | 015fc461b5d5e0ae60d026bee31a46986da63a7b /pkgs | |
parent | 87c22100a6892b864ff94476f2965a793d8e4282 (diff) |
tests/stdenv: Check derivations with an MD5 `outputHash` fail to evaluate
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/test/stdenv/default.nix | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/pkgs/test/stdenv/default.nix b/pkgs/test/stdenv/default.nix index 0fa87cccc2199..3882eb2b625c5 100644 --- a/pkgs/test/stdenv/default.nix +++ b/pkgs/test/stdenv/default.nix @@ -142,6 +142,15 @@ in ''; }; + # Check that mkDerivation rejects MD5 hashes + rejectedHashes = lib.recurseIntoAttrs { + md5 = + let drv = runCommand "md5 outputHash rejected" { + outputHash = "md5-fPt7dxVVP7ffY3MxkQdwVw=="; + } "true"; + in assert !(builtins.tryEval drv).success; {}; + }; + test-inputDerivation = let inherit (stdenv.mkDerivation { dep1 = derivation { name = "dep1"; builder = "/bin/sh"; args = [ "-c" ": > $out" ]; system = builtins.currentSystem; }; |