about summary refs log tree commit diff
diff options
context:
space:
mode:
authorsterni <sternenseemann@systemli.org>2021-09-15T11·25+0200
committersterni <sternenseemann@systemli.org>2021-09-15T22·35+0000
commitd904724adf6650747d79b80426432f59620ec175 (patch)
treed4cd92971e5de5d2b88587a7e883fd553e6e63cb
parent7894d7e178ac542f2542b71b10cb34e99080acd7 (diff)
refactor(rust-crates-advisory): check type instead of blacklisting r/2868
`our-crates` can just check if the attributes in question are
derivation (i. e. have an `outPath`) instead of blacklisting the
`__readTree` attribute specifically.

Change-Id: I472692e89c0e9eff551372c72a73ab765b0b6599
-rw-r--r--tools/rust-crates-advisory/default.nix5
1 files changed, 2 insertions, 3 deletions
diff --git a/tools/rust-crates-advisory/default.nix b/tools/rust-crates-advisory/default.nix
index d9b87839044b..1a26a523b22c 100644
--- a/tools/rust-crates-advisory/default.nix
+++ b/tools/rust-crates-advisory/default.nix
@@ -15,9 +15,8 @@ let
     sha256 = "0v086ybwr71zgs5nv8yr4w2w2d4daxx6in2s1sjb4m41q1r9p0wj";
   }}/crates";
 
-  our-crates = lib.mapAttrsToList (_: lib.id)
-    # this is a bit eh, but no idea how to avoid the readTree thing otherwise
-    (builtins.removeAttrs depot.third_party.rust-crates [ "__readTree" ]);
+  our-crates = lib.filter (v: v ? outPath)
+    (builtins.attrValues depot.third_party.rust-crates);
 
   check-security-advisory = depot.nix.writers.rustSimple {
     name = "parse-security-advisory";