Unverified Commit 539624fb authored by Jörg Thalheim's avatar Jörg Thalheim Committed by GitHub
Browse files

splice: defer per-output spliceReal recursion behind genAttrs (#508944)

parents 9f1820cc 363ae292
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -52,12 +52,15 @@ let
            getOutputs (lib.optionalAttrs success value);
          getOutputs =
            value: lib.genAttrs (value.outputs or (lib.optional (value ? out) "out")) (output: value.${output});
          outputNames = defaultValue.outputs or (lib.optional (defaultValue ? out) "out");
          outputSplice = spliceReal (
            mapCrossIndex tryGetOutputs value' // { hostTarget = getOutputs value'.hostTarget; }
          );
        in
        # The derivation along with its outputs, which we recur
        # on to splice them together.
        if lib.isDerivation defaultValue then
          augmentedValue
          // spliceReal (mapCrossIndex tryGetOutputs value' // { hostTarget = getOutputs value'.hostTarget; })
          augmentedValue // lib.genAttrs outputNames (out: outputSplice.${out})
        else if lib.isAttrs defaultValue then
          spliceReal value'
        else