haskellPackages: update hackage (#339272)
This commit is contained in:
@@ -1076,6 +1076,9 @@ benchmark component.
|
||||
`disableLibraryProfiling drv`
|
||||
: Sets the `enableLibraryProfiling` argument to `false` for `drv`.
|
||||
|
||||
`disableParallelBuilding drv`
|
||||
: Sets the `enableParallelBuilding` argument to `false` for `drv`.
|
||||
|
||||
#### Library functions in the Haskell package sets {#haskell-package-set-lib-functions}
|
||||
|
||||
Some library functions depend on packages from the Haskell package sets. Thus they are
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"commit": "4670ba3f52eae6737137ddcb817182f3daad4f26",
|
||||
"url": "https://github.com/commercialhaskell/all-cabal-hashes/archive/4670ba3f52eae6737137ddcb817182f3daad4f26.tar.gz",
|
||||
"sha256": "18q5shdmh12147502135q6132rmzp29qfjhwrcjwidl0pi9ki70i",
|
||||
"msg": "Update from Hackage at 2024-08-19T17:17:03Z"
|
||||
"commit": "5d97d9c05e76d8cecb68f1e9063afb39ca0fb26b",
|
||||
"url": "https://github.com/commercialhaskell/all-cabal-hashes/archive/5d97d9c05e76d8cecb68f1e9063afb39ca0fb26b.tar.gz",
|
||||
"sha256": "1ic4wn5immv06m1m2cq6mzrrgrxbidxmj39licxlkmnm9jlwzjwr",
|
||||
"msg": "Update from Hackage at 2024-09-03T10:29:19Z"
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ lib, stdenv, pkgsBuildTarget, pkgsHostTarget, targetPackages
|
||||
{ lib, stdenv, pkgsBuildTarget, pkgsHostTarget, buildPackages, targetPackages
|
||||
|
||||
# build-tools
|
||||
, bootPkgs
|
||||
@@ -32,14 +32,19 @@
|
||||
, # If enabled, use -fPIC when compiling static libs.
|
||||
enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
|
||||
|
||||
, enableProfiledLibs ? true
|
||||
# Exceeds Hydra output limit (at the time of writing ~3GB) when cross compiled to riscv64.
|
||||
# A riscv64 cross-compiler fits into the limit comfortably.
|
||||
, enableProfiledLibs ? !stdenv.hostPlatform.isRiscV64
|
||||
|
||||
, # Whether to build dynamic libs for the standard library (on the target
|
||||
# platform). Static libs are always built.
|
||||
enableShared ? !stdenv.targetPlatform.isWindows && !stdenv.targetPlatform.useiOSPrebuilt
|
||||
|
||||
, # Whether to build terminfo.
|
||||
enableTerminfo ? !stdenv.targetPlatform.isWindows
|
||||
enableTerminfo ? !(stdenv.targetPlatform.isWindows
|
||||
# terminfo can't be built for cross
|
||||
|| (stdenv.buildPlatform != stdenv.hostPlatform)
|
||||
|| (stdenv.hostPlatform != stdenv.targetPlatform))
|
||||
|
||||
, # What flavour to build. An empty string indicates no
|
||||
# specific flavour and falls back to ghc default values.
|
||||
@@ -55,25 +60,31 @@
|
||||
|
||||
, enableHaddockProgram ?
|
||||
# Disabled for cross; see note [HADDOCK_DOCS].
|
||||
(stdenv.targetPlatform == stdenv.hostPlatform)
|
||||
(stdenv.buildPlatform == stdenv.hostPlatform && stdenv.targetPlatform == stdenv.hostPlatform)
|
||||
|
||||
, # Whether to disable the large address space allocator
|
||||
# necessary fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/
|
||||
disableLargeAddressSpace ? stdenv.targetPlatform.isiOS
|
||||
|
||||
, # Whether to build an unregisterised version of GHC.
|
||||
# GHC will normally auto-detect whether it can do a registered build, but this
|
||||
# option will force it to do an unregistered build when set to true.
|
||||
# See https://gitlab.haskell.org/ghc/ghc/-/wikis/building/unregisterised
|
||||
enableUnregisterised ? false
|
||||
}@args:
|
||||
|
||||
assert !enableIntegerSimple -> gmp != null;
|
||||
|
||||
# Cross cannot currently build the `haddock` program for silly reasons,
|
||||
# see note [HADDOCK_DOCS].
|
||||
assert (stdenv.targetPlatform != stdenv.hostPlatform) -> !enableHaddockProgram;
|
||||
assert (stdenv.buildPlatform != stdenv.hostPlatform || stdenv.targetPlatform != stdenv.hostPlatform) -> !enableHaddockProgram;
|
||||
|
||||
# GHC does not support building when all 3 platforms are different.
|
||||
assert stdenv.buildPlatform == stdenv.hostPlatform || stdenv.hostPlatform == stdenv.targetPlatform;
|
||||
|
||||
let
|
||||
libffi_name = if stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64 then "libffi" else "libffi_3_3";
|
||||
inherit (stdenv) buildPlatform hostPlatform targetPlatform;
|
||||
|
||||
inherit (bootPkgs) ghc;
|
||||
|
||||
# TODO(@Ericson2314) Make unconditional
|
||||
targetPrefix = lib.optionalString
|
||||
(targetPlatform != hostPlatform)
|
||||
@@ -86,6 +97,8 @@ let
|
||||
endif
|
||||
BUILD_SPHINX_HTML = ${if enableDocs then "YES" else "NO"}
|
||||
BUILD_SPHINX_PDF = NO
|
||||
|
||||
WITH_TERMINFO = ${if enableTerminfo then "YES" else "NO"}
|
||||
'' +
|
||||
# Note [HADDOCK_DOCS]:
|
||||
# Unfortunately currently `HADDOCK_DOCS` controls both whether the `haddock`
|
||||
@@ -134,7 +147,9 @@ let
|
||||
pkgsBuildTarget.targetPackages.stdenv.cc
|
||||
] ++ lib.optional useLLVM buildTargetLlvmPackages.llvm;
|
||||
|
||||
buildCC = buildPackages.stdenv.cc;
|
||||
targetCC = builtins.head toolsForTarget;
|
||||
installCC = pkgsHostTarget.targetPackages.stdenv.cc;
|
||||
|
||||
# toolPath calculates the absolute path to the name tool associated with a
|
||||
# given `stdenv.cc` derivation, i.e. it picks the correct derivation to take
|
||||
@@ -145,12 +160,13 @@ let
|
||||
tools = {
|
||||
"cc" = cc;
|
||||
"c++" = cc;
|
||||
as = cc.bintools.bintools;
|
||||
as = cc.bintools;
|
||||
|
||||
ar = cc.bintools.bintools;
|
||||
ranlib = cc.bintools.bintools;
|
||||
nm = cc.bintools.bintools;
|
||||
readelf = cc.bintools.bintools;
|
||||
ar = cc.bintools;
|
||||
ranlib = cc.bintools;
|
||||
nm = cc.bintools;
|
||||
readelf = cc.bintools;
|
||||
objdump = cc.bintools;
|
||||
|
||||
ld = cc.bintools;
|
||||
"ld.gold" = cc.bintools;
|
||||
@@ -169,6 +185,9 @@ let
|
||||
if stdenv.targetPlatform.isDarwin
|
||||
then cc.bintools
|
||||
else cc.bintools.bintools;
|
||||
|
||||
# clang is used as an assembler on darwin with the LLVM backend
|
||||
clang = cc;
|
||||
}.${name};
|
||||
in
|
||||
"${tools}/bin/${tools.targetPrefix}${name}";
|
||||
@@ -185,14 +204,40 @@ let
|
||||
(lib.optionalString enableIntegerSimple "-integer-simple")
|
||||
];
|
||||
|
||||
in
|
||||
libffi_name =
|
||||
if stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64
|
||||
then "libffi"
|
||||
else "libffi_3_3";
|
||||
|
||||
# C compiler, bintools and LLVM are used at build time, but will also leak into
|
||||
# the resulting GHC's settings file and used at runtime. This means that we are
|
||||
# currently only able to build GHC if hostPlatform == buildPlatform.
|
||||
assert targetCC == pkgsHostTarget.targetPackages.stdenv.cc;
|
||||
assert buildTargetLlvmPackages.llvm == llvmPackages.llvm;
|
||||
assert stdenv.targetPlatform.isDarwin -> buildTargetLlvmPackages.clang == llvmPackages.clang;
|
||||
# These libraries are library dependencies of the standard libraries bundled
|
||||
# by GHC (core libs) users will link their compiled artifacts again. Thus,
|
||||
# they should be taken from targetPackages.
|
||||
#
|
||||
# We need to use pkgsHostTarget if we are cross compiling a native GHC compiler,
|
||||
# though (when native compiling GHC, pkgsHostTarget == targetPackages):
|
||||
#
|
||||
# 1. targetPackages would be empty(-ish) in this situation since we can't
|
||||
# execute cross compiled compilers in order to obtain the libraries
|
||||
# that would be in targetPackages.
|
||||
# 2. pkgsHostTarget is fine to use since hostPlatform == targetPlatform in this
|
||||
# situation.
|
||||
# 3. The core libs used by the final GHC (stage 2) for user artifacts are also
|
||||
# used to build stage 2 GHC itself, i.e. the core libs are both host and
|
||||
# target.
|
||||
targetLibs =
|
||||
let
|
||||
basePackageSet =
|
||||
if hostPlatform != targetPlatform
|
||||
then targetPackages
|
||||
else pkgsHostTarget;
|
||||
in
|
||||
{
|
||||
inherit (basePackageSet) gmp ncurses;
|
||||
# dynamic inherits are not possible in Nix
|
||||
libffi = basePackageSet.${libffi_name};
|
||||
};
|
||||
|
||||
in
|
||||
|
||||
stdenv.mkDerivation (rec {
|
||||
version = "8.10.7";
|
||||
@@ -277,6 +322,8 @@ stdenv.mkDerivation (rec {
|
||||
for env in $(env | grep '^TARGET_' | sed -E 's|\+?=.*||'); do
|
||||
export "''${env#TARGET_}=''${!env}"
|
||||
done
|
||||
# Stage0 (build->build) which builds stage 1
|
||||
export GHC="${bootPkgs.ghc}/bin/ghc"
|
||||
# GHC is a bit confused on its cross terminology, as these would normally be
|
||||
# the *host* tools.
|
||||
export CC="${toolPath "cc" targetCC}"
|
||||
@@ -289,6 +336,7 @@ stdenv.mkDerivation (rec {
|
||||
export RANLIB="${toolPath "ranlib" targetCC}"
|
||||
export READELF="${toolPath "readelf" targetCC}"
|
||||
export STRIP="${toolPath "strip" targetCC}"
|
||||
export OBJDUMP="${toolPath "objdump" targetCC}"
|
||||
'' + lib.optionalString (stdenv.targetPlatform.linker == "cctools") ''
|
||||
export OTOOL="${toolPath "otool" targetCC}"
|
||||
export INSTALL_NAME_TOOL="${toolPath "install_name_tool" targetCC}"
|
||||
@@ -297,8 +345,22 @@ stdenv.mkDerivation (rec {
|
||||
export OPT="${lib.getBin buildTargetLlvmPackages.llvm}/bin/opt"
|
||||
'' + lib.optionalString (useLLVM && stdenv.targetPlatform.isDarwin) ''
|
||||
# LLVM backend on Darwin needs clang: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/codegens.html#llvm-code-generator-fllvm
|
||||
export CLANG="${buildTargetLlvmPackages.clang}/bin/${buildTargetLlvmPackages.clang.targetPrefix}clang"
|
||||
# The executable we specify via $CLANG is used as an assembler (exclusively, it seems, but this isn't
|
||||
# clarified in any user facing documentation). As such, it'll be called on assembly produced by $CC
|
||||
# which usually comes from the darwin stdenv. To prevent a situation where $CLANG doesn't understand
|
||||
# the assembly it is given, we need to make sure that it matches the LLVM version of $CC if possible.
|
||||
# It is unclear (at the time of writing 2024-09-01) whether $CC should match the LLVM version we use
|
||||
# for llc and opt which would require using a custom darwin stdenv for targetCC.
|
||||
export CLANG="${
|
||||
if targetCC.isClang
|
||||
then toolPath "clang" targetCC
|
||||
else "${buildTargetLlvmPackages.clang}/bin/${buildTargetLlvmPackages.clang.targetPrefix}clang"
|
||||
}"
|
||||
'' + ''
|
||||
# No need for absolute paths since these tools only need to work during the build
|
||||
export CC_STAGE0="$CC_FOR_BUILD"
|
||||
export LD_STAGE0="$LD_FOR_BUILD"
|
||||
export AR_STAGE0="$AR_FOR_BUILD"
|
||||
|
||||
echo -n "${buildMK}" > mk/build.mk
|
||||
sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
|
||||
@@ -329,21 +391,26 @@ stdenv.mkDerivation (rec {
|
||||
done
|
||||
'';
|
||||
|
||||
# Although it is usually correct to pass --host, we don't do that here because
|
||||
# GHC's usage of build, host, and target is non-standard.
|
||||
# See https://gitlab.haskell.org/ghc/ghc/-/wikis/building/cross-compiling
|
||||
# TODO(@Ericson2314): Always pass "--target" and always prefix.
|
||||
configurePlatforms = [ "build" "host" ]
|
||||
++ lib.optional (targetPlatform != hostPlatform) "target";
|
||||
configurePlatforms = [ "build" ]
|
||||
++ lib.optional (buildPlatform != hostPlatform || targetPlatform != hostPlatform) "target";
|
||||
|
||||
# `--with` flags for libraries needed for RTS linker
|
||||
configureFlags = [
|
||||
"--datadir=$doc/share/doc/ghc"
|
||||
"--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib"
|
||||
] ++ lib.optionals enableTerminfo [
|
||||
"--with-curses-includes=${lib.getDev targetLibs.ncurses}/include"
|
||||
"--with-curses-libraries=${lib.getLib targetLibs.ncurses}/lib"
|
||||
] ++ lib.optionals (args.${libffi_name} != null) [
|
||||
"--with-system-libffi"
|
||||
"--with-ffi-includes=${targetPackages.${libffi_name}.dev}/include"
|
||||
"--with-ffi-libraries=${targetPackages.${libffi_name}.out}/lib"
|
||||
"--with-ffi-includes=${targetLibs.libffi.dev}/include"
|
||||
"--with-ffi-libraries=${targetLibs.libffi.out}/lib"
|
||||
] ++ lib.optionals (targetPlatform == hostPlatform && !enableIntegerSimple) [
|
||||
"--with-gmp-includes=${targetPackages.gmp.dev}/include"
|
||||
"--with-gmp-libraries=${targetPackages.gmp.out}/lib"
|
||||
"--with-gmp-includes=${targetLibs.gmp.dev}/include"
|
||||
"--with-gmp-libraries=${targetLibs.gmp.out}/lib"
|
||||
] ++ lib.optionals (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
|
||||
"--with-iconv-includes=${libiconv}/include"
|
||||
"--with-iconv-libraries=${libiconv}/lib"
|
||||
@@ -355,6 +422,8 @@ stdenv.mkDerivation (rec {
|
||||
"CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold"
|
||||
] ++ lib.optionals (disableLargeAddressSpace) [
|
||||
"--disable-large-address-space"
|
||||
] ++ lib.optionals enableUnregisterised [
|
||||
"--enable-unregisterised"
|
||||
];
|
||||
|
||||
# Make sure we never relax`$PATH` and hooks support for compatibility.
|
||||
@@ -365,17 +434,35 @@ stdenv.mkDerivation (rec {
|
||||
|
||||
nativeBuildInputs = [
|
||||
perl autoreconfHook autoconf automake m4 python3
|
||||
ghc bootPkgs.alex bootPkgs.happy bootPkgs.hscolour
|
||||
bootPkgs.alex bootPkgs.happy bootPkgs.hscolour
|
||||
bootPkgs.ghc-settings-edit
|
||||
] ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [
|
||||
autoSignDarwinBinariesHook
|
||||
] ++ lib.optionals enableDocs [
|
||||
sphinx
|
||||
];
|
||||
|
||||
# Everything the stage0 compiler needs to build stage1: CC, bintools, extra libs.
|
||||
# See also GHC, {CC,LD,AR}_STAGE0 in preConfigure.
|
||||
depsBuildBuild = [
|
||||
# N.B. We do not declare bootPkgs.ghc in any of the stdenv.mkDerivation
|
||||
# dependency lists to prevent the bintools setup hook from adding ghc's
|
||||
# lib directory to the linker flags. Instead we tell configure about it
|
||||
# via the GHC environment variable.
|
||||
buildCC
|
||||
# stage0 builds terminfo unconditionally, so we always need ncurses
|
||||
ncurses
|
||||
];
|
||||
# For building runtime libs
|
||||
depsBuildTarget = toolsForTarget;
|
||||
|
||||
buildInputs = [ perl bash ] ++ (libDeps hostPlatform);
|
||||
# Prevent stage0 ghc from leaking into the final result. This was an issue
|
||||
# with GHC 9.6.
|
||||
disallowedReferences = [
|
||||
bootPkgs.ghc
|
||||
];
|
||||
|
||||
buildInputs = [ bash ] ++ (libDeps hostPlatform);
|
||||
|
||||
depsTargetTarget = map lib.getDev (libDeps targetPlatform);
|
||||
depsTargetTargetPropagated = map (lib.getOutput "out") (libDeps targetPlatform);
|
||||
@@ -402,6 +489,39 @@ stdenv.mkDerivation (rec {
|
||||
requiredSystemFeatures = [ "big-parallel" ];
|
||||
|
||||
postInstall = ''
|
||||
settingsFile="$out/lib/${targetPrefix}${passthru.haskellCompilerName}/settings"
|
||||
|
||||
# Make the installed GHC use the host->target tools.
|
||||
ghc-settings-edit "$settingsFile" \
|
||||
"C compiler command" "${toolPath "cc" installCC}" \
|
||||
"Haskell CPP command" "${toolPath "cc" installCC}" \
|
||||
"C++ compiler command" "${toolPath "c++" installCC}" \
|
||||
"ld command" "${toolPath "ld${lib.optionalString useLdGold ".gold"}" installCC}" \
|
||||
"Merge objects command" "${toolPath "ld${lib.optionalString useLdGold ".gold"}" installCC}" \
|
||||
"ar command" "${toolPath "ar" installCC}" \
|
||||
"ranlib command" "${toolPath "ranlib" installCC}"
|
||||
''
|
||||
+ lib.optionalString (stdenv.targetPlatform.linker == "cctools") ''
|
||||
ghc-settings-edit "$settingsFile" \
|
||||
"otool command" "${toolPath "otool" installCC}" \
|
||||
"install_name_tool command" "${toolPath "install_name_tool" installCC}"
|
||||
''
|
||||
+ lib.optionalString useLLVM ''
|
||||
ghc-settings-edit "$settingsFile" \
|
||||
"LLVM llc command" "${lib.getBin llvmPackages.llvm}/bin/llc" \
|
||||
"LLVM opt command" "${lib.getBin llvmPackages.llvm}/bin/opt"
|
||||
''
|
||||
+ lib.optionalString (useLLVM && stdenv.targetPlatform.isDarwin) ''
|
||||
ghc-settings-edit "$settingsFile" \
|
||||
"LLVM clang command" "${
|
||||
# See comment for CLANG in preConfigure
|
||||
if installCC.isClang
|
||||
then toolPath "clang" installCC
|
||||
else "${llvmPackages.clang}/bin/${llvmPackages.clang.targetPrefix}clang"
|
||||
}"
|
||||
''
|
||||
+ ''
|
||||
|
||||
# Install the bash completion file.
|
||||
install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/${targetPrefix}ghc
|
||||
'';
|
||||
@@ -427,7 +547,8 @@ stdenv.mkDerivation (rec {
|
||||
guibou
|
||||
] ++ lib.teams.haskell.members;
|
||||
timeout = 24 * 3600;
|
||||
inherit (ghc.meta) license platforms;
|
||||
platforms = lib.platforms.all;
|
||||
inherit (bootPkgs.ghc.meta) license;
|
||||
};
|
||||
|
||||
} // lib.optionalAttrs targetPlatform.useAndroidPrebuilt {
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
, stdenv
|
||||
, pkgsBuildTarget
|
||||
, pkgsHostTarget
|
||||
, buildPackages
|
||||
, targetPackages
|
||||
, fetchpatch
|
||||
|
||||
@@ -58,15 +59,23 @@
|
||||
, # If enabled, use -fPIC when compiling static libs.
|
||||
enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
|
||||
|
||||
, enableProfiledLibs ? true
|
||||
# Exceeds Hydra output limit (at the time of writing ~3GB) when cross compiled to riscv64.
|
||||
# A riscv64 cross-compiler fits into the limit comfortably.
|
||||
, enableProfiledLibs ? !stdenv.hostPlatform.isRiscV64
|
||||
|
||||
, # Whether to build dynamic libs for the standard library (on the target
|
||||
# platform). Static libs are always built.
|
||||
enableShared ? with stdenv.targetPlatform; !isWindows && !useiOSPrebuilt && !isStatic && !isGhcjs
|
||||
|
||||
, # Whether to build terminfo.
|
||||
# FIXME(@sternenseemann): This actually doesn't influence what hadrian does,
|
||||
# just what buildInputs etc. looks like. It would be best if we could actually
|
||||
# tell it what to do like it was possible with make.
|
||||
enableTerminfo ? !(stdenv.targetPlatform.isWindows
|
||||
|| stdenv.targetPlatform.isGhcjs)
|
||||
|| stdenv.targetPlatform.isGhcjs
|
||||
# terminfo can't be built for cross
|
||||
|| (stdenv.buildPlatform != stdenv.hostPlatform)
|
||||
|| (stdenv.hostPlatform != stdenv.targetPlatform))
|
||||
|
||||
, # Libdw.c only supports x86_64, i686 and s390x as of 2022-08-04
|
||||
enableDwarf ? (stdenv.targetPlatform.isx86 ||
|
||||
@@ -117,9 +126,8 @@
|
||||
-- no way to set this via the command line
|
||||
finalStage :: Stage
|
||||
finalStage = ${
|
||||
# Always build the stage 2 compiler if possible. Note we can currently
|
||||
# assume hostPlatform == buildPlatform.
|
||||
# TODO(@sternenseemann): improve this condition when we can cross-compile GHC
|
||||
# Always build the stage 2 compiler if possible.
|
||||
# TODO(@sternensemann): unify condition with make-built GHCs
|
||||
if stdenv.hostPlatform.canExecute stdenv.targetPlatform
|
||||
then "Stage2" # native compiler or “native” cross e.g. pkgsStatic
|
||||
else "Stage1" # cross compiler
|
||||
@@ -178,6 +186,15 @@
|
||||
hash = "sha256-MpvTmFFsNiPDoOp9BhZyWeapeibQ77zgEV+xzZ1UAXs=";
|
||||
})
|
||||
]
|
||||
++ lib.optionals (lib.versionAtLeast version "9.6" && lib.versionOlder version "9.8") [
|
||||
# Fix unlit being installed under a different name than is used in the
|
||||
# settings file: https://gitlab.haskell.org/ghc/ghc/-/issues/23317
|
||||
(fetchpatch {
|
||||
name = "ghc-9.6-fix-unlit-path.patch";
|
||||
url = "https://gitlab.haskell.org/ghc/ghc/-/commit/8fde4ac84ec7b1ead238cb158bbef48555d12af9.patch";
|
||||
hash = "sha256-3+CyRBpebEZi8YpS22SsdGQHqi0drR7cCKPtKbR3zyE=";
|
||||
})
|
||||
]
|
||||
++ lib.optionals (stdenv.targetPlatform.isDarwin && stdenv.targetPlatform.isAarch64) [
|
||||
# Prevent the paths module from emitting symbols that we don't use
|
||||
# when building with separate outputs.
|
||||
@@ -222,15 +239,25 @@
|
||||
, # Whether to disable the large address space allocator
|
||||
# necessary fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/
|
||||
disableLargeAddressSpace ? stdenv.targetPlatform.isiOS
|
||||
|
||||
, # Whether to build an unregisterised version of GHC.
|
||||
# GHC will normally auto-detect whether it can do a registered build, but this
|
||||
# option will force it to do an unregistered build when set to true.
|
||||
# See https://gitlab.haskell.org/ghc/ghc/-/wikis/building/unregisterised
|
||||
enableUnregisterised ? false
|
||||
}:
|
||||
|
||||
assert !enableNativeBignum -> gmp != null;
|
||||
|
||||
# GHC does not support building when all 3 platforms are different.
|
||||
assert stdenv.buildPlatform == stdenv.hostPlatform || stdenv.hostPlatform == stdenv.targetPlatform;
|
||||
|
||||
# It is currently impossible to cross-compile GHC with Hadrian.
|
||||
assert stdenv.buildPlatform == stdenv.hostPlatform;
|
||||
|
||||
let
|
||||
inherit (stdenv) buildPlatform hostPlatform targetPlatform;
|
||||
|
||||
inherit (bootPkgs) ghc;
|
||||
|
||||
# TODO(@Ericson2314) Make unconditional
|
||||
targetPrefix = lib.optionalString
|
||||
(targetPlatform != hostPlatform)
|
||||
@@ -265,7 +292,12 @@ let
|
||||
else pkgsBuildTarget.targetPackages.stdenv.cc)
|
||||
] ++ lib.optional useLLVM buildTargetLlvmPackages.llvm;
|
||||
|
||||
buildCC = buildPackages.stdenv.cc;
|
||||
targetCC = builtins.head toolsForTarget;
|
||||
installCC =
|
||||
if targetPlatform.isGhcjs
|
||||
then pkgsHostTarget.emscripten
|
||||
else pkgsHostTarget.targetPackages.stdenv.cc;
|
||||
|
||||
# toolPath calculates the absolute path to the name tool associated with a
|
||||
# given `stdenv.cc` derivation, i.e. it picks the correct derivation to take
|
||||
@@ -276,12 +308,13 @@ let
|
||||
tools = {
|
||||
"cc" = cc;
|
||||
"c++" = cc;
|
||||
as = cc.bintools.bintools;
|
||||
as = cc.bintools;
|
||||
|
||||
ar = cc.bintools.bintools;
|
||||
ranlib = cc.bintools.bintools;
|
||||
nm = cc.bintools.bintools;
|
||||
readelf = cc.bintools.bintools;
|
||||
ar = cc.bintools;
|
||||
ranlib = cc.bintools;
|
||||
nm = cc.bintools;
|
||||
readelf = cc.bintools;
|
||||
objdump = cc.bintools;
|
||||
|
||||
ld = cc.bintools;
|
||||
"ld.gold" = cc.bintools;
|
||||
@@ -300,6 +333,9 @@ let
|
||||
if stdenv.targetPlatform.isDarwin
|
||||
then cc.bintools
|
||||
else cc.bintools.bintools;
|
||||
|
||||
# clang is used as an assembler on darwin with the LLVM backend
|
||||
clang = cc;
|
||||
}.${name};
|
||||
in
|
||||
"${tools}/bin/${tools.targetPrefix}${name}";
|
||||
@@ -316,14 +352,34 @@ let
|
||||
(lib.optionalString enableNativeBignum "-native-bignum")
|
||||
];
|
||||
|
||||
in
|
||||
# These libraries are library dependencies of the standard libraries bundled
|
||||
# by GHC (core libs) users will link their compiled artifacts again. Thus,
|
||||
# they should be taken from targetPackages.
|
||||
#
|
||||
# We need to use pkgsHostTarget if we are cross compiling a native GHC compiler,
|
||||
# though (when native compiling GHC, pkgsHostTarget == targetPackages):
|
||||
#
|
||||
# 1. targetPackages would be empty(-ish) in this situation since we can't
|
||||
# execute cross compiled compilers in order to obtain the libraries
|
||||
# that would be in targetPackages.
|
||||
# 2. pkgsHostTarget is fine to use since hostPlatform == targetPlatform in this
|
||||
# situation.
|
||||
# 3. The core libs used by the final GHC (stage 2) for user artifacts are also
|
||||
# used to build stage 2 GHC itself, i.e. the core libs are both host and
|
||||
# target.
|
||||
targetLibs = {
|
||||
inherit
|
||||
(if hostPlatform != targetPlatform then targetPackages else pkgsHostTarget)
|
||||
elfutils
|
||||
gmp
|
||||
libffi
|
||||
ncurses;
|
||||
};
|
||||
|
||||
# C compiler, bintools and LLVM are used at build time, but will also leak into
|
||||
# the resulting GHC's settings file and used at runtime. This means that we are
|
||||
# currently only able to build GHC if hostPlatform == buildPlatform.
|
||||
assert !targetPlatform.isGhcjs -> targetCC == pkgsHostTarget.targetPackages.stdenv.cc;
|
||||
assert buildTargetLlvmPackages.llvm == llvmPackages.llvm;
|
||||
assert stdenv.targetPlatform.isDarwin -> buildTargetLlvmPackages.clang == llvmPackages.clang;
|
||||
# Our Cabal compiler name
|
||||
haskellCompilerName = "ghc-${version}";
|
||||
|
||||
in
|
||||
|
||||
stdenv.mkDerivation ({
|
||||
pname = "${targetPrefix}ghc${variantSuffix}";
|
||||
@@ -346,6 +402,13 @@ stdenv.mkDerivation ({
|
||||
for env in $(env | grep '^TARGET_' | sed -E 's|\+?=.*||'); do
|
||||
export "''${env#TARGET_}=''${!env}"
|
||||
done
|
||||
# No need for absolute paths since these tools only need to work during the build
|
||||
export CC_STAGE0="$CC_FOR_BUILD"
|
||||
export LD_STAGE0="$LD_FOR_BUILD"
|
||||
export AR_STAGE0="$AR_FOR_BUILD"
|
||||
|
||||
# Stage0 (build->build) which builds stage 1
|
||||
export GHC="${bootPkgs.ghc}/bin/ghc"
|
||||
# GHC is a bit confused on its cross terminology, as these would normally be
|
||||
# the *host* tools.
|
||||
export CC="${toolPath "cc" targetCC}"
|
||||
@@ -358,6 +421,7 @@ stdenv.mkDerivation ({
|
||||
export RANLIB="${toolPath "ranlib" targetCC}"
|
||||
export READELF="${toolPath "readelf" targetCC}"
|
||||
export STRIP="${toolPath "strip" targetCC}"
|
||||
export OBJDUMP="${toolPath "objdump" targetCC}"
|
||||
'' + lib.optionalString (stdenv.targetPlatform.linker == "cctools") ''
|
||||
export OTOOL="${toolPath "otool" targetCC}"
|
||||
export INSTALL_NAME_TOOL="${toolPath "install_name_tool" targetCC}"
|
||||
@@ -366,7 +430,17 @@ stdenv.mkDerivation ({
|
||||
export OPT="${lib.getBin buildTargetLlvmPackages.llvm}/bin/opt"
|
||||
'' + lib.optionalString (useLLVM && stdenv.targetPlatform.isDarwin) ''
|
||||
# LLVM backend on Darwin needs clang: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/codegens.html#llvm-code-generator-fllvm
|
||||
export CLANG="${buildTargetLlvmPackages.clang}/bin/${buildTargetLlvmPackages.clang.targetPrefix}clang"
|
||||
# The executable we specify via $CLANG is used as an assembler (exclusively, it seems, but this isn't
|
||||
# clarified in any user facing documentation). As such, it'll be called on assembly produced by $CC
|
||||
# which usually comes from the darwin stdenv. To prevent a situation where $CLANG doesn't understand
|
||||
# the assembly it is given, we need to make sure that it matches the LLVM version of $CC if possible.
|
||||
# It is unclear (at the time of writing 2024-09-01) whether $CC should match the LLVM version we use
|
||||
# for llc and opt which would require using a custom darwin stdenv for targetCC.
|
||||
export CLANG="${
|
||||
if targetCC.isClang
|
||||
then toolPath "clang" targetCC
|
||||
else "${buildTargetLlvmPackages.clang}/bin/${buildTargetLlvmPackages.clang.targetPrefix}clang"
|
||||
}"
|
||||
'' +
|
||||
lib.optionalString (stdenv.hostPlatform.isLinux && hostPlatform.libc == "glibc") ''
|
||||
export LOCALE_ARCHIVE="${glibcLocales}/lib/locale/locale-archive"
|
||||
@@ -433,14 +507,16 @@ stdenv.mkDerivation ({
|
||||
# `--with` flags for libraries needed for RTS linker
|
||||
configureFlags = [
|
||||
"--datadir=$doc/share/doc/ghc"
|
||||
"--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib"
|
||||
] ++ lib.optionals enableTerminfo [
|
||||
"--with-curses-includes=${lib.getDev targetLibs.ncurses}/include"
|
||||
"--with-curses-libraries=${lib.getLib targetLibs.ncurses}/lib"
|
||||
] ++ lib.optionals (libffi != null && !targetPlatform.isGhcjs) [
|
||||
"--with-system-libffi"
|
||||
"--with-ffi-includes=${targetPackages.libffi.dev}/include"
|
||||
"--with-ffi-libraries=${targetPackages.libffi.out}/lib"
|
||||
"--with-ffi-includes=${targetLibs.libffi.dev}/include"
|
||||
"--with-ffi-libraries=${targetLibs.libffi.out}/lib"
|
||||
] ++ lib.optionals (targetPlatform == hostPlatform && !enableNativeBignum) [
|
||||
"--with-gmp-includes=${targetPackages.gmp.dev}/include"
|
||||
"--with-gmp-libraries=${targetPackages.gmp.out}/lib"
|
||||
"--with-gmp-includes=${targetLibs.gmp.dev}/include"
|
||||
"--with-gmp-libraries=${targetLibs.gmp.out}/lib"
|
||||
] ++ lib.optionals (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
|
||||
"--with-iconv-includes=${libiconv}/include"
|
||||
"--with-iconv-libraries=${libiconv}/lib"
|
||||
@@ -454,14 +530,16 @@ stdenv.mkDerivation ({
|
||||
"--disable-large-address-space"
|
||||
] ++ lib.optionals enableDwarf [
|
||||
"--enable-dwarf-unwind"
|
||||
"--with-libdw-includes=${lib.getDev targetPackages.elfutils}/include"
|
||||
"--with-libdw-libraries=${lib.getLib targetPackages.elfutils}/lib"
|
||||
"--with-libdw-includes=${lib.getDev targetLibs.elfutils}/include"
|
||||
"--with-libdw-libraries=${lib.getLib targetLibs.elfutils}/lib"
|
||||
] ++ lib.optionals targetPlatform.isDarwin [
|
||||
# Darwin uses llvm-ar. GHC will try to use `-L` with `ar` when it is `llvm-ar`
|
||||
# but it doesn’t currently work because Cabal never uses `-L` on Darwin. See:
|
||||
# https://gitlab.haskell.org/ghc/ghc/-/issues/23188
|
||||
# https://github.com/haskell/cabal/issues/8882
|
||||
"fp_cv_prog_ar_supports_dash_l=no"
|
||||
] ++ lib.optionals enableUnregisterised [
|
||||
"--enable-unregisterised"
|
||||
];
|
||||
|
||||
# Make sure we never relax`$PATH` and hooks support for compatibility.
|
||||
@@ -471,11 +549,13 @@ stdenv.mkDerivation ({
|
||||
dontAddExtraLibs = true;
|
||||
|
||||
nativeBuildInputs = [
|
||||
perl ghc hadrian bootPkgs.alex bootPkgs.happy bootPkgs.hscolour
|
||||
perl hadrian bootPkgs.alex bootPkgs.happy bootPkgs.hscolour
|
||||
# autoconf and friends are necessary for hadrian to create the bindist
|
||||
autoconf automake m4
|
||||
# Python is used in a few scripts invoked by hadrian to generate e.g. rts headers.
|
||||
python3
|
||||
# Tool used to update GHC's settings file in postInstall
|
||||
bootPkgs.ghc-settings-edit
|
||||
] ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [
|
||||
autoSignDarwinBinariesHook
|
||||
] ++ lib.optionals enableDocs [
|
||||
@@ -484,8 +564,25 @@ stdenv.mkDerivation ({
|
||||
|
||||
# For building runtime libs
|
||||
depsBuildTarget = toolsForTarget;
|
||||
# Everything the stage0 compiler needs to build stage1: CC, bintools, extra libs.
|
||||
# See also GHC, {CC,LD,AR}_STAGE0 in preConfigure.
|
||||
depsBuildBuild = [
|
||||
# N.B. We do not declare bootPkgs.ghc in any of the stdenv.mkDerivation
|
||||
# dependency lists to prevent the bintools setup hook from adding ghc's
|
||||
# lib directory to the linker flags. Instead we tell configure about it
|
||||
# via the GHC environment variable.
|
||||
buildCC
|
||||
# stage0 builds terminfo unconditionally, so we always need ncurses
|
||||
ncurses
|
||||
];
|
||||
|
||||
buildInputs = [ perl bash ] ++ (libDeps hostPlatform);
|
||||
# Prevent stage0 ghc from leaking into the final result. This was an issue
|
||||
# with GHC 9.6.
|
||||
disallowedReferences = [
|
||||
bootPkgs.ghc
|
||||
];
|
||||
|
||||
buildInputs = [ bash ] ++ (libDeps hostPlatform);
|
||||
|
||||
depsTargetTarget = map lib.getDev (libDeps targetPlatform);
|
||||
depsTargetTargetPropagated = map (lib.getOutput "out") (libDeps targetPlatform);
|
||||
@@ -553,19 +650,49 @@ stdenv.mkDerivation ({
|
||||
# leave bindist directory
|
||||
popd
|
||||
|
||||
settingsFile="$out/lib/${targetPrefix}${haskellCompilerName}/lib/settings"
|
||||
|
||||
# Make the installed GHC use the host->target tools.
|
||||
ghc-settings-edit "$settingsFile" \
|
||||
"C compiler command" "${toolPath "cc" installCC}" \
|
||||
"Haskell CPP command" "${toolPath "cc" installCC}" \
|
||||
"C++ compiler command" "${toolPath "c++" installCC}" \
|
||||
"ld command" "${toolPath "ld${lib.optionalString useLdGold ".gold"}" installCC}" \
|
||||
"Merge objects command" "${toolPath "ld${lib.optionalString useLdGold ".gold"}" installCC}" \
|
||||
"ar command" "${toolPath "ar" installCC}" \
|
||||
"ranlib command" "${toolPath "ranlib" installCC}"
|
||||
''
|
||||
+ lib.optionalString (stdenv.targetPlatform.linker == "cctools") ''
|
||||
ghc-settings-edit "$settingsFile" \
|
||||
"otool command" "${toolPath "otool" installCC}" \
|
||||
"install_name_tool command" "${toolPath "install_name_tool" installCC}"
|
||||
''
|
||||
+ lib.optionalString useLLVM ''
|
||||
ghc-settings-edit "$settingsFile" \
|
||||
"LLVM llc command" "${lib.getBin llvmPackages.llvm}/bin/llc" \
|
||||
"LLVM opt command" "${lib.getBin llvmPackages.llvm}/bin/opt"
|
||||
''
|
||||
+ lib.optionalString (useLLVM && stdenv.targetPlatform.isDarwin) ''
|
||||
ghc-settings-edit "$settingsFile" \
|
||||
"LLVM clang command" "${
|
||||
# See comment for CLANG in preConfigure
|
||||
if installCC.isClang
|
||||
then toolPath "clang" installCC
|
||||
else "${llvmPackages.clang}/bin/${llvmPackages.clang.targetPrefix}clang"
|
||||
}"
|
||||
''
|
||||
+ ''
|
||||
|
||||
# Install the bash completion file.
|
||||
install -Dm 644 utils/completion/ghc.bash $out/share/bash-completion/completions/${targetPrefix}ghc
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
inherit bootPkgs targetPrefix;
|
||||
inherit bootPkgs targetPrefix haskellCompilerName;
|
||||
|
||||
inherit llvmPackages;
|
||||
inherit enableShared;
|
||||
|
||||
# Our Cabal compiler name
|
||||
haskellCompilerName = "ghc-${version}";
|
||||
|
||||
# Expose hadrian used for bootstrapping, for debugging purposes
|
||||
inherit hadrian;
|
||||
|
||||
@@ -581,7 +708,8 @@ stdenv.mkDerivation ({
|
||||
guibou
|
||||
] ++ lib.teams.haskell.members;
|
||||
timeout = 24 * 3600;
|
||||
inherit (ghc.meta) license platforms;
|
||||
platforms = lib.platforms.all;
|
||||
inherit (bootPkgs.ghc.meta) license;
|
||||
};
|
||||
|
||||
dontStrip = targetPlatform.useAndroidPrebuilt || targetPlatform.isWasm;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
, url ? "https://downloads.haskell.org/ghc/${version}/ghc-${version}-src.tar.xz"
|
||||
}:
|
||||
|
||||
{ lib, stdenv, pkgsBuildTarget, pkgsHostTarget, targetPackages
|
||||
{ lib, stdenv, pkgsBuildTarget, pkgsHostTarget, buildPackages, targetPackages
|
||||
|
||||
# build-tools
|
||||
, bootPkgs
|
||||
@@ -35,14 +35,19 @@
|
||||
, # If enabled, use -fPIC when compiling static libs.
|
||||
enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
|
||||
|
||||
, enableProfiledLibs ? true
|
||||
# Exceeds Hydra output limit (at the time of writing ~3GB) when cross compiled to riscv64.
|
||||
# A riscv64 cross-compiler fits into the limit comfortably.
|
||||
, enableProfiledLibs ? !stdenv.hostPlatform.isRiscV64
|
||||
|
||||
, # Whether to build dynamic libs for the standard library (on the target
|
||||
# platform). Static libs are always built.
|
||||
enableShared ? with stdenv.targetPlatform; !isWindows && !useiOSPrebuilt && !isStatic
|
||||
|
||||
, # Whether to build terminfo.
|
||||
enableTerminfo ? !stdenv.targetPlatform.isWindows
|
||||
enableTerminfo ? !(stdenv.targetPlatform.isWindows
|
||||
# terminfo can't be built for cross
|
||||
|| (stdenv.buildPlatform != stdenv.hostPlatform)
|
||||
|| (stdenv.hostPlatform != stdenv.targetPlatform))
|
||||
|
||||
, # What flavour to build. An empty string indicates no
|
||||
# specific flavour and falls back to ghc default values.
|
||||
@@ -58,24 +63,33 @@
|
||||
|
||||
, enableHaddockProgram ?
|
||||
# Disabled for cross; see note [HADDOCK_DOCS].
|
||||
(stdenv.targetPlatform == stdenv.hostPlatform)
|
||||
(stdenv.buildPlatform == stdenv.hostPlatform && stdenv.targetPlatform == stdenv.hostPlatform)
|
||||
|
||||
, # Whether to disable the large address space allocator
|
||||
# necessary fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/
|
||||
disableLargeAddressSpace ? stdenv.targetPlatform.isiOS
|
||||
|
||||
, # Whether to build an unregisterised version of GHC.
|
||||
# GHC will normally auto-detect whether it can do a registered build, but this
|
||||
# option will force it to do an unregistered build when set to true.
|
||||
# See https://gitlab.haskell.org/ghc/ghc/-/wikis/building/unregisterised
|
||||
# Registerised RV64 compiler produces programs that segfault
|
||||
# See https://gitlab.haskell.org/ghc/ghc/-/issues/23957
|
||||
enableUnregisterised ? stdenv.hostPlatform.isRiscV64 || stdenv.targetPlatform.isRiscV64
|
||||
}:
|
||||
|
||||
assert !enableNativeBignum -> gmp != null;
|
||||
|
||||
# Cross cannot currently build the `haddock` program for silly reasons,
|
||||
# see note [HADDOCK_DOCS].
|
||||
assert (stdenv.targetPlatform != stdenv.hostPlatform) -> !enableHaddockProgram;
|
||||
assert (stdenv.buildPlatform != stdenv.hostPlatform || stdenv.targetPlatform != stdenv.hostPlatform) -> !enableHaddockProgram;
|
||||
|
||||
# GHC does not support building when all 3 platforms are different.
|
||||
assert stdenv.buildPlatform == stdenv.hostPlatform || stdenv.hostPlatform == stdenv.targetPlatform;
|
||||
|
||||
let
|
||||
inherit (stdenv) buildPlatform hostPlatform targetPlatform;
|
||||
|
||||
inherit (bootPkgs) ghc;
|
||||
|
||||
# TODO(@Ericson2314) Make unconditional
|
||||
targetPrefix = lib.optionalString
|
||||
(targetPlatform != hostPlatform)
|
||||
@@ -88,6 +102,8 @@ let
|
||||
endif
|
||||
BUILD_SPHINX_HTML = ${if enableDocs then "YES" else "NO"}
|
||||
BUILD_SPHINX_PDF = NO
|
||||
|
||||
WITH_TERMINFO = ${if enableTerminfo then "YES" else "NO"}
|
||||
'' +
|
||||
# Note [HADDOCK_DOCS]:
|
||||
# Unfortunately currently `HADDOCK_DOCS` controls both whether the `haddock`
|
||||
@@ -134,7 +150,9 @@ let
|
||||
pkgsBuildTarget.targetPackages.stdenv.cc
|
||||
] ++ lib.optional useLLVM buildTargetLlvmPackages.llvm;
|
||||
|
||||
buildCC = buildPackages.stdenv.cc;
|
||||
targetCC = builtins.head toolsForTarget;
|
||||
installCC = pkgsHostTarget.targetPackages.stdenv.cc;
|
||||
|
||||
# toolPath calculates the absolute path to the name tool associated with a
|
||||
# given `stdenv.cc` derivation, i.e. it picks the correct derivation to take
|
||||
@@ -145,12 +163,13 @@ let
|
||||
tools = {
|
||||
"cc" = cc;
|
||||
"c++" = cc;
|
||||
as = cc.bintools.bintools;
|
||||
as = cc.bintools;
|
||||
|
||||
ar = cc.bintools.bintools;
|
||||
ranlib = cc.bintools.bintools;
|
||||
nm = cc.bintools.bintools;
|
||||
readelf = cc.bintools.bintools;
|
||||
ar = cc.bintools;
|
||||
ranlib = cc.bintools;
|
||||
nm = cc.bintools;
|
||||
readelf = cc.bintools;
|
||||
objdump = cc.bintools;
|
||||
|
||||
ld = cc.bintools;
|
||||
"ld.gold" = cc.bintools;
|
||||
@@ -169,6 +188,9 @@ let
|
||||
if stdenv.targetPlatform.isDarwin
|
||||
then cc.bintools
|
||||
else cc.bintools.bintools;
|
||||
|
||||
# clang is used as an assembler on darwin with the LLVM backend
|
||||
clang = cc;
|
||||
}.${name};
|
||||
in
|
||||
"${tools}/bin/${tools.targetPrefix}${name}";
|
||||
@@ -185,14 +207,30 @@ let
|
||||
(lib.optionalString enableNativeBignum "-native-bignum")
|
||||
];
|
||||
|
||||
in
|
||||
# These libraries are library dependencies of the standard libraries bundled
|
||||
# by GHC (core libs) users will link their compiled artifacts again. Thus,
|
||||
# they should be taken from targetPackages.
|
||||
#
|
||||
# We need to use pkgsHostTarget if we are cross compiling a native GHC compiler,
|
||||
# though (when native compiling GHC, pkgsHostTarget == targetPackages):
|
||||
#
|
||||
# 1. targetPackages would be empty(-ish) in this situation since we can't
|
||||
# execute cross compiled compilers in order to obtain the libraries
|
||||
# that would be in targetPackages.
|
||||
# 2. pkgsHostTarget is fine to use since hostPlatform == targetPlatform in this
|
||||
# situation.
|
||||
# 3. The core libs used by the final GHC (stage 2) for user artifacts are also
|
||||
# used to build stage 2 GHC itself, i.e. the core libs are both host and
|
||||
# target.
|
||||
targetLibs = {
|
||||
inherit
|
||||
(if hostPlatform != targetPlatform then targetPackages else pkgsHostTarget)
|
||||
gmp
|
||||
libffi
|
||||
ncurses;
|
||||
};
|
||||
|
||||
# C compiler, bintools and LLVM are used at build time, but will also leak into
|
||||
# the resulting GHC's settings file and used at runtime. This means that we are
|
||||
# currently only able to build GHC if hostPlatform == buildPlatform.
|
||||
assert targetCC == pkgsHostTarget.targetPackages.stdenv.cc;
|
||||
assert buildTargetLlvmPackages.llvm == llvmPackages.llvm;
|
||||
assert stdenv.targetPlatform.isDarwin -> buildTargetLlvmPackages.clang == llvmPackages.clang;
|
||||
in
|
||||
|
||||
stdenv.mkDerivation (rec {
|
||||
pname = "${targetPrefix}ghc${variantSuffix}";
|
||||
@@ -282,6 +320,8 @@ stdenv.mkDerivation (rec {
|
||||
for env in $(env | grep '^TARGET_' | sed -E 's|\+?=.*||'); do
|
||||
export "''${env#TARGET_}=''${!env}"
|
||||
done
|
||||
# Stage0 (build->build) which builds stage 1
|
||||
export GHC="${bootPkgs.ghc}/bin/ghc"
|
||||
# GHC is a bit confused on its cross terminology, as these would normally be
|
||||
# the *host* tools.
|
||||
export CC="${toolPath "cc" targetCC}"
|
||||
@@ -294,6 +334,7 @@ stdenv.mkDerivation (rec {
|
||||
export RANLIB="${toolPath "ranlib" targetCC}"
|
||||
export READELF="${toolPath "readelf" targetCC}"
|
||||
export STRIP="${toolPath "strip" targetCC}"
|
||||
export OBJDUMP="${toolPath "objdump" targetCC}"
|
||||
'' + lib.optionalString (stdenv.targetPlatform.linker == "cctools") ''
|
||||
export OTOOL="${toolPath "otool" targetCC}"
|
||||
export INSTALL_NAME_TOOL="${toolPath "install_name_tool" targetCC}"
|
||||
@@ -302,9 +343,24 @@ stdenv.mkDerivation (rec {
|
||||
export OPT="${lib.getBin buildTargetLlvmPackages.llvm}/bin/opt"
|
||||
'' + lib.optionalString (useLLVM && stdenv.targetPlatform.isDarwin) ''
|
||||
# LLVM backend on Darwin needs clang: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/codegens.html#llvm-code-generator-fllvm
|
||||
export CLANG="${buildTargetLlvmPackages.clang}/bin/${buildTargetLlvmPackages.clang.targetPrefix}clang"
|
||||
# The executable we specify via $CLANG is used as an assembler (exclusively, it seems, but this isn't
|
||||
# clarified in any user facing documentation). As such, it'll be called on assembly produced by $CC
|
||||
# which usually comes from the darwin stdenv. To prevent a situation where $CLANG doesn't understand
|
||||
# the assembly it is given, we need to make sure that it matches the LLVM version of $CC if possible.
|
||||
# It is unclear (at the time of writing 2024-09-01) whether $CC should match the LLVM version we use
|
||||
# for llc and opt which would require using a custom darwin stdenv for targetCC.
|
||||
export CLANG="${
|
||||
if targetCC.isClang
|
||||
then toolPath "clang" targetCC
|
||||
else "${buildTargetLlvmPackages.clang}/bin/${buildTargetLlvmPackages.clang.targetPrefix}clang"
|
||||
}"
|
||||
''
|
||||
+ ''
|
||||
# No need for absolute paths since these tools only need to work during the build
|
||||
export CC_STAGE0="$CC_FOR_BUILD"
|
||||
export LD_STAGE0="$LD_FOR_BUILD"
|
||||
export AR_STAGE0="$AR_FOR_BUILD"
|
||||
|
||||
echo -n "${buildMK}" > mk/build.mk
|
||||
''
|
||||
+ lib.optionalString (lib.versionOlder version "9.2" || lib.versionAtLeast version "9.4") ''
|
||||
@@ -346,21 +402,26 @@ stdenv.mkDerivation (rec {
|
||||
'MinBootGhcVersion="8.10"'
|
||||
'';
|
||||
|
||||
# Although it is usually correct to pass --host, we don't do that here because
|
||||
# GHC's usage of build, host, and target is non-standard.
|
||||
# See https://gitlab.haskell.org/ghc/ghc/-/wikis/building/cross-compiling
|
||||
# TODO(@Ericson2314): Always pass "--target" and always prefix.
|
||||
configurePlatforms = [ "build" "host" ]
|
||||
++ lib.optional (targetPlatform != hostPlatform) "target";
|
||||
configurePlatforms = [ "build" ]
|
||||
++ lib.optional (buildPlatform != hostPlatform || targetPlatform != hostPlatform) "target";
|
||||
|
||||
# `--with` flags for libraries needed for RTS linker
|
||||
configureFlags = [
|
||||
"--datadir=$doc/share/doc/ghc"
|
||||
"--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib"
|
||||
] ++ lib.optionals enableTerminfo [
|
||||
"--with-curses-includes=${lib.getDev targetLibs.ncurses}/include"
|
||||
"--with-curses-libraries=${lib.getLib targetLibs.ncurses}/lib"
|
||||
] ++ lib.optionals (libffi != null) [
|
||||
"--with-system-libffi"
|
||||
"--with-ffi-includes=${targetPackages.libffi.dev}/include"
|
||||
"--with-ffi-libraries=${targetPackages.libffi.out}/lib"
|
||||
"--with-ffi-includes=${targetLibs.libffi.dev}/include"
|
||||
"--with-ffi-libraries=${targetLibs.libffi.out}/lib"
|
||||
] ++ lib.optionals (targetPlatform == hostPlatform && !enableNativeBignum) [
|
||||
"--with-gmp-includes=${targetPackages.gmp.dev}/include"
|
||||
"--with-gmp-libraries=${targetPackages.gmp.out}/lib"
|
||||
"--with-gmp-includes=${targetLibs.gmp.dev}/include"
|
||||
"--with-gmp-libraries=${targetLibs.gmp.out}/lib"
|
||||
] ++ lib.optionals (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
|
||||
"--with-iconv-includes=${libiconv}/include"
|
||||
"--with-iconv-libraries=${libiconv}/lib"
|
||||
@@ -372,6 +433,8 @@ stdenv.mkDerivation (rec {
|
||||
"CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold"
|
||||
] ++ lib.optionals (disableLargeAddressSpace) [
|
||||
"--disable-large-address-space"
|
||||
] ++ lib.optionals enableUnregisterised [
|
||||
"--enable-unregisterised"
|
||||
];
|
||||
|
||||
# Make sure we never relax`$PATH` and hooks support for compatibility.
|
||||
@@ -382,7 +445,8 @@ stdenv.mkDerivation (rec {
|
||||
|
||||
nativeBuildInputs = [
|
||||
perl autoconf automake m4 python3
|
||||
ghc bootPkgs.alex bootPkgs.happy bootPkgs.hscolour
|
||||
bootPkgs.alex bootPkgs.happy bootPkgs.hscolour
|
||||
bootPkgs.ghc-settings-edit
|
||||
] ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [
|
||||
autoSignDarwinBinariesHook
|
||||
] ++ lib.optionals enableDocs [
|
||||
@@ -393,10 +457,27 @@ stdenv.mkDerivation (rec {
|
||||
xattr
|
||||
];
|
||||
|
||||
# Everything the stage0 compiler needs to build stage1: CC, bintools, extra libs.
|
||||
# See also GHC, {CC,LD,AR}_STAGE0 in preConfigure.
|
||||
depsBuildBuild = [
|
||||
# N.B. We do not declare bootPkgs.ghc in any of the stdenv.mkDerivation
|
||||
# dependency lists to prevent the bintools setup hook from adding ghc's
|
||||
# lib directory to the linker flags. Instead we tell configure about it
|
||||
# via the GHC environment variable.
|
||||
buildCC
|
||||
# stage0 builds terminfo unconditionally, so we always need ncurses
|
||||
ncurses
|
||||
];
|
||||
# For building runtime libs
|
||||
depsBuildTarget = toolsForTarget;
|
||||
|
||||
buildInputs = [ perl bash ] ++ (libDeps hostPlatform);
|
||||
# Prevent stage0 ghc from leaking into the final result. This was an issue
|
||||
# with GHC 9.6.
|
||||
disallowedReferences = [
|
||||
bootPkgs.ghc
|
||||
];
|
||||
|
||||
buildInputs = [ bash ] ++ (libDeps hostPlatform);
|
||||
|
||||
depsTargetTarget = map lib.getDev (libDeps targetPlatform);
|
||||
depsTargetTargetPropagated = map (lib.getOutput "out") (libDeps targetPlatform);
|
||||
@@ -423,6 +504,39 @@ stdenv.mkDerivation (rec {
|
||||
requiredSystemFeatures = [ "big-parallel" ];
|
||||
|
||||
postInstall = ''
|
||||
settingsFile="$out/lib/${targetPrefix}${passthru.haskellCompilerName}/settings"
|
||||
|
||||
# Make the installed GHC use the host->target tools.
|
||||
ghc-settings-edit "$settingsFile" \
|
||||
"C compiler command" "${toolPath "cc" installCC}" \
|
||||
"Haskell CPP command" "${toolPath "cc" installCC}" \
|
||||
"C++ compiler command" "${toolPath "c++" installCC}" \
|
||||
"ld command" "${toolPath "ld${lib.optionalString useLdGold ".gold"}" installCC}" \
|
||||
"Merge objects command" "${toolPath "ld${lib.optionalString useLdGold ".gold"}" installCC}" \
|
||||
"ar command" "${toolPath "ar" installCC}" \
|
||||
"ranlib command" "${toolPath "ranlib" installCC}"
|
||||
''
|
||||
+ lib.optionalString (stdenv.targetPlatform.linker == "cctools") ''
|
||||
ghc-settings-edit "$settingsFile" \
|
||||
"otool command" "${toolPath "otool" installCC}" \
|
||||
"install_name_tool command" "${toolPath "install_name_tool" installCC}"
|
||||
''
|
||||
+ lib.optionalString useLLVM ''
|
||||
ghc-settings-edit "$settingsFile" \
|
||||
"LLVM llc command" "${lib.getBin llvmPackages.llvm}/bin/llc" \
|
||||
"LLVM opt command" "${lib.getBin llvmPackages.llvm}/bin/opt"
|
||||
''
|
||||
+ lib.optionalString (useLLVM && stdenv.targetPlatform.isDarwin) ''
|
||||
ghc-settings-edit "$settingsFile" \
|
||||
"LLVM clang command" "${
|
||||
# See comment for CLANG in preConfigure
|
||||
if installCC.isClang
|
||||
then toolPath "clang" installCC
|
||||
else "${llvmPackages.clang}/bin/${llvmPackages.clang.targetPrefix}clang"
|
||||
}"
|
||||
''
|
||||
+ ''
|
||||
|
||||
# Install the bash completion file.
|
||||
install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/${targetPrefix}ghc
|
||||
'';
|
||||
@@ -448,7 +562,8 @@ stdenv.mkDerivation (rec {
|
||||
guibou
|
||||
] ++ lib.teams.haskell.members;
|
||||
timeout = 24 * 3600;
|
||||
inherit (ghc.meta) license platforms;
|
||||
platforms = lib.platforms.all;
|
||||
inherit (bootPkgs.ghc.meta) license;
|
||||
};
|
||||
|
||||
} // lib.optionalAttrs targetPlatform.useAndroidPrebuilt {
|
||||
|
||||
@@ -185,6 +185,13 @@ self: super: {
|
||||
http-api-data = doJailbreak super.http-api-data;
|
||||
tasty-discover = doJailbreak super.tasty-discover;
|
||||
|
||||
# Out of date test data: https://github.com/ocharles/weeder/issues/176
|
||||
weeder = appendPatch (pkgs.fetchpatch {
|
||||
name = "weeder-2.9.0-test-fix-expected.patch";
|
||||
url = "https://github.com/ocharles/weeder/commit/56028d0c80fe89d4f2ae25275aedb72714fec7da.patch";
|
||||
sha256 = "10zkvclyir3zf21v41zdsvg68vrkq89n64kv9k54742am2i4aygf";
|
||||
}) super.weeder;
|
||||
|
||||
# Allow aeson == 2.1.*
|
||||
# https://github.com/hdgarrood/aeson-better-errors/issues/23
|
||||
aeson-better-errors = lib.pipe super.aeson-better-errors [
|
||||
@@ -404,7 +411,7 @@ self: super: {
|
||||
name = "git-annex-${super.git-annex.version}-src";
|
||||
url = "git://git-annex.branchable.com/";
|
||||
rev = "refs/tags/" + super.git-annex.version;
|
||||
sha256 = "1h0vbz95jgj8c380rpy688frnbwind5c2y3ylaw06l2l3j6gdaq3";
|
||||
sha256 = "0j037sis64gnrll7ajg48cvzzvxqsrhj7vnhiwcqv8wbmbfv0avn";
|
||||
# delete android and Android directories which cause issues on
|
||||
# darwin (case insensitive directory). Since we don't need them
|
||||
# during the build process, we can delete it to prevent a hash
|
||||
@@ -1461,6 +1468,11 @@ self: super: {
|
||||
'';
|
||||
}) super.hledger-flow;
|
||||
|
||||
# xmonad-contrib >= 0.18.1 for latest XMonad
|
||||
xmonad-contrib_0_18_1 = super.xmonad-contrib_0_18_1.override {
|
||||
xmonad = self.xmonad_0_18_0;
|
||||
};
|
||||
|
||||
# Chart-tests needs and compiles some modules from Chart itself
|
||||
Chart-tests = overrideCabal (old: {
|
||||
# https://github.com/timbod7/haskell-chart/issues/233
|
||||
@@ -2048,6 +2060,11 @@ self: super: {
|
||||
tls = self.tls_2_0_6;
|
||||
});
|
||||
|
||||
# Requests version 2 of tls, can be removed once it's the default
|
||||
diohsc = super.diohsc.overrideScope (self: super: {
|
||||
tls = self.tls_2_0_6;
|
||||
});
|
||||
|
||||
# Need https://github.com/obsidiansystems/cli-extras/pull/12 and more
|
||||
cli-extras = doJailbreak super.cli-extras;
|
||||
|
||||
@@ -2445,9 +2462,7 @@ self: super: {
|
||||
# See: https://gitlab.haskell.org/ghc/ghc/-/issues/17188
|
||||
#
|
||||
# Overwrite the build cores
|
||||
raaz = overrideCabal (drv: {
|
||||
enableParallelBuilding = false;
|
||||
}) super.raaz;
|
||||
raaz = disableParallelBuilding super.raaz;
|
||||
|
||||
# https://github.com/andreymulik/sdp/issues/3
|
||||
sdp = disableLibraryProfiling super.sdp;
|
||||
@@ -2552,8 +2567,9 @@ self: super: {
|
||||
relative = "dependent-sum-template";
|
||||
}) super.dependent-sum-template;
|
||||
|
||||
# Too strict bounds on chell: https://github.com/fpco/haskell-filesystem/issues/24
|
||||
system-fileio = doJailbreak super.system-fileio;
|
||||
# doJailbreak: too strict bounds on chell: https://github.com/fpco/haskell-filesystem/issues/24
|
||||
# dontCheck: tests don't typecheck after ghc 8.4 (possibly introduced by api change of unix library)
|
||||
system-fileio = doJailbreak (dontCheck super.system-fileio);
|
||||
|
||||
# Bounds too strict on base and ghc-prim: https://github.com/tibbe/ekg-core/pull/43 (merged); waiting on hackage release
|
||||
ekg-core = assert super.ekg-core.version == "0.1.1.7"; doJailbreak super.ekg-core;
|
||||
|
||||
@@ -83,9 +83,6 @@ self: super: ({
|
||||
with-utf8 = addExtraLibrary pkgs.libiconv super.with-utf8;
|
||||
with-utf8_1_1_0_0 = addExtraLibrary pkgs.libiconv super.with-utf8_1_1_0_0;
|
||||
|
||||
# the system-fileio tests use canonicalizePath, which fails in the sandbox
|
||||
system-fileio = dontCheck super.system-fileio;
|
||||
|
||||
git-annex = overrideCabal (drv: {
|
||||
# We can't use testFlags since git-annex side steps the Cabal test mechanism
|
||||
preCheck = drv.preCheck or "" + ''
|
||||
|
||||
@@ -69,7 +69,6 @@ self: super: {
|
||||
hpc-coveralls = doJailbreak super.hpc-coveralls; # https://github.com/guillaume-nargeot/hpc-coveralls/issues/82
|
||||
http-api-data = doJailbreak super.http-api-data;
|
||||
persistent-sqlite = dontCheck super.persistent-sqlite;
|
||||
system-fileio = dontCheck super.system-fileio; # avoid dependency on broken "patience"
|
||||
unicode-transforms = dontCheck super.unicode-transforms;
|
||||
wl-pprint-extras = doJailbreak super.wl-pprint-extras; # containers >=0.4 && <0.6 is too tight; https://github.com/ekmett/wl-pprint-extras/issues/17
|
||||
RSA = dontCheck super.RSA; # https://github.com/GaloisInc/RSA/issues/14
|
||||
|
||||
@@ -5,7 +5,6 @@ with haskellLib;
|
||||
let
|
||||
inherit (pkgs) lib;
|
||||
|
||||
disableParallelBuilding = haskellLib.overrideCabal (drv: { enableParallelBuilding = false; });
|
||||
in
|
||||
|
||||
self: super: {
|
||||
@@ -55,9 +54,6 @@ self: super: {
|
||||
unix = null;
|
||||
xhtml = null;
|
||||
|
||||
# https://gitlab.haskell.org/ghc/ghc/-/issues/23392
|
||||
gi-gtk = disableParallelBuilding super.gi-gtk;
|
||||
|
||||
#
|
||||
# Version upgrades
|
||||
#
|
||||
@@ -67,14 +63,18 @@ self: super: {
|
||||
aeson = doDistribute self.aeson_2_2_3_0;
|
||||
apply-refact = doDistribute self.apply-refact_0_14_0_0;
|
||||
attoparsec-aeson = doDistribute self.attoparsec-aeson_2_2_2_0;
|
||||
auto-update = super.auto-update_0_2_1;
|
||||
extensions = doDistribute self.extensions_0_1_0_2;
|
||||
fourmolu = doDistribute self.fourmolu_0_16_2_0;
|
||||
hashable = doDistribute self.hashable_1_4_7_0;
|
||||
integer-conversion = doDistribute self.integer-conversion_0_1_1;
|
||||
ghc-lib-parser = doDistribute self.ghc-lib-parser_9_10_1_20240511;
|
||||
ghc-lib-parser-ex = doDistribute self.ghc-lib-parser-ex_9_10_0_0;
|
||||
http2 = super.http2_5_3_4;
|
||||
lens = doDistribute self.lens_5_3_2;
|
||||
lukko = doDistribute self.lukko_0_1_2;
|
||||
network-control = super.network-control_0_1_3;
|
||||
network-run = super.network-run_0_4_0;
|
||||
ormolu = doDistribute self.ormolu_0_7_7_0;
|
||||
primitive = doDistribute (dontCheck self.primitive_0_9_0_0); # tests introduce a recursive dependency via hspec
|
||||
quickcheck-instances = doDistribute self.quickcheck-instances_0_3_31;
|
||||
@@ -82,6 +82,7 @@ self: super: {
|
||||
rerebase = doDistribute self.rerebase_1_21_1;
|
||||
scientific = doDistribute self.scientific_0_3_8_0;
|
||||
semirings = doDistribute self.semirings_0_7;
|
||||
time-manager = super.time-manager_0_1_0;
|
||||
th-abstraction = doDistribute self.th-abstraction_0_7_0_0;
|
||||
uuid-types = doDistribute self.uuid-types_1_0_6;
|
||||
|
||||
@@ -101,9 +102,11 @@ self: super: {
|
||||
#
|
||||
base64 = doJailbreak super.base64; # base <4.20
|
||||
commutative-semigroups = doJailbreak super.commutative-semigroups; # base <4.20
|
||||
dejafu = doJailbreak super.dejafu; # containers <0.7
|
||||
floskell = doJailbreak super.floskell; # base <4.20
|
||||
lucid = doJailbreak super.lucid; # base <4.20
|
||||
tar = doJailbreak super.tar; # base <4.20
|
||||
tasty-coverage = doJailbreak super.tasty-coverage; # base <4.20, filepath <1.5
|
||||
tree-diff = doJailbreak super.tree-diff; # base <4.20
|
||||
time-compat = doJailbreak super.time-compat; # base <4.20
|
||||
|
||||
@@ -123,6 +126,9 @@ self: super: {
|
||||
lukko_0_1_2 = dontCheck super.lukko_0_1_2; # doesn't compile with tasty ==1.4.*
|
||||
resolv = dontCheck super.resolv; # doesn't compile with filepath ==1.5.*
|
||||
primitive-unlifted = dontCheck super.primitive-unlifted; # doesn't compile with primitive ==0.9.*
|
||||
bsb-http-chunked = pkgs.haskell.lib.dontCheck super.bsb-http-chunked; # https://github.com/sjakobi/bsb-http-chunked/issues/45
|
||||
hinotify = pkgs.haskell.lib.dontCheck super.hinotify; # https://github.com/kolmodin/hinotify/issues/38
|
||||
warp = pkgs.haskell.lib.dontCheck super.warp_3_4_1; # test suite assumes it can freely call curl
|
||||
|
||||
haskell-language-server = disableCabalFlag "retrie" (disableCabalFlag "hlint" (disableCabalFlag "stylishhaskel" (super.haskell-language-server.override {stylish-haskell = null;retrie = null;apply-refact=null;hlint = null;})));
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
let
|
||||
inherit (pkgs) lib;
|
||||
|
||||
disableParallelBuilding = haskellLib.overrideCabal (drv: { enableParallelBuilding = false; });
|
||||
in
|
||||
|
||||
self: super: {
|
||||
@@ -53,6 +52,4 @@ self: super: {
|
||||
unix = null;
|
||||
xhtml = null;
|
||||
|
||||
# https://gitlab.haskell.org/ghc/ghc/-/issues/23392
|
||||
gi-gtk = disableParallelBuilding super.gi-gtk;
|
||||
}
|
||||
|
||||
@@ -15,8 +15,6 @@ let
|
||||
builtins.throw "Check if '${msg}' was resolved in ${pkg.pname} ${pkg.version} and update or remove this";
|
||||
jailbreakForCurrentVersion = p: v: checkAgainAfter p v "bad bounds" (doJailbreak p);
|
||||
|
||||
# Workaround for a ghc-9.6 issue: https://gitlab.haskell.org/ghc/ghc/-/issues/23392
|
||||
disableParallelBuilding = overrideCabal (drv: { enableParallelBuilding = false; });
|
||||
in
|
||||
|
||||
self: super: {
|
||||
@@ -109,9 +107,6 @@ self: super: {
|
||||
package-version # doctest <0.21, tasty-hedgehog <1.4
|
||||
;
|
||||
|
||||
# Avoid triggering an issue in ghc-9.6.2
|
||||
gi-gtk = disableParallelBuilding super.gi-gtk;
|
||||
|
||||
# Pending text-2.0 support https://github.com/gtk2hs/gtk2hs/issues/327
|
||||
gtk = doJailbreak super.gtk;
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ with haskellLib;
|
||||
let
|
||||
inherit (pkgs.stdenv.hostPlatform) isDarwin;
|
||||
|
||||
disableParallelBuilding = haskellLib.overrideCabal (drv: { enableParallelBuilding = false; });
|
||||
in
|
||||
|
||||
self: super: {
|
||||
@@ -146,7 +145,4 @@ self: super: {
|
||||
sha256 = "sha256-umjwgdSKebJdRrXjwHhsi8HBqotx1vFibY9ttLkyT/0=";
|
||||
}) super.reflex;
|
||||
|
||||
# https://gitlab.haskell.org/ghc/ghc/-/issues/23392
|
||||
gi-gtk = disableParallelBuilding super.gi-gtk;
|
||||
|
||||
}
|
||||
|
||||
@@ -2,12 +2,6 @@
|
||||
|
||||
with haskellLib;
|
||||
|
||||
let
|
||||
disableParallelBuilding = overrideCabal (drv: {
|
||||
enableParallelBuilding = false;
|
||||
});
|
||||
in
|
||||
|
||||
# cabal2nix doesn't properly add dependencies conditional on arch(javascript)
|
||||
|
||||
(self: super: {
|
||||
|
||||
@@ -158,6 +158,7 @@ broken-packages:
|
||||
- amqp-conduit # failure in job https://hydra.nixos.org/build/233228080 at 2023-09-02
|
||||
- amqp-worker # failure in job https://hydra.nixos.org/build/236675859 at 2023-10-04
|
||||
- analyze # failure in job https://hydra.nixos.org/build/233251441 at 2023-09-02
|
||||
- anansi # failure in job https://hydra.nixos.org/build/273451545 at 2024-10-01
|
||||
- anansi-pandoc # failure in job https://hydra.nixos.org/build/233252389 at 2023-09-02
|
||||
- android-activity # failure in job https://hydra.nixos.org/build/233203400 at 2023-09-02
|
||||
- android # failure in job https://hydra.nixos.org/build/233222148 at 2023-09-02
|
||||
@@ -611,6 +612,7 @@ broken-packages:
|
||||
- cabal2ebuild # failure in job https://hydra.nixos.org/build/233221248 at 2023-09-02
|
||||
- cabal2ghci # failure in job https://hydra.nixos.org/build/233233018 at 2023-09-02
|
||||
- cabal2json # failure in job https://hydra.nixos.org/build/233196099 at 2023-09-02
|
||||
- cabal-add # failure in job https://hydra.nixos.org/build/273461296 at 2024-10-01
|
||||
- cabal-audit # failure in job https://hydra.nixos.org/build/233193414 at 2023-09-02
|
||||
- cabal-auto-expose # failure in job https://hydra.nixos.org/build/233195440 at 2023-09-02
|
||||
- cabal-build-programs # failure in job https://hydra.nixos.org/build/257091363 at 2024-04-27
|
||||
@@ -799,8 +801,13 @@ broken-packages:
|
||||
- clanki # failure in job https://hydra.nixos.org/build/233196970 at 2023-09-02
|
||||
- clarifai # failure in job https://hydra.nixos.org/build/233229480 at 2023-09-02
|
||||
- CLASE # failure in job https://hydra.nixos.org/build/233234459 at 2023-09-02
|
||||
- clash-prelude # failure in job https://hydra.nixos.org/build/233252128 at 2023-09-02
|
||||
- clashilator # failure in job https://hydra.nixos.org/build/273442437 at 2024-10-01
|
||||
- clash-multisignal # failure in job https://hydra.nixos.org/build/273463331 at 2024-10-01
|
||||
- clash-prelude-quickcheck # failure in job https://hydra.nixos.org/build/273453747 at 2024-10-01
|
||||
- Clash-Royale-Hack-Cheats # failure in job https://hydra.nixos.org/build/233216034 at 2023-09-02
|
||||
- clash-systemverilog # failure in job https://hydra.nixos.org/build/273453889 at 2024-10-01
|
||||
- clash-verilog # failure in job https://hydra.nixos.org/build/273466517 at 2024-10-01
|
||||
- clash-vhdl # failure in job https://hydra.nixos.org/build/273460098 at 2024-10-01
|
||||
- ClasshSS # failure in job https://hydra.nixos.org/build/255688076 at 2024-04-16
|
||||
- ClassLaws # failure in job https://hydra.nixos.org/build/233243019 at 2023-09-02
|
||||
- classy-effects-base # failure in updateAutotoolsGnuConfigScriptsPhase in job https://hydra.nixos.org/build/237233636 at 2023-10-21
|
||||
@@ -1319,7 +1326,6 @@ broken-packages:
|
||||
- dijkstra-simple # failure in job https://hydra.nixos.org/build/233218373 at 2023-09-02
|
||||
- DimensionalHash # failure in job https://hydra.nixos.org/build/233230945 at 2023-09-02
|
||||
- dino # failure in job https://hydra.nixos.org/build/252725815 at 2024-03-16
|
||||
- diohsc # failure in job https://hydra.nixos.org/build/259625302 at 2024-05-15
|
||||
- diophantine # failure in job https://hydra.nixos.org/build/233229215 at 2023-09-02
|
||||
- diplomacy # failure in job https://hydra.nixos.org/build/233207895 at 2023-09-02
|
||||
- direct-binary-files # failure in job https://hydra.nixos.org/build/233246387 at 2023-09-02
|
||||
@@ -1329,6 +1335,7 @@ broken-packages:
|
||||
- directory-ospath-streaming # failure in job https://hydra.nixos.org/build/233240003 at 2023-09-02
|
||||
- direct-plugins # failure in job https://hydra.nixos.org/build/233211547 at 2023-09-02
|
||||
- direm # failure in job https://hydra.nixos.org/build/233211496 at 2023-09-02
|
||||
- dirstream # failure in job https://hydra.nixos.org/build/273442606 at 2024-10-01
|
||||
- disco # failure in job https://hydra.nixos.org/build/233212298 at 2023-09-02
|
||||
- discordian-calendar # failure in job https://hydra.nixos.org/build/233218124 at 2023-09-02
|
||||
- discord-types # failure in job https://hydra.nixos.org/build/233251778 at 2023-09-02
|
||||
@@ -2791,6 +2798,7 @@ broken-packages:
|
||||
- hs2ps # failure in job https://hydra.nixos.org/build/233258362 at 2023-09-02
|
||||
- hsakamai # failure in job https://hydra.nixos.org/build/252722933 at 2024-03-16
|
||||
- hsaml2 # failure in job https://hydra.nixos.org/build/233252618 at 2023-09-02
|
||||
- hs-asapo # failure in job https://hydra.nixos.org/build/273456994 at 2024-10-01
|
||||
- hsautogui # failure in job https://hydra.nixos.org/build/253687662 at 2024-03-31
|
||||
- hsay # failure in job https://hydra.nixos.org/build/233218925 at 2023-09-02
|
||||
- hsbc # failure in job https://hydra.nixos.org/build/233206310 at 2023-09-02
|
||||
@@ -4809,6 +4817,7 @@ broken-packages:
|
||||
- proof-assistant-bot # failure in job https://hydra.nixos.org/build/234974688 at 2023-09-13
|
||||
- proof-combinators # failure in job https://hydra.nixos.org/build/233210521 at 2023-09-02
|
||||
- PropaFP # failure in job https://hydra.nixos.org/build/233206496 at 2023-09-02
|
||||
- propeller # failure in job https://hydra.nixos.org/build/273449652 at 2024-10-01
|
||||
- Proper # failure in job https://hydra.nixos.org/build/233194417 at 2023-09-02
|
||||
- properties # failure in job https://hydra.nixos.org/build/233240862 at 2023-09-02
|
||||
- property-list # failure in job https://hydra.nixos.org/build/233254907 at 2023-09-02
|
||||
@@ -5500,6 +5509,7 @@ broken-packages:
|
||||
- sint # failure in job https://hydra.nixos.org/build/233238431 at 2023-09-02
|
||||
- siphash # failure in job https://hydra.nixos.org/build/233199344 at 2023-09-02
|
||||
- sitepipe # failure in job https://hydra.nixos.org/build/233201989 at 2023-09-02
|
||||
- si-timers # failure in job https://hydra.nixos.org/build/273467737 at 2024-10-01
|
||||
- sixfiguregroup # failure in job https://hydra.nixos.org/build/233252141 at 2023-09-02
|
||||
- sixty-five-oh-two # failure in job https://hydra.nixos.org/build/252714578 at 2024-03-16
|
||||
- sized-grid # failure in job https://hydra.nixos.org/build/233239056 at 2023-09-02
|
||||
@@ -5783,7 +5793,9 @@ broken-packages:
|
||||
- strict-ghc-plugin # failure in job https://hydra.nixos.org/build/233246830 at 2023-09-02
|
||||
- strict-impl-params # failure in job https://hydra.nixos.org/build/252732248 at 2024-03-16
|
||||
- strictly # failure in job https://hydra.nixos.org/build/233197142 at 2023-09-02
|
||||
- strict-mvar # failure in job https://hydra.nixos.org/build/273459853 at 2024-10-01
|
||||
- strict-optics # failure in job https://hydra.nixos.org/build/267983907 at 2024-07-31
|
||||
- strict-stm # failure in job https://hydra.nixos.org/build/273449297 at 2024-10-01
|
||||
- strict-tuple-lens # failure in job https://hydra.nixos.org/build/233194548 at 2023-09-02
|
||||
- strict-writer # failure in job https://hydra.nixos.org/build/252725649 at 2024-03-16
|
||||
- string-class # failure in job https://hydra.nixos.org/build/233230041 at 2023-09-02
|
||||
@@ -5888,7 +5900,6 @@ broken-packages:
|
||||
- system-command # failure in job https://hydra.nixos.org/build/233239356 at 2023-09-02
|
||||
- systemd-ntfy # failure in job https://hydra.nixos.org/build/236686880 at 2023-10-04
|
||||
- system-extra # failure in job https://hydra.nixos.org/build/233203137 at 2023-09-02
|
||||
- system-fileio # failure in job https://hydra.nixos.org/build/252731084 at 2024-03-16
|
||||
- system-inotify # failure in job https://hydra.nixos.org/build/233206871 at 2023-09-02
|
||||
- system-lifted # failure in job https://hydra.nixos.org/build/233236013 at 2023-09-02
|
||||
- system-linux-proc # failure in job https://hydra.nixos.org/build/233209447 at 2023-09-02
|
||||
@@ -6095,6 +6106,7 @@ broken-packages:
|
||||
- tiger # failure in job https://hydra.nixos.org/build/233249333 at 2023-09-02
|
||||
- TigerHash # failure in job https://hydra.nixos.org/build/233208162 at 2023-09-02
|
||||
- tightrope # failure in job https://hydra.nixos.org/build/233215237 at 2023-09-02
|
||||
- tiktoken # failure in job https://hydra.nixos.org/build/273448419 at 2024-10-01
|
||||
- tikzsd # failure in job https://hydra.nixos.org/build/233224431 at 2023-09-02
|
||||
- timecalc # failure in job https://hydra.nixos.org/build/233207970 at 2023-09-02
|
||||
- time-extras # failure in job https://hydra.nixos.org/build/233204030 at 2023-09-02
|
||||
@@ -6262,6 +6274,7 @@ broken-packages:
|
||||
- typed-process-effectful # failure in job https://hydra.nixos.org/build/236684332 at 2023-10-04
|
||||
- typedquery # failure in job https://hydra.nixos.org/build/233215307 at 2023-09-02
|
||||
- typed-session # failure in job https://hydra.nixos.org/build/270089993 at 2024-08-31
|
||||
- typed-session-state-algorithm # failure in job https://hydra.nixos.org/build/273462641 at 2024-10-01
|
||||
- typed-spreadsheet # failure in job https://hydra.nixos.org/build/233248967 at 2023-09-02
|
||||
- typed-time # failure in job https://hydra.nixos.org/build/233246930 at 2023-09-02
|
||||
- typed-wire # failure in job https://hydra.nixos.org/build/233237626 at 2023-09-02
|
||||
@@ -6318,6 +6331,7 @@ broken-packages:
|
||||
- unboxed # failure in job https://hydra.nixos.org/build/233219555 at 2023-09-02
|
||||
- unboxed-references # failure in job https://hydra.nixos.org/build/233192713 at 2023-09-02
|
||||
- unbreak # failure in job https://hydra.nixos.org/build/233242560 at 2023-09-02
|
||||
- uncertain # failure in job https://hydra.nixos.org/build/273461304 at 2024-10-01
|
||||
- unescaping-print # failure in job https://hydra.nixos.org/build/252736030 at 2024-03-16
|
||||
- unfix-binders # failure in job https://hydra.nixos.org/build/233259262 at 2023-09-02
|
||||
- unfoldable # failure in job https://hydra.nixos.org/build/252721990 at 2024-03-16
|
||||
|
||||
@@ -34,8 +34,8 @@ default-package-overrides:
|
||||
- chs-cabal < 0.1.1.2 # Incompatible with Cabal < 3.12
|
||||
# 2024-08-17: Stackage doesn't contain hnix-store-core >= 0.8 yet, so we need to restrict hnix-store-remote
|
||||
- hnix-store-remote < 0.7
|
||||
# 2024-08-26: test failure for >= 2.9 https://github.com/ocharles/weeder/issues/176
|
||||
- weeder < 2.9.0
|
||||
# 2024-09-12: match xmonad 0.17.* from Stackage LTS
|
||||
- xmonad-contrib < 0.18.1
|
||||
|
||||
|
||||
extra-packages:
|
||||
|
||||
@@ -483,7 +483,6 @@ dont-distribute-packages:
|
||||
- ampersand
|
||||
- amqp-streamly
|
||||
- analyze-client
|
||||
- anansi
|
||||
- anansi-hscolour
|
||||
- anatomy
|
||||
- animate-example
|
||||
@@ -572,6 +571,7 @@ dont-distribute-packages:
|
||||
- aviation-weight-balance
|
||||
- awesomium
|
||||
- awesomium-glut
|
||||
- aws-arn
|
||||
- aws-configuration-tools
|
||||
- aws-dynamodb-conduit
|
||||
- aws-dynamodb-streams
|
||||
@@ -673,7 +673,6 @@ dont-distribute-packages:
|
||||
- bitmaps
|
||||
- bittorrent
|
||||
- bla
|
||||
- blacktip
|
||||
- blakesum-demo
|
||||
- blastxml
|
||||
- blatex
|
||||
@@ -824,7 +823,6 @@ dont-distribute-packages:
|
||||
- chu2
|
||||
- chuchu
|
||||
- chunks
|
||||
- circuit-notation
|
||||
- citation-resolve
|
||||
- citeproc-hs-pandoc-filter
|
||||
- clac
|
||||
@@ -832,17 +830,7 @@ dont-distribute-packages:
|
||||
- claferIG
|
||||
- claferwiki
|
||||
- clash
|
||||
- clash-ghc
|
||||
- clash-lib
|
||||
- clash-lib-hedgehog
|
||||
- clash-multisignal
|
||||
- clash-prelude-hedgehog
|
||||
- clash-prelude-quickcheck
|
||||
- clash-shake
|
||||
- clash-systemverilog
|
||||
- clash-verilog
|
||||
- clash-vhdl
|
||||
- clashilator
|
||||
- classify-frog
|
||||
- classy-effects
|
||||
- classy-effects-th
|
||||
@@ -1144,7 +1132,6 @@ dont-distribute-packages:
|
||||
- direct-rocksdb
|
||||
- directory-contents
|
||||
- dirfiles
|
||||
- dirstream
|
||||
- discogs-haskell
|
||||
- discord-gateway
|
||||
- discord-hs
|
||||
@@ -1440,6 +1427,8 @@ dont-distribute-packages:
|
||||
- frpnow-gtk
|
||||
- frpnow-gtk3
|
||||
- frpnow-vty
|
||||
- fs-api
|
||||
- fs-sim
|
||||
- ftdi
|
||||
- ftp-client-conduit
|
||||
- ftree
|
||||
@@ -2280,7 +2269,6 @@ dont-distribute-packages:
|
||||
- hyperpublic
|
||||
- i
|
||||
- iException
|
||||
- ice40-prim
|
||||
- ide-backend
|
||||
- ide-backend-server
|
||||
- ideas-math
|
||||
@@ -2337,6 +2325,7 @@ dont-distribute-packages:
|
||||
- introduction-test
|
||||
- intset
|
||||
- invertible-hlist
|
||||
- io-classes-mtl
|
||||
- ion
|
||||
- ipatch
|
||||
- ipc
|
||||
@@ -2573,7 +2562,6 @@ dont-distribute-packages:
|
||||
- linnet-conduit
|
||||
- linux-ptrace
|
||||
- lio-eci11
|
||||
- lion
|
||||
- liquid-base
|
||||
- liquid-bytestring
|
||||
- liquid-containers
|
||||
@@ -3157,7 +3145,7 @@ dont-distribute-packages:
|
||||
- poseidon
|
||||
- poseidon-postgis
|
||||
- postgresql-common-persistent
|
||||
- postgresql-libpq_0_10_2_0
|
||||
- postgresql-libpq_0_11_0_0
|
||||
- postgresql-pure
|
||||
- postgresql-simple-ltree
|
||||
- postgresql-simple-queue
|
||||
@@ -3306,6 +3294,7 @@ dont-distribute-packages:
|
||||
- rc
|
||||
- rdf4h-vocab-activitystreams
|
||||
- rdioh
|
||||
- rds-data
|
||||
- react-flux-servant
|
||||
- reactive
|
||||
- reactive-banana-sdl
|
||||
@@ -3403,8 +3392,6 @@ dont-distribute-packages:
|
||||
- restricted-workers
|
||||
- rethinkdb-model
|
||||
- rethinkdb-wereHamster
|
||||
- retroclash-lib
|
||||
- retroclash-sim
|
||||
- rewrite
|
||||
- rewriting
|
||||
- rezoom
|
||||
@@ -3556,11 +3543,11 @@ dont-distribute-packages:
|
||||
- seqloc-datafiles
|
||||
- sequor
|
||||
- serdoc-binary
|
||||
- serial-test-generators
|
||||
- serpentine
|
||||
- serv
|
||||
- serv-wai
|
||||
- servant-aeson-generics-typescript
|
||||
- servant-auth-client_0_4_2_0
|
||||
- servant-auth-hmac
|
||||
- servant-auth-token
|
||||
- servant-auth-token-acid
|
||||
@@ -4297,7 +4284,6 @@ dont-distribute-packages:
|
||||
- yesod-raml-bin
|
||||
- yesod-raml-docs
|
||||
- yesod-raml-mock
|
||||
- yesod-routes-flow
|
||||
- yesod-routes-typescript
|
||||
- yesod-session-redis
|
||||
- yesod-worker
|
||||
|
||||
+1508
-424
File diff suppressed because it is too large
Load Diff
@@ -184,6 +184,13 @@ rec {
|
||||
markBrokenVersion = version: drv: assert drv.version == version; markBroken drv;
|
||||
markUnbroken = overrideCabal (drv: { broken = false; });
|
||||
|
||||
/* disableParallelBuilding drops the -j<n> option from the GHC
|
||||
command line for the given package. This can be useful in rare
|
||||
situations where parallel building of a package causes GHC to
|
||||
fail for some reason.
|
||||
*/
|
||||
disableParallelBuilding = overrideCabal (drv: { enableParallelBuilding = false; });
|
||||
|
||||
enableLibraryProfiling = overrideCabal (drv: { enableLibraryProfiling = true; });
|
||||
disableLibraryProfiling = overrideCabal (drv: { enableLibraryProfiling = false; });
|
||||
|
||||
|
||||
@@ -176,6 +176,8 @@ rec {
|
||||
markBrokenVersion = compose.markBrokenVersion;
|
||||
markUnbroken = compose.markUnbroken;
|
||||
|
||||
disableParallelBuilding = compose.disableParallelBuilding;
|
||||
|
||||
enableLibraryProfiling = compose.enableLibraryProfiling;
|
||||
disableLibraryProfiling = compose.disableLibraryProfiling;
|
||||
|
||||
|
||||
@@ -17,6 +17,8 @@ self: super: {
|
||||
# from the latest master instead of the current version on Hackage.
|
||||
cabal2nix-unstable = self.callPackage ./cabal2nix-unstable.nix { };
|
||||
|
||||
ghc-settings-edit = self.callPackage ../tools/haskell/ghc-settings-edit { };
|
||||
|
||||
# https://github.com/channable/vaultenv/issues/1
|
||||
vaultenv = self.callPackage ../tools/haskell/vaultenv { };
|
||||
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
import Distribution.Simple
|
||||
main = defaultMain
|
||||
@@ -0,0 +1,31 @@
|
||||
{
|
||||
mkDerivation,
|
||||
base,
|
||||
containers,
|
||||
lib,
|
||||
}:
|
||||
|
||||
mkDerivation {
|
||||
pname = "ghc-settings-edit";
|
||||
version = "0.1.0";
|
||||
src = lib.fileset.toSource {
|
||||
root = ./.;
|
||||
fileset = lib.fileset.unions [
|
||||
./Setup.hs
|
||||
./ghc-settings-edit.lhs
|
||||
./ghc-settings-edit.cabal
|
||||
];
|
||||
};
|
||||
isLibrary = false;
|
||||
isExecutable = true;
|
||||
executableHaskellDepends = [
|
||||
base
|
||||
containers
|
||||
];
|
||||
license = [
|
||||
lib.licenses.mit
|
||||
lib.licenses.bsd3
|
||||
];
|
||||
description = "Tool for editing GHC's settings file";
|
||||
mainProgram = "ghc-settings-edit";
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
cabal-version: 2.2
|
||||
name: ghc-settings-edit
|
||||
version: 0.1.0
|
||||
synopsis: Tool for editing GHC's settings file
|
||||
-- TODO: description for hackage
|
||||
-- TODO: category for hackage
|
||||
license: MIT AND BSD-3-Clause
|
||||
author: sternenseemann
|
||||
-- FIXME: must be email for potential Hackage upload
|
||||
maintainer: @NixOS/haskell
|
||||
copyright: © 2024 The Nixpkgs/NixOS contributors
|
||||
stability: experimental
|
||||
build-type: Simple
|
||||
bug-reports: https://github.com/NixOS/nixpkgs/issues
|
||||
|
||||
executable ghc-settings-edit
|
||||
default-language: Haskell2010
|
||||
-- TODO: bounds for hackage
|
||||
build-depends: base
|
||||
, containers
|
||||
main-is: ghc-settings-edit.lhs
|
||||
hs-source-dirs: .
|
||||
@@ -0,0 +1,109 @@
|
||||
ghc-settings-edit is a small tool for changing certain fields in the settings
|
||||
file that is part of every GHC installation (usually located at
|
||||
lib/ghc-$version/lib/settings or lib/ghc-$version/settings). This is sometimes
|
||||
necessary because GHC's build process leaks the tools used at build time into
|
||||
the final settings file. This is fine, as long as the build and host platform
|
||||
of the GHC build is the same since it will be possible to execute the tools
|
||||
used at build time at run time. In case we are cross compiling GHC itself,
|
||||
the settings file needs to be changed so that the correct tools are used in the
|
||||
final installation. The GHC build system itself doesn't allow for this due to
|
||||
its somewhat peculiar bootstrapping mechanism.
|
||||
|
||||
This tool was originally written by sternenseemann and is licensed under the MIT
|
||||
license (as is nixpkgs) as well as the BSD 3 Clause license since it incorporates
|
||||
some code from GHC. It is primarily intended for use in nixpkgs, so it should be
|
||||
considered unstable: No guarantees about the stability of its command line
|
||||
interface are made at this time.
|
||||
|
||||
> -- SPDX-License-Identifier: MIT AND BSD-3-Clause
|
||||
> {-# LANGUAGE LambdaCase #-}
|
||||
> module Main where
|
||||
|
||||
ghc-settings-edit requires no additional dependencies to the ones already
|
||||
required to bootstrap GHC. This means that it only depends on GHC and core
|
||||
libraries shipped with the compiler (base and containers). This property should
|
||||
be preserved going forward as to not needlessly complicate bootstrapping GHC
|
||||
in nixpkgs. Additionally, a wide range of library versions and thus GHC versions
|
||||
should be supported (via CPP if necessary).
|
||||
|
||||
> import Control.Monad (foldM)
|
||||
> import qualified Data.Map.Lazy as Map
|
||||
> import System.Environment (getArgs, getProgName)
|
||||
> import Text.Read (readEither)
|
||||
|
||||
Note that the containers dependency is needed to represent the contents of the
|
||||
settings file. In theory, [(String, String)] (think lookup) would suffice, but
|
||||
base doesn't provide any facilities for updating such lists. To avoid needlessly
|
||||
reinventing the wheel here, we depend on an extra core library.
|
||||
|
||||
> type SettingsMap = Map.Map String String
|
||||
|
||||
ghc-settings-edit accepts the following arguments:
|
||||
|
||||
- The path to the settings file which is edited in place.
|
||||
- For every field in the settings file to be updated, two arguments need to be
|
||||
passed: the name of the field and its new value. Any number of these pairs
|
||||
may be provided. If a field is missing from the given settings file,
|
||||
it won't be added (see also below).
|
||||
|
||||
> usage :: String -> String
|
||||
> usage name = "Usage: " ++ name ++ " FILE [KEY NEWVAL [KEY2 NEWVAL2 ...]]"
|
||||
|
||||
The arguments and the contents of the settings file are fed into the performEdits
|
||||
function which implements the main logic of ghc-settings-edit (except IO).
|
||||
|
||||
> performEdits :: [String] -> String -> Either String String
|
||||
> performEdits editArgs settingsString = do
|
||||
|
||||
First, the settings file is parsed and read into the SettingsMap structure. For
|
||||
parsing, we can simply rely read, as GHC uses the familiar Read/Show format
|
||||
(plus some formatting) for storing its settings. This is the main reason
|
||||
ghc-settings-edit is written in Haskell: We don't need to roll our own parser.
|
||||
|
||||
> settingsMap <- Map.fromList <$> readEither settingsString
|
||||
|
||||
We also need to parse the remaining command line arguments (after the path)
|
||||
which means splitting them into pairs of arguments describing the individual
|
||||
edits. We use the chunkList utility function from GHC for this which is vendored
|
||||
below. Since it doesn't guarantee that all sublists have the exact length given,
|
||||
we'll have to check the length of the returned “pairs” later.
|
||||
|
||||
> let edits = chunkList 2 editArgs
|
||||
|
||||
Since each edit is a transformation of the SettingsMap, we use a fold to go
|
||||
through the edits. The Either monad allows us to bail out if one is malformed.
|
||||
The use of Map.adjust ensures that fields that aren't present in the original
|
||||
settings file aren't added since the corresponding GHC installation wouldn't
|
||||
understand them. Note that this is done silently which may be suboptimal:
|
||||
It could be better to fail.
|
||||
|
||||
> show . Map.toList <$> foldM applyEdit settingsMap edits
|
||||
> where
|
||||
> applyEdit :: SettingsMap -> [String] -> Either String SettingsMap
|
||||
> applyEdit m [key, newValue] = Right $ Map.adjust (const newValue) key m
|
||||
> applyEdit _ _ = Left "Uneven number of edit arguments provided"
|
||||
|
||||
main just wraps performEdits and takes care of reading from and writing to the
|
||||
given file.
|
||||
|
||||
> main :: IO ()
|
||||
> main =
|
||||
> getArgs >>= \case
|
||||
> (settingsFile:edits) -> do
|
||||
> orig <- readFile settingsFile
|
||||
> case performEdits edits orig of
|
||||
> Right edited -> writeFile settingsFile edited
|
||||
> Left errorMsg -> error errorMsg
|
||||
> _ -> do
|
||||
> name <- getProgName
|
||||
> error $ usage name
|
||||
|
||||
As mentioned, chunkList is taken from GHC, specifically GHC.Utils.Misc of GHC
|
||||
verson 9.8.2. We don't depend on the ghc library directly (which would be
|
||||
possible in theory) since there are no stability guarantees or deprecation
|
||||
windows for the ghc's public library.
|
||||
|
||||
> -- | Split a list into chunks of /n/ elements
|
||||
> chunkList :: Int -> [a] -> [[a]]
|
||||
> chunkList _ [] = []
|
||||
> chunkList n xs = as : chunkList n bs where (as,bs) = splitAt n xs
|
||||
@@ -84,7 +84,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
# not need to know binutils' BINDIR at all. It's an absolute path
|
||||
# where libraries are stored.
|
||||
./plugins-no-BINDIR.patch
|
||||
] ++ lib.optionals buildPlatform.isDarwin [
|
||||
] ++ lib.optionals hostPlatform.isDarwin [
|
||||
# Note: Conditional to avoid Linux rebuilds on staging-next. Remove the conditional with the next update.
|
||||
# ld64 needs `-undefined dynamic_lookup` to link `libctf-nobfd.dylib`, but the Darwin
|
||||
# version detection in `libtool.m4` fails to detect the Darwin version correctly.
|
||||
@@ -122,7 +122,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
++ lib.optionals targetPlatform.isVc4 [ flex ]
|
||||
;
|
||||
|
||||
buildInputs = [ zlib gettext ] ++ lib.optionals buildPlatform.isDarwin [ CoreServices ];
|
||||
buildInputs = [ zlib gettext ] ++ lib.optionals hostPlatform.isDarwin [ CoreServices ];
|
||||
|
||||
inherit noSysDirs;
|
||||
|
||||
|
||||
@@ -146,6 +146,8 @@ let
|
||||
pkgs.pkgsCross.mips64el-linux-gnuabi64.stdenv
|
||||
pkgs.pkgsCross.mips64el-linux-gnuabin32.stdenv
|
||||
pkgs.pkgsCross.mingwW64.stdenv
|
||||
# Uses the expression that is used by the most cross-compil_ed_ GHCs
|
||||
pkgs.pkgsCross.riscv64.haskell.compiler.native-bignum.ghc948
|
||||
|
||||
] ++ lib.optionals (with pkgs.stdenv.buildPlatform; isx86_64 && isLinux) [
|
||||
# Musl-to-glibc cross on the same architecture tends to turn up
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ buildPackages, pkgsBuildTarget, pkgs, newScope, stdenv }:
|
||||
{ buildPackages, pkgsBuildBuild, pkgsBuildTarget, pkgs, newScope, stdenv }:
|
||||
|
||||
let
|
||||
# These are attributes in compiler that support integer-simple.
|
||||
@@ -52,7 +52,18 @@ in {
|
||||
|
||||
package-list = callPackage ../development/haskell-modules/package-list.nix {};
|
||||
|
||||
compiler = {
|
||||
# Always get boot compilers from `pkgsBuildBuild`. The boot (stage0) compiler
|
||||
# is used to build another compiler (stage1) that'll be used to build the
|
||||
# final compiler (stage2) (except when building a cross-compiler). This means
|
||||
# that stage1's host platform is the same as stage0: build. Consequently,
|
||||
# stage0 needs to be build->build.
|
||||
#
|
||||
# Note that we use bb.haskell.packages.*. haskell.packages.*.ghc is similar to
|
||||
# stdenv: The ghc comes from the previous package set, i.e. this predicate holds:
|
||||
# `name: pkgs: pkgs.haskell.packages.${name}.ghc == pkgs.buildPackages.haskell.compiler.${name}.ghc`.
|
||||
# This isn't problematic since pkgsBuildBuild.buildPackages is also build->build,
|
||||
# just something to keep in mind.
|
||||
compiler = let bb = pkgsBuildBuild.haskell; in {
|
||||
ghc865Binary = callPackage ../development/compilers/ghc/8.6.5-binary.nix {
|
||||
# Should be llvmPackages_6 which has been removed from nixpkgs
|
||||
llvmPackages = null;
|
||||
@@ -73,11 +84,11 @@ in {
|
||||
ghc8107 = callPackage ../development/compilers/ghc/8.10.7.nix {
|
||||
bootPkgs =
|
||||
# the oldest ghc with aarch64-darwin support is 8.10.5
|
||||
if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
|
||||
if stdenv.buildPlatform.isPower64 && stdenv.buildPlatform.isLittleEndian then
|
||||
# to my (@a-m-joseph) knowledge there are no newer official binaries for this platform
|
||||
packages.ghc865Binary
|
||||
bb.packages.ghc865Binary
|
||||
else
|
||||
packages.ghc8107Binary;
|
||||
bb.packages.ghc8107Binary;
|
||||
inherit (buildPackages.python311Packages) sphinx; # a distutils issue with 3.12
|
||||
python3 = buildPackages.python311; # so that we don't have two of them
|
||||
# Need to use apple's patched xattr until
|
||||
@@ -91,10 +102,10 @@ in {
|
||||
ghc902 = callPackage ../development/compilers/ghc/9.0.2.nix {
|
||||
bootPkgs =
|
||||
# the oldest ghc with aarch64-darwin support is 8.10.5
|
||||
if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
|
||||
packages.ghc810
|
||||
if stdenv.buildPlatform.isPower64 && stdenv.buildPlatform.isLittleEndian then
|
||||
bb.packages.ghc810
|
||||
else
|
||||
packages.ghc8107Binary;
|
||||
bb.packages.ghc8107Binary;
|
||||
inherit (buildPackages.python311Packages) sphinx; # a distutils issue with 3.12
|
||||
python3 = buildPackages.python311; # so that we don't have two of them
|
||||
inherit (buildPackages.darwin) autoSignDarwinBinariesHook xattr;
|
||||
@@ -104,10 +115,10 @@ in {
|
||||
ghc90 = compiler.ghc902;
|
||||
ghc925 = callPackage ../development/compilers/ghc/9.2.5.nix {
|
||||
bootPkgs =
|
||||
if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
|
||||
packages.ghc810
|
||||
if stdenv.buildPlatform.isPower64 && stdenv.buildPlatform.isLittleEndian then
|
||||
bb.packages.ghc810
|
||||
else
|
||||
packages.ghc8107Binary;
|
||||
bb.packages.ghc8107Binary;
|
||||
inherit (buildPackages.python311Packages) sphinx; # a distutils issue with 3.12
|
||||
python3 = buildPackages.python311; # so that we don't have two of them
|
||||
# Need to use apple's patched xattr until
|
||||
@@ -119,10 +130,10 @@ in {
|
||||
};
|
||||
ghc926 = callPackage ../development/compilers/ghc/9.2.6.nix {
|
||||
bootPkgs =
|
||||
if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
|
||||
packages.ghc810
|
||||
if stdenv.buildPlatform.isPower64 && stdenv.buildPlatform.isLittleEndian then
|
||||
bb.packages.ghc810
|
||||
else
|
||||
packages.ghc8107Binary;
|
||||
bb.packages.ghc8107Binary;
|
||||
inherit (buildPackages.python311Packages) sphinx; # a distutils issue with 3.12
|
||||
python3 = buildPackages.python311; # so that we don't have two of them
|
||||
# Need to use apple's patched xattr until
|
||||
@@ -134,10 +145,10 @@ in {
|
||||
};
|
||||
ghc927 = callPackage ../development/compilers/ghc/9.2.7.nix {
|
||||
bootPkgs =
|
||||
if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
|
||||
packages.ghc810
|
||||
if stdenv.buildPlatform.isPower64 && stdenv.buildPlatform.isLittleEndian then
|
||||
bb.packages.ghc810
|
||||
else
|
||||
packages.ghc8107Binary;
|
||||
bb.packages.ghc8107Binary;
|
||||
inherit (buildPackages.python311Packages) sphinx; # a distutils issue with 3.12
|
||||
python3 = buildPackages.python311; # so that we don't have two of them
|
||||
# Need to use apple's patched xattr until
|
||||
@@ -149,10 +160,10 @@ in {
|
||||
};
|
||||
ghc928 = callPackage ../development/compilers/ghc/9.2.8.nix {
|
||||
bootPkgs =
|
||||
if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
|
||||
packages.ghc810
|
||||
if stdenv.buildPlatform.isPower64 && stdenv.buildPlatform.isLittleEndian then
|
||||
bb.packages.ghc810
|
||||
else
|
||||
packages.ghc8107Binary;
|
||||
bb.packages.ghc8107Binary;
|
||||
inherit (buildPackages.python311Packages) sphinx; # a distutils issue with 3.12
|
||||
python3 = buildPackages.python311; # so that we don't have two of them
|
||||
# Need to use apple's patched xattr until
|
||||
@@ -170,14 +181,14 @@ in {
|
||||
# Use 8.10 as a workaround where possible to keep bootstrap path short.
|
||||
|
||||
# On ARM text won't build with GHC 8.10.*
|
||||
if stdenv.hostPlatform.isAarch then
|
||||
if stdenv.buildPlatform.isAarch then
|
||||
# TODO(@sternenseemann): package bindist
|
||||
packages.ghc902
|
||||
bb.packages.ghc902
|
||||
# No suitable bindists for powerpc64le
|
||||
else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
|
||||
packages.ghc902
|
||||
else if stdenv.buildPlatform.isPower64 && stdenv.buildPlatform.isLittleEndian then
|
||||
bb.packages.ghc902
|
||||
else
|
||||
packages.ghc8107Binary;
|
||||
bb.packages.ghc8107Binary;
|
||||
inherit (buildPackages.python311Packages) sphinx; # a distutils issue with 3.12
|
||||
python3 = buildPackages.python311; # so that we don't have two of them
|
||||
# Need to use apple's patched xattr until
|
||||
@@ -195,14 +206,14 @@ in {
|
||||
# Use 8.10 as a workaround where possible to keep bootstrap path short.
|
||||
|
||||
# On ARM text won't build with GHC 8.10.*
|
||||
if stdenv.hostPlatform.isAarch then
|
||||
if stdenv.buildPlatform.isAarch then
|
||||
# TODO(@sternenseemann): package bindist
|
||||
packages.ghc902
|
||||
bb.packages.ghc902
|
||||
# No suitable bindists for powerpc64le
|
||||
else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
|
||||
packages.ghc902
|
||||
else if stdenv.buildPlatform.isPower64 && stdenv.buildPlatform.isLittleEndian then
|
||||
bb.packages.ghc902
|
||||
else
|
||||
packages.ghc8107Binary;
|
||||
bb.packages.ghc8107Binary;
|
||||
inherit (buildPackages.python311Packages) sphinx; # a distutils issue with 3.12
|
||||
python3 = buildPackages.python311; # so that we don't have two of them
|
||||
# Need to use apple's patched xattr until
|
||||
@@ -220,14 +231,14 @@ in {
|
||||
# Use 8.10 as a workaround where possible to keep bootstrap path short.
|
||||
|
||||
# On ARM text won't build with GHC 8.10.*
|
||||
if stdenv.hostPlatform.isAarch then
|
||||
if stdenv.buildPlatform.isAarch then
|
||||
# TODO(@sternenseemann): package bindist
|
||||
packages.ghc902
|
||||
bb.packages.ghc902
|
||||
# No suitable bindists for powerpc64le
|
||||
else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
|
||||
packages.ghc902
|
||||
else if stdenv.buildPlatform.isPower64 && stdenv.buildPlatform.isLittleEndian then
|
||||
bb.packages.ghc902
|
||||
else
|
||||
packages.ghc8107Binary;
|
||||
bb.packages.ghc8107Binary;
|
||||
inherit (buildPackages.python3Packages) sphinx;
|
||||
# Need to use apple's patched xattr until
|
||||
# https://github.com/xattr/xattr/issues/44 and
|
||||
@@ -244,14 +255,14 @@ in {
|
||||
# Use 8.10 as a workaround where possible to keep bootstrap path short.
|
||||
|
||||
# On ARM text won't build with GHC 8.10.*
|
||||
if stdenv.hostPlatform.isAarch then
|
||||
if stdenv.buildPlatform.isAarch then
|
||||
# TODO(@sternenseemann): package bindist
|
||||
packages.ghc902
|
||||
bb.packages.ghc902
|
||||
# No suitable bindists for powerpc64le
|
||||
else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
|
||||
packages.ghc902
|
||||
else if stdenv.buildPlatform.isPower64 && stdenv.buildPlatform.isLittleEndian then
|
||||
bb.packages.ghc902
|
||||
else
|
||||
packages.ghc8107Binary;
|
||||
bb.packages.ghc8107Binary;
|
||||
inherit (buildPackages.python3Packages) sphinx;
|
||||
# Need to use apple's patched xattr until
|
||||
# https://github.com/xattr/xattr/issues/44 and
|
||||
@@ -265,12 +276,12 @@ in {
|
||||
ghc963 = callPackage ../development/compilers/ghc/9.6.3.nix {
|
||||
bootPkgs =
|
||||
# For GHC 9.2 no armv7l bindists are available.
|
||||
if stdenv.hostPlatform.isAarch32 then
|
||||
packages.ghc928
|
||||
else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
|
||||
packages.ghc928
|
||||
if stdenv.buildPlatform.isAarch32 then
|
||||
bb.packages.ghc928
|
||||
else if stdenv.buildPlatform.isPower64 && stdenv.buildPlatform.isLittleEndian then
|
||||
bb.packages.ghc928
|
||||
else
|
||||
packages.ghc924Binary;
|
||||
bb.packages.ghc924Binary;
|
||||
inherit (buildPackages.python3Packages) sphinx;
|
||||
# Need to use apple's patched xattr until
|
||||
# https://github.com/xattr/xattr/issues/44 and
|
||||
@@ -283,12 +294,12 @@ in {
|
||||
ghc964 = callPackage ../development/compilers/ghc/9.6.4.nix {
|
||||
bootPkgs =
|
||||
# For GHC 9.2 no armv7l bindists are available.
|
||||
if stdenv.hostPlatform.isAarch32 then
|
||||
packages.ghc928
|
||||
else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
|
||||
packages.ghc928
|
||||
if stdenv.buildPlatform.isAarch32 then
|
||||
bb.packages.ghc928
|
||||
else if stdenv.buildPlatform.isPower64 && stdenv.buildPlatform.isLittleEndian then
|
||||
bb.packages.ghc928
|
||||
else
|
||||
packages.ghc924Binary;
|
||||
bb.packages.ghc924Binary;
|
||||
inherit (buildPackages.python3Packages) sphinx;
|
||||
# Need to use apple's patched xattr until
|
||||
# https://github.com/xattr/xattr/issues/44 and
|
||||
@@ -301,12 +312,12 @@ in {
|
||||
ghc965 = callPackage ../development/compilers/ghc/9.6.5.nix {
|
||||
bootPkgs =
|
||||
# For GHC 9.2 no armv7l bindists are available.
|
||||
if stdenv.hostPlatform.isAarch32 then
|
||||
packages.ghc928
|
||||
else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
|
||||
packages.ghc928
|
||||
if stdenv.buildPlatform.isAarch32 then
|
||||
bb.packages.ghc928
|
||||
else if stdenv.buildPlatform.isPower64 && stdenv.buildPlatform.isLittleEndian then
|
||||
bb.packages.ghc928
|
||||
else
|
||||
packages.ghc924Binary;
|
||||
bb.packages.ghc924Binary;
|
||||
inherit (buildPackages.python3Packages) sphinx;
|
||||
# Need to use apple's patched xattr until
|
||||
# https://github.com/xattr/xattr/issues/44 and
|
||||
@@ -319,12 +330,12 @@ in {
|
||||
ghc966 = callPackage ../development/compilers/ghc/9.6.6.nix {
|
||||
bootPkgs =
|
||||
# For GHC 9.2 no armv7l bindists are available.
|
||||
if stdenv.hostPlatform.isAarch32 then
|
||||
packages.ghc928
|
||||
else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
|
||||
packages.ghc928
|
||||
if stdenv.buildPlatform.isAarch32 then
|
||||
bb.packages.ghc928
|
||||
else if stdenv.buildPlatform.isPower64 && stdenv.buildPlatform.isLittleEndian then
|
||||
bb.packages.ghc928
|
||||
else
|
||||
packages.ghc924Binary;
|
||||
bb.packages.ghc924Binary;
|
||||
inherit (buildPackages.python3Packages) sphinx;
|
||||
# Need to use apple's patched xattr until
|
||||
# https://github.com/xattr/xattr/issues/44 and
|
||||
@@ -338,12 +349,12 @@ in {
|
||||
ghc981 = callPackage ../development/compilers/ghc/9.8.1.nix {
|
||||
bootPkgs =
|
||||
# For GHC 9.6 no armv7l bindists are available.
|
||||
if stdenv.hostPlatform.isAarch32 then
|
||||
packages.ghc963
|
||||
else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
|
||||
packages.ghc963
|
||||
if stdenv.buildPlatform.isAarch32 then
|
||||
bb.packages.ghc963
|
||||
else if stdenv.buildPlatform.isPower64 && stdenv.buildPlatform.isLittleEndian then
|
||||
bb.packages.ghc963
|
||||
else
|
||||
packages.ghc963Binary;
|
||||
bb.packages.ghc963Binary;
|
||||
inherit (buildPackages.python3Packages) sphinx;
|
||||
# Need to use apple's patched xattr until
|
||||
# https://github.com/xattr/xattr/issues/44 and
|
||||
@@ -356,12 +367,12 @@ in {
|
||||
ghc982 = callPackage ../development/compilers/ghc/9.8.2.nix {
|
||||
bootPkgs =
|
||||
# For GHC 9.6 no armv7l bindists are available.
|
||||
if stdenv.hostPlatform.isAarch32 then
|
||||
packages.ghc963
|
||||
else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
|
||||
packages.ghc963
|
||||
if stdenv.buildPlatform.isAarch32 then
|
||||
bb.packages.ghc963
|
||||
else if stdenv.buildPlatform.isPower64 && stdenv.buildPlatform.isLittleEndian then
|
||||
bb.packages.ghc963
|
||||
else
|
||||
packages.ghc963Binary;
|
||||
bb.packages.ghc963Binary;
|
||||
inherit (buildPackages.python3Packages) sphinx;
|
||||
# Need to use apple's patched xattr until
|
||||
# https://github.com/xattr/xattr/issues/44 and
|
||||
@@ -375,19 +386,19 @@ in {
|
||||
ghc9101 = callPackage ../development/compilers/ghc/9.10.1.nix {
|
||||
bootPkgs =
|
||||
# For GHC 9.6 no armv7l bindists are available.
|
||||
if stdenv.hostPlatform.isAarch32 then
|
||||
packages.ghc963
|
||||
else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
|
||||
packages.ghc963
|
||||
else if stdenv.hostPlatform.isDarwin then
|
||||
if stdenv.buildPlatform.isAarch32 then
|
||||
bb.packages.ghc963
|
||||
else if stdenv.buildPlatform.isPower64 && stdenv.buildPlatform.isLittleEndian then
|
||||
bb.packages.ghc963
|
||||
else if stdenv.buildPlatform.isDarwin then
|
||||
# it seems like the GHC 9.6.* bindists are built with a different
|
||||
# toolchain than we are using (which I'm guessing from the fact
|
||||
# that 9.6.4 bindists pass linker flags our ld doesn't support).
|
||||
# With both 9.6.3 and 9.6.4 binary it is impossible to link against
|
||||
# the clock package (probably a hsc2hs problem).
|
||||
packages.ghc963
|
||||
bb.packages.ghc963
|
||||
else
|
||||
packages.ghc963Binary;
|
||||
bb.packages.ghc963Binary;
|
||||
inherit (buildPackages.python3Packages) sphinx;
|
||||
# Need to use apple's patched xattr until
|
||||
# https://github.com/xattr/xattr/issues/44 and
|
||||
@@ -401,12 +412,12 @@ in {
|
||||
ghcHEAD = callPackage ../development/compilers/ghc/head.nix {
|
||||
bootPkgs =
|
||||
# For GHC 9.6 no armv7l bindists are available.
|
||||
if stdenv.hostPlatform.isAarch32 then
|
||||
packages.ghc963
|
||||
else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
|
||||
packages.ghc963
|
||||
if stdenv.buildPlatform.isAarch32 then
|
||||
bb.packages.ghc963
|
||||
else if stdenv.buildPlatform.isPower64 && stdenv.buildPlatform.isLittleEndian then
|
||||
bb.packages.ghc963
|
||||
else
|
||||
packages.ghc963Binary;
|
||||
bb.packages.ghc963Binary;
|
||||
inherit (buildPackages.python3Packages) sphinx;
|
||||
# Need to use apple's patched xattr until
|
||||
# https://github.com/xattr/xattr/issues/44 and
|
||||
@@ -419,7 +430,7 @@ in {
|
||||
|
||||
ghcjs = compiler.ghcjs810;
|
||||
ghcjs810 = callPackage ../development/compilers/ghcjs/8.10 {
|
||||
bootPkgs = packages.ghc810;
|
||||
bootPkgs = bb.packages.ghc810;
|
||||
ghcjsSrcJson = ../development/compilers/ghcjs/8.10/git.json;
|
||||
stage0 = ../development/compilers/ghcjs/8.10/stage0.nix;
|
||||
};
|
||||
|
||||
@@ -327,7 +327,6 @@ let
|
||||
lambdabot
|
||||
lhs2tex
|
||||
madlang
|
||||
mailctl
|
||||
matterhorn
|
||||
mkjson
|
||||
mueval
|
||||
@@ -394,19 +393,7 @@ let
|
||||
};
|
||||
|
||||
# GHCs linked to musl.
|
||||
pkgsMusl.haskell.compiler = lib.recursiveUpdate
|
||||
(packagePlatforms pkgs.pkgsMusl.haskell.compiler)
|
||||
{
|
||||
# remove musl ghc865Binary since it is known to be broken and
|
||||
# causes an evaluation error on darwin.
|
||||
ghc865Binary = {};
|
||||
|
||||
ghcjs = {};
|
||||
ghcjs810 = {};
|
||||
};
|
||||
|
||||
# Get some cache going for MUSL-enabled GHC.
|
||||
pkgsMusl.haskellPackages =
|
||||
pkgsMusl =
|
||||
removePlatforms
|
||||
[
|
||||
# pkgsMusl is compiled natively with musl. It is not
|
||||
@@ -420,11 +407,26 @@ let
|
||||
"aarch64-darwin"
|
||||
]
|
||||
{
|
||||
inherit (packagePlatforms pkgs.pkgsMusl.haskellPackages)
|
||||
hello
|
||||
lens
|
||||
random
|
||||
;
|
||||
haskell.compiler = lib.recursiveUpdate
|
||||
(packagePlatforms pkgs.pkgsMusl.haskell.compiler)
|
||||
{
|
||||
# remove musl ghc865Binary since it is known to be broken and
|
||||
# causes an evaluation error on darwin.
|
||||
ghc865Binary = {};
|
||||
|
||||
ghcjs = {};
|
||||
ghcjs810 = {};
|
||||
};
|
||||
|
||||
# Get some cache going for MUSL-enabled GHC.
|
||||
haskellPackages =
|
||||
{
|
||||
inherit (packagePlatforms pkgs.pkgsMusl.haskellPackages)
|
||||
hello
|
||||
lens
|
||||
random
|
||||
;
|
||||
};
|
||||
};
|
||||
|
||||
# Test some statically linked packages to catch regressions
|
||||
@@ -473,37 +475,65 @@ let
|
||||
};
|
||||
};
|
||||
|
||||
pkgsCross.ghcjs =
|
||||
removePlatforms
|
||||
[
|
||||
# Hydra output size of 3GB is exceeded
|
||||
"aarch64-linux"
|
||||
]
|
||||
{
|
||||
haskellPackages = {
|
||||
inherit (packagePlatforms pkgs.pkgsCross.ghcjs.haskellPackages)
|
||||
ghc
|
||||
hello
|
||||
microlens
|
||||
;
|
||||
pkgsCross = {
|
||||
ghcjs =
|
||||
removePlatforms
|
||||
[
|
||||
# Hydra output size of 3GB is exceeded
|
||||
"aarch64-linux"
|
||||
]
|
||||
{
|
||||
haskellPackages = {
|
||||
inherit (packagePlatforms pkgs.pkgsCross.ghcjs.haskellPackages)
|
||||
ghc
|
||||
hello
|
||||
microlens
|
||||
;
|
||||
};
|
||||
|
||||
haskell.packages.ghc98 = {
|
||||
inherit (packagePlatforms pkgs.pkgsCross.ghcjs.haskell.packages.ghc98)
|
||||
ghc
|
||||
hello
|
||||
microlens
|
||||
;
|
||||
};
|
||||
|
||||
haskell.packages.ghcHEAD = {
|
||||
inherit (packagePlatforms pkgs.pkgsCross.ghcjs.haskell.packages.ghcHEAD)
|
||||
ghc
|
||||
hello
|
||||
microlens
|
||||
;
|
||||
};
|
||||
};
|
||||
|
||||
haskell.packages.ghc98 = {
|
||||
inherit (packagePlatforms pkgs.pkgsCross.ghcjs.haskell.packages.ghc98)
|
||||
ghc
|
||||
hello
|
||||
microlens
|
||||
riscv64 = {
|
||||
# Cross compilation of GHC
|
||||
haskell.compiler = {
|
||||
inherit (packagePlatforms pkgs.pkgsCross.riscv64.haskell.compiler)
|
||||
# Our oldest GHC which still uses its own expression. 8.10.7 can
|
||||
# theoretically be used to chain bootstrap all GHCs on riscv64
|
||||
# which doesn't have official bindists.
|
||||
ghc8107
|
||||
# Latest GHC we are able to cross-compile.
|
||||
ghc948
|
||||
;
|
||||
};
|
||||
|
||||
haskell.packages.ghcHEAD = {
|
||||
inherit (packagePlatforms pkgs.pkgsCross.ghcjs.haskell.packages.ghcHEAD)
|
||||
ghc
|
||||
hello
|
||||
microlens
|
||||
;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
aarch64-multiplatform = {
|
||||
# Cross compilation of GHC
|
||||
haskell.compiler = {
|
||||
inherit (packagePlatforms pkgs.pkgsCross.aarch64-multiplatform.haskell.compiler)
|
||||
# Uses a separate expression and LLVM backend for aarch64.
|
||||
ghc8107
|
||||
# Latest GHC we are able to cross-compile. Uses NCG backend.
|
||||
ghc948
|
||||
;
|
||||
};
|
||||
};
|
||||
};
|
||||
})
|
||||
(versionedCompilerJobs {
|
||||
# Packages which should be checked on more than the
|
||||
@@ -545,11 +575,8 @@ let
|
||||
compilerNames.ghc8107
|
||||
# Support ceased as of 2.5.0.0
|
||||
compilerNames.ghc902
|
||||
# No support yet (2024-05-12)
|
||||
compilerNames.ghc9101
|
||||
] released;
|
||||
hoogle = lib.subtractLists [
|
||||
compilerNames.ghc9101
|
||||
] released;
|
||||
hlint = lib.subtractLists [
|
||||
compilerNames.ghc902
|
||||
|
||||
Reference in New Issue
Block a user