From 11e65b623dcd057ed1a6bee25e2f3a384c15e47f Mon Sep 17 00:00:00 2001 From: Archit Gupta Date: Sun, 14 Jan 2024 23:52:48 -0800 Subject: [PATCH] Fix evaluation of packages.default not using mkDerivation The mock pkgs set passed `{}` as the value for unknown args; if a package def tried to evaluate one, this can raise an error that can't be caught. Replacing the default value with `throw ""` enables bailing out if one of the fake args is accessed. --- misc/nameMockedPkgs.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/nameMockedPkgs.nix b/misc/nameMockedPkgs.nix index d4d8d61..ddfcf21 100644 --- a/misc/nameMockedPkgs.nix +++ b/misc/nameMockedPkgs.nix @@ -12,7 +12,7 @@ let let f = if lib.isFunction fn then fn else import fn; fargs = lib.functionArgs f; - mock = lib.mapAttrs (_: _: { }) (lib.filterAttrs (_: v: !v) fargs); + mock = lib.mapAttrs (_: _: throw "") (lib.filterAttrs (_: v: !v) fargs); in f (mock // builtins.intersectAttrs fargs autoArgs // args); in