doc/haskell: don't use lib.recursiveUpdate in overlays

`lib.recursiveUpdate` indiscriminately recurses into all attribute sets,
also into derivations. This means that it is possible that evaluating a
derivation in the final haskell package set can cause something in
`prev.haskell` to be forced by `recursiveUpdate`, potentially causing an
evaluation error that should not happen.

It can be fixed using a well-crafted predicate for
`lib.recursiveUpdateUntil`, but most robust is just explicitly writing
out the desired merging manually.

+30 -26
+30 -26
doc/languages-frameworks/haskell.section.md
··· 1229 in 1230 1231 { 1232 - haskell = lib.recursiveUpdate prev.haskell { 1233 - compiler.${ghcName} = prev.haskell.compiler.${ghcName}.override { 1234 - # Unfortunately, the GHC setting is named differently for historical reasons 1235 - enableProfiledLibs = enableProfiling; 1236 }; 1237 }; 1238 }) ··· 1244 in 1245 1246 { 1247 - haskell = lib.recursiveUpdate prev.haskell { 1248 - packages.${ghcName} = prev.haskell.packages.${ghcName}.override { 1249 - overrides = hfinal: hprev: { 1250 - mkDerivation = args: hprev.mkDerivation (args // { 1251 - # Since we are forcing our ideas upon mkDerivation, this change will 1252 - # affect every package in the package set. 1253 - enableLibraryProfiling = enableProfiling; 1254 1255 - # To actually use profiling on an executable, executable profiling 1256 - # needs to be enabled for the executable you want to profile. You 1257 - # can either do this globally or… 1258 - enableExecutableProfiling = enableProfiling; 1259 - }); 1260 1261 - # …only for the package that contains an executable you want to profile. 1262 - # That saves on unnecessary rebuilds for packages that you only depend 1263 - # on for their library, but also contain executables (e.g. pandoc). 1264 - my-executable = haskellLib.enableExecutableProfiling hprev.my-executable; 1265 1266 - # If you are disabling profiling to save on build time, but want to 1267 - # retain the ability to substitute from the binary cache. Drop the 1268 - # override for mkDerivation above and instead have an override like 1269 - # this for the specific packages you are building locally and want 1270 - # to make cheaper to build. 1271 - my-library = haskellLib.disableLibraryProfiling hprev.my-library; 1272 }; 1273 }; 1274 };
··· 1229 in 1230 1231 { 1232 + haskell = prev.haskell // { 1233 + compiler = prev.haskell.compiler // { 1234 + ${ghcName} = prev.haskell.compiler.${ghcName}.override { 1235 + # Unfortunately, the GHC setting is named differently for historical reasons 1236 + enableProfiledLibs = enableProfiling; 1237 + }; 1238 }; 1239 }; 1240 }) ··· 1246 in 1247 1248 { 1249 + haskell = prev.haskell // { 1250 + packages = prev.haskell.packages // { 1251 + ${ghcName} = prev.haskell.packages.${ghcName}.override { 1252 + overrides = hfinal: hprev: { 1253 + mkDerivation = args: hprev.mkDerivation (args // { 1254 + # Since we are forcing our ideas upon mkDerivation, this change will 1255 + # affect every package in the package set. 1256 + enableLibraryProfiling = enableProfiling; 1257 1258 + # To actually use profiling on an executable, executable profiling 1259 + # needs to be enabled for the executable you want to profile. You 1260 + # can either do this globally or… 1261 + enableExecutableProfiling = enableProfiling; 1262 + }); 1263 1264 + # …only for the package that contains an executable you want to profile. 1265 + # That saves on unnecessary rebuilds for packages that you only depend 1266 + # on for their library, but also contain executables (e.g. pandoc). 1267 + my-executable = haskellLib.enableExecutableProfiling hprev.my-executable; 1268 1269 + # If you are disabling profiling to save on build time, but want to 1270 + # retain the ability to substitute from the binary cache. Drop the 1271 + # override for mkDerivation above and instead have an override like 1272 + # this for the specific packages you are building locally and want 1273 + # to make cheaper to build. 1274 + my-library = haskellLib.disableLibraryProfiling hprev.my-library; 1275 + }; 1276 }; 1277 }; 1278 };