-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
Expand file tree
/
Copy pathhaskell-packages.nix
More file actions
363 lines (343 loc) · 14.8 KB
/
haskell-packages.nix
File metadata and controls
363 lines (343 loc) · 14.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
{
buildPackages,
pkgsBuildBuild,
pkgsBuildTarget,
pkgs,
newScope,
stdenv,
config,
}:
let
nativeBignumExcludes = [
# haskell.compiler sub groups
"native-bignum"
# Binary GHCs
"ghc902Binary"
"ghc966DebianBinary"
"ghc984Binary"
];
haskellLibUncomposable = import ../development/haskell-modules/lib {
inherit (pkgs) lib;
inherit pkgs;
};
callPackage = newScope {
haskellLib = haskellLibUncomposable.compose;
overrides = pkgs.haskell.packageOverrides;
};
bootstrapPackageSet = self: super: {
mkDerivation =
drv:
super.mkDerivation (
drv
// {
doCheck = false;
doHaddock = false;
enableExecutableProfiling = false;
enableLibraryProfiling = false;
enableSharedExecutables = false;
enableSharedLibraries = false;
}
);
};
# Use this rather than `rec { ... }` below for sake of overlays.
inherit (pkgs.haskell) compiler packages;
# The GHC LLVM backend rarely sees significant changes relating to
# LLVM version support, as it uses the textual IR format and invokes
# the LLVM binary tools rather than linking to the C++ libraries.
#
# Consider backporting upstream GHC changes to support new LLVM
# versions in `common-llvm-patches.nix` to allow the version to be
# shared across our supported versions of GHC. If the required
# changes are too invasive, it’s fine to decouple individual versions
# from this default or disable their LLVM support if it’s not load‐
# bearing (e.g. GHC 9.4.8 is important for cross‐compiling GHC).
buildTargetLlvmPackages = pkgsBuildTarget.llvmPackages_20;
llvmPackages = pkgs.llvmPackages_20;
# Note the Nixpkgs default version is chosen in all-packages.nix.
chooseDefaultVersions = sets: {
ghc94 = sets.ghc948;
ghc96 = sets.ghc967;
ghc98 = sets.ghc984;
ghc910 = sets.ghc9103;
ghc912 = sets.ghc9122;
ghc914 = sets.ghc9141;
microhs_0_15 = sets.microhs_0_15_4_0;
microhs = sets.microhs_0_15;
};
in
{
lib = haskellLibUncomposable;
package-list = callPackage ../development/haskell-modules/package-list.nix { };
# Always get boot compilers from `pkgsBuildBuild`. The boot (stage0) compiler
# is used to build another compiler (stage1) that'll be used to build the
# final compiler (stage2) (except when building a cross-compiler). This means
# that stage1's host platform is the same as stage0: build. Consequently,
# stage0 needs to be build->build.
#
# Note that we use bb.haskell.packages.*. haskell.packages.*.ghc is similar to
# stdenv: The ghc comes from the previous package set, i.e. this predicate holds:
# `name: pkgs: pkgs.haskell.packages.${name}.ghc == pkgs.buildPackages.haskell.compiler.${name}.ghc`.
# This isn't problematic since pkgsBuildBuild.buildPackages is also build->build,
# just something to keep in mind.
compiler = pkgs.lib.recurseIntoAttrs (
let
bb = pkgsBuildBuild.haskell;
in
{
# Required to bootstrap 9.4.8.
ghc902Binary = callPackage ../development/compilers/ghc/9.0.2-binary.nix {
inherit llvmPackages;
};
ghc966DebianBinary = callPackage ../development/compilers/ghc/9.6.6-debian-binary.nix { };
ghc984Binary = callPackage ../development/compilers/ghc/9.8.4-binary.nix { };
ghc948 = callPackage ../development/compilers/ghc/9.4.8.nix {
bootPkgs =
# Building with 9.2 is broken due to
# https://gitlab.haskell.org/ghc/ghc/-/issues/21914 krank:ignore-line
bb.packages.ghc902Binary;
inherit (buildPackages.python3Packages) sphinx;
inherit (buildPackages.darwin) xattr autoSignDarwinBinariesHook;
inherit buildTargetLlvmPackages llvmPackages;
};
ghc967 = callPackage ../development/compilers/ghc/9.6.7.nix {
bootPkgs =
if
stdenv.buildPlatform.isPower64
&& stdenv.buildPlatform.isBigEndian
&& pkgs.stdenv.hostPlatform.isAbiElfv1
then
# No bindist, "borrowing" the GHC from Debian
bb.packages.ghc966DebianBinary
else
bb.packages.ghc948;
inherit (buildPackages.python3Packages) sphinx;
inherit (buildPackages.darwin) xattr autoSignDarwinBinariesHook;
inherit buildTargetLlvmPackages llvmPackages;
};
ghc984 = callPackage ../development/compilers/ghc/9.8.4.nix {
bootPkgs =
if
stdenv.buildPlatform.isPower64
&& stdenv.buildPlatform.isBigEndian
&& pkgs.stdenv.hostPlatform.isAbiElfv1
then
# No bindist, "borrowing" the GHC from Debian
bb.packages.ghc966DebianBinary
else if stdenv.buildPlatform.isi686 then
bb.packages.ghc948
else
bb.packages.ghc984Binary;
inherit (buildPackages.python3Packages) sphinx;
inherit (buildPackages.darwin) xattr autoSignDarwinBinariesHook;
inherit buildTargetLlvmPackages llvmPackages;
};
ghc9102 = callPackage ../development/compilers/ghc/9.10.2.nix {
bootPkgs =
if
stdenv.buildPlatform.isPower64
&& stdenv.buildPlatform.isBigEndian
&& pkgs.stdenv.hostPlatform.isAbiElfv1
then
# No bindist, "borrowing" the GHC from Debian
bb.packages.ghc966DebianBinary
else if stdenv.buildPlatform.isi686 then
bb.packages.ghc967
else
bb.packages.ghc984Binary;
inherit (buildPackages.python3Packages) sphinx;
inherit (buildPackages.darwin) xattr autoSignDarwinBinariesHook;
inherit buildTargetLlvmPackages llvmPackages;
};
ghc9103 = callPackage ../development/compilers/ghc/9.10.3.nix {
bootPkgs =
if
stdenv.buildPlatform.isPower64
&& stdenv.buildPlatform.isBigEndian
&& pkgs.stdenv.hostPlatform.isAbiElfv1
then
# No bindist, "borrowing" the GHC from Debian
bb.packages.ghc966DebianBinary
else if stdenv.buildPlatform.isi686 then
bb.packages.ghc967
else
bb.packages.ghc984Binary;
inherit (buildPackages.python3Packages) sphinx;
inherit (buildPackages.darwin) xattr autoSignDarwinBinariesHook;
inherit buildTargetLlvmPackages llvmPackages;
};
ghc9122 = callPackage ../development/compilers/ghc/9.12.2.nix {
bootPkgs =
# No suitable bindist packaged yet
bb.packages.ghc9103;
inherit (buildPackages.python3Packages) sphinx;
inherit (buildPackages.darwin) xattr autoSignDarwinBinariesHook;
inherit buildTargetLlvmPackages llvmPackages;
};
ghc9123 = callPackage ../development/compilers/ghc/9.12.3.nix {
bootPkgs =
# No suitable bindist packaged yet
bb.packages.ghc9103;
inherit (buildPackages.python3Packages) sphinx;
inherit (buildPackages.darwin) xattr autoSignDarwinBinariesHook;
inherit buildTargetLlvmPackages llvmPackages;
};
ghc9124 = callPackage ../development/compilers/ghc/9.12.4.nix {
bootPkgs =
# No suitable bindist packaged yet
bb.packages.ghc9103;
inherit (buildPackages.python3Packages) sphinx;
inherit (buildPackages.darwin) xattr autoSignDarwinBinariesHook;
inherit buildTargetLlvmPackages llvmPackages;
};
ghc9141 = callPackage ../development/compilers/ghc/9.14.1.nix {
bootPkgs =
# No suitable bindist packaged yet
bb.packages.ghc9103;
inherit (buildPackages.python3Packages) sphinx;
inherit (buildPackages.darwin) xattr autoSignDarwinBinariesHook;
inherit buildTargetLlvmPackages llvmPackages;
};
ghcHEAD = callPackage ../development/compilers/ghc/head.nix {
bootPkgs =
# No suitable bindist packaged yet
bb.packages.ghc910;
inherit (buildPackages.python3Packages) sphinx;
inherit (buildPackages.darwin) xattr autoSignDarwinBinariesHook;
inherit buildTargetLlvmPackages llvmPackages;
};
# Starting from GHC 9, integer-{simple,gmp} is replaced by ghc-bignum
# with "native" and "gmp" backends.
native-bignum =
let
isNativeBignumGhc =
name: pkgs.lib.hasPrefix "ghc" name && !(builtins.elem name nativeBignumExcludes);
nativeBignumGhcNames = pkgs.lib.filter isNativeBignumGhc (pkgs.lib.attrNames compiler);
in
pkgs.lib.recurseIntoAttrs (
pkgs.lib.genAttrs nativeBignumGhcNames (
name: compiler.${name}.override { enableNativeBignum = true; }
)
);
microhs-boot = callPackage ../development/compilers/microhs/boot.nix {
microhs-src = bb.compiler.microhs_0_15_4_0;
};
microhs_0_15_4_0 = callPackage ../development/compilers/microhs/0.15.4.0.nix {
inherit (bb.compiler) microhs-boot;
};
}
// chooseDefaultVersions compiler
// pkgs.lib.optionalAttrs config.allowAliases {
ghc810 = throw "'haskell.compiler.ghc810' has been removed."; # Added 2025-09-07
ghc90 = throw "'haskell.compiler.ghc90' has been removed."; # Added 2025-09-07
ghc92 = throw "'haskell.compiler.ghc92' has been removed."; # Added 2025-09-07
ghcjs = throw "'haskell.compiler.ghcjs' has been removed. Please use 'pkgsCross.ghcjs' instead."; # Added 2025-09-06
ghcjs810 = throw "'haskell.compiler.ghcjs810' has been removed. Please use 'pkgsCross.ghcjs' instead."; # Added 2025-09-06
integer-simple = throw "All GHC versions with integer-simple support have been removed."; # Added 2025-09-07
}
);
# Default overrides that are applied to all package sets.
packageOverrides = self: super: { };
# Always get compilers from `buildPackages`
packages =
let
bh = buildPackages.haskell;
in
{
ghc902Binary = callPackage ../development/haskell-modules {
buildHaskellPackages = bh.packages.ghc902Binary;
ghc = bh.compiler.ghc902Binary;
compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-9.0.x.nix { };
packageSetConfig = bootstrapPackageSet;
};
ghc966DebianBinary = callPackage ../development/haskell-modules {
buildHaskellPackages = bh.packages.ghc966DebianBinary;
ghc = bh.compiler.ghc966DebianBinary;
compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-9.6.x.nix { };
packageSetConfig = bootstrapPackageSet;
};
ghc984Binary = callPackage ../development/haskell-modules {
buildHaskellPackages = bh.packages.ghc984Binary;
ghc = bh.compiler.ghc984Binary;
compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-9.8.x.nix { };
packageSetConfig = bootstrapPackageSet;
};
ghc948 = callPackage ../development/haskell-modules {
buildHaskellPackages = bh.packages.ghc948;
ghc = bh.compiler.ghc948;
compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-9.4.x.nix { };
};
ghc967 = callPackage ../development/haskell-modules {
buildHaskellPackages = bh.packages.ghc967;
ghc = bh.compiler.ghc967;
compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-9.6.x.nix { };
};
ghc984 = callPackage ../development/haskell-modules {
buildHaskellPackages = bh.packages.ghc984;
ghc = bh.compiler.ghc984;
compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-9.8.x.nix { };
};
ghc9102 = callPackage ../development/haskell-modules {
buildHaskellPackages = bh.packages.ghc9102;
ghc = bh.compiler.ghc9102;
compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-9.10.x.nix { };
};
ghc9103 = callPackage ../development/haskell-modules {
buildHaskellPackages = bh.packages.ghc9103;
ghc = bh.compiler.ghc9103;
compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-9.10.x.nix { };
};
ghc9122 = callPackage ../development/haskell-modules {
buildHaskellPackages = bh.packages.ghc9122;
ghc = bh.compiler.ghc9122;
compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-9.12.x.nix { };
};
ghc9123 = callPackage ../development/haskell-modules {
buildHaskellPackages = bh.packages.ghc9123;
ghc = bh.compiler.ghc9123;
compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-9.12.x.nix { };
};
ghc9124 = callPackage ../development/haskell-modules {
buildHaskellPackages = bh.packages.ghc9124;
ghc = bh.compiler.ghc9124;
compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-9.12.x.nix { };
};
ghc9141 = callPackage ../development/haskell-modules {
buildHaskellPackages = bh.packages.ghc9141;
ghc = bh.compiler.ghc9141;
compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-9.14.x.nix { };
};
ghcHEAD = callPackage ../development/haskell-modules {
buildHaskellPackages = bh.packages.ghcHEAD;
ghc = bh.compiler.ghcHEAD;
compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-9.16.x.nix { };
};
native-bignum =
let
nativeBignumGhcNames = pkgs.lib.filter (name: !(builtins.elem name nativeBignumExcludes)) (
pkgs.lib.attrNames packages
);
in
pkgs.lib.genAttrs nativeBignumGhcNames (
name:
packages.${name}.override {
ghc = bh.compiler.native-bignum.${name};
buildHaskellPackages = bh.packages.native-bignum.${name};
}
);
microhs_0_15_4_0 = callPackage ../development/haskell-modules {
buildHaskellPackages = bh.packages.microhs_0_15_4_0;
ghc = bh.compiler.microhs_0_15_4_0;
compilerConfig = callPackage ../development/haskell-modules/configuration-microhs.nix { };
packageSetConfig = bootstrapPackageSet;
};
}
// chooseDefaultVersions packages
// pkgs.lib.optionalAttrs config.allowAliases {
ghc810 = throw "'haskell.packages.ghc810' has been removed."; # Added 2025-09-07
ghc90 = throw "'haskell.packages.ghc90' has been removed."; # Added 2025-09-07
ghc92 = throw "'haskell.packages.ghc92' has been removed."; # Added 2025-09-07
ghcjs = throw "'haskell.packages.ghcjs' has been removed. Please use 'pkgsCross.ghcjs' instead."; # Added 2025-09-06
ghcjs810 = throw "'haskell.packages.ghcjs810' has been removed. Please use 'pkgsCross.ghcjs' instead."; # Added 2025-09-06
integer-simple = throw "All GHC versions with integer-simple support have been removed."; # Added 2025-09-07
};
}