···3737 inherit name;
3838 value = let
3939 defaultValue = mash.${name};
4040- buildValue = buildPkgs.${name};
4141- runValue = runPkgs.${name};
4040+ # `or {}` is for the non-derivation attsert splicing case, where `{}` is the identity.
4141+ buildValue = buildPkgs.${name} or {};
4242+ runValue = runPkgs.${name} or {};
4243 augmentedValue = defaultValue
4344 // (lib.optionalAttrs (buildPkgs ? ${name}) { nativeDrv = buildValue; })
4445 // (lib.optionalAttrs (runPkgs ? ${name}) { crossDrv = runValue; });
4545- # Get the set of outputs of a derivation
4646+ # Get the set of outputs of a derivation. If one derivation fails to
4747+ # evaluate we don't want to diverge the entire splice, so we fall back
4848+ # on {}
4649 tryGetOutputs = value0: let
4747- eval = builtins.tryEval value0;
4848- in getOutputs (if eval.success then eval.value else {});
5050+ inherit (builtins.tryEval value0) success value;
5151+ in getOutputs (lib.optionalAttrs success value);
4952 getOutputs = value: lib.genAttrs
5053 (value.outputs or (lib.optional (value ? out) "out"))
5154 (output: value.${output});
5255 in
5353- # Certain *Cross derivations will fail assertions, but we need their
5454- # nativeDrv. We are assuming anything that fails to evaluate is an
5555- # attrset (including derivation) and thus can be unioned.
5656- if !(builtins.tryEval defaultValue).success then augmentedValue
5756 # The derivation along with its outputs, which we recur
5857 # on to splice them together.
5959- else if lib.isDerivation defaultValue then augmentedValue
5858+ if lib.isDerivation defaultValue then augmentedValue
6059 // splicer (tryGetOutputs buildValue) (getOutputs runValue)
6160 # Just recur on plain attrsets
6261 else if lib.isAttrs defaultValue then splicer buildValue runValue