1
1
forked from extern/flakelight

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.
This commit is contained in:
Archit Gupta 2024-01-14 23:52:48 -08:00
parent 589ee5ba7a
commit 11e65b623d

View File

@ -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