From 473ac9692e09451ef6025e50ccfa19efe5ae69a9 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sun, 29 Jan 2023 23:39:27 +0100 Subject: [PATCH] lib.hydraJob: Tolerate null By allowing null, we allow code to avoid filterAttrs, improving laziness in real world use cases. Specifically, this strategy prevents infinite recursion errors, performance issues and possibly other errors that are unrelated to the user's code. --- lib/customisation.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/customisation.nix b/lib/customisation.nix index 101c9e62b9e6..42d711cf5fb9 100644 --- a/lib/customisation.nix +++ b/lib/customisation.nix @@ -252,7 +252,8 @@ rec { outputsList = map makeOutput outputs; drv' = (lib.head outputsList).value; - in lib.deepSeq drv' drv'; + in if drv == null then null else + lib.deepSeq drv' drv'; /* Make a set of packages with a common scope. All packages called with the provided `callPackage` will be evaluated with the same