Skip to content

Commit

Permalink
haskell.compiler.ghc*: use GHC from pkgsBuildBuild
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandreTunstall committed Jul 23, 2023
1 parent 9865993 commit 40f2e8f
Showing 1 changed file with 58 additions and 57 deletions.
115 changes: 58 additions & 57 deletions pkgs/top-level/haskell-packages.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ buildPackages, pkgsBuildTarget, pkgs, newScope, stdenv }:
{ buildPackages, pkgsBuildBuild, pkgsBuildTarget, pkgs, newScope, stdenv }:

let
# These are attributes in compiler and packages that don't support integer-simple.
Expand Down Expand Up @@ -77,7 +77,8 @@ in {

package-list = callPackage ../development/haskell-modules/package-list.nix {};

compiler = {
# Always get boot compilers from `pkgsBuildBuild`
compiler = let bb = pkgsBuildBuild.haskell; in {
ghc865Binary = callPackage ../development/compilers/ghc/8.6.5-binary.nix {
llvmPackages = pkgs.llvmPackages_6;
};
Expand All @@ -99,10 +100,10 @@ in {
# aarch64 ghc865Binary gets SEGVs due to haskell#15449 or similar
# 8.10.2 is needed as using 8.10.7 is broken due to RTS-incompatibilities
# Musl bindists do not exist for ghc 8.6.5, so we use 8.10.* for them
if stdenv.hostPlatform.isAarch64 || stdenv.hostPlatform.isMusl then
packages.ghc8102Binary
if stdenv.buildPlatform.isAarch64 || stdenv.buildPlatform.isMusl then
bb.packages.ghc8102Binary
else
packages.ghc865Binary;
bb.packages.ghc865Binary;
inherit (buildPackages.python3Packages) sphinx;
buildTargetLlvmPackages = pkgsBuildTarget.llvmPackages_7;
llvmPackages = pkgs.llvmPackages_7;
Expand All @@ -111,11 +112,11 @@ in {
ghc8107 = callPackage ../development/compilers/ghc/8.10.7.nix {
bootPkgs =
# the oldest ghc with aarch64-darwin support is 8.10.5
if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
if stdenv.buildPlatform.isPower64 && stdenv.buildPlatform.isLittleEndian then
# to my (@a-m-joseph) knowledge there are no newer official binaries for this platform
packages.ghc865Binary
bb.packages.ghc865Binary
else
packages.ghc8107Binary;
bb.packages.ghc8107Binary;
inherit (buildPackages.python3Packages) sphinx;
# Need to use apple's patched xattr until
# https://github.com/xattr/xattr/issues/44 and
Expand All @@ -128,10 +129,10 @@ in {
ghc902 = callPackage ../development/compilers/ghc/9.0.2.nix {
bootPkgs =
# the oldest ghc with aarch64-darwin support is 8.10.5
if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
packages.ghc810
if stdenv.buildPlatform.isPower64 && stdenv.buildPlatform.isLittleEndian then
bb.packages.ghc810
else
packages.ghc8107Binary;
bb.packages.ghc8107Binary;
inherit (buildPackages.python3Packages) sphinx;
inherit (buildPackages.darwin) autoSignDarwinBinariesHook xattr;
buildTargetLlvmPackages = pkgsBuildTarget.llvmPackages_12;
Expand All @@ -140,10 +141,10 @@ in {
ghc90 = compiler.ghc902;
ghc924 = callPackage ../development/compilers/ghc/9.2.4.nix {
bootPkgs =
if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
packages.ghc810
if stdenv.buildPlatform.isPower64 && stdenv.buildPlatform.isLittleEndian then
bb.packages.ghc810
else
packages.ghc8107Binary;
bb.packages.ghc8107Binary;
inherit (buildPackages.python3Packages) sphinx;
# Need to use apple's patched xattr until
# https://github.com/xattr/xattr/issues/44 and
Expand All @@ -154,10 +155,10 @@ in {
};
ghc925 = callPackage ../development/compilers/ghc/9.2.5.nix {
bootPkgs =
if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
packages.ghc810
if stdenv.buildPlatform.isPower64 && stdenv.buildPlatform.isLittleEndian then
bb.packages.ghc810
else
packages.ghc8107Binary;
bb.packages.ghc8107Binary;
inherit (buildPackages.python3Packages) sphinx;
# Need to use apple's patched xattr until
# https://github.com/xattr/xattr/issues/44 and
Expand All @@ -168,10 +169,10 @@ in {
};
ghc926 = callPackage ../development/compilers/ghc/9.2.6.nix {
bootPkgs =
if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
packages.ghc810
if stdenv.buildPlatform.isPower64 && stdenv.buildPlatform.isLittleEndian then
bb.packages.ghc810
else
packages.ghc8107Binary;
bb.packages.ghc8107Binary;
inherit (buildPackages.python3Packages) sphinx;
# Need to use apple's patched xattr until
# https://github.com/xattr/xattr/issues/44 and
Expand All @@ -182,10 +183,10 @@ in {
};
ghc927 = callPackage ../development/compilers/ghc/9.2.7.nix {
bootPkgs =
if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
packages.ghc810
if stdenv.buildPlatform.isPower64 && stdenv.buildPlatform.isLittleEndian then
bb.packages.ghc810
else
packages.ghc8107Binary;
bb.packages.ghc8107Binary;
inherit (buildPackages.python3Packages) sphinx;
# Need to use apple's patched xattr until
# https://github.com/xattr/xattr/issues/44 and
Expand All @@ -196,10 +197,10 @@ in {
};
ghc928 = callPackage ../development/compilers/ghc/9.2.8.nix {
bootPkgs =
if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
packages.ghc810
if stdenv.buildPlatform.isPower64 && stdenv.buildPlatform.isLittleEndian then
bb.packages.ghc810
else
packages.ghc8107Binary;
bb.packages.ghc8107Binary;
inherit (buildPackages.python3Packages) sphinx;
# Need to use apple's patched xattr until
# https://github.com/xattr/xattr/issues/44 and
Expand All @@ -216,14 +217,14 @@ in {
# Use 8.10 as a workaround where possible to keep bootstrap path short.

# On ARM text won't build with GHC 8.10.*
if stdenv.hostPlatform.isAarch then
if stdenv.buildPlatform.isAarch then
# TODO(@sternenseemann): package bindist
packages.ghc902
bb.packages.ghc902
# No suitable bindists for powerpc64le
else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
packages.ghc902
else if stdenv.buildPlatform.isPower64 && stdenv.buildPlatform.isLittleEndian then
bb.packages.ghc902
else
packages.ghc8107Binary;
bb.packages.ghc8107Binary;
inherit (buildPackages.python3Packages) sphinx;
# Need to use apple's patched xattr until
# https://github.com/xattr/xattr/issues/44 and
Expand All @@ -240,14 +241,14 @@ in {
# Use 8.10 as a workaround where possible to keep bootstrap path short.

# On ARM text won't build with GHC 8.10.*
if stdenv.hostPlatform.isAarch then
if stdenv.buildPlatform.isAarch then
# TODO(@sternenseemann): package bindist
packages.ghc902
bb.packages.ghc902
# No suitable bindists for powerpc64le
else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
packages.ghc902
else if stdenv.buildPlatform.isPower64 && stdenv.buildPlatform.isLittleEndian then
bb.packages.ghc902
else
packages.ghc8107Binary;
bb.packages.ghc8107Binary;
inherit (buildPackages.python3Packages) sphinx;
# Need to use apple's patched xattr until
# https://github.com/xattr/xattr/issues/44 and
Expand All @@ -264,14 +265,14 @@ in {
# Use 8.10 as a workaround where possible to keep bootstrap path short.

# On ARM text won't build with GHC 8.10.*
if stdenv.hostPlatform.isAarch then
if stdenv.buildPlatform.isAarch then
# TODO(@sternenseemann): package bindist
packages.ghc902
bb.packages.ghc902
# No suitable bindists for powerpc64le
else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
packages.ghc902
else if stdenv.buildPlatform.isPower64 && stdenv.buildPlatform.isLittleEndian then
bb.packages.ghc902
else
packages.ghc8107Binary;
bb.packages.ghc8107Binary;
inherit (buildPackages.python3Packages) sphinx;
# Need to use apple's patched xattr until
# https://github.com/xattr/xattr/issues/44 and
Expand All @@ -288,14 +289,14 @@ in {
# Use 8.10 as a workaround where possible to keep bootstrap path short.

# On ARM text won't build with GHC 8.10.*
if stdenv.hostPlatform.isAarch then
if stdenv.buildPlatform.isAarch then
# TODO(@sternenseemann): package bindist
packages.ghc902
bb.packages.ghc902
# No suitable bindists for powerpc64le
else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
packages.ghc902
else if stdenv.buildPlatform.isPower64 && stdenv.buildPlatform.isLittleEndian then
bb.packages.ghc902
else
packages.ghc8107Binary;
bb.packages.ghc8107Binary;
inherit (buildPackages.python3Packages) sphinx;
# Need to use apple's patched xattr until
# https://github.com/xattr/xattr/issues/44 and
Expand All @@ -309,12 +310,12 @@ in {
ghc962 = callPackage ../development/compilers/ghc/9.6.2.nix {
bootPkgs =
# For GHC 9.2 no armv7l bindists are available.
if stdenv.hostPlatform.isAarch32 then
packages.ghc924
else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
packages.ghc924
if stdenv.buildPlatform.isAarch32 then
bb.packages.ghc924
else if stdenv.buildPlatform.isPower64 && stdenv.buildPlatform.isLittleEndian then
bb.packages.ghc924
else
packages.ghc924Binary;
bb.packages.ghc924Binary;
inherit (buildPackages.python3Packages) sphinx;
# Need to use apple's patched xattr until
# https://github.com/xattr/xattr/issues/44 and
Expand All @@ -328,12 +329,12 @@ in {
ghcHEAD = callPackage ../development/compilers/ghc/head.nix {
bootPkgs =
# For GHC 9.2 no armv7l bindists are available.
if stdenv.hostPlatform.isAarch32 then
packages.ghc924
else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
packages.ghc924
if stdenv.buildPlatform.isAarch32 then
bb.packages.ghc924
else if stdenv.buildPlatform.isPower64 && stdenv.buildPlatform.isLittleEndian then
bb.packages.ghc924
else
packages.ghc924Binary;
bb.packages.ghc924Binary;
inherit (buildPackages.python3Packages) sphinx;
# Need to use apple's patched xattr until
# https://github.com/xattr/xattr/issues/44 and
Expand All @@ -346,7 +347,7 @@ in {

ghcjs = compiler.ghcjs810;
ghcjs810 = callPackage ../development/compilers/ghcjs/8.10 {
bootPkgs = packages.ghc810;
bootPkgs = bb.packages.ghc810;
ghcjsSrcJson = ../development/compilers/ghcjs/8.10/git.json;
stage0 = ../development/compilers/ghcjs/8.10/stage0.nix;
};
Expand Down

0 comments on commit 40f2e8f

Please sign in to comment.