···1076`disableLibraryProfiling drv`
1077: Sets the `enableLibraryProfiling` argument to `false` for `drv`.
10780001079#### Library functions in the Haskell package sets {#haskell-package-set-lib-functions}
10801081Some library functions depend on packages from the Haskell package sets. Thus they are
···1076`disableLibraryProfiling drv`
1077: Sets the `enableLibraryProfiling` argument to `false` for `drv`.
10781079+`disableParallelBuilding drv`
1080+: Sets the `enableParallelBuilding` argument to `false` for `drv`.
1081+1082#### Library functions in the Haskell package sets {#haskell-package-set-lib-functions}
10831084Some library functions depend on packages from the Haskell package sets. Thus they are
+4-4
pkgs/data/misc/hackage/pin.json
···1{
2- "commit": "4670ba3f52eae6737137ddcb817182f3daad4f26",
3- "url": "https://github.com/commercialhaskell/all-cabal-hashes/archive/4670ba3f52eae6737137ddcb817182f3daad4f26.tar.gz",
4- "sha256": "18q5shdmh12147502135q6132rmzp29qfjhwrcjwidl0pi9ki70i",
5- "msg": "Update from Hackage at 2024-08-19T17:17:03Z"
6}
···1{
2+ "commit": "5d97d9c05e76d8cecb68f1e9063afb39ca0fb26b",
3+ "url": "https://github.com/commercialhaskell/all-cabal-hashes/archive/5d97d9c05e76d8cecb68f1e9063afb39ca0fb26b.tar.gz",
4+ "sha256": "1ic4wn5immv06m1m2cq6mzrrgrxbidxmj39licxlkmnm9jlwzjwr",
5+ "msg": "Update from Hackage at 2024-09-03T10:29:19Z"
6}
+152-31
pkgs/development/compilers/ghc/8.10.7.nix
···1-{ lib, stdenv, pkgsBuildTarget, pkgsHostTarget, targetPackages
23# build-tools
4, bootPkgs
···32, # If enabled, use -fPIC when compiling static libs.
33 enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
3435-, enableProfiledLibs ? true
003637, # Whether to build dynamic libs for the standard library (on the target
38 # platform). Static libs are always built.
39 enableShared ? !stdenv.targetPlatform.isWindows && !stdenv.targetPlatform.useiOSPrebuilt
4041, # Whether to build terminfo.
42- enableTerminfo ? !stdenv.targetPlatform.isWindows
0004344, # What flavour to build. An empty string indicates no
45 # specific flavour and falls back to ghc default values.
···5556, enableHaddockProgram ?
57 # Disabled for cross; see note [HADDOCK_DOCS].
58- (stdenv.targetPlatform == stdenv.hostPlatform)
5960, # Whether to disable the large address space allocator
61 # necessary fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/
62 disableLargeAddressSpace ? stdenv.targetPlatform.isiOS
00000063}@args:
6465assert !enableIntegerSimple -> gmp != null;
6667# Cross cannot currently build the `haddock` program for silly reasons,
68# see note [HADDOCK_DOCS].
69-assert (stdenv.targetPlatform != stdenv.hostPlatform) -> !enableHaddockProgram;
0007071let
72- libffi_name = if stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64 then "libffi" else "libffi_3_3";
73 inherit (stdenv) buildPlatform hostPlatform targetPlatform;
74-75- inherit (bootPkgs) ghc;
7677 # TODO(@Ericson2314) Make unconditional
78 targetPrefix = lib.optionalString
···86 endif
87 BUILD_SPHINX_HTML = ${if enableDocs then "YES" else "NO"}
88 BUILD_SPHINX_PDF = NO
0089 '' +
90 # Note [HADDOCK_DOCS]:
91 # Unfortunately currently `HADDOCK_DOCS` controls both whether the `haddock`
···134 pkgsBuildTarget.targetPackages.stdenv.cc
135 ] ++ lib.optional useLLVM buildTargetLlvmPackages.llvm;
1360137 targetCC = builtins.head toolsForTarget;
0138139 # toolPath calculates the absolute path to the name tool associated with a
140 # given `stdenv.cc` derivation, i.e. it picks the correct derivation to take
···145 tools = {
146 "cc" = cc;
147 "c++" = cc;
148- as = cc.bintools.bintools;
149150- ar = cc.bintools.bintools;
151- ranlib = cc.bintools.bintools;
152- nm = cc.bintools.bintools;
153- readelf = cc.bintools.bintools;
0154155 ld = cc.bintools;
156 "ld.gold" = cc.bintools;
···169 if stdenv.targetPlatform.isDarwin
170 then cc.bintools
171 else cc.bintools.bintools;
000172 }.${name};
173 in
174 "${tools}/bin/${tools.targetPrefix}${name}";
···185 (lib.optionalString enableIntegerSimple "-integer-simple")
186 ];
187188-in
000189190-# C compiler, bintools and LLVM are used at build time, but will also leak into
191-# the resulting GHC's settings file and used at runtime. This means that we are
192-# currently only able to build GHC if hostPlatform == buildPlatform.
193-assert targetCC == pkgsHostTarget.targetPackages.stdenv.cc;
194-assert buildTargetLlvmPackages.llvm == llvmPackages.llvm;
195-assert stdenv.targetPlatform.isDarwin -> buildTargetLlvmPackages.clang == llvmPackages.clang;
00000000000000000000000196197stdenv.mkDerivation (rec {
198 version = "8.10.7";
···277 for env in $(env | grep '^TARGET_' | sed -E 's|\+?=.*||'); do
278 export "''${env#TARGET_}=''${!env}"
279 done
00280 # GHC is a bit confused on its cross terminology, as these would normally be
281 # the *host* tools.
282 export CC="${toolPath "cc" targetCC}"
···289 export RANLIB="${toolPath "ranlib" targetCC}"
290 export READELF="${toolPath "readelf" targetCC}"
291 export STRIP="${toolPath "strip" targetCC}"
0292 '' + lib.optionalString (stdenv.targetPlatform.linker == "cctools") ''
293 export OTOOL="${toolPath "otool" targetCC}"
294 export INSTALL_NAME_TOOL="${toolPath "install_name_tool" targetCC}"
···297 export OPT="${lib.getBin buildTargetLlvmPackages.llvm}/bin/opt"
298 '' + lib.optionalString (useLLVM && stdenv.targetPlatform.isDarwin) ''
299 # LLVM backend on Darwin needs clang: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/codegens.html#llvm-code-generator-fllvm
300- export CLANG="${buildTargetLlvmPackages.clang}/bin/${buildTargetLlvmPackages.clang.targetPrefix}clang"
0000000000301 '' + ''
0000302303 echo -n "${buildMK}" > mk/build.mk
304 sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
···329 done
330 '';
331000332 # TODO(@Ericson2314): Always pass "--target" and always prefix.
333- configurePlatforms = [ "build" "host" ]
334- ++ lib.optional (targetPlatform != hostPlatform) "target";
335336 # `--with` flags for libraries needed for RTS linker
337 configureFlags = [
338 "--datadir=$doc/share/doc/ghc"
339- "--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib"
00340 ] ++ lib.optionals (args.${libffi_name} != null) [
341 "--with-system-libffi"
342- "--with-ffi-includes=${targetPackages.${libffi_name}.dev}/include"
343- "--with-ffi-libraries=${targetPackages.${libffi_name}.out}/lib"
344 ] ++ lib.optionals (targetPlatform == hostPlatform && !enableIntegerSimple) [
345- "--with-gmp-includes=${targetPackages.gmp.dev}/include"
346- "--with-gmp-libraries=${targetPackages.gmp.out}/lib"
347 ] ++ lib.optionals (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
348 "--with-iconv-includes=${libiconv}/include"
349 "--with-iconv-libraries=${libiconv}/lib"
···355 "CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold"
356 ] ++ lib.optionals (disableLargeAddressSpace) [
357 "--disable-large-address-space"
00358 ];
359360 # Make sure we never relax`$PATH` and hooks support for compatibility.
···365366 nativeBuildInputs = [
367 perl autoreconfHook autoconf automake m4 python3
368- ghc bootPkgs.alex bootPkgs.happy bootPkgs.hscolour
0369 ] ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [
370 autoSignDarwinBinariesHook
371 ] ++ lib.optionals enableDocs [
372 sphinx
373 ];
37400000000000375 # For building runtime libs
376 depsBuildTarget = toolsForTarget;
377378- buildInputs = [ perl bash ] ++ (libDeps hostPlatform);
000000379380 depsTargetTarget = map lib.getDev (libDeps targetPlatform);
381 depsTargetTargetPropagated = map (lib.getOutput "out") (libDeps targetPlatform);
···402 requiredSystemFeatures = [ "big-parallel" ];
403404 postInstall = ''
000000000000000000000000000000000405 # Install the bash completion file.
406 install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/${targetPrefix}ghc
407 '';
···427 guibou
428 ] ++ lib.teams.haskell.members;
429 timeout = 24 * 3600;
430- inherit (ghc.meta) license platforms;
0431 };
432433} // lib.optionalAttrs targetPlatform.useAndroidPrebuilt {
···1+{ lib, stdenv, pkgsBuildTarget, pkgsHostTarget, buildPackages, targetPackages
23# build-tools
4, bootPkgs
···32, # If enabled, use -fPIC when compiling static libs.
33 enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
3435+ # Exceeds Hydra output limit (at the time of writing ~3GB) when cross compiled to riscv64.
36+ # A riscv64 cross-compiler fits into the limit comfortably.
37+, enableProfiledLibs ? !stdenv.hostPlatform.isRiscV64
3839, # Whether to build dynamic libs for the standard library (on the target
40 # platform). Static libs are always built.
41 enableShared ? !stdenv.targetPlatform.isWindows && !stdenv.targetPlatform.useiOSPrebuilt
4243, # Whether to build terminfo.
44+ enableTerminfo ? !(stdenv.targetPlatform.isWindows
45+ # terminfo can't be built for cross
46+ || (stdenv.buildPlatform != stdenv.hostPlatform)
47+ || (stdenv.hostPlatform != stdenv.targetPlatform))
4849, # What flavour to build. An empty string indicates no
50 # specific flavour and falls back to ghc default values.
···6061, enableHaddockProgram ?
62 # Disabled for cross; see note [HADDOCK_DOCS].
63+ (stdenv.buildPlatform == stdenv.hostPlatform && stdenv.targetPlatform == stdenv.hostPlatform)
6465, # Whether to disable the large address space allocator
66 # necessary fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/
67 disableLargeAddressSpace ? stdenv.targetPlatform.isiOS
68+69+, # Whether to build an unregisterised version of GHC.
70+ # GHC will normally auto-detect whether it can do a registered build, but this
71+ # option will force it to do an unregistered build when set to true.
72+ # See https://gitlab.haskell.org/ghc/ghc/-/wikis/building/unregisterised
73+ enableUnregisterised ? false
74}@args:
7576assert !enableIntegerSimple -> gmp != null;
7778# Cross cannot currently build the `haddock` program for silly reasons,
79# see note [HADDOCK_DOCS].
80+assert (stdenv.buildPlatform != stdenv.hostPlatform || stdenv.targetPlatform != stdenv.hostPlatform) -> !enableHaddockProgram;
81+82+# GHC does not support building when all 3 platforms are different.
83+assert stdenv.buildPlatform == stdenv.hostPlatform || stdenv.hostPlatform == stdenv.targetPlatform;
8485let
086 inherit (stdenv) buildPlatform hostPlatform targetPlatform;
008788 # TODO(@Ericson2314) Make unconditional
89 targetPrefix = lib.optionalString
···97 endif
98 BUILD_SPHINX_HTML = ${if enableDocs then "YES" else "NO"}
99 BUILD_SPHINX_PDF = NO
100+101+ WITH_TERMINFO = ${if enableTerminfo then "YES" else "NO"}
102 '' +
103 # Note [HADDOCK_DOCS]:
104 # Unfortunately currently `HADDOCK_DOCS` controls both whether the `haddock`
···147 pkgsBuildTarget.targetPackages.stdenv.cc
148 ] ++ lib.optional useLLVM buildTargetLlvmPackages.llvm;
149150+ buildCC = buildPackages.stdenv.cc;
151 targetCC = builtins.head toolsForTarget;
152+ installCC = pkgsHostTarget.targetPackages.stdenv.cc;
153154 # toolPath calculates the absolute path to the name tool associated with a
155 # given `stdenv.cc` derivation, i.e. it picks the correct derivation to take
···160 tools = {
161 "cc" = cc;
162 "c++" = cc;
163+ as = cc.bintools;
164165+ ar = cc.bintools;
166+ ranlib = cc.bintools;
167+ nm = cc.bintools;
168+ readelf = cc.bintools;
169+ objdump = cc.bintools;
170171 ld = cc.bintools;
172 "ld.gold" = cc.bintools;
···185 if stdenv.targetPlatform.isDarwin
186 then cc.bintools
187 else cc.bintools.bintools;
188+189+ # clang is used as an assembler on darwin with the LLVM backend
190+ clang = cc;
191 }.${name};
192 in
193 "${tools}/bin/${tools.targetPrefix}${name}";
···204 (lib.optionalString enableIntegerSimple "-integer-simple")
205 ];
206207+ libffi_name =
208+ if stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64
209+ then "libffi"
210+ else "libffi_3_3";
211212+ # These libraries are library dependencies of the standard libraries bundled
213+ # by GHC (core libs) users will link their compiled artifacts again. Thus,
214+ # they should be taken from targetPackages.
215+ #
216+ # We need to use pkgsHostTarget if we are cross compiling a native GHC compiler,
217+ # though (when native compiling GHC, pkgsHostTarget == targetPackages):
218+ #
219+ # 1. targetPackages would be empty(-ish) in this situation since we can't
220+ # execute cross compiled compilers in order to obtain the libraries
221+ # that would be in targetPackages.
222+ # 2. pkgsHostTarget is fine to use since hostPlatform == targetPlatform in this
223+ # situation.
224+ # 3. The core libs used by the final GHC (stage 2) for user artifacts are also
225+ # used to build stage 2 GHC itself, i.e. the core libs are both host and
226+ # target.
227+ targetLibs =
228+ let
229+ basePackageSet =
230+ if hostPlatform != targetPlatform
231+ then targetPackages
232+ else pkgsHostTarget;
233+ in
234+ {
235+ inherit (basePackageSet) gmp ncurses;
236+ # dynamic inherits are not possible in Nix
237+ libffi = basePackageSet.${libffi_name};
238+ };
239+240+in
241242stdenv.mkDerivation (rec {
243 version = "8.10.7";
···322 for env in $(env | grep '^TARGET_' | sed -E 's|\+?=.*||'); do
323 export "''${env#TARGET_}=''${!env}"
324 done
325+ # Stage0 (build->build) which builds stage 1
326+ export GHC="${bootPkgs.ghc}/bin/ghc"
327 # GHC is a bit confused on its cross terminology, as these would normally be
328 # the *host* tools.
329 export CC="${toolPath "cc" targetCC}"
···336 export RANLIB="${toolPath "ranlib" targetCC}"
337 export READELF="${toolPath "readelf" targetCC}"
338 export STRIP="${toolPath "strip" targetCC}"
339+ export OBJDUMP="${toolPath "objdump" targetCC}"
340 '' + lib.optionalString (stdenv.targetPlatform.linker == "cctools") ''
341 export OTOOL="${toolPath "otool" targetCC}"
342 export INSTALL_NAME_TOOL="${toolPath "install_name_tool" targetCC}"
···345 export OPT="${lib.getBin buildTargetLlvmPackages.llvm}/bin/opt"
346 '' + lib.optionalString (useLLVM && stdenv.targetPlatform.isDarwin) ''
347 # LLVM backend on Darwin needs clang: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/codegens.html#llvm-code-generator-fllvm
348+ # The executable we specify via $CLANG is used as an assembler (exclusively, it seems, but this isn't
349+ # clarified in any user facing documentation). As such, it'll be called on assembly produced by $CC
350+ # which usually comes from the darwin stdenv. To prevent a situation where $CLANG doesn't understand
351+ # the assembly it is given, we need to make sure that it matches the LLVM version of $CC if possible.
352+ # It is unclear (at the time of writing 2024-09-01) whether $CC should match the LLVM version we use
353+ # for llc and opt which would require using a custom darwin stdenv for targetCC.
354+ export CLANG="${
355+ if targetCC.isClang
356+ then toolPath "clang" targetCC
357+ else "${buildTargetLlvmPackages.clang}/bin/${buildTargetLlvmPackages.clang.targetPrefix}clang"
358+ }"
359 '' + ''
360+ # No need for absolute paths since these tools only need to work during the build
361+ export CC_STAGE0="$CC_FOR_BUILD"
362+ export LD_STAGE0="$LD_FOR_BUILD"
363+ export AR_STAGE0="$AR_FOR_BUILD"
364365 echo -n "${buildMK}" > mk/build.mk
366 sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
···391 done
392 '';
393394+ # Although it is usually correct to pass --host, we don't do that here because
395+ # GHC's usage of build, host, and target is non-standard.
396+ # See https://gitlab.haskell.org/ghc/ghc/-/wikis/building/cross-compiling
397 # TODO(@Ericson2314): Always pass "--target" and always prefix.
398+ configurePlatforms = [ "build" ]
399+ ++ lib.optional (buildPlatform != hostPlatform || targetPlatform != hostPlatform) "target";
400401 # `--with` flags for libraries needed for RTS linker
402 configureFlags = [
403 "--datadir=$doc/share/doc/ghc"
404+ ] ++ lib.optionals enableTerminfo [
405+ "--with-curses-includes=${lib.getDev targetLibs.ncurses}/include"
406+ "--with-curses-libraries=${lib.getLib targetLibs.ncurses}/lib"
407 ] ++ lib.optionals (args.${libffi_name} != null) [
408 "--with-system-libffi"
409+ "--with-ffi-includes=${targetLibs.libffi.dev}/include"
410+ "--with-ffi-libraries=${targetLibs.libffi.out}/lib"
411 ] ++ lib.optionals (targetPlatform == hostPlatform && !enableIntegerSimple) [
412+ "--with-gmp-includes=${targetLibs.gmp.dev}/include"
413+ "--with-gmp-libraries=${targetLibs.gmp.out}/lib"
414 ] ++ lib.optionals (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
415 "--with-iconv-includes=${libiconv}/include"
416 "--with-iconv-libraries=${libiconv}/lib"
···422 "CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold"
423 ] ++ lib.optionals (disableLargeAddressSpace) [
424 "--disable-large-address-space"
425+ ] ++ lib.optionals enableUnregisterised [
426+ "--enable-unregisterised"
427 ];
428429 # Make sure we never relax`$PATH` and hooks support for compatibility.
···434435 nativeBuildInputs = [
436 perl autoreconfHook autoconf automake m4 python3
437+ bootPkgs.alex bootPkgs.happy bootPkgs.hscolour
438+ bootPkgs.ghc-settings-edit
439 ] ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [
440 autoSignDarwinBinariesHook
441 ] ++ lib.optionals enableDocs [
442 sphinx
443 ];
444445+ # Everything the stage0 compiler needs to build stage1: CC, bintools, extra libs.
446+ # See also GHC, {CC,LD,AR}_STAGE0 in preConfigure.
447+ depsBuildBuild = [
448+ # N.B. We do not declare bootPkgs.ghc in any of the stdenv.mkDerivation
449+ # dependency lists to prevent the bintools setup hook from adding ghc's
450+ # lib directory to the linker flags. Instead we tell configure about it
451+ # via the GHC environment variable.
452+ buildCC
453+ # stage0 builds terminfo unconditionally, so we always need ncurses
454+ ncurses
455+ ];
456 # For building runtime libs
457 depsBuildTarget = toolsForTarget;
458459+ # Prevent stage0 ghc from leaking into the final result. This was an issue
460+ # with GHC 9.6.
461+ disallowedReferences = [
462+ bootPkgs.ghc
463+ ];
464+465+ buildInputs = [ bash ] ++ (libDeps hostPlatform);
466467 depsTargetTarget = map lib.getDev (libDeps targetPlatform);
468 depsTargetTargetPropagated = map (lib.getOutput "out") (libDeps targetPlatform);
···489 requiredSystemFeatures = [ "big-parallel" ];
490491 postInstall = ''
492+ settingsFile="$out/lib/${targetPrefix}${passthru.haskellCompilerName}/settings"
493+494+ # Make the installed GHC use the host->target tools.
495+ ghc-settings-edit "$settingsFile" \
496+ "C compiler command" "${toolPath "cc" installCC}" \
497+ "Haskell CPP command" "${toolPath "cc" installCC}" \
498+ "C++ compiler command" "${toolPath "c++" installCC}" \
499+ "ld command" "${toolPath "ld${lib.optionalString useLdGold ".gold"}" installCC}" \
500+ "Merge objects command" "${toolPath "ld${lib.optionalString useLdGold ".gold"}" installCC}" \
501+ "ar command" "${toolPath "ar" installCC}" \
502+ "ranlib command" "${toolPath "ranlib" installCC}"
503+ ''
504+ + lib.optionalString (stdenv.targetPlatform.linker == "cctools") ''
505+ ghc-settings-edit "$settingsFile" \
506+ "otool command" "${toolPath "otool" installCC}" \
507+ "install_name_tool command" "${toolPath "install_name_tool" installCC}"
508+ ''
509+ + lib.optionalString useLLVM ''
510+ ghc-settings-edit "$settingsFile" \
511+ "LLVM llc command" "${lib.getBin llvmPackages.llvm}/bin/llc" \
512+ "LLVM opt command" "${lib.getBin llvmPackages.llvm}/bin/opt"
513+ ''
514+ + lib.optionalString (useLLVM && stdenv.targetPlatform.isDarwin) ''
515+ ghc-settings-edit "$settingsFile" \
516+ "LLVM clang command" "${
517+ # See comment for CLANG in preConfigure
518+ if installCC.isClang
519+ then toolPath "clang" installCC
520+ else "${llvmPackages.clang}/bin/${llvmPackages.clang.targetPrefix}clang"
521+ }"
522+ ''
523+ + ''
524+525 # Install the bash completion file.
526 install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/${targetPrefix}ghc
527 '';
···547 guibou
548 ] ++ lib.teams.haskell.members;
549 timeout = 24 * 3600;
550+ platforms = lib.platforms.all;
551+ inherit (bootPkgs.ghc.meta) license;
552 };
553554} // lib.optionalAttrs targetPlatform.useAndroidPrebuilt {
+162-34
pkgs/development/compilers/ghc/common-hadrian.nix
···12, stdenv
13, pkgsBuildTarget
14, pkgsHostTarget
015, targetPackages
16, fetchpatch
17···58, # If enabled, use -fPIC when compiling static libs.
59 enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
6061-, enableProfiledLibs ? true
006263, # Whether to build dynamic libs for the standard library (on the target
64 # platform). Static libs are always built.
65 enableShared ? with stdenv.targetPlatform; !isWindows && !useiOSPrebuilt && !isStatic && !isGhcjs
6667, # Whether to build terminfo.
00068 enableTerminfo ? !(stdenv.targetPlatform.isWindows
69- || stdenv.targetPlatform.isGhcjs)
0007071, # Libdw.c only supports x86_64, i686 and s390x as of 2022-08-04
72 enableDwarf ? (stdenv.targetPlatform.isx86 ||
···117 -- no way to set this via the command line
118 finalStage :: Stage
119 finalStage = ${
120- # Always build the stage 2 compiler if possible. Note we can currently
121- # assume hostPlatform == buildPlatform.
122- # TODO(@sternenseemann): improve this condition when we can cross-compile GHC
123 if stdenv.hostPlatform.canExecute stdenv.targetPlatform
124 then "Stage2" # native compiler or “native” cross e.g. pkgsStatic
125 else "Stage1" # cross compiler
···178 hash = "sha256-MpvTmFFsNiPDoOp9BhZyWeapeibQ77zgEV+xzZ1UAXs=";
179 })
180 ]
000000000181 ++ lib.optionals (stdenv.targetPlatform.isDarwin && stdenv.targetPlatform.isAarch64) [
182 # Prevent the paths module from emitting symbols that we don't use
183 # when building with separate outputs.
···222, # Whether to disable the large address space allocator
223 # necessary fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/
224 disableLargeAddressSpace ? stdenv.targetPlatform.isiOS
000000225}:
226227assert !enableNativeBignum -> gmp != null;
228000000229let
230 inherit (stdenv) buildPlatform hostPlatform targetPlatform;
231-232- inherit (bootPkgs) ghc;
233234 # TODO(@Ericson2314) Make unconditional
235 targetPrefix = lib.optionalString
···265 else pkgsBuildTarget.targetPackages.stdenv.cc)
266 ] ++ lib.optional useLLVM buildTargetLlvmPackages.llvm;
2670268 targetCC = builtins.head toolsForTarget;
0000269270 # toolPath calculates the absolute path to the name tool associated with a
271 # given `stdenv.cc` derivation, i.e. it picks the correct derivation to take
···276 tools = {
277 "cc" = cc;
278 "c++" = cc;
279- as = cc.bintools.bintools;
280281- ar = cc.bintools.bintools;
282- ranlib = cc.bintools.bintools;
283- nm = cc.bintools.bintools;
284- readelf = cc.bintools.bintools;
0285286 ld = cc.bintools;
287 "ld.gold" = cc.bintools;
···300 if stdenv.targetPlatform.isDarwin
301 then cc.bintools
302 else cc.bintools.bintools;
000303 }.${name};
304 in
305 "${tools}/bin/${tools.targetPrefix}${name}";
···316 (lib.optionalString enableNativeBignum "-native-bignum")
317 ];
318319-in
0000000000000000000000320321-# C compiler, bintools and LLVM are used at build time, but will also leak into
322-# the resulting GHC's settings file and used at runtime. This means that we are
323-# currently only able to build GHC if hostPlatform == buildPlatform.
324-assert !targetPlatform.isGhcjs -> targetCC == pkgsHostTarget.targetPackages.stdenv.cc;
325-assert buildTargetLlvmPackages.llvm == llvmPackages.llvm;
326-assert stdenv.targetPlatform.isDarwin -> buildTargetLlvmPackages.clang == llvmPackages.clang;
327328stdenv.mkDerivation ({
329 pname = "${targetPrefix}ghc${variantSuffix}";
···346 for env in $(env | grep '^TARGET_' | sed -E 's|\+?=.*||'); do
347 export "''${env#TARGET_}=''${!env}"
348 done
0000000349 # GHC is a bit confused on its cross terminology, as these would normally be
350 # the *host* tools.
351 export CC="${toolPath "cc" targetCC}"
···358 export RANLIB="${toolPath "ranlib" targetCC}"
359 export READELF="${toolPath "readelf" targetCC}"
360 export STRIP="${toolPath "strip" targetCC}"
0361 '' + lib.optionalString (stdenv.targetPlatform.linker == "cctools") ''
362 export OTOOL="${toolPath "otool" targetCC}"
363 export INSTALL_NAME_TOOL="${toolPath "install_name_tool" targetCC}"
···366 export OPT="${lib.getBin buildTargetLlvmPackages.llvm}/bin/opt"
367 '' + lib.optionalString (useLLVM && stdenv.targetPlatform.isDarwin) ''
368 # LLVM backend on Darwin needs clang: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/codegens.html#llvm-code-generator-fllvm
369- export CLANG="${buildTargetLlvmPackages.clang}/bin/${buildTargetLlvmPackages.clang.targetPrefix}clang"
0000000000370 '' +
371 lib.optionalString (stdenv.hostPlatform.isLinux && hostPlatform.libc == "glibc") ''
372 export LOCALE_ARCHIVE="${glibcLocales}/lib/locale/locale-archive"
···433 # `--with` flags for libraries needed for RTS linker
434 configureFlags = [
435 "--datadir=$doc/share/doc/ghc"
436- "--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib"
00437 ] ++ lib.optionals (libffi != null && !targetPlatform.isGhcjs) [
438 "--with-system-libffi"
439- "--with-ffi-includes=${targetPackages.libffi.dev}/include"
440- "--with-ffi-libraries=${targetPackages.libffi.out}/lib"
441 ] ++ lib.optionals (targetPlatform == hostPlatform && !enableNativeBignum) [
442- "--with-gmp-includes=${targetPackages.gmp.dev}/include"
443- "--with-gmp-libraries=${targetPackages.gmp.out}/lib"
444 ] ++ lib.optionals (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
445 "--with-iconv-includes=${libiconv}/include"
446 "--with-iconv-libraries=${libiconv}/lib"
···454 "--disable-large-address-space"
455 ] ++ lib.optionals enableDwarf [
456 "--enable-dwarf-unwind"
457- "--with-libdw-includes=${lib.getDev targetPackages.elfutils}/include"
458- "--with-libdw-libraries=${lib.getLib targetPackages.elfutils}/lib"
459 ] ++ lib.optionals targetPlatform.isDarwin [
460 # Darwin uses llvm-ar. GHC will try to use `-L` with `ar` when it is `llvm-ar`
461 # but it doesn’t currently work because Cabal never uses `-L` on Darwin. See:
462 # https://gitlab.haskell.org/ghc/ghc/-/issues/23188
463 # https://github.com/haskell/cabal/issues/8882
464 "fp_cv_prog_ar_supports_dash_l=no"
00465 ];
466467 # Make sure we never relax`$PATH` and hooks support for compatibility.
···471 dontAddExtraLibs = true;
472473 nativeBuildInputs = [
474- perl ghc hadrian bootPkgs.alex bootPkgs.happy bootPkgs.hscolour
475 # autoconf and friends are necessary for hadrian to create the bindist
476 autoconf automake m4
477 # Python is used in a few scripts invoked by hadrian to generate e.g. rts headers.
478 python3
00479 ] ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [
480 autoSignDarwinBinariesHook
481 ] ++ lib.optionals enableDocs [
···484485 # For building runtime libs
486 depsBuildTarget = toolsForTarget;
00000000000487488- buildInputs = [ perl bash ] ++ (libDeps hostPlatform);
000000489490 depsTargetTarget = map lib.getDev (libDeps targetPlatform);
491 depsTargetTargetPropagated = map (lib.getOutput "out") (libDeps targetPlatform);
···553 # leave bindist directory
554 popd
555000000000000000000000000000000000556 # Install the bash completion file.
557 install -Dm 644 utils/completion/ghc.bash $out/share/bash-completion/completions/${targetPrefix}ghc
558 '';
559560 passthru = {
561- inherit bootPkgs targetPrefix;
562563 inherit llvmPackages;
564 inherit enableShared;
565-566- # Our Cabal compiler name
567- haskellCompilerName = "ghc-${version}";
568569 # Expose hadrian used for bootstrapping, for debugging purposes
570 inherit hadrian;
···581 guibou
582 ] ++ lib.teams.haskell.members;
583 timeout = 24 * 3600;
584- inherit (ghc.meta) license platforms;
0585 };
586587 dontStrip = targetPlatform.useAndroidPrebuilt || targetPlatform.isWasm;
···12, stdenv
13, pkgsBuildTarget
14, pkgsHostTarget
15+, buildPackages
16, targetPackages
17, fetchpatch
18···59, # If enabled, use -fPIC when compiling static libs.
60 enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
6162+ # Exceeds Hydra output limit (at the time of writing ~3GB) when cross compiled to riscv64.
63+ # A riscv64 cross-compiler fits into the limit comfortably.
64+, enableProfiledLibs ? !stdenv.hostPlatform.isRiscV64
6566, # Whether to build dynamic libs for the standard library (on the target
67 # platform). Static libs are always built.
68 enableShared ? with stdenv.targetPlatform; !isWindows && !useiOSPrebuilt && !isStatic && !isGhcjs
6970, # Whether to build terminfo.
71+ # FIXME(@sternenseemann): This actually doesn't influence what hadrian does,
72+ # just what buildInputs etc. looks like. It would be best if we could actually
73+ # tell it what to do like it was possible with make.
74 enableTerminfo ? !(stdenv.targetPlatform.isWindows
75+ || stdenv.targetPlatform.isGhcjs
76+ # terminfo can't be built for cross
77+ || (stdenv.buildPlatform != stdenv.hostPlatform)
78+ || (stdenv.hostPlatform != stdenv.targetPlatform))
7980, # Libdw.c only supports x86_64, i686 and s390x as of 2022-08-04
81 enableDwarf ? (stdenv.targetPlatform.isx86 ||
···126 -- no way to set this via the command line
127 finalStage :: Stage
128 finalStage = ${
129+ # Always build the stage 2 compiler if possible.
130+ # TODO(@sternensemann): unify condition with make-built GHCs
0131 if stdenv.hostPlatform.canExecute stdenv.targetPlatform
132 then "Stage2" # native compiler or “native” cross e.g. pkgsStatic
133 else "Stage1" # cross compiler
···186 hash = "sha256-MpvTmFFsNiPDoOp9BhZyWeapeibQ77zgEV+xzZ1UAXs=";
187 })
188 ]
189+ ++ lib.optionals (lib.versionAtLeast version "9.6" && lib.versionOlder version "9.8") [
190+ # Fix unlit being installed under a different name than is used in the
191+ # settings file: https://gitlab.haskell.org/ghc/ghc/-/issues/23317
192+ (fetchpatch {
193+ name = "ghc-9.6-fix-unlit-path.patch";
194+ url = "https://gitlab.haskell.org/ghc/ghc/-/commit/8fde4ac84ec7b1ead238cb158bbef48555d12af9.patch";
195+ hash = "sha256-3+CyRBpebEZi8YpS22SsdGQHqi0drR7cCKPtKbR3zyE=";
196+ })
197+ ]
198 ++ lib.optionals (stdenv.targetPlatform.isDarwin && stdenv.targetPlatform.isAarch64) [
199 # Prevent the paths module from emitting symbols that we don't use
200 # when building with separate outputs.
···239, # Whether to disable the large address space allocator
240 # necessary fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/
241 disableLargeAddressSpace ? stdenv.targetPlatform.isiOS
242+243+, # Whether to build an unregisterised version of GHC.
244+ # GHC will normally auto-detect whether it can do a registered build, but this
245+ # option will force it to do an unregistered build when set to true.
246+ # See https://gitlab.haskell.org/ghc/ghc/-/wikis/building/unregisterised
247+ enableUnregisterised ? false
248}:
249250assert !enableNativeBignum -> gmp != null;
251252+# GHC does not support building when all 3 platforms are different.
253+assert stdenv.buildPlatform == stdenv.hostPlatform || stdenv.hostPlatform == stdenv.targetPlatform;
254+255+# It is currently impossible to cross-compile GHC with Hadrian.
256+assert stdenv.buildPlatform == stdenv.hostPlatform;
257+258let
259 inherit (stdenv) buildPlatform hostPlatform targetPlatform;
00260261 # TODO(@Ericson2314) Make unconditional
262 targetPrefix = lib.optionalString
···292 else pkgsBuildTarget.targetPackages.stdenv.cc)
293 ] ++ lib.optional useLLVM buildTargetLlvmPackages.llvm;
294295+ buildCC = buildPackages.stdenv.cc;
296 targetCC = builtins.head toolsForTarget;
297+ installCC =
298+ if targetPlatform.isGhcjs
299+ then pkgsHostTarget.emscripten
300+ else pkgsHostTarget.targetPackages.stdenv.cc;
301302 # toolPath calculates the absolute path to the name tool associated with a
303 # given `stdenv.cc` derivation, i.e. it picks the correct derivation to take
···308 tools = {
309 "cc" = cc;
310 "c++" = cc;
311+ as = cc.bintools;
312313+ ar = cc.bintools;
314+ ranlib = cc.bintools;
315+ nm = cc.bintools;
316+ readelf = cc.bintools;
317+ objdump = cc.bintools;
318319 ld = cc.bintools;
320 "ld.gold" = cc.bintools;
···333 if stdenv.targetPlatform.isDarwin
334 then cc.bintools
335 else cc.bintools.bintools;
336+337+ # clang is used as an assembler on darwin with the LLVM backend
338+ clang = cc;
339 }.${name};
340 in
341 "${tools}/bin/${tools.targetPrefix}${name}";
···352 (lib.optionalString enableNativeBignum "-native-bignum")
353 ];
354355+ # These libraries are library dependencies of the standard libraries bundled
356+ # by GHC (core libs) users will link their compiled artifacts again. Thus,
357+ # they should be taken from targetPackages.
358+ #
359+ # We need to use pkgsHostTarget if we are cross compiling a native GHC compiler,
360+ # though (when native compiling GHC, pkgsHostTarget == targetPackages):
361+ #
362+ # 1. targetPackages would be empty(-ish) in this situation since we can't
363+ # execute cross compiled compilers in order to obtain the libraries
364+ # that would be in targetPackages.
365+ # 2. pkgsHostTarget is fine to use since hostPlatform == targetPlatform in this
366+ # situation.
367+ # 3. The core libs used by the final GHC (stage 2) for user artifacts are also
368+ # used to build stage 2 GHC itself, i.e. the core libs are both host and
369+ # target.
370+ targetLibs = {
371+ inherit
372+ (if hostPlatform != targetPlatform then targetPackages else pkgsHostTarget)
373+ elfutils
374+ gmp
375+ libffi
376+ ncurses;
377+ };
378379+ # Our Cabal compiler name
380+ haskellCompilerName = "ghc-${version}";
381+382+in
00383384stdenv.mkDerivation ({
385 pname = "${targetPrefix}ghc${variantSuffix}";
···402 for env in $(env | grep '^TARGET_' | sed -E 's|\+?=.*||'); do
403 export "''${env#TARGET_}=''${!env}"
404 done
405+ # No need for absolute paths since these tools only need to work during the build
406+ export CC_STAGE0="$CC_FOR_BUILD"
407+ export LD_STAGE0="$LD_FOR_BUILD"
408+ export AR_STAGE0="$AR_FOR_BUILD"
409+410+ # Stage0 (build->build) which builds stage 1
411+ export GHC="${bootPkgs.ghc}/bin/ghc"
412 # GHC is a bit confused on its cross terminology, as these would normally be
413 # the *host* tools.
414 export CC="${toolPath "cc" targetCC}"
···421 export RANLIB="${toolPath "ranlib" targetCC}"
422 export READELF="${toolPath "readelf" targetCC}"
423 export STRIP="${toolPath "strip" targetCC}"
424+ export OBJDUMP="${toolPath "objdump" targetCC}"
425 '' + lib.optionalString (stdenv.targetPlatform.linker == "cctools") ''
426 export OTOOL="${toolPath "otool" targetCC}"
427 export INSTALL_NAME_TOOL="${toolPath "install_name_tool" targetCC}"
···430 export OPT="${lib.getBin buildTargetLlvmPackages.llvm}/bin/opt"
431 '' + lib.optionalString (useLLVM && stdenv.targetPlatform.isDarwin) ''
432 # LLVM backend on Darwin needs clang: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/codegens.html#llvm-code-generator-fllvm
433+ # The executable we specify via $CLANG is used as an assembler (exclusively, it seems, but this isn't
434+ # clarified in any user facing documentation). As such, it'll be called on assembly produced by $CC
435+ # which usually comes from the darwin stdenv. To prevent a situation where $CLANG doesn't understand
436+ # the assembly it is given, we need to make sure that it matches the LLVM version of $CC if possible.
437+ # It is unclear (at the time of writing 2024-09-01) whether $CC should match the LLVM version we use
438+ # for llc and opt which would require using a custom darwin stdenv for targetCC.
439+ export CLANG="${
440+ if targetCC.isClang
441+ then toolPath "clang" targetCC
442+ else "${buildTargetLlvmPackages.clang}/bin/${buildTargetLlvmPackages.clang.targetPrefix}clang"
443+ }"
444 '' +
445 lib.optionalString (stdenv.hostPlatform.isLinux && hostPlatform.libc == "glibc") ''
446 export LOCALE_ARCHIVE="${glibcLocales}/lib/locale/locale-archive"
···507 # `--with` flags for libraries needed for RTS linker
508 configureFlags = [
509 "--datadir=$doc/share/doc/ghc"
510+ ] ++ lib.optionals enableTerminfo [
511+ "--with-curses-includes=${lib.getDev targetLibs.ncurses}/include"
512+ "--with-curses-libraries=${lib.getLib targetLibs.ncurses}/lib"
513 ] ++ lib.optionals (libffi != null && !targetPlatform.isGhcjs) [
514 "--with-system-libffi"
515+ "--with-ffi-includes=${targetLibs.libffi.dev}/include"
516+ "--with-ffi-libraries=${targetLibs.libffi.out}/lib"
517 ] ++ lib.optionals (targetPlatform == hostPlatform && !enableNativeBignum) [
518+ "--with-gmp-includes=${targetLibs.gmp.dev}/include"
519+ "--with-gmp-libraries=${targetLibs.gmp.out}/lib"
520 ] ++ lib.optionals (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
521 "--with-iconv-includes=${libiconv}/include"
522 "--with-iconv-libraries=${libiconv}/lib"
···530 "--disable-large-address-space"
531 ] ++ lib.optionals enableDwarf [
532 "--enable-dwarf-unwind"
533+ "--with-libdw-includes=${lib.getDev targetLibs.elfutils}/include"
534+ "--with-libdw-libraries=${lib.getLib targetLibs.elfutils}/lib"
535 ] ++ lib.optionals targetPlatform.isDarwin [
536 # Darwin uses llvm-ar. GHC will try to use `-L` with `ar` when it is `llvm-ar`
537 # but it doesn’t currently work because Cabal never uses `-L` on Darwin. See:
538 # https://gitlab.haskell.org/ghc/ghc/-/issues/23188
539 # https://github.com/haskell/cabal/issues/8882
540 "fp_cv_prog_ar_supports_dash_l=no"
541+ ] ++ lib.optionals enableUnregisterised [
542+ "--enable-unregisterised"
543 ];
544545 # Make sure we never relax`$PATH` and hooks support for compatibility.
···549 dontAddExtraLibs = true;
550551 nativeBuildInputs = [
552+ perl hadrian bootPkgs.alex bootPkgs.happy bootPkgs.hscolour
553 # autoconf and friends are necessary for hadrian to create the bindist
554 autoconf automake m4
555 # Python is used in a few scripts invoked by hadrian to generate e.g. rts headers.
556 python3
557+ # Tool used to update GHC's settings file in postInstall
558+ bootPkgs.ghc-settings-edit
559 ] ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [
560 autoSignDarwinBinariesHook
561 ] ++ lib.optionals enableDocs [
···564565 # For building runtime libs
566 depsBuildTarget = toolsForTarget;
567+ # Everything the stage0 compiler needs to build stage1: CC, bintools, extra libs.
568+ # See also GHC, {CC,LD,AR}_STAGE0 in preConfigure.
569+ depsBuildBuild = [
570+ # N.B. We do not declare bootPkgs.ghc in any of the stdenv.mkDerivation
571+ # dependency lists to prevent the bintools setup hook from adding ghc's
572+ # lib directory to the linker flags. Instead we tell configure about it
573+ # via the GHC environment variable.
574+ buildCC
575+ # stage0 builds terminfo unconditionally, so we always need ncurses
576+ ncurses
577+ ];
578579+ # Prevent stage0 ghc from leaking into the final result. This was an issue
580+ # with GHC 9.6.
581+ disallowedReferences = [
582+ bootPkgs.ghc
583+ ];
584+585+ buildInputs = [ bash ] ++ (libDeps hostPlatform);
586587 depsTargetTarget = map lib.getDev (libDeps targetPlatform);
588 depsTargetTargetPropagated = map (lib.getOutput "out") (libDeps targetPlatform);
···650 # leave bindist directory
651 popd
652653+ settingsFile="$out/lib/${targetPrefix}${haskellCompilerName}/lib/settings"
654+655+ # Make the installed GHC use the host->target tools.
656+ ghc-settings-edit "$settingsFile" \
657+ "C compiler command" "${toolPath "cc" installCC}" \
658+ "Haskell CPP command" "${toolPath "cc" installCC}" \
659+ "C++ compiler command" "${toolPath "c++" installCC}" \
660+ "ld command" "${toolPath "ld${lib.optionalString useLdGold ".gold"}" installCC}" \
661+ "Merge objects command" "${toolPath "ld${lib.optionalString useLdGold ".gold"}" installCC}" \
662+ "ar command" "${toolPath "ar" installCC}" \
663+ "ranlib command" "${toolPath "ranlib" installCC}"
664+ ''
665+ + lib.optionalString (stdenv.targetPlatform.linker == "cctools") ''
666+ ghc-settings-edit "$settingsFile" \
667+ "otool command" "${toolPath "otool" installCC}" \
668+ "install_name_tool command" "${toolPath "install_name_tool" installCC}"
669+ ''
670+ + lib.optionalString useLLVM ''
671+ ghc-settings-edit "$settingsFile" \
672+ "LLVM llc command" "${lib.getBin llvmPackages.llvm}/bin/llc" \
673+ "LLVM opt command" "${lib.getBin llvmPackages.llvm}/bin/opt"
674+ ''
675+ + lib.optionalString (useLLVM && stdenv.targetPlatform.isDarwin) ''
676+ ghc-settings-edit "$settingsFile" \
677+ "LLVM clang command" "${
678+ # See comment for CLANG in preConfigure
679+ if installCC.isClang
680+ then toolPath "clang" installCC
681+ else "${llvmPackages.clang}/bin/${llvmPackages.clang.targetPrefix}clang"
682+ }"
683+ ''
684+ + ''
685+686 # Install the bash completion file.
687 install -Dm 644 utils/completion/ghc.bash $out/share/bash-completion/completions/${targetPrefix}ghc
688 '';
689690 passthru = {
691+ inherit bootPkgs targetPrefix haskellCompilerName;
692693 inherit llvmPackages;
694 inherit enableShared;
000695696 # Expose hadrian used for bootstrapping, for debugging purposes
697 inherit hadrian;
···708 guibou
709 ] ++ lib.teams.haskell.members;
710 timeout = 24 * 3600;
711+ platforms = lib.platforms.all;
712+ inherit (bootPkgs.ghc.meta) license;
713 };
714715 dontStrip = targetPlatform.useAndroidPrebuilt || targetPlatform.isWasm;
···3, url ? "https://downloads.haskell.org/ghc/${version}/ghc-${version}-src.tar.xz"
4}:
56-{ lib, stdenv, pkgsBuildTarget, pkgsHostTarget, targetPackages
78# build-tools
9, bootPkgs
···35, # If enabled, use -fPIC when compiling static libs.
36 enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
3738-, enableProfiledLibs ? true
003940, # Whether to build dynamic libs for the standard library (on the target
41 # platform). Static libs are always built.
42 enableShared ? with stdenv.targetPlatform; !isWindows && !useiOSPrebuilt && !isStatic
4344, # Whether to build terminfo.
45- enableTerminfo ? !stdenv.targetPlatform.isWindows
0004647, # What flavour to build. An empty string indicates no
48 # specific flavour and falls back to ghc default values.
···5859, enableHaddockProgram ?
60 # Disabled for cross; see note [HADDOCK_DOCS].
61- (stdenv.targetPlatform == stdenv.hostPlatform)
6263, # Whether to disable the large address space allocator
64 # necessary fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/
65 disableLargeAddressSpace ? stdenv.targetPlatform.isiOS
0000000066}:
6768assert !enableNativeBignum -> gmp != null;
6970# Cross cannot currently build the `haddock` program for silly reasons,
71# see note [HADDOCK_DOCS].
72-assert (stdenv.targetPlatform != stdenv.hostPlatform) -> !enableHaddockProgram;
0007374let
75 inherit (stdenv) buildPlatform hostPlatform targetPlatform;
76-77- inherit (bootPkgs) ghc;
7879 # TODO(@Ericson2314) Make unconditional
80 targetPrefix = lib.optionalString
···88 endif
89 BUILD_SPHINX_HTML = ${if enableDocs then "YES" else "NO"}
90 BUILD_SPHINX_PDF = NO
0091 '' +
92 # Note [HADDOCK_DOCS]:
93 # Unfortunately currently `HADDOCK_DOCS` controls both whether the `haddock`
···134 pkgsBuildTarget.targetPackages.stdenv.cc
135 ] ++ lib.optional useLLVM buildTargetLlvmPackages.llvm;
1360137 targetCC = builtins.head toolsForTarget;
0138139 # toolPath calculates the absolute path to the name tool associated with a
140 # given `stdenv.cc` derivation, i.e. it picks the correct derivation to take
···145 tools = {
146 "cc" = cc;
147 "c++" = cc;
148- as = cc.bintools.bintools;
149150- ar = cc.bintools.bintools;
151- ranlib = cc.bintools.bintools;
152- nm = cc.bintools.bintools;
153- readelf = cc.bintools.bintools;
0154155 ld = cc.bintools;
156 "ld.gold" = cc.bintools;
···169 if stdenv.targetPlatform.isDarwin
170 then cc.bintools
171 else cc.bintools.bintools;
000172 }.${name};
173 in
174 "${tools}/bin/${tools.targetPrefix}${name}";
···185 (lib.optionalString enableNativeBignum "-native-bignum")
186 ];
187188-in
000000000000000000000189190-# C compiler, bintools and LLVM are used at build time, but will also leak into
191-# the resulting GHC's settings file and used at runtime. This means that we are
192-# currently only able to build GHC if hostPlatform == buildPlatform.
193-assert targetCC == pkgsHostTarget.targetPackages.stdenv.cc;
194-assert buildTargetLlvmPackages.llvm == llvmPackages.llvm;
195-assert stdenv.targetPlatform.isDarwin -> buildTargetLlvmPackages.clang == llvmPackages.clang;
196197stdenv.mkDerivation (rec {
198 pname = "${targetPrefix}ghc${variantSuffix}";
···282 for env in $(env | grep '^TARGET_' | sed -E 's|\+?=.*||'); do
283 export "''${env#TARGET_}=''${!env}"
284 done
00285 # GHC is a bit confused on its cross terminology, as these would normally be
286 # the *host* tools.
287 export CC="${toolPath "cc" targetCC}"
···294 export RANLIB="${toolPath "ranlib" targetCC}"
295 export READELF="${toolPath "readelf" targetCC}"
296 export STRIP="${toolPath "strip" targetCC}"
0297 '' + lib.optionalString (stdenv.targetPlatform.linker == "cctools") ''
298 export OTOOL="${toolPath "otool" targetCC}"
299 export INSTALL_NAME_TOOL="${toolPath "install_name_tool" targetCC}"
···302 export OPT="${lib.getBin buildTargetLlvmPackages.llvm}/bin/opt"
303 '' + lib.optionalString (useLLVM && stdenv.targetPlatform.isDarwin) ''
304 # LLVM backend on Darwin needs clang: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/codegens.html#llvm-code-generator-fllvm
305- export CLANG="${buildTargetLlvmPackages.clang}/bin/${buildTargetLlvmPackages.clang.targetPrefix}clang"
0000000000306 ''
307 + ''
00000308 echo -n "${buildMK}" > mk/build.mk
309 ''
310 + lib.optionalString (lib.versionOlder version "9.2" || lib.versionAtLeast version "9.4") ''
···346 'MinBootGhcVersion="8.10"'
347 '';
348000349 # TODO(@Ericson2314): Always pass "--target" and always prefix.
350- configurePlatforms = [ "build" "host" ]
351- ++ lib.optional (targetPlatform != hostPlatform) "target";
352353 # `--with` flags for libraries needed for RTS linker
354 configureFlags = [
355 "--datadir=$doc/share/doc/ghc"
356- "--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib"
00357 ] ++ lib.optionals (libffi != null) [
358 "--with-system-libffi"
359- "--with-ffi-includes=${targetPackages.libffi.dev}/include"
360- "--with-ffi-libraries=${targetPackages.libffi.out}/lib"
361 ] ++ lib.optionals (targetPlatform == hostPlatform && !enableNativeBignum) [
362- "--with-gmp-includes=${targetPackages.gmp.dev}/include"
363- "--with-gmp-libraries=${targetPackages.gmp.out}/lib"
364 ] ++ lib.optionals (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
365 "--with-iconv-includes=${libiconv}/include"
366 "--with-iconv-libraries=${libiconv}/lib"
···372 "CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold"
373 ] ++ lib.optionals (disableLargeAddressSpace) [
374 "--disable-large-address-space"
00375 ];
376377 # Make sure we never relax`$PATH` and hooks support for compatibility.
···382383 nativeBuildInputs = [
384 perl autoconf automake m4 python3
385- ghc bootPkgs.alex bootPkgs.happy bootPkgs.hscolour
0386 ] ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [
387 autoSignDarwinBinariesHook
388 ] ++ lib.optionals enableDocs [
···393 xattr
394 ];
39500000000000396 # For building runtime libs
397 depsBuildTarget = toolsForTarget;
398399- buildInputs = [ perl bash ] ++ (libDeps hostPlatform);
000000400401 depsTargetTarget = map lib.getDev (libDeps targetPlatform);
402 depsTargetTargetPropagated = map (lib.getOutput "out") (libDeps targetPlatform);
···423 requiredSystemFeatures = [ "big-parallel" ];
424425 postInstall = ''
000000000000000000000000000000000426 # Install the bash completion file.
427 install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/${targetPrefix}ghc
428 '';
···448 guibou
449 ] ++ lib.teams.haskell.members;
450 timeout = 24 * 3600;
451- inherit (ghc.meta) license platforms;
0452 };
453454} // lib.optionalAttrs targetPlatform.useAndroidPrebuilt {
···3, url ? "https://downloads.haskell.org/ghc/${version}/ghc-${version}-src.tar.xz"
4}:
56+{ lib, stdenv, pkgsBuildTarget, pkgsHostTarget, buildPackages, targetPackages
78# build-tools
9, bootPkgs
···35, # If enabled, use -fPIC when compiling static libs.
36 enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
3738+ # Exceeds Hydra output limit (at the time of writing ~3GB) when cross compiled to riscv64.
39+ # A riscv64 cross-compiler fits into the limit comfortably.
40+, enableProfiledLibs ? !stdenv.hostPlatform.isRiscV64
4142, # Whether to build dynamic libs for the standard library (on the target
43 # platform). Static libs are always built.
44 enableShared ? with stdenv.targetPlatform; !isWindows && !useiOSPrebuilt && !isStatic
4546, # Whether to build terminfo.
47+ enableTerminfo ? !(stdenv.targetPlatform.isWindows
48+ # terminfo can't be built for cross
49+ || (stdenv.buildPlatform != stdenv.hostPlatform)
50+ || (stdenv.hostPlatform != stdenv.targetPlatform))
5152, # What flavour to build. An empty string indicates no
53 # specific flavour and falls back to ghc default values.
···6364, enableHaddockProgram ?
65 # Disabled for cross; see note [HADDOCK_DOCS].
66+ (stdenv.buildPlatform == stdenv.hostPlatform && stdenv.targetPlatform == stdenv.hostPlatform)
6768, # Whether to disable the large address space allocator
69 # necessary fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/
70 disableLargeAddressSpace ? stdenv.targetPlatform.isiOS
71+72+, # Whether to build an unregisterised version of GHC.
73+ # GHC will normally auto-detect whether it can do a registered build, but this
74+ # option will force it to do an unregistered build when set to true.
75+ # See https://gitlab.haskell.org/ghc/ghc/-/wikis/building/unregisterised
76+ # Registerised RV64 compiler produces programs that segfault
77+ # See https://gitlab.haskell.org/ghc/ghc/-/issues/23957
78+ enableUnregisterised ? stdenv.hostPlatform.isRiscV64 || stdenv.targetPlatform.isRiscV64
79}:
8081assert !enableNativeBignum -> gmp != null;
8283# Cross cannot currently build the `haddock` program for silly reasons,
84# see note [HADDOCK_DOCS].
85+assert (stdenv.buildPlatform != stdenv.hostPlatform || stdenv.targetPlatform != stdenv.hostPlatform) -> !enableHaddockProgram;
86+87+# GHC does not support building when all 3 platforms are different.
88+assert stdenv.buildPlatform == stdenv.hostPlatform || stdenv.hostPlatform == stdenv.targetPlatform;
8990let
91 inherit (stdenv) buildPlatform hostPlatform targetPlatform;
009293 # TODO(@Ericson2314) Make unconditional
94 targetPrefix = lib.optionalString
···102 endif
103 BUILD_SPHINX_HTML = ${if enableDocs then "YES" else "NO"}
104 BUILD_SPHINX_PDF = NO
105+106+ WITH_TERMINFO = ${if enableTerminfo then "YES" else "NO"}
107 '' +
108 # Note [HADDOCK_DOCS]:
109 # Unfortunately currently `HADDOCK_DOCS` controls both whether the `haddock`
···150 pkgsBuildTarget.targetPackages.stdenv.cc
151 ] ++ lib.optional useLLVM buildTargetLlvmPackages.llvm;
152153+ buildCC = buildPackages.stdenv.cc;
154 targetCC = builtins.head toolsForTarget;
155+ installCC = pkgsHostTarget.targetPackages.stdenv.cc;
156157 # toolPath calculates the absolute path to the name tool associated with a
158 # given `stdenv.cc` derivation, i.e. it picks the correct derivation to take
···163 tools = {
164 "cc" = cc;
165 "c++" = cc;
166+ as = cc.bintools;
167168+ ar = cc.bintools;
169+ ranlib = cc.bintools;
170+ nm = cc.bintools;
171+ readelf = cc.bintools;
172+ objdump = cc.bintools;
173174 ld = cc.bintools;
175 "ld.gold" = cc.bintools;
···188 if stdenv.targetPlatform.isDarwin
189 then cc.bintools
190 else cc.bintools.bintools;
191+192+ # clang is used as an assembler on darwin with the LLVM backend
193+ clang = cc;
194 }.${name};
195 in
196 "${tools}/bin/${tools.targetPrefix}${name}";
···207 (lib.optionalString enableNativeBignum "-native-bignum")
208 ];
209210+ # These libraries are library dependencies of the standard libraries bundled
211+ # by GHC (core libs) users will link their compiled artifacts again. Thus,
212+ # they should be taken from targetPackages.
213+ #
214+ # We need to use pkgsHostTarget if we are cross compiling a native GHC compiler,
215+ # though (when native compiling GHC, pkgsHostTarget == targetPackages):
216+ #
217+ # 1. targetPackages would be empty(-ish) in this situation since we can't
218+ # execute cross compiled compilers in order to obtain the libraries
219+ # that would be in targetPackages.
220+ # 2. pkgsHostTarget is fine to use since hostPlatform == targetPlatform in this
221+ # situation.
222+ # 3. The core libs used by the final GHC (stage 2) for user artifacts are also
223+ # used to build stage 2 GHC itself, i.e. the core libs are both host and
224+ # target.
225+ targetLibs = {
226+ inherit
227+ (if hostPlatform != targetPlatform then targetPackages else pkgsHostTarget)
228+ gmp
229+ libffi
230+ ncurses;
231+ };
232233+in
00000234235stdenv.mkDerivation (rec {
236 pname = "${targetPrefix}ghc${variantSuffix}";
···320 for env in $(env | grep '^TARGET_' | sed -E 's|\+?=.*||'); do
321 export "''${env#TARGET_}=''${!env}"
322 done
323+ # Stage0 (build->build) which builds stage 1
324+ export GHC="${bootPkgs.ghc}/bin/ghc"
325 # GHC is a bit confused on its cross terminology, as these would normally be
326 # the *host* tools.
327 export CC="${toolPath "cc" targetCC}"
···334 export RANLIB="${toolPath "ranlib" targetCC}"
335 export READELF="${toolPath "readelf" targetCC}"
336 export STRIP="${toolPath "strip" targetCC}"
337+ export OBJDUMP="${toolPath "objdump" targetCC}"
338 '' + lib.optionalString (stdenv.targetPlatform.linker == "cctools") ''
339 export OTOOL="${toolPath "otool" targetCC}"
340 export INSTALL_NAME_TOOL="${toolPath "install_name_tool" targetCC}"
···343 export OPT="${lib.getBin buildTargetLlvmPackages.llvm}/bin/opt"
344 '' + lib.optionalString (useLLVM && stdenv.targetPlatform.isDarwin) ''
345 # LLVM backend on Darwin needs clang: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/codegens.html#llvm-code-generator-fllvm
346+ # The executable we specify via $CLANG is used as an assembler (exclusively, it seems, but this isn't
347+ # clarified in any user facing documentation). As such, it'll be called on assembly produced by $CC
348+ # which usually comes from the darwin stdenv. To prevent a situation where $CLANG doesn't understand
349+ # the assembly it is given, we need to make sure that it matches the LLVM version of $CC if possible.
350+ # It is unclear (at the time of writing 2024-09-01) whether $CC should match the LLVM version we use
351+ # for llc and opt which would require using a custom darwin stdenv for targetCC.
352+ export CLANG="${
353+ if targetCC.isClang
354+ then toolPath "clang" targetCC
355+ else "${buildTargetLlvmPackages.clang}/bin/${buildTargetLlvmPackages.clang.targetPrefix}clang"
356+ }"
357 ''
358 + ''
359+ # No need for absolute paths since these tools only need to work during the build
360+ export CC_STAGE0="$CC_FOR_BUILD"
361+ export LD_STAGE0="$LD_FOR_BUILD"
362+ export AR_STAGE0="$AR_FOR_BUILD"
363+364 echo -n "${buildMK}" > mk/build.mk
365 ''
366 + lib.optionalString (lib.versionOlder version "9.2" || lib.versionAtLeast version "9.4") ''
···402 'MinBootGhcVersion="8.10"'
403 '';
404405+ # Although it is usually correct to pass --host, we don't do that here because
406+ # GHC's usage of build, host, and target is non-standard.
407+ # See https://gitlab.haskell.org/ghc/ghc/-/wikis/building/cross-compiling
408 # TODO(@Ericson2314): Always pass "--target" and always prefix.
409+ configurePlatforms = [ "build" ]
410+ ++ lib.optional (buildPlatform != hostPlatform || targetPlatform != hostPlatform) "target";
411412 # `--with` flags for libraries needed for RTS linker
413 configureFlags = [
414 "--datadir=$doc/share/doc/ghc"
415+ ] ++ lib.optionals enableTerminfo [
416+ "--with-curses-includes=${lib.getDev targetLibs.ncurses}/include"
417+ "--with-curses-libraries=${lib.getLib targetLibs.ncurses}/lib"
418 ] ++ lib.optionals (libffi != null) [
419 "--with-system-libffi"
420+ "--with-ffi-includes=${targetLibs.libffi.dev}/include"
421+ "--with-ffi-libraries=${targetLibs.libffi.out}/lib"
422 ] ++ lib.optionals (targetPlatform == hostPlatform && !enableNativeBignum) [
423+ "--with-gmp-includes=${targetLibs.gmp.dev}/include"
424+ "--with-gmp-libraries=${targetLibs.gmp.out}/lib"
425 ] ++ lib.optionals (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
426 "--with-iconv-includes=${libiconv}/include"
427 "--with-iconv-libraries=${libiconv}/lib"
···433 "CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold"
434 ] ++ lib.optionals (disableLargeAddressSpace) [
435 "--disable-large-address-space"
436+ ] ++ lib.optionals enableUnregisterised [
437+ "--enable-unregisterised"
438 ];
439440 # Make sure we never relax`$PATH` and hooks support for compatibility.
···445446 nativeBuildInputs = [
447 perl autoconf automake m4 python3
448+ bootPkgs.alex bootPkgs.happy bootPkgs.hscolour
449+ bootPkgs.ghc-settings-edit
450 ] ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [
451 autoSignDarwinBinariesHook
452 ] ++ lib.optionals enableDocs [
···457 xattr
458 ];
459460+ # Everything the stage0 compiler needs to build stage1: CC, bintools, extra libs.
461+ # See also GHC, {CC,LD,AR}_STAGE0 in preConfigure.
462+ depsBuildBuild = [
463+ # N.B. We do not declare bootPkgs.ghc in any of the stdenv.mkDerivation
464+ # dependency lists to prevent the bintools setup hook from adding ghc's
465+ # lib directory to the linker flags. Instead we tell configure about it
466+ # via the GHC environment variable.
467+ buildCC
468+ # stage0 builds terminfo unconditionally, so we always need ncurses
469+ ncurses
470+ ];
471 # For building runtime libs
472 depsBuildTarget = toolsForTarget;
473474+ # Prevent stage0 ghc from leaking into the final result. This was an issue
475+ # with GHC 9.6.
476+ disallowedReferences = [
477+ bootPkgs.ghc
478+ ];
479+480+ buildInputs = [ bash ] ++ (libDeps hostPlatform);
481482 depsTargetTarget = map lib.getDev (libDeps targetPlatform);
483 depsTargetTargetPropagated = map (lib.getOutput "out") (libDeps targetPlatform);
···504 requiredSystemFeatures = [ "big-parallel" ];
505506 postInstall = ''
507+ settingsFile="$out/lib/${targetPrefix}${passthru.haskellCompilerName}/settings"
508+509+ # Make the installed GHC use the host->target tools.
510+ ghc-settings-edit "$settingsFile" \
511+ "C compiler command" "${toolPath "cc" installCC}" \
512+ "Haskell CPP command" "${toolPath "cc" installCC}" \
513+ "C++ compiler command" "${toolPath "c++" installCC}" \
514+ "ld command" "${toolPath "ld${lib.optionalString useLdGold ".gold"}" installCC}" \
515+ "Merge objects command" "${toolPath "ld${lib.optionalString useLdGold ".gold"}" installCC}" \
516+ "ar command" "${toolPath "ar" installCC}" \
517+ "ranlib command" "${toolPath "ranlib" installCC}"
518+ ''
519+ + lib.optionalString (stdenv.targetPlatform.linker == "cctools") ''
520+ ghc-settings-edit "$settingsFile" \
521+ "otool command" "${toolPath "otool" installCC}" \
522+ "install_name_tool command" "${toolPath "install_name_tool" installCC}"
523+ ''
524+ + lib.optionalString useLLVM ''
525+ ghc-settings-edit "$settingsFile" \
526+ "LLVM llc command" "${lib.getBin llvmPackages.llvm}/bin/llc" \
527+ "LLVM opt command" "${lib.getBin llvmPackages.llvm}/bin/opt"
528+ ''
529+ + lib.optionalString (useLLVM && stdenv.targetPlatform.isDarwin) ''
530+ ghc-settings-edit "$settingsFile" \
531+ "LLVM clang command" "${
532+ # See comment for CLANG in preConfigure
533+ if installCC.isClang
534+ then toolPath "clang" installCC
535+ else "${llvmPackages.clang}/bin/${llvmPackages.clang.targetPrefix}clang"
536+ }"
537+ ''
538+ + ''
539+540 # Install the bash completion file.
541 install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/${targetPrefix}ghc
542 '';
···562 guibou
563 ] ++ lib.teams.haskell.members;
564 timeout = 24 * 3600;
565+ platforms = lib.platforms.all;
566+ inherit (bootPkgs.ghc.meta) license;
567 };
568569} // lib.optionalAttrs targetPlatform.useAndroidPrebuilt {
···83 with-utf8 = addExtraLibrary pkgs.libiconv super.with-utf8;
84 with-utf8_1_1_0_0 = addExtraLibrary pkgs.libiconv super.with-utf8_1_1_0_0;
8586- # the system-fileio tests use canonicalizePath, which fails in the sandbox
87- system-fileio = dontCheck super.system-fileio;
88-89 git-annex = overrideCabal (drv: {
90 # We can't use testFlags since git-annex side steps the Cabal test mechanism
91 preCheck = drv.preCheck or "" + ''
···83 with-utf8 = addExtraLibrary pkgs.libiconv super.with-utf8;
84 with-utf8_1_1_0_0 = addExtraLibrary pkgs.libiconv super.with-utf8_1_1_0_0;
8500086 git-annex = overrideCabal (drv: {
87 # We can't use testFlags since git-annex side steps the Cabal test mechanism
88 preCheck = drv.preCheck or "" + ''
···158 - amqp-conduit # failure in job https://hydra.nixos.org/build/233228080 at 2023-09-02
159 - amqp-worker # failure in job https://hydra.nixos.org/build/236675859 at 2023-10-04
160 - analyze # failure in job https://hydra.nixos.org/build/233251441 at 2023-09-02
0161 - anansi-pandoc # failure in job https://hydra.nixos.org/build/233252389 at 2023-09-02
162 - android-activity # failure in job https://hydra.nixos.org/build/233203400 at 2023-09-02
163 - android # failure in job https://hydra.nixos.org/build/233222148 at 2023-09-02
···611 - cabal2ebuild # failure in job https://hydra.nixos.org/build/233221248 at 2023-09-02
612 - cabal2ghci # failure in job https://hydra.nixos.org/build/233233018 at 2023-09-02
613 - cabal2json # failure in job https://hydra.nixos.org/build/233196099 at 2023-09-02
0614 - cabal-audit # failure in job https://hydra.nixos.org/build/233193414 at 2023-09-02
615 - cabal-auto-expose # failure in job https://hydra.nixos.org/build/233195440 at 2023-09-02
616 - cabal-build-programs # failure in job https://hydra.nixos.org/build/257091363 at 2024-04-27
···799 - clanki # failure in job https://hydra.nixos.org/build/233196970 at 2023-09-02
800 - clarifai # failure in job https://hydra.nixos.org/build/233229480 at 2023-09-02
801 - CLASE # failure in job https://hydra.nixos.org/build/233234459 at 2023-09-02
802- - clash-prelude # failure in job https://hydra.nixos.org/build/233252128 at 2023-09-02
00803 - Clash-Royale-Hack-Cheats # failure in job https://hydra.nixos.org/build/233216034 at 2023-09-02
000804 - ClasshSS # failure in job https://hydra.nixos.org/build/255688076 at 2024-04-16
805 - ClassLaws # failure in job https://hydra.nixos.org/build/233243019 at 2023-09-02
806 - classy-effects-base # failure in updateAutotoolsGnuConfigScriptsPhase in job https://hydra.nixos.org/build/237233636 at 2023-10-21
···1319 - dijkstra-simple # failure in job https://hydra.nixos.org/build/233218373 at 2023-09-02
1320 - DimensionalHash # failure in job https://hydra.nixos.org/build/233230945 at 2023-09-02
1321 - dino # failure in job https://hydra.nixos.org/build/252725815 at 2024-03-16
1322- - diohsc # failure in job https://hydra.nixos.org/build/259625302 at 2024-05-15
1323 - diophantine # failure in job https://hydra.nixos.org/build/233229215 at 2023-09-02
1324 - diplomacy # failure in job https://hydra.nixos.org/build/233207895 at 2023-09-02
1325 - direct-binary-files # failure in job https://hydra.nixos.org/build/233246387 at 2023-09-02
···1329 - directory-ospath-streaming # failure in job https://hydra.nixos.org/build/233240003 at 2023-09-02
1330 - direct-plugins # failure in job https://hydra.nixos.org/build/233211547 at 2023-09-02
1331 - direm # failure in job https://hydra.nixos.org/build/233211496 at 2023-09-02
01332 - disco # failure in job https://hydra.nixos.org/build/233212298 at 2023-09-02
1333 - discordian-calendar # failure in job https://hydra.nixos.org/build/233218124 at 2023-09-02
1334 - discord-types # failure in job https://hydra.nixos.org/build/233251778 at 2023-09-02
···2791 - hs2ps # failure in job https://hydra.nixos.org/build/233258362 at 2023-09-02
2792 - hsakamai # failure in job https://hydra.nixos.org/build/252722933 at 2024-03-16
2793 - hsaml2 # failure in job https://hydra.nixos.org/build/233252618 at 2023-09-02
02794 - hsautogui # failure in job https://hydra.nixos.org/build/253687662 at 2024-03-31
2795 - hsay # failure in job https://hydra.nixos.org/build/233218925 at 2023-09-02
2796 - hsbc # failure in job https://hydra.nixos.org/build/233206310 at 2023-09-02
···4809 - proof-assistant-bot # failure in job https://hydra.nixos.org/build/234974688 at 2023-09-13
4810 - proof-combinators # failure in job https://hydra.nixos.org/build/233210521 at 2023-09-02
4811 - PropaFP # failure in job https://hydra.nixos.org/build/233206496 at 2023-09-02
04812 - Proper # failure in job https://hydra.nixos.org/build/233194417 at 2023-09-02
4813 - properties # failure in job https://hydra.nixos.org/build/233240862 at 2023-09-02
4814 - property-list # failure in job https://hydra.nixos.org/build/233254907 at 2023-09-02
···5500 - sint # failure in job https://hydra.nixos.org/build/233238431 at 2023-09-02
5501 - siphash # failure in job https://hydra.nixos.org/build/233199344 at 2023-09-02
5502 - sitepipe # failure in job https://hydra.nixos.org/build/233201989 at 2023-09-02
05503 - sixfiguregroup # failure in job https://hydra.nixos.org/build/233252141 at 2023-09-02
5504 - sixty-five-oh-two # failure in job https://hydra.nixos.org/build/252714578 at 2024-03-16
5505 - sized-grid # failure in job https://hydra.nixos.org/build/233239056 at 2023-09-02
···5783 - strict-ghc-plugin # failure in job https://hydra.nixos.org/build/233246830 at 2023-09-02
5784 - strict-impl-params # failure in job https://hydra.nixos.org/build/252732248 at 2024-03-16
5785 - strictly # failure in job https://hydra.nixos.org/build/233197142 at 2023-09-02
05786 - strict-optics # failure in job https://hydra.nixos.org/build/267983907 at 2024-07-31
05787 - strict-tuple-lens # failure in job https://hydra.nixos.org/build/233194548 at 2023-09-02
5788 - strict-writer # failure in job https://hydra.nixos.org/build/252725649 at 2024-03-16
5789 - string-class # failure in job https://hydra.nixos.org/build/233230041 at 2023-09-02
···5888 - system-command # failure in job https://hydra.nixos.org/build/233239356 at 2023-09-02
5889 - systemd-ntfy # failure in job https://hydra.nixos.org/build/236686880 at 2023-10-04
5890 - system-extra # failure in job https://hydra.nixos.org/build/233203137 at 2023-09-02
5891- - system-fileio # failure in job https://hydra.nixos.org/build/252731084 at 2024-03-16
5892 - system-inotify # failure in job https://hydra.nixos.org/build/233206871 at 2023-09-02
5893 - system-lifted # failure in job https://hydra.nixos.org/build/233236013 at 2023-09-02
5894 - system-linux-proc # failure in job https://hydra.nixos.org/build/233209447 at 2023-09-02
···6095 - tiger # failure in job https://hydra.nixos.org/build/233249333 at 2023-09-02
6096 - TigerHash # failure in job https://hydra.nixos.org/build/233208162 at 2023-09-02
6097 - tightrope # failure in job https://hydra.nixos.org/build/233215237 at 2023-09-02
06098 - tikzsd # failure in job https://hydra.nixos.org/build/233224431 at 2023-09-02
6099 - timecalc # failure in job https://hydra.nixos.org/build/233207970 at 2023-09-02
6100 - time-extras # failure in job https://hydra.nixos.org/build/233204030 at 2023-09-02
···6262 - typed-process-effectful # failure in job https://hydra.nixos.org/build/236684332 at 2023-10-04
6263 - typedquery # failure in job https://hydra.nixos.org/build/233215307 at 2023-09-02
6264 - typed-session # failure in job https://hydra.nixos.org/build/270089993 at 2024-08-31
06265 - typed-spreadsheet # failure in job https://hydra.nixos.org/build/233248967 at 2023-09-02
6266 - typed-time # failure in job https://hydra.nixos.org/build/233246930 at 2023-09-02
6267 - typed-wire # failure in job https://hydra.nixos.org/build/233237626 at 2023-09-02
···6318 - unboxed # failure in job https://hydra.nixos.org/build/233219555 at 2023-09-02
6319 - unboxed-references # failure in job https://hydra.nixos.org/build/233192713 at 2023-09-02
6320 - unbreak # failure in job https://hydra.nixos.org/build/233242560 at 2023-09-02
06321 - unescaping-print # failure in job https://hydra.nixos.org/build/252736030 at 2024-03-16
6322 - unfix-binders # failure in job https://hydra.nixos.org/build/233259262 at 2023-09-02
6323 - unfoldable # failure in job https://hydra.nixos.org/build/252721990 at 2024-03-16
···158 - amqp-conduit # failure in job https://hydra.nixos.org/build/233228080 at 2023-09-02
159 - amqp-worker # failure in job https://hydra.nixos.org/build/236675859 at 2023-10-04
160 - analyze # failure in job https://hydra.nixos.org/build/233251441 at 2023-09-02
161+ - anansi # failure in job https://hydra.nixos.org/build/273451545 at 2024-10-01
162 - anansi-pandoc # failure in job https://hydra.nixos.org/build/233252389 at 2023-09-02
163 - android-activity # failure in job https://hydra.nixos.org/build/233203400 at 2023-09-02
164 - android # failure in job https://hydra.nixos.org/build/233222148 at 2023-09-02
···612 - cabal2ebuild # failure in job https://hydra.nixos.org/build/233221248 at 2023-09-02
613 - cabal2ghci # failure in job https://hydra.nixos.org/build/233233018 at 2023-09-02
614 - cabal2json # failure in job https://hydra.nixos.org/build/233196099 at 2023-09-02
615+ - cabal-add # failure in job https://hydra.nixos.org/build/273461296 at 2024-10-01
616 - cabal-audit # failure in job https://hydra.nixos.org/build/233193414 at 2023-09-02
617 - cabal-auto-expose # failure in job https://hydra.nixos.org/build/233195440 at 2023-09-02
618 - cabal-build-programs # failure in job https://hydra.nixos.org/build/257091363 at 2024-04-27
···801 - clanki # failure in job https://hydra.nixos.org/build/233196970 at 2023-09-02
802 - clarifai # failure in job https://hydra.nixos.org/build/233229480 at 2023-09-02
803 - CLASE # failure in job https://hydra.nixos.org/build/233234459 at 2023-09-02
804+ - clashilator # failure in job https://hydra.nixos.org/build/273442437 at 2024-10-01
805+ - clash-multisignal # failure in job https://hydra.nixos.org/build/273463331 at 2024-10-01
806+ - clash-prelude-quickcheck # failure in job https://hydra.nixos.org/build/273453747 at 2024-10-01
807 - Clash-Royale-Hack-Cheats # failure in job https://hydra.nixos.org/build/233216034 at 2023-09-02
808+ - clash-systemverilog # failure in job https://hydra.nixos.org/build/273453889 at 2024-10-01
809+ - clash-verilog # failure in job https://hydra.nixos.org/build/273466517 at 2024-10-01
810+ - clash-vhdl # failure in job https://hydra.nixos.org/build/273460098 at 2024-10-01
811 - ClasshSS # failure in job https://hydra.nixos.org/build/255688076 at 2024-04-16
812 - ClassLaws # failure in job https://hydra.nixos.org/build/233243019 at 2023-09-02
813 - classy-effects-base # failure in updateAutotoolsGnuConfigScriptsPhase in job https://hydra.nixos.org/build/237233636 at 2023-10-21
···1326 - dijkstra-simple # failure in job https://hydra.nixos.org/build/233218373 at 2023-09-02
1327 - DimensionalHash # failure in job https://hydra.nixos.org/build/233230945 at 2023-09-02
1328 - dino # failure in job https://hydra.nixos.org/build/252725815 at 2024-03-16
01329 - diophantine # failure in job https://hydra.nixos.org/build/233229215 at 2023-09-02
1330 - diplomacy # failure in job https://hydra.nixos.org/build/233207895 at 2023-09-02
1331 - direct-binary-files # failure in job https://hydra.nixos.org/build/233246387 at 2023-09-02
···1335 - directory-ospath-streaming # failure in job https://hydra.nixos.org/build/233240003 at 2023-09-02
1336 - direct-plugins # failure in job https://hydra.nixos.org/build/233211547 at 2023-09-02
1337 - direm # failure in job https://hydra.nixos.org/build/233211496 at 2023-09-02
1338+ - dirstream # failure in job https://hydra.nixos.org/build/273442606 at 2024-10-01
1339 - disco # failure in job https://hydra.nixos.org/build/233212298 at 2023-09-02
1340 - discordian-calendar # failure in job https://hydra.nixos.org/build/233218124 at 2023-09-02
1341 - discord-types # failure in job https://hydra.nixos.org/build/233251778 at 2023-09-02
···2798 - hs2ps # failure in job https://hydra.nixos.org/build/233258362 at 2023-09-02
2799 - hsakamai # failure in job https://hydra.nixos.org/build/252722933 at 2024-03-16
2800 - hsaml2 # failure in job https://hydra.nixos.org/build/233252618 at 2023-09-02
2801+ - hs-asapo # failure in job https://hydra.nixos.org/build/273456994 at 2024-10-01
2802 - hsautogui # failure in job https://hydra.nixos.org/build/253687662 at 2024-03-31
2803 - hsay # failure in job https://hydra.nixos.org/build/233218925 at 2023-09-02
2804 - hsbc # failure in job https://hydra.nixos.org/build/233206310 at 2023-09-02
···4817 - proof-assistant-bot # failure in job https://hydra.nixos.org/build/234974688 at 2023-09-13
4818 - proof-combinators # failure in job https://hydra.nixos.org/build/233210521 at 2023-09-02
4819 - PropaFP # failure in job https://hydra.nixos.org/build/233206496 at 2023-09-02
4820+ - propeller # failure in job https://hydra.nixos.org/build/273449652 at 2024-10-01
4821 - Proper # failure in job https://hydra.nixos.org/build/233194417 at 2023-09-02
4822 - properties # failure in job https://hydra.nixos.org/build/233240862 at 2023-09-02
4823 - property-list # failure in job https://hydra.nixos.org/build/233254907 at 2023-09-02
···5509 - sint # failure in job https://hydra.nixos.org/build/233238431 at 2023-09-02
5510 - siphash # failure in job https://hydra.nixos.org/build/233199344 at 2023-09-02
5511 - sitepipe # failure in job https://hydra.nixos.org/build/233201989 at 2023-09-02
5512+ - si-timers # failure in job https://hydra.nixos.org/build/273467737 at 2024-10-01
5513 - sixfiguregroup # failure in job https://hydra.nixos.org/build/233252141 at 2023-09-02
5514 - sixty-five-oh-two # failure in job https://hydra.nixos.org/build/252714578 at 2024-03-16
5515 - sized-grid # failure in job https://hydra.nixos.org/build/233239056 at 2023-09-02
···5793 - strict-ghc-plugin # failure in job https://hydra.nixos.org/build/233246830 at 2023-09-02
5794 - strict-impl-params # failure in job https://hydra.nixos.org/build/252732248 at 2024-03-16
5795 - strictly # failure in job https://hydra.nixos.org/build/233197142 at 2023-09-02
5796+ - strict-mvar # failure in job https://hydra.nixos.org/build/273459853 at 2024-10-01
5797 - strict-optics # failure in job https://hydra.nixos.org/build/267983907 at 2024-07-31
5798+ - strict-stm # failure in job https://hydra.nixos.org/build/273449297 at 2024-10-01
5799 - strict-tuple-lens # failure in job https://hydra.nixos.org/build/233194548 at 2023-09-02
5800 - strict-writer # failure in job https://hydra.nixos.org/build/252725649 at 2024-03-16
5801 - string-class # failure in job https://hydra.nixos.org/build/233230041 at 2023-09-02
···5900 - system-command # failure in job https://hydra.nixos.org/build/233239356 at 2023-09-02
5901 - systemd-ntfy # failure in job https://hydra.nixos.org/build/236686880 at 2023-10-04
5902 - system-extra # failure in job https://hydra.nixos.org/build/233203137 at 2023-09-02
05903 - system-inotify # failure in job https://hydra.nixos.org/build/233206871 at 2023-09-02
5904 - system-lifted # failure in job https://hydra.nixos.org/build/233236013 at 2023-09-02
5905 - system-linux-proc # failure in job https://hydra.nixos.org/build/233209447 at 2023-09-02
···6106 - tiger # failure in job https://hydra.nixos.org/build/233249333 at 2023-09-02
6107 - TigerHash # failure in job https://hydra.nixos.org/build/233208162 at 2023-09-02
6108 - tightrope # failure in job https://hydra.nixos.org/build/233215237 at 2023-09-02
6109+ - tiktoken # failure in job https://hydra.nixos.org/build/273448419 at 2024-10-01
6110 - tikzsd # failure in job https://hydra.nixos.org/build/233224431 at 2023-09-02
6111 - timecalc # failure in job https://hydra.nixos.org/build/233207970 at 2023-09-02
6112 - time-extras # failure in job https://hydra.nixos.org/build/233204030 at 2023-09-02
···6274 - typed-process-effectful # failure in job https://hydra.nixos.org/build/236684332 at 2023-10-04
6275 - typedquery # failure in job https://hydra.nixos.org/build/233215307 at 2023-09-02
6276 - typed-session # failure in job https://hydra.nixos.org/build/270089993 at 2024-08-31
6277+ - typed-session-state-algorithm # failure in job https://hydra.nixos.org/build/273462641 at 2024-10-01
6278 - typed-spreadsheet # failure in job https://hydra.nixos.org/build/233248967 at 2023-09-02
6279 - typed-time # failure in job https://hydra.nixos.org/build/233246930 at 2023-09-02
6280 - typed-wire # failure in job https://hydra.nixos.org/build/233237626 at 2023-09-02
···6331 - unboxed # failure in job https://hydra.nixos.org/build/233219555 at 2023-09-02
6332 - unboxed-references # failure in job https://hydra.nixos.org/build/233192713 at 2023-09-02
6333 - unbreak # failure in job https://hydra.nixos.org/build/233242560 at 2023-09-02
6334+ - uncertain # failure in job https://hydra.nixos.org/build/273461304 at 2024-10-01
6335 - unescaping-print # failure in job https://hydra.nixos.org/build/252736030 at 2024-03-16
6336 - unfix-binders # failure in job https://hydra.nixos.org/build/233259262 at 2023-09-02
6337 - unfoldable # failure in job https://hydra.nixos.org/build/252721990 at 2024-03-16
···17 # from the latest master instead of the current version on Hackage.
18 cabal2nix-unstable = self.callPackage ./cabal2nix-unstable.nix { };
190020 # https://github.com/channable/vaultenv/issues/1
21 vaultenv = self.callPackage ../tools/haskell/vaultenv { };
22
···17 # from the latest master instead of the current version on Hackage.
18 cabal2nix-unstable = self.callPackage ./cabal2nix-unstable.nix { };
1920+ ghc-settings-edit = self.callPackage ../tools/haskell/ghc-settings-edit { };
21+22 # https://github.com/channable/vaultenv/issues/1
23 vaultenv = self.callPackage ../tools/haskell/vaultenv { };
24
···1+ghc-settings-edit is a small tool for changing certain fields in the settings
2+file that is part of every GHC installation (usually located at
3+lib/ghc-$version/lib/settings or lib/ghc-$version/settings). This is sometimes
4+necessary because GHC's build process leaks the tools used at build time into
5+the final settings file. This is fine, as long as the build and host platform
6+of the GHC build is the same since it will be possible to execute the tools
7+used at build time at run time. In case we are cross compiling GHC itself,
8+the settings file needs to be changed so that the correct tools are used in the
9+final installation. The GHC build system itself doesn't allow for this due to
10+its somewhat peculiar bootstrapping mechanism.
11+12+This tool was originally written by sternenseemann and is licensed under the MIT
13+license (as is nixpkgs) as well as the BSD 3 Clause license since it incorporates
14+some code from GHC. It is primarily intended for use in nixpkgs, so it should be
15+considered unstable: No guarantees about the stability of its command line
16+interface are made at this time.
17+18+> -- SPDX-License-Identifier: MIT AND BSD-3-Clause
19+> {-# LANGUAGE LambdaCase #-}
20+> module Main where
21+22+ghc-settings-edit requires no additional dependencies to the ones already
23+required to bootstrap GHC. This means that it only depends on GHC and core
24+libraries shipped with the compiler (base and containers). This property should
25+be preserved going forward as to not needlessly complicate bootstrapping GHC
26+in nixpkgs. Additionally, a wide range of library versions and thus GHC versions
27+should be supported (via CPP if necessary).
28+29+> import Control.Monad (foldM)
30+> import qualified Data.Map.Lazy as Map
31+> import System.Environment (getArgs, getProgName)
32+> import Text.Read (readEither)
33+34+Note that the containers dependency is needed to represent the contents of the
35+settings file. In theory, [(String, String)] (think lookup) would suffice, but
36+base doesn't provide any facilities for updating such lists. To avoid needlessly
37+reinventing the wheel here, we depend on an extra core library.
38+39+> type SettingsMap = Map.Map String String
40+41+ghc-settings-edit accepts the following arguments:
42+43+- The path to the settings file which is edited in place.
44+- For every field in the settings file to be updated, two arguments need to be
45+ passed: the name of the field and its new value. Any number of these pairs
46+ may be provided. If a field is missing from the given settings file,
47+ it won't be added (see also below).
48+49+> usage :: String -> String
50+> usage name = "Usage: " ++ name ++ " FILE [KEY NEWVAL [KEY2 NEWVAL2 ...]]"
51+52+The arguments and the contents of the settings file are fed into the performEdits
53+function which implements the main logic of ghc-settings-edit (except IO).
54+55+> performEdits :: [String] -> String -> Either String String
56+> performEdits editArgs settingsString = do
57+58+First, the settings file is parsed and read into the SettingsMap structure. For
59+parsing, we can simply rely read, as GHC uses the familiar Read/Show format
60+(plus some formatting) for storing its settings. This is the main reason
61+ghc-settings-edit is written in Haskell: We don't need to roll our own parser.
62+63+> settingsMap <- Map.fromList <$> readEither settingsString
64+65+We also need to parse the remaining command line arguments (after the path)
66+which means splitting them into pairs of arguments describing the individual
67+edits. We use the chunkList utility function from GHC for this which is vendored
68+below. Since it doesn't guarantee that all sublists have the exact length given,
69+we'll have to check the length of the returned “pairs” later.
70+71+> let edits = chunkList 2 editArgs
72+73+Since each edit is a transformation of the SettingsMap, we use a fold to go
74+through the edits. The Either monad allows us to bail out if one is malformed.
75+The use of Map.adjust ensures that fields that aren't present in the original
76+settings file aren't added since the corresponding GHC installation wouldn't
77+understand them. Note that this is done silently which may be suboptimal:
78+It could be better to fail.
79+80+> show . Map.toList <$> foldM applyEdit settingsMap edits
81+> where
82+> applyEdit :: SettingsMap -> [String] -> Either String SettingsMap
83+> applyEdit m [key, newValue] = Right $ Map.adjust (const newValue) key m
84+> applyEdit _ _ = Left "Uneven number of edit arguments provided"
85+86+main just wraps performEdits and takes care of reading from and writing to the
87+given file.
88+89+> main :: IO ()
90+> main =
91+> getArgs >>= \case
92+> (settingsFile:edits) -> do
93+> orig <- readFile settingsFile
94+> case performEdits edits orig of
95+> Right edited -> writeFile settingsFile edited
96+> Left errorMsg -> error errorMsg
97+> _ -> do
98+> name <- getProgName
99+> error $ usage name
100+101+As mentioned, chunkList is taken from GHC, specifically GHC.Utils.Misc of GHC
102+verson 9.8.2. We don't depend on the ghc library directly (which would be
103+possible in theory) since there are no stability guarantees or deprecation
104+windows for the ghc's public library.
105+106+> -- | Split a list into chunks of /n/ elements
107+> chunkList :: Int -> [a] -> [[a]]
108+> chunkList _ [] = []
109+> chunkList n xs = as : chunkList n bs where (as,bs) = splitAt n xs
+2-2
pkgs/development/tools/misc/binutils/default.nix
···84 # not need to know binutils' BINDIR at all. It's an absolute path
85 # where libraries are stored.
86 ./plugins-no-BINDIR.patch
87- ] ++ lib.optionals buildPlatform.isDarwin [
88 # Note: Conditional to avoid Linux rebuilds on staging-next. Remove the conditional with the next update.
89 # ld64 needs `-undefined dynamic_lookup` to link `libctf-nobfd.dylib`, but the Darwin
90 # version detection in `libtool.m4` fails to detect the Darwin version correctly.
···122 ++ lib.optionals targetPlatform.isVc4 [ flex ]
123 ;
124125- buildInputs = [ zlib gettext ] ++ lib.optionals buildPlatform.isDarwin [ CoreServices ];
126127 inherit noSysDirs;
128
···84 # not need to know binutils' BINDIR at all. It's an absolute path
85 # where libraries are stored.
86 ./plugins-no-BINDIR.patch
87+ ] ++ lib.optionals hostPlatform.isDarwin [
88 # Note: Conditional to avoid Linux rebuilds on staging-next. Remove the conditional with the next update.
89 # ld64 needs `-undefined dynamic_lookup` to link `libctf-nobfd.dylib`, but the Darwin
90 # version detection in `libtool.m4` fails to detect the Darwin version correctly.
···122 ++ lib.optionals targetPlatform.isVc4 [ flex ]
123 ;
124125+ buildInputs = [ zlib gettext ] ++ lib.optionals hostPlatform.isDarwin [ CoreServices ];
126127 inherit noSysDirs;
128
+2
pkgs/test/cross/default.nix
···146 pkgs.pkgsCross.mips64el-linux-gnuabi64.stdenv
147 pkgs.pkgsCross.mips64el-linux-gnuabin32.stdenv
148 pkgs.pkgsCross.mingwW64.stdenv
00149150 ] ++ lib.optionals (with pkgs.stdenv.buildPlatform; isx86_64 && isLinux) [
151 # Musl-to-glibc cross on the same architecture tends to turn up
···146 pkgs.pkgsCross.mips64el-linux-gnuabi64.stdenv
147 pkgs.pkgsCross.mips64el-linux-gnuabin32.stdenv
148 pkgs.pkgsCross.mingwW64.stdenv
149+ # Uses the expression that is used by the most cross-compil_ed_ GHCs
150+ pkgs.pkgsCross.riscv64.haskell.compiler.native-bignum.ghc948
151152 ] ++ lib.optionals (with pkgs.stdenv.buildPlatform; isx86_64 && isLinux) [
153 # Musl-to-glibc cross on the same architecture tends to turn up
+94-83
pkgs/top-level/haskell-packages.nix
···1-{ buildPackages, pkgsBuildTarget, pkgs, newScope, stdenv }:
23let
4 # These are attributes in compiler that support integer-simple.
···5253 package-list = callPackage ../development/haskell-modules/package-list.nix {};
5455- compiler = {
0000000000056 ghc865Binary = callPackage ../development/compilers/ghc/8.6.5-binary.nix {
57 # Should be llvmPackages_6 which has been removed from nixpkgs
58 llvmPackages = null;
···73 ghc8107 = callPackage ../development/compilers/ghc/8.10.7.nix {
74 bootPkgs =
75 # the oldest ghc with aarch64-darwin support is 8.10.5
76- if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
77 # to my (@a-m-joseph) knowledge there are no newer official binaries for this platform
78- packages.ghc865Binary
79 else
80- packages.ghc8107Binary;
81 inherit (buildPackages.python311Packages) sphinx; # a distutils issue with 3.12
82 python3 = buildPackages.python311; # so that we don't have two of them
83 # Need to use apple's patched xattr until
···91 ghc902 = callPackage ../development/compilers/ghc/9.0.2.nix {
92 bootPkgs =
93 # the oldest ghc with aarch64-darwin support is 8.10.5
94- if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
95- packages.ghc810
96 else
97- packages.ghc8107Binary;
98 inherit (buildPackages.python311Packages) sphinx; # a distutils issue with 3.12
99 python3 = buildPackages.python311; # so that we don't have two of them
100 inherit (buildPackages.darwin) autoSignDarwinBinariesHook xattr;
···104 ghc90 = compiler.ghc902;
105 ghc925 = callPackage ../development/compilers/ghc/9.2.5.nix {
106 bootPkgs =
107- if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
108- packages.ghc810
109 else
110- packages.ghc8107Binary;
111 inherit (buildPackages.python311Packages) sphinx; # a distutils issue with 3.12
112 python3 = buildPackages.python311; # so that we don't have two of them
113 # Need to use apple's patched xattr until
···119 };
120 ghc926 = callPackage ../development/compilers/ghc/9.2.6.nix {
121 bootPkgs =
122- if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
123- packages.ghc810
124 else
125- packages.ghc8107Binary;
126 inherit (buildPackages.python311Packages) sphinx; # a distutils issue with 3.12
127 python3 = buildPackages.python311; # so that we don't have two of them
128 # Need to use apple's patched xattr until
···134 };
135 ghc927 = callPackage ../development/compilers/ghc/9.2.7.nix {
136 bootPkgs =
137- if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
138- packages.ghc810
139 else
140- packages.ghc8107Binary;
141 inherit (buildPackages.python311Packages) sphinx; # a distutils issue with 3.12
142 python3 = buildPackages.python311; # so that we don't have two of them
143 # Need to use apple's patched xattr until
···149 };
150 ghc928 = callPackage ../development/compilers/ghc/9.2.8.nix {
151 bootPkgs =
152- if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
153- packages.ghc810
154 else
155- packages.ghc8107Binary;
156 inherit (buildPackages.python311Packages) sphinx; # a distutils issue with 3.12
157 python3 = buildPackages.python311; # so that we don't have two of them
158 # Need to use apple's patched xattr until
···170 # Use 8.10 as a workaround where possible to keep bootstrap path short.
171172 # On ARM text won't build with GHC 8.10.*
173- if stdenv.hostPlatform.isAarch then
174 # TODO(@sternenseemann): package bindist
175- packages.ghc902
176 # No suitable bindists for powerpc64le
177- else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
178- packages.ghc902
179 else
180- packages.ghc8107Binary;
181 inherit (buildPackages.python311Packages) sphinx; # a distutils issue with 3.12
182 python3 = buildPackages.python311; # so that we don't have two of them
183 # Need to use apple's patched xattr until
···195 # Use 8.10 as a workaround where possible to keep bootstrap path short.
196197 # On ARM text won't build with GHC 8.10.*
198- if stdenv.hostPlatform.isAarch then
199 # TODO(@sternenseemann): package bindist
200- packages.ghc902
201 # No suitable bindists for powerpc64le
202- else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
203- packages.ghc902
204 else
205- packages.ghc8107Binary;
206 inherit (buildPackages.python311Packages) sphinx; # a distutils issue with 3.12
207 python3 = buildPackages.python311; # so that we don't have two of them
208 # Need to use apple's patched xattr until
···220 # Use 8.10 as a workaround where possible to keep bootstrap path short.
221222 # On ARM text won't build with GHC 8.10.*
223- if stdenv.hostPlatform.isAarch then
224 # TODO(@sternenseemann): package bindist
225- packages.ghc902
226 # No suitable bindists for powerpc64le
227- else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
228- packages.ghc902
229 else
230- packages.ghc8107Binary;
231 inherit (buildPackages.python3Packages) sphinx;
232 # Need to use apple's patched xattr until
233 # https://github.com/xattr/xattr/issues/44 and
···244 # Use 8.10 as a workaround where possible to keep bootstrap path short.
245246 # On ARM text won't build with GHC 8.10.*
247- if stdenv.hostPlatform.isAarch then
248 # TODO(@sternenseemann): package bindist
249- packages.ghc902
250 # No suitable bindists for powerpc64le
251- else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
252- packages.ghc902
253 else
254- packages.ghc8107Binary;
255 inherit (buildPackages.python3Packages) sphinx;
256 # Need to use apple's patched xattr until
257 # https://github.com/xattr/xattr/issues/44 and
···265 ghc963 = callPackage ../development/compilers/ghc/9.6.3.nix {
266 bootPkgs =
267 # For GHC 9.2 no armv7l bindists are available.
268- if stdenv.hostPlatform.isAarch32 then
269- packages.ghc928
270- else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
271- packages.ghc928
272 else
273- packages.ghc924Binary;
274 inherit (buildPackages.python3Packages) sphinx;
275 # Need to use apple's patched xattr until
276 # https://github.com/xattr/xattr/issues/44 and
···283 ghc964 = callPackage ../development/compilers/ghc/9.6.4.nix {
284 bootPkgs =
285 # For GHC 9.2 no armv7l bindists are available.
286- if stdenv.hostPlatform.isAarch32 then
287- packages.ghc928
288- else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
289- packages.ghc928
290 else
291- packages.ghc924Binary;
292 inherit (buildPackages.python3Packages) sphinx;
293 # Need to use apple's patched xattr until
294 # https://github.com/xattr/xattr/issues/44 and
···301 ghc965 = callPackage ../development/compilers/ghc/9.6.5.nix {
302 bootPkgs =
303 # For GHC 9.2 no armv7l bindists are available.
304- if stdenv.hostPlatform.isAarch32 then
305- packages.ghc928
306- else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
307- packages.ghc928
308 else
309- packages.ghc924Binary;
310 inherit (buildPackages.python3Packages) sphinx;
311 # Need to use apple's patched xattr until
312 # https://github.com/xattr/xattr/issues/44 and
···319 ghc966 = callPackage ../development/compilers/ghc/9.6.6.nix {
320 bootPkgs =
321 # For GHC 9.2 no armv7l bindists are available.
322- if stdenv.hostPlatform.isAarch32 then
323- packages.ghc928
324- else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
325- packages.ghc928
326 else
327- packages.ghc924Binary;
328 inherit (buildPackages.python3Packages) sphinx;
329 # Need to use apple's patched xattr until
330 # https://github.com/xattr/xattr/issues/44 and
···338 ghc981 = callPackage ../development/compilers/ghc/9.8.1.nix {
339 bootPkgs =
340 # For GHC 9.6 no armv7l bindists are available.
341- if stdenv.hostPlatform.isAarch32 then
342- packages.ghc963
343- else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
344- packages.ghc963
345 else
346- packages.ghc963Binary;
347 inherit (buildPackages.python3Packages) sphinx;
348 # Need to use apple's patched xattr until
349 # https://github.com/xattr/xattr/issues/44 and
···356 ghc982 = callPackage ../development/compilers/ghc/9.8.2.nix {
357 bootPkgs =
358 # For GHC 9.6 no armv7l bindists are available.
359- if stdenv.hostPlatform.isAarch32 then
360- packages.ghc963
361- else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
362- packages.ghc963
363 else
364- packages.ghc963Binary;
365 inherit (buildPackages.python3Packages) sphinx;
366 # Need to use apple's patched xattr until
367 # https://github.com/xattr/xattr/issues/44 and
···375 ghc9101 = callPackage ../development/compilers/ghc/9.10.1.nix {
376 bootPkgs =
377 # For GHC 9.6 no armv7l bindists are available.
378- if stdenv.hostPlatform.isAarch32 then
379- packages.ghc963
380- else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
381- packages.ghc963
382- else if stdenv.hostPlatform.isDarwin then
383 # it seems like the GHC 9.6.* bindists are built with a different
384 # toolchain than we are using (which I'm guessing from the fact
385 # that 9.6.4 bindists pass linker flags our ld doesn't support).
386 # With both 9.6.3 and 9.6.4 binary it is impossible to link against
387 # the clock package (probably a hsc2hs problem).
388- packages.ghc963
389 else
390- packages.ghc963Binary;
391 inherit (buildPackages.python3Packages) sphinx;
392 # Need to use apple's patched xattr until
393 # https://github.com/xattr/xattr/issues/44 and
···401 ghcHEAD = callPackage ../development/compilers/ghc/head.nix {
402 bootPkgs =
403 # For GHC 9.6 no armv7l bindists are available.
404- if stdenv.hostPlatform.isAarch32 then
405- packages.ghc963
406- else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
407- packages.ghc963
408 else
409- packages.ghc963Binary;
410 inherit (buildPackages.python3Packages) sphinx;
411 # Need to use apple's patched xattr until
412 # https://github.com/xattr/xattr/issues/44 and
···419420 ghcjs = compiler.ghcjs810;
421 ghcjs810 = callPackage ../development/compilers/ghcjs/8.10 {
422- bootPkgs = packages.ghc810;
423 ghcjsSrcJson = ../development/compilers/ghcjs/8.10/git.json;
424 stage0 = ../development/compilers/ghcjs/8.10/stage0.nix;
425 };
···1+{ buildPackages, pkgsBuildBuild, pkgsBuildTarget, pkgs, newScope, stdenv }:
23let
4 # These are attributes in compiler that support integer-simple.
···5253 package-list = callPackage ../development/haskell-modules/package-list.nix {};
5455+ # Always get boot compilers from `pkgsBuildBuild`. The boot (stage0) compiler
56+ # is used to build another compiler (stage1) that'll be used to build the
57+ # final compiler (stage2) (except when building a cross-compiler). This means
58+ # that stage1's host platform is the same as stage0: build. Consequently,
59+ # stage0 needs to be build->build.
60+ #
61+ # Note that we use bb.haskell.packages.*. haskell.packages.*.ghc is similar to
62+ # stdenv: The ghc comes from the previous package set, i.e. this predicate holds:
63+ # `name: pkgs: pkgs.haskell.packages.${name}.ghc == pkgs.buildPackages.haskell.compiler.${name}.ghc`.
64+ # This isn't problematic since pkgsBuildBuild.buildPackages is also build->build,
65+ # just something to keep in mind.
66+ compiler = let bb = pkgsBuildBuild.haskell; in {
67 ghc865Binary = callPackage ../development/compilers/ghc/8.6.5-binary.nix {
68 # Should be llvmPackages_6 which has been removed from nixpkgs
69 llvmPackages = null;
···84 ghc8107 = callPackage ../development/compilers/ghc/8.10.7.nix {
85 bootPkgs =
86 # the oldest ghc with aarch64-darwin support is 8.10.5
87+ if stdenv.buildPlatform.isPower64 && stdenv.buildPlatform.isLittleEndian then
88 # to my (@a-m-joseph) knowledge there are no newer official binaries for this platform
89+ bb.packages.ghc865Binary
90 else
91+ bb.packages.ghc8107Binary;
92 inherit (buildPackages.python311Packages) sphinx; # a distutils issue with 3.12
93 python3 = buildPackages.python311; # so that we don't have two of them
94 # Need to use apple's patched xattr until
···102 ghc902 = callPackage ../development/compilers/ghc/9.0.2.nix {
103 bootPkgs =
104 # the oldest ghc with aarch64-darwin support is 8.10.5
105+ if stdenv.buildPlatform.isPower64 && stdenv.buildPlatform.isLittleEndian then
106+ bb.packages.ghc810
107 else
108+ bb.packages.ghc8107Binary;
109 inherit (buildPackages.python311Packages) sphinx; # a distutils issue with 3.12
110 python3 = buildPackages.python311; # so that we don't have two of them
111 inherit (buildPackages.darwin) autoSignDarwinBinariesHook xattr;
···115 ghc90 = compiler.ghc902;
116 ghc925 = callPackage ../development/compilers/ghc/9.2.5.nix {
117 bootPkgs =
118+ if stdenv.buildPlatform.isPower64 && stdenv.buildPlatform.isLittleEndian then
119+ bb.packages.ghc810
120 else
121+ bb.packages.ghc8107Binary;
122 inherit (buildPackages.python311Packages) sphinx; # a distutils issue with 3.12
123 python3 = buildPackages.python311; # so that we don't have two of them
124 # Need to use apple's patched xattr until
···130 };
131 ghc926 = callPackage ../development/compilers/ghc/9.2.6.nix {
132 bootPkgs =
133+ if stdenv.buildPlatform.isPower64 && stdenv.buildPlatform.isLittleEndian then
134+ bb.packages.ghc810
135 else
136+ bb.packages.ghc8107Binary;
137 inherit (buildPackages.python311Packages) sphinx; # a distutils issue with 3.12
138 python3 = buildPackages.python311; # so that we don't have two of them
139 # Need to use apple's patched xattr until
···145 };
146 ghc927 = callPackage ../development/compilers/ghc/9.2.7.nix {
147 bootPkgs =
148+ if stdenv.buildPlatform.isPower64 && stdenv.buildPlatform.isLittleEndian then
149+ bb.packages.ghc810
150 else
151+ bb.packages.ghc8107Binary;
152 inherit (buildPackages.python311Packages) sphinx; # a distutils issue with 3.12
153 python3 = buildPackages.python311; # so that we don't have two of them
154 # Need to use apple's patched xattr until
···160 };
161 ghc928 = callPackage ../development/compilers/ghc/9.2.8.nix {
162 bootPkgs =
163+ if stdenv.buildPlatform.isPower64 && stdenv.buildPlatform.isLittleEndian then
164+ bb.packages.ghc810
165 else
166+ bb.packages.ghc8107Binary;
167 inherit (buildPackages.python311Packages) sphinx; # a distutils issue with 3.12
168 python3 = buildPackages.python311; # so that we don't have two of them
169 # Need to use apple's patched xattr until
···181 # Use 8.10 as a workaround where possible to keep bootstrap path short.
182183 # On ARM text won't build with GHC 8.10.*
184+ if stdenv.buildPlatform.isAarch then
185 # TODO(@sternenseemann): package bindist
186+ bb.packages.ghc902
187 # No suitable bindists for powerpc64le
188+ else if stdenv.buildPlatform.isPower64 && stdenv.buildPlatform.isLittleEndian then
189+ bb.packages.ghc902
190 else
191+ bb.packages.ghc8107Binary;
192 inherit (buildPackages.python311Packages) sphinx; # a distutils issue with 3.12
193 python3 = buildPackages.python311; # so that we don't have two of them
194 # Need to use apple's patched xattr until
···206 # Use 8.10 as a workaround where possible to keep bootstrap path short.
207208 # On ARM text won't build with GHC 8.10.*
209+ if stdenv.buildPlatform.isAarch then
210 # TODO(@sternenseemann): package bindist
211+ bb.packages.ghc902
212 # No suitable bindists for powerpc64le
213+ else if stdenv.buildPlatform.isPower64 && stdenv.buildPlatform.isLittleEndian then
214+ bb.packages.ghc902
215 else
216+ bb.packages.ghc8107Binary;
217 inherit (buildPackages.python311Packages) sphinx; # a distutils issue with 3.12
218 python3 = buildPackages.python311; # so that we don't have two of them
219 # Need to use apple's patched xattr until
···231 # Use 8.10 as a workaround where possible to keep bootstrap path short.
232233 # On ARM text won't build with GHC 8.10.*
234+ if stdenv.buildPlatform.isAarch then
235 # TODO(@sternenseemann): package bindist
236+ bb.packages.ghc902
237 # No suitable bindists for powerpc64le
238+ else if stdenv.buildPlatform.isPower64 && stdenv.buildPlatform.isLittleEndian then
239+ bb.packages.ghc902
240 else
241+ bb.packages.ghc8107Binary;
242 inherit (buildPackages.python3Packages) sphinx;
243 # Need to use apple's patched xattr until
244 # https://github.com/xattr/xattr/issues/44 and
···255 # Use 8.10 as a workaround where possible to keep bootstrap path short.
256257 # On ARM text won't build with GHC 8.10.*
258+ if stdenv.buildPlatform.isAarch then
259 # TODO(@sternenseemann): package bindist
260+ bb.packages.ghc902
261 # No suitable bindists for powerpc64le
262+ else if stdenv.buildPlatform.isPower64 && stdenv.buildPlatform.isLittleEndian then
263+ bb.packages.ghc902
264 else
265+ bb.packages.ghc8107Binary;
266 inherit (buildPackages.python3Packages) sphinx;
267 # Need to use apple's patched xattr until
268 # https://github.com/xattr/xattr/issues/44 and
···276 ghc963 = callPackage ../development/compilers/ghc/9.6.3.nix {
277 bootPkgs =
278 # For GHC 9.2 no armv7l bindists are available.
279+ if stdenv.buildPlatform.isAarch32 then
280+ bb.packages.ghc928
281+ else if stdenv.buildPlatform.isPower64 && stdenv.buildPlatform.isLittleEndian then
282+ bb.packages.ghc928
283 else
284+ bb.packages.ghc924Binary;
285 inherit (buildPackages.python3Packages) sphinx;
286 # Need to use apple's patched xattr until
287 # https://github.com/xattr/xattr/issues/44 and
···294 ghc964 = callPackage ../development/compilers/ghc/9.6.4.nix {
295 bootPkgs =
296 # For GHC 9.2 no armv7l bindists are available.
297+ if stdenv.buildPlatform.isAarch32 then
298+ bb.packages.ghc928
299+ else if stdenv.buildPlatform.isPower64 && stdenv.buildPlatform.isLittleEndian then
300+ bb.packages.ghc928
301 else
302+ bb.packages.ghc924Binary;
303 inherit (buildPackages.python3Packages) sphinx;
304 # Need to use apple's patched xattr until
305 # https://github.com/xattr/xattr/issues/44 and
···312 ghc965 = callPackage ../development/compilers/ghc/9.6.5.nix {
313 bootPkgs =
314 # For GHC 9.2 no armv7l bindists are available.
315+ if stdenv.buildPlatform.isAarch32 then
316+ bb.packages.ghc928
317+ else if stdenv.buildPlatform.isPower64 && stdenv.buildPlatform.isLittleEndian then
318+ bb.packages.ghc928
319 else
320+ bb.packages.ghc924Binary;
321 inherit (buildPackages.python3Packages) sphinx;
322 # Need to use apple's patched xattr until
323 # https://github.com/xattr/xattr/issues/44 and
···330 ghc966 = callPackage ../development/compilers/ghc/9.6.6.nix {
331 bootPkgs =
332 # For GHC 9.2 no armv7l bindists are available.
333+ if stdenv.buildPlatform.isAarch32 then
334+ bb.packages.ghc928
335+ else if stdenv.buildPlatform.isPower64 && stdenv.buildPlatform.isLittleEndian then
336+ bb.packages.ghc928
337 else
338+ bb.packages.ghc924Binary;
339 inherit (buildPackages.python3Packages) sphinx;
340 # Need to use apple's patched xattr until
341 # https://github.com/xattr/xattr/issues/44 and
···349 ghc981 = callPackage ../development/compilers/ghc/9.8.1.nix {
350 bootPkgs =
351 # For GHC 9.6 no armv7l bindists are available.
352+ if stdenv.buildPlatform.isAarch32 then
353+ bb.packages.ghc963
354+ else if stdenv.buildPlatform.isPower64 && stdenv.buildPlatform.isLittleEndian then
355+ bb.packages.ghc963
356 else
357+ bb.packages.ghc963Binary;
358 inherit (buildPackages.python3Packages) sphinx;
359 # Need to use apple's patched xattr until
360 # https://github.com/xattr/xattr/issues/44 and
···367 ghc982 = callPackage ../development/compilers/ghc/9.8.2.nix {
368 bootPkgs =
369 # For GHC 9.6 no armv7l bindists are available.
370+ if stdenv.buildPlatform.isAarch32 then
371+ bb.packages.ghc963
372+ else if stdenv.buildPlatform.isPower64 && stdenv.buildPlatform.isLittleEndian then
373+ bb.packages.ghc963
374 else
375+ bb.packages.ghc963Binary;
376 inherit (buildPackages.python3Packages) sphinx;
377 # Need to use apple's patched xattr until
378 # https://github.com/xattr/xattr/issues/44 and
···386 ghc9101 = callPackage ../development/compilers/ghc/9.10.1.nix {
387 bootPkgs =
388 # For GHC 9.6 no armv7l bindists are available.
389+ if stdenv.buildPlatform.isAarch32 then
390+ bb.packages.ghc963
391+ else if stdenv.buildPlatform.isPower64 && stdenv.buildPlatform.isLittleEndian then
392+ bb.packages.ghc963
393+ else if stdenv.buildPlatform.isDarwin then
394 # it seems like the GHC 9.6.* bindists are built with a different
395 # toolchain than we are using (which I'm guessing from the fact
396 # that 9.6.4 bindists pass linker flags our ld doesn't support).
397 # With both 9.6.3 and 9.6.4 binary it is impossible to link against
398 # the clock package (probably a hsc2hs problem).
399+ bb.packages.ghc963
400 else
401+ bb.packages.ghc963Binary;
402 inherit (buildPackages.python3Packages) sphinx;
403 # Need to use apple's patched xattr until
404 # https://github.com/xattr/xattr/issues/44 and
···412 ghcHEAD = callPackage ../development/compilers/ghc/head.nix {
413 bootPkgs =
414 # For GHC 9.6 no armv7l bindists are available.
415+ if stdenv.buildPlatform.isAarch32 then
416+ bb.packages.ghc963
417+ else if stdenv.buildPlatform.isPower64 && stdenv.buildPlatform.isLittleEndian then
418+ bb.packages.ghc963
419 else
420+ bb.packages.ghc963Binary;
421 inherit (buildPackages.python3Packages) sphinx;
422 # Need to use apple's patched xattr until
423 # https://github.com/xattr/xattr/issues/44 and
···430431 ghcjs = compiler.ghcjs810;
432 ghcjs810 = callPackage ../development/compilers/ghcjs/8.10 {
433+ bootPkgs = bb.packages.ghc810;
434 ghcjsSrcJson = ../development/compilers/ghcjs/8.10/git.json;
435 stage0 = ../development/compilers/ghcjs/8.10/stage0.nix;
436 };
+74-47
pkgs/top-level/release-haskell.nix
···327 lambdabot
328 lhs2tex
329 madlang
330- mailctl
331 matterhorn
332 mkjson
333 mueval
···394 };
395396 # GHCs linked to musl.
397- pkgsMusl.haskell.compiler = lib.recursiveUpdate
398- (packagePlatforms pkgs.pkgsMusl.haskell.compiler)
399- {
400- # remove musl ghc865Binary since it is known to be broken and
401- # causes an evaluation error on darwin.
402- ghc865Binary = {};
403-404- ghcjs = {};
405- ghcjs810 = {};
406- };
407-408- # Get some cache going for MUSL-enabled GHC.
409- pkgsMusl.haskellPackages =
410 removePlatforms
411 [
412 # pkgsMusl is compiled natively with musl. It is not
···420 "aarch64-darwin"
421 ]
422 {
423- inherit (packagePlatforms pkgs.pkgsMusl.haskellPackages)
424- hello
425- lens
426- random
427- ;
000000000000000428 };
429430 # Test some statically linked packages to catch regressions
···473 };
474 };
475476- pkgsCross.ghcjs =
477- removePlatforms
478- [
479- # Hydra output size of 3GB is exceeded
480- "aarch64-linux"
481- ]
482- {
483- haskellPackages = {
484- inherit (packagePlatforms pkgs.pkgsCross.ghcjs.haskellPackages)
485- ghc
486- hello
487- microlens
488- ;
000000000000000000489 };
490491- haskell.packages.ghc98 = {
492- inherit (packagePlatforms pkgs.pkgsCross.ghcjs.haskell.packages.ghc98)
493- ghc
494- hello
495- microlens
00000496 ;
497- };
0498499- haskell.packages.ghcHEAD = {
500- inherit (packagePlatforms pkgs.pkgsCross.ghcjs.haskell.packages.ghcHEAD)
501- ghc
502- hello
503- microlens
000504 ;
505- };
506 };
00507 })
508 (versionedCompilerJobs {
509 # Packages which should be checked on more than the
···545 compilerNames.ghc8107
546 # Support ceased as of 2.5.0.0
547 compilerNames.ghc902
548- # No support yet (2024-05-12)
549- compilerNames.ghc9101
550 ] released;
551 hoogle = lib.subtractLists [
552- compilerNames.ghc9101
553 ] released;
554 hlint = lib.subtractLists [
555 compilerNames.ghc902
···327 lambdabot
328 lhs2tex
329 madlang
0330 matterhorn
331 mkjson
332 mueval
···393 };
394395 # GHCs linked to musl.
396+ pkgsMusl =
000000000000397 removePlatforms
398 [
399 # pkgsMusl is compiled natively with musl. It is not
···407 "aarch64-darwin"
408 ]
409 {
410+ haskell.compiler = lib.recursiveUpdate
411+ (packagePlatforms pkgs.pkgsMusl.haskell.compiler)
412+ {
413+ # remove musl ghc865Binary since it is known to be broken and
414+ # causes an evaluation error on darwin.
415+ ghc865Binary = {};
416+417+ ghcjs = {};
418+ ghcjs810 = {};
419+ };
420+421+ # Get some cache going for MUSL-enabled GHC.
422+ haskellPackages =
423+ {
424+ inherit (packagePlatforms pkgs.pkgsMusl.haskellPackages)
425+ hello
426+ lens
427+ random
428+ ;
429+ };
430 };
431432 # Test some statically linked packages to catch regressions
···475 };
476 };
477478+ pkgsCross = {
479+ ghcjs =
480+ removePlatforms
481+ [
482+ # Hydra output size of 3GB is exceeded
483+ "aarch64-linux"
484+ ]
485+ {
486+ haskellPackages = {
487+ inherit (packagePlatforms pkgs.pkgsCross.ghcjs.haskellPackages)
488+ ghc
489+ hello
490+ microlens
491+ ;
492+ };
493+494+ haskell.packages.ghc98 = {
495+ inherit (packagePlatforms pkgs.pkgsCross.ghcjs.haskell.packages.ghc98)
496+ ghc
497+ hello
498+ microlens
499+ ;
500+ };
501+502+ haskell.packages.ghcHEAD = {
503+ inherit (packagePlatforms pkgs.pkgsCross.ghcjs.haskell.packages.ghcHEAD)
504+ ghc
505+ hello
506+ microlens
507+ ;
508+ };
509 };
510511+ riscv64 = {
512+ # Cross compilation of GHC
513+ haskell.compiler = {
514+ inherit (packagePlatforms pkgs.pkgsCross.riscv64.haskell.compiler)
515+ # Our oldest GHC which still uses its own expression. 8.10.7 can
516+ # theoretically be used to chain bootstrap all GHCs on riscv64
517+ # which doesn't have official bindists.
518+ ghc8107
519+ # Latest GHC we are able to cross-compile.
520+ ghc948
521 ;
522+ };
523+ };
524525+ aarch64-multiplatform = {
526+ # Cross compilation of GHC
527+ haskell.compiler = {
528+ inherit (packagePlatforms pkgs.pkgsCross.aarch64-multiplatform.haskell.compiler)
529+ # Uses a separate expression and LLVM backend for aarch64.
530+ ghc8107
531+ # Latest GHC we are able to cross-compile. Uses NCG backend.
532+ ghc948
533 ;
0534 };
535+ };
536+ };
537 })
538 (versionedCompilerJobs {
539 # Packages which should be checked on more than the
···575 compilerNames.ghc8107
576 # Support ceased as of 2.5.0.0
577 compilerNames.ghc902
00578 ] released;
579 hoogle = lib.subtractLists [
0580 ] released;
581 hlint = lib.subtractLists [
582 compilerNames.ghc902