lol

haskell.compiler.ghc*: Add `variantSuffix`.

When debugging musl builds, I often have to sift through thousands of lines
of `nix-store -q --tree` or `nix-store -qR` output.
Until now, `pkgsMusl` and normal `pkgs` GHCs looked exactly the same in
there, making that task tough.

Same for `integer-simple`, which makes debugging `gmp` issues easier.

This commit introduces a suffix to tell them apart easily.

Note that this is different from `targetPrefix` which is for
cross-compilation, which `pkgsMusl` does not do.

For GHC HEAD, integer-simple no longer exists, instead we now have a
“bignum backend”, so we just call the integer-simple successor
native-bignum.

Co-Authored-By: sternenseemann <sternenseemann@systemli.org>

authored by

Niklas Hambüchen
sternenseemann
and committed by
sterni
998e40ce 3bdb4768

+50 -7
+7 -1
pkgs/development/compilers/ghc/8.10.2-binary.nix
··· 40 40 # nixpkgs uses for the respective system. 41 41 defaultLibc = { 42 42 i686-linux = { 43 + variantSuffix = ""; 43 44 src = { 44 45 url = "${downloadsUrl}/${version}/ghc-${version}-i386-deb9-linux.tar.xz"; 45 46 sha256 = "0bvwisl4w0z5z8z0da10m9sv0mhm9na2qm43qxr8zl23mn32mblx"; ··· 54 55 ]; 55 56 }; 56 57 x86_64-linux = { 58 + variantSuffix = ""; 57 59 src = { 58 60 url = "${downloadsUrl}/${version}/ghc-${version}-x86_64-deb10-linux.tar.xz"; 59 61 sha256 = "0chnzy9j23b2wa8clx5arwz8wnjfxyjmz9qkj548z14cqf13slcl"; ··· 65 67 ]; 66 68 }; 67 69 armv7l-linux = { 70 + variantSuffix = ""; 68 71 src = { 69 72 url = "${downloadsUrl}/${version}/ghc-${version}-armv7-deb10-linux.tar.xz"; 70 73 sha256 = "1j41cq5d3rmlgz7hzw8f908fs79gc5mn3q5wz277lk8zdf19g75v"; ··· 76 79 ]; 77 80 }; 78 81 aarch64-linux = { 82 + variantSuffix = ""; 79 83 src = { 80 84 url = "${downloadsUrl}/${version}/ghc-${version}-aarch64-deb10-linux.tar.xz"; 81 85 sha256 = "14smwl3741ixnbgi0l51a7kh7xjkiannfqx15b72svky0y4l3wjw"; ··· 88 92 ]; 89 93 }; 90 94 x86_64-darwin = { 95 + variantSuffix = ""; 91 96 src = { 92 97 url = "${downloadsUrl}/${version}/ghc-${version}-x86_64-apple-darwin.tar.xz"; 93 98 sha256 = "1hngyq14l4f950hzhh2d204ca2gfc98pc9xdasxihzqd1jq75dzd"; ··· 103 108 # Binary distributions for the musl libc for the respective system. 104 109 musl = { 105 110 x86_64-linux = { 111 + variantSuffix = "-musl"; 106 112 src = { 107 113 url = "${downloadsUrl}/${version}/ghc-${version}-x86_64-alpine3.10-linux-integer-simple.tar.xz"; 108 114 sha256 = "0xpcbyaxqyhbl6f0i3s4rp2jm67nqpkfh2qlbj3i2fiaix89ml0l"; ··· 138 144 139 145 stdenv.mkDerivation rec { 140 146 inherit version; 141 - pname = "ghc-binary"; 147 + pname = "ghc-binary${binDistUsed.variantSuffix}"; 142 148 143 149 src = fetchurl binDistUsed.src; 144 150
+8 -1
pkgs/development/compilers/ghc/8.10.7-binary.nix
··· 41 41 # nixpkgs uses for the respective system. 42 42 defaultLibc = { 43 43 i686-linux = { 44 + variantSuffix = ""; 44 45 src = { 45 46 url = "${downloadsUrl}/${version}/ghc-${version}-i386-deb9-linux.tar.xz"; 46 47 sha256 = "fbfc1ef194f4e7a4c0da8c11cc69b17458a4b928b609b3622c97acc4acd5c5ab"; ··· 55 56 ]; 56 57 }; 57 58 x86_64-linux = { 59 + variantSuffix = ""; 58 60 src = { 59 61 url = "${downloadsUrl}/${version}/ghc-${version}-x86_64-deb10-linux.tar.xz"; 60 62 sha256 = "a13719bca87a0d3ac0c7d4157a4e60887009a7f1a8dbe95c4759ec413e086d30"; ··· 66 68 ]; 67 69 }; 68 70 armv7l-linux = { 71 + variantSuffix = ""; 69 72 src = { 70 73 url = "${downloadsUrl}/${version}/ghc-${version}-armv7-deb10-linux.tar.xz"; 71 74 sha256 = "3949c31bdf7d3b4afb765ea8246bca4ca9707c5d988d9961a244f0da100956a2"; ··· 77 80 ]; 78 81 }; 79 82 aarch64-linux = { 83 + variantSuffix = ""; 80 84 src = { 81 85 url = "${downloadsUrl}/${version}/ghc-${version}-aarch64-deb10-linux.tar.xz"; 82 86 sha256 = "fad2417f9b295233bf8ade79c0e6140896359e87be46cb61cd1d35863d9d0e55"; ··· 89 93 ]; 90 94 }; 91 95 x86_64-darwin = { 96 + variantSuffix = ""; 92 97 src = { 93 98 url = "${downloadsUrl}/${version}/ghc-${version}-x86_64-apple-darwin.tar.xz"; 94 99 sha256 = "287db0f9c338c9f53123bfa8731b0996803ee50f6ee847fe388092e5e5132047"; ··· 101 106 ]; 102 107 }; 103 108 aarch64-darwin = { 109 + variantSuffix = ""; 104 110 src = { 105 111 url = "${downloadsUrl}/${version}/ghc-${version}-aarch64-apple-darwin.tar.xz"; 106 112 sha256 = "dc469fc3c35fd2a33a5a575ffce87f13de7b98c2d349a41002e200a56d9bba1c"; ··· 116 122 # Binary distributions for the musl libc for the respective system. 117 123 musl = { 118 124 x86_64-linux = { 125 + variantSuffix = "-musl-integer-simple"; 119 126 src = { 120 127 url = "${downloadsUrl}/${version}/ghc-${version}-x86_64-alpine3.10-linux-integer-simple.tar.xz"; 121 128 sha256 = "16903df850ef73d5246f2ff169cbf57ecab76c2ac5acfa9928934282cfad575c"; ··· 152 159 153 160 stdenv.mkDerivation rec { 154 161 inherit version; 155 - pname = "ghc-binary"; 162 + pname = "ghc-binary${binDistUsed.variantSuffix}"; 156 163 157 164 src = fetchurl binDistUsed.src; 158 165
+7 -1
pkgs/development/compilers/ghc/8.10.7.nix
··· 141 141 targetPackages.stdenv.cc.bintools.bintools 142 142 ]; 143 143 144 + # Makes debugging easier to see which variant is at play in `nix-store -q --tree`. 145 + variantSuffix = lib.concatStrings [ 146 + (lib.optionalString stdenv.hostPlatform.isMusl "-musl") 147 + (lib.optionalString enableIntegerSimple "-integer-simple") 148 + ]; 149 + 144 150 in 145 151 stdenv.mkDerivation (rec { 146 152 version = "8.10.7"; 147 - pname = "${targetPrefix}ghc"; 153 + pname = "${targetPrefix}ghc${variantSuffix}"; 148 154 149 155 src = fetchurl { 150 156 url = "https://downloads.haskell.org/ghc/${version}/ghc-${version}-src.tar.xz";
+7 -1
pkgs/development/compilers/ghc/8.8.4.nix
··· 149 149 targetPackages.stdenv.cc.bintools.bintools 150 150 ]; 151 151 152 + # Makes debugging easier to see which variant is at play in `nix-store -q --tree`. 153 + variantSuffix = lib.concatStrings [ 154 + (lib.optionalString stdenv.hostPlatform.isMusl "-musl") 155 + (lib.optionalString enableIntegerSimple "-integer-simple") 156 + ]; 157 + 152 158 in 153 159 stdenv.mkDerivation (rec { 154 160 version = "8.8.4"; 155 - pname = "${targetPrefix}ghc"; 161 + pname = "${targetPrefix}ghc${variantSuffix}"; 156 162 157 163 src = fetchurl { 158 164 url = "https://downloads.haskell.org/ghc/${version}/ghc-${version}-src.tar.xz";
+7 -1
pkgs/development/compilers/ghc/9.0.1.nix
··· 135 135 targetPackages.stdenv.cc.bintools.bintools 136 136 ]; 137 137 138 + # Makes debugging easier to see which variant is at play in `nix-store -q --tree`. 139 + variantSuffix = lib.concatStrings [ 140 + (lib.optionalString stdenv.hostPlatform.isMusl "-musl") 141 + (lib.optionalString enableIntegerSimple "-integer-simple") 142 + ]; 143 + 138 144 in 139 145 stdenv.mkDerivation (rec { 140 146 version = "9.0.1"; 141 - pname = "${targetPrefix}ghc"; 147 + pname = "${targetPrefix}ghc${variantSuffix}"; 142 148 143 149 src = fetchurl { 144 150 url = "https://downloads.haskell.org/ghc/${version}/ghc-${version}-src.tar.xz";
+7 -1
pkgs/development/compilers/ghc/9.2.1.nix
··· 134 134 targetPackages.stdenv.cc.bintools.bintools 135 135 ]; 136 136 137 + # Makes debugging easier to see which variant is at play in `nix-store -q --tree`. 138 + variantSuffix = lib.concatStrings [ 139 + (lib.optionalString stdenv.hostPlatform.isMusl "-musl") 140 + (lib.optionalString enableIntegerSimple "-integer-simple") 141 + ]; 142 + 137 143 in 138 144 stdenv.mkDerivation (rec { 139 145 version = "9.2.0.20210821"; 140 - pname = "${targetPrefix}ghc"; 146 + pname = "${targetPrefix}ghc${variantSuffix}"; 141 147 142 148 src = fetchurl { 143 149 url = "https://downloads.haskell.org/ghc/9.2.1-rc1/ghc-${version}-src.tar.xz";
+7 -1
pkgs/development/compilers/ghc/head.nix
··· 145 145 targetPackages.stdenv.cc.bintools.bintools 146 146 ]; 147 147 148 + # Makes debugging easier to see which variant is at play in `nix-store -q --tree`. 149 + variantSuffix = lib.concatStrings [ 150 + (lib.optionalString stdenv.hostPlatform.isMusl "-musl") 151 + (lib.optionalString enableNativeBignum "-native-bignum") 152 + ]; 153 + 148 154 in 149 155 stdenv.mkDerivation (rec { 150 156 inherit version; 151 157 inherit (src) rev; 152 - pname = "${targetPrefix}ghc"; 158 + pname = "${targetPrefix}ghc${variantSuffix}"; 153 159 154 160 src = fetchgit { 155 161 url = "https://gitlab.haskell.org/ghc/ghc.git/";