haskell.compiler.{ghc98*,ghcHEAD}: bootstrap using source built 9.6

Unfortunately, we are running into trouble linking dependencies of
hadrian against the libraries of the clock package with 9.6.3 and
9.6.4 _bindists_. My current suspiscion is that this is caused by
some kind of discrepancy between the toolchain used by GHC upstream
and us that persists from the configure step used when building the
bindist. The problem seems to be somewhat localized to hsc2hs (hence
clock is an issue), with GHC 9.6.4 bindists even passing a flag to
ld that is not supported by our version of cctools.

The problem is not fully diagnosed, so take the speculation above
with a grain of salt.

As a workaround, we can use the source built GHC 9.6 which is, of
course, configured with our toolchain in the environment.

+24
+3
pkgs/development/compilers/ghc/9.6.3-binary.nix
··· 403 # `pkgsMusl`. 404 platforms = builtins.attrNames ghcBinDists.${distSetName}; 405 maintainers = lib.teams.haskell.members; 406 }; 407 }
··· 403 # `pkgsMusl`. 404 platforms = builtins.attrNames ghcBinDists.${distSetName}; 405 maintainers = lib.teams.haskell.members; 406 + # packages involving hsc2hs (clock) produce libraries our 407 + # ld can't link against 408 + broken = stdenv.hostPlatform.isDarwin; 409 }; 410 }
+21
pkgs/top-level/haskell-packages.nix
··· 298 packages.ghc963 299 else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then 300 packages.ghc963 301 else 302 packages.ghc963Binary; 303 inherit (buildPackages.python3Packages) sphinx; ··· 316 packages.ghc963 317 else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then 318 packages.ghc963 319 else 320 packages.ghc963Binary; 321 inherit (buildPackages.python3Packages) sphinx; ··· 334 if stdenv.hostPlatform.isAarch32 then 335 packages.ghc963 336 else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then 337 packages.ghc963 338 else 339 packages.ghc963Binary;
··· 298 packages.ghc963 299 else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then 300 packages.ghc963 301 + else if stdenv.hostPlatform.isDarwin then 302 + # it seems like the GHC 9.6.* bindists are built with a different 303 + # toolchain than we are using (which I'm guessing from the fact 304 + # that 9.6.4 bindists pass linker flags our ld doesn't support). 305 + # With both 9.6.3 and 9.6.4 binary it is impossible to link against 306 + # the clock package (probably a hsc2hs problem). 307 + packages.ghc963 308 else 309 packages.ghc963Binary; 310 inherit (buildPackages.python3Packages) sphinx; ··· 323 packages.ghc963 324 else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then 325 packages.ghc963 326 + else if stdenv.hostPlatform.isDarwin then 327 + # it seems like the GHC 9.6.* bindists are built with a different 328 + # toolchain than we are using (which I'm guessing from the fact 329 + # that 9.6.4 bindists pass linker flags our ld doesn't support). 330 + # With both 9.6.3 and 9.6.4 binary it is impossible to link against 331 + # the clock package (probably a hsc2hs problem). 332 + packages.ghc963 333 else 334 packages.ghc963Binary; 335 inherit (buildPackages.python3Packages) sphinx; ··· 348 if stdenv.hostPlatform.isAarch32 then 349 packages.ghc963 350 else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then 351 + packages.ghc963 352 + else if stdenv.hostPlatform.isDarwin then 353 + # it seems like the GHC 9.6.* bindists are built with a different 354 + # toolchain than we are using (which I'm guessing from the fact 355 + # that 9.6.4 bindists pass linker flags our ld doesn't support). 356 + # With both 9.6.3 and 9.6.4 binary it is impossible to link against 357 + # the clock package (probably a hsc2hs problem). 358 packages.ghc963 359 else 360 packages.ghc963Binary;