haskell.compiler.ghc8107{,Binary}: drop

Also, rearrange the GHC‐related release notes to be in order of
most likely to matter to anyone.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
This commit is contained in:
Emily
2025-09-07 01:12:16 +01:00
parent 08129b69e5
commit c024327605
12 changed files with 10 additions and 2047 deletions

View File

@@ -26,7 +26,7 @@
- GHCJS 8.10, exposed via `haskell.compiler.ghcjs` and `haskell.compiler.ghcjs810`, has been removed. Downstream users should migrate their projects to the new JavaScript backend of GHC proper which can be used via `pkgsCross.ghcjs` from Nixpkgs. Haskell packaging code, like `haskellPackages.mkDerivation`, `ghcWithPackages` and `hoogleWithPackages`, also no longer supports GHCJS. - GHCJS 8.10, exposed via `haskell.compiler.ghcjs` and `haskell.compiler.ghcjs810`, has been removed. Downstream users should migrate their projects to the new JavaScript backend of GHC proper which can be used via `pkgsCross.ghcjs` from Nixpkgs. Haskell packaging code, like `haskellPackages.mkDerivation`, `ghcWithPackages` and `hoogleWithPackages`, also no longer supports GHCJS.
- GHC 8.6, 9.0, and their package sets have been removed. - GHC 8.6, 8.10, 9.0, and their package sets have been removed.
- Support for bootstrapping native GHC compilers on 32bit ARM and littleendian 64bit PowerPC has been dropped. - Support for bootstrapping native GHC compilers on 32bit ARM and littleendian 64bit PowerPC has been dropped.
The latter was probably broken anyway. The latter was probably broken anyway.

View File

@@ -6,7 +6,7 @@
and builds all derivations (or at least a reasonable subset) affected by and builds all derivations (or at least a reasonable subset) affected by
these overrides. these overrides.
By default, it checks `configuration-{common,nix,ghc-8.10.x}.nix`. You can By default, it checks `configuration-{common,nix,ghc-9.8.x}.nix`. You can
invoke it like this: invoke it like this:
nix-build maintainers/scripts/haskell/test-configurations.nix --keep-going nix-build maintainers/scripts/haskell/test-configurations.nix --keep-going
@@ -50,7 +50,7 @@
files ? [ files ? [
"configuration-common.nix" "configuration-common.nix"
"configuration-nix.nix" "configuration-nix.nix"
"configuration-ghc-8.10.x.nix" "configuration-ghc-9.8.x.nix"
], ],
nixpkgsPath ? ../../.., nixpkgsPath ? ../../..,
config ? { config ? {

View File

@@ -74,7 +74,7 @@ in
haskellPackages = mkOption { haskellPackages = mkOption {
default = pkgs.haskellPackages; default = pkgs.haskellPackages;
defaultText = literalExpression "pkgs.haskellPackages"; defaultText = literalExpression "pkgs.haskellPackages";
example = literalExpression "pkgs.haskell.packages.ghc810"; example = literalExpression "pkgs.haskell.packages.ghc910";
type = types.attrs; type = types.attrs;
description = '' description = ''
haskellPackages used to build Xmonad and other packages. haskellPackages used to build Xmonad and other packages.

View File

@@ -1,546 +0,0 @@
{
lib,
stdenv,
fetchurl,
perl,
gcc,
ncurses5,
ncurses6,
gmp,
libiconv,
numactl,
llvmPackages,
coreutils,
rcodesign,
targetPackages,
# minimal = true; will remove files that aren't strictly necessary for
# regular builds and GHC bootstrapping.
# This is "useful" for staying within hydra's output limits for at least the
# aarch64-linux architecture.
minimal ? false,
}:
# Prebuilt only does native
assert stdenv.targetPlatform == stdenv.hostPlatform;
let
downloadsUrl = "https://downloads.haskell.org/ghc";
# Copy sha256 from https://downloads.haskell.org/~ghc/8.10.7/SHA256SUMS
version = "8.10.7";
# Information about available bindists that we use in the build.
#
# # Bindist library checking
#
# The field `archSpecificLibraries` also provides a way for us get notified
# early when the upstream bindist changes its dependencies (e.g. because a
# newer Debian version is used that uses a new `ncurses` version).
#
# Usage:
#
# * You can find the `fileToCheckFor` of libraries by running `readelf -d`
# on the compiler binary (`exePathForLibraryCheck`).
# * To skip library checking for an architecture,
# set `exePathForLibraryCheck = null`.
# * To skip file checking for a specific arch specific library,
# set `fileToCheckFor = null`.
ghcBinDists = {
# Binary distributions for the default libc (e.g. glibc, or libSystem on Darwin)
# nixpkgs uses for the respective system.
defaultLibc = {
i686-linux = {
variantSuffix = "";
src = {
url = "${downloadsUrl}/${version}/ghc-${version}-i386-deb9-linux.tar.xz";
sha256 = "fbfc1ef194f4e7a4c0da8c11cc69b17458a4b928b609b3622c97acc4acd5c5ab";
};
exePathForLibraryCheck = "ghc/stage2/build/tmp/ghc-stage2";
archSpecificLibraries = [
{
nixPackage = gmp;
fileToCheckFor = null;
}
# The i686-linux bindist provided by GHC HQ is currently built on Debian 9,
# which link it against `libtinfo.so.5` (ncurses 5).
# Other bindists are linked `libtinfo.so.6` (ncurses 6).
{
nixPackage = ncurses5;
fileToCheckFor = "libtinfo.so.5";
}
];
};
x86_64-linux = {
variantSuffix = "";
src = {
url = "${downloadsUrl}/${version}/ghc-${version}-x86_64-deb10-linux.tar.xz";
sha256 = "a13719bca87a0d3ac0c7d4157a4e60887009a7f1a8dbe95c4759ec413e086d30";
};
exePathForLibraryCheck = "ghc/stage2/build/tmp/ghc-stage2";
archSpecificLibraries = [
{
nixPackage = gmp;
fileToCheckFor = null;
}
{
nixPackage = ncurses6;
fileToCheckFor = "libtinfo.so.6";
}
];
};
armv7l-linux = {
variantSuffix = "";
src = {
url = "${downloadsUrl}/${version}/ghc-${version}-armv7-deb10-linux.tar.xz";
sha256 = "3949c31bdf7d3b4afb765ea8246bca4ca9707c5d988d9961a244f0da100956a2";
};
exePathForLibraryCheck = "ghc/stage2/build/tmp/ghc-stage2";
archSpecificLibraries = [
{
nixPackage = gmp;
fileToCheckFor = null;
}
{
nixPackage = ncurses6;
fileToCheckFor = "libtinfo.so.6";
}
];
};
aarch64-linux = {
variantSuffix = "";
src = {
url = "${downloadsUrl}/${version}/ghc-${version}-aarch64-deb10-linux.tar.xz";
sha256 = "fad2417f9b295233bf8ade79c0e6140896359e87be46cb61cd1d35863d9d0e55";
};
exePathForLibraryCheck = "ghc/stage2/build/tmp/ghc-stage2";
archSpecificLibraries = [
{
nixPackage = gmp;
fileToCheckFor = null;
}
{
nixPackage = ncurses6;
fileToCheckFor = "libtinfo.so.6";
}
{
nixPackage = numactl;
fileToCheckFor = null;
}
];
};
x86_64-darwin = {
variantSuffix = "";
src = {
url = "${downloadsUrl}/${version}/ghc-${version}-x86_64-apple-darwin.tar.xz";
sha256 = "287db0f9c338c9f53123bfa8731b0996803ee50f6ee847fe388092e5e5132047";
};
exePathForLibraryCheck = null; # we don't have a library check for darwin yet
archSpecificLibraries = [
{
nixPackage = gmp;
fileToCheckFor = null;
}
{
nixPackage = ncurses6;
fileToCheckFor = null;
}
{
nixPackage = libiconv;
fileToCheckFor = null;
}
];
};
aarch64-darwin = {
variantSuffix = "";
src = {
url = "${downloadsUrl}/${version}/ghc-${version}-aarch64-apple-darwin.tar.xz";
sha256 = "dc469fc3c35fd2a33a5a575ffce87f13de7b98c2d349a41002e200a56d9bba1c";
};
exePathForLibraryCheck = null; # we don't have a library check for darwin yet
archSpecificLibraries = [
{
nixPackage = gmp;
fileToCheckFor = null;
}
{
nixPackage = ncurses6;
fileToCheckFor = null;
}
{
nixPackage = libiconv;
fileToCheckFor = null;
}
];
};
};
# Binary distributions for the musl libc for the respective system.
musl = {
x86_64-linux = {
variantSuffix = "-musl-integer-simple";
src = {
url = "${downloadsUrl}/${version}/ghc-${version}-x86_64-alpine3.10-linux-integer-simple.tar.xz";
sha256 = "16903df850ef73d5246f2ff169cbf57ecab76c2ac5acfa9928934282cfad575c";
};
exePathForLibraryCheck = "bin/ghc";
archSpecificLibraries = [
# No `gmp` here, since this is an `integer-simple` bindist.
# In contrast to glibc builds, the musl-bindist uses `libncursesw.so.*`
# instead of `libtinfo.so.*.`
{
nixPackage = ncurses6;
fileToCheckFor = "libncursesw.so.6";
}
];
isHadrian = true;
};
};
};
distSetName = if stdenv.hostPlatform.isMusl then "musl" else "defaultLibc";
binDistUsed =
ghcBinDists.${distSetName}.${stdenv.hostPlatform.system}
or (throw "cannot bootstrap GHC on this platform ('${stdenv.hostPlatform.system}' with libc '${distSetName}')");
useLLVM = !(import ./common-have-ncg.nix { inherit lib stdenv version; });
libPath = lib.makeLibraryPath (
# Add arch-specific libraries.
map ({ nixPackage, ... }: nixPackage) binDistUsed.archSpecificLibraries
);
libEnvVar = lib.optionalString stdenv.hostPlatform.isDarwin "DY" + "LD_LIBRARY_PATH";
runtimeDeps = [
targetPackages.stdenv.cc
targetPackages.stdenv.cc.bintools
coreutils # for cat
]
++ lib.optionals useLLVM [
(lib.getBin llvmPackages.llvm)
]
# On darwin, we need unwrapped bintools as well (for otool)
++ lib.optionals (stdenv.targetPlatform.linker == "cctools") [
targetPackages.stdenv.cc.bintools.bintools
];
in
stdenv.mkDerivation {
inherit version;
pname = "ghc-binary${binDistUsed.variantSuffix}";
src = fetchurl binDistUsed.src;
# Note that for GHC 8.10 versions >= 8.10.6, the GHC HQ musl bindist
# uses `integer-simple` and has no `gmp` dependency:
# https://gitlab.haskell.org/ghc/ghc/-/commit/8306501020cd66f683ad9c215fa8e16c2d62357d
# Related nixpkgs issues:
# * https://github.com/NixOS/nixpkgs/pull/130441#issuecomment-922452843
# TODO: When this file is copied to `ghc-9.*-binary.nix`, determine whether
# the GHC 9 branch also switched from `gmp` to `integer-simple` via the
# currently-open issue:
# https://gitlab.haskell.org/ghc/ghc/-/issues/20059
# and update this comment accordingly.
nativeBuildInputs = [
perl
]
# Upstream binaries may not be linker-signed, which invalidates their signatures
# because `install_name_tool` will only replace a signature if it is both
# an ad hoc signature and the signature is flagged as linker-signed.
#
# rcodesign is used to replace the signature instead of sigtool because it
# supports setting the linker-signed flag, which will ensure future processing
# of the binaries does not invalidate their signatures.
++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ rcodesign ];
# Set LD_LIBRARY_PATH or equivalent so that the programs running as part
# of the bindist installer can find the libraries they expect.
# Cannot patchelf beforehand due to relative RPATHs that anticipate
# the final install location.
${libEnvVar} = libPath;
postUnpack =
# Verify our assumptions of which `libtinfo.so` (ncurses) version is used,
# so that we know when ghc bindists upgrade that and we need to update the
# version used in `libPath`.
lib.optionalString (binDistUsed.exePathForLibraryCheck != null)
# Note the `*` glob because some GHCs have a suffix when unpacked, e.g.
# the musl bindist has dir `ghc-VERSION-x86_64-unknown-linux/`.
# As a result, don't shell-quote this glob when splicing the string.
(
let
buildExeGlob = ''ghc-${version}*/"${binDistUsed.exePathForLibraryCheck}"'';
in
lib.concatStringsSep "\n" [
(''
shopt -u nullglob
echo "Checking that ghc binary exists in bindist at ${buildExeGlob}"
if ! test -e ${buildExeGlob}; then
echo >&2 "GHC binary ${binDistUsed.exePathForLibraryCheck} could not be found in the bindist build directory (at ${buildExeGlob}) for arch ${stdenv.hostPlatform.system}, please check that ghcBinDists correctly reflect the bindist dependencies!"; exit 1;
fi
'')
(lib.concatMapStringsSep "\n" (
{ fileToCheckFor, nixPackage }:
lib.optionalString (fileToCheckFor != null) ''
echo "Checking bindist for ${fileToCheckFor} to ensure that is still used"
if ! readelf -d ${buildExeGlob} | grep "${fileToCheckFor}"; then
echo >&2 "File ${fileToCheckFor} could not be found in ${binDistUsed.exePathForLibraryCheck} for arch ${stdenv.hostPlatform.system}, please check that ghcBinDists correctly reflect the bindist dependencies!"; exit 1;
fi
echo "Checking that the nix package ${nixPackage} contains ${fileToCheckFor}"
if ! test -e "${lib.getLib nixPackage}/lib/${fileToCheckFor}"; then
echo >&2 "Nix package ${nixPackage} did not contain ${fileToCheckFor} for arch ${stdenv.hostPlatform.system}, please check that ghcBinDists correctly reflect the bindist dependencies!"; exit 1;
fi
''
) binDistUsed.archSpecificLibraries)
]
)
# GHC has dtrace probes, which causes ld to try to open /usr/lib/libdtrace.dylib
# during linking
+ lib.optionalString stdenv.hostPlatform.isDarwin (
''
export NIX_LDFLAGS+=" -no_dtrace_dof"
# not enough room in the object files for the full path to libiconv :(
for exe in $(find . -type f -executable); do
isScript $exe && continue
ln -fs ${libiconv}/lib/libiconv.dylib $(dirname $exe)/libiconv.dylib
install_name_tool -change /usr/lib/libiconv.2.dylib @executable_path/libiconv.dylib $exe
''
+ lib.optionalString stdenv.hostPlatform.isAarch64 ''
# Resign the binary and set the linker-signed flag. Ignore failures when the file is an object file.
# Object files dont have signatures, so ignoring the failures is harmless.
rcodesign sign --code-signature-flags linker-signed $exe || true
''
+ ''
done
''
)
+
# Some scripts used during the build need to have their shebangs patched
''
patchShebangs ghc-${version}/utils/
patchShebangs ghc-${version}/configure
test -d ghc-${version}/inplace/bin && \
patchShebangs ghc-${version}/inplace/bin
''
+
# We have to patch the GMP paths for the integer-gmp package.
# Note that musl bindists do not contain them,
# see: https://gitlab.haskell.org/ghc/ghc/-/issues/20073#note_363231
# However, musl bindists >= 8.10.6 use `integer-simple`, not `gmp`.
''
find . -name integer-gmp.buildinfo \
-exec sed -i "s@extra-lib-dirs: @extra-lib-dirs: ${gmp.out}/lib@" {} \;
''
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
find . -name base.buildinfo \
-exec sed -i "s@extra-lib-dirs: @extra-lib-dirs: ${libiconv}/lib@" {} \;
''
+
# Some platforms do HAVE_NUMA so -lnuma requires it in library-dirs in rts/package.conf.in
# FFI_LIB_DIR is a good indication of places it must be needed.
lib.optionalString
(
lib.meta.availableOn stdenv.hostPlatform numactl
&& builtins.any ({ nixPackage, ... }: nixPackage == numactl) binDistUsed.archSpecificLibraries
)
''
find . -name package.conf.in \
-exec sed -i "s@FFI_LIB_DIR@FFI_LIB_DIR ${numactl.out}/lib@g" {} \;
''
+
# Rename needed libraries and binaries, fix interpreter
lib.optionalString stdenv.hostPlatform.isLinux ''
find . -type f -executable -exec patchelf \
--interpreter ${stdenv.cc.bintools.dynamicLinker} {} \;
''
+
# The hadrian install Makefile uses 'xxx' as a temporary placeholder in path
# substitution. Which can break the build if the store path / prefix happens
# to contain this string. This will be fixed with 9.4 bindists.
# https://gitlab.haskell.org/ghc/ghc/-/issues/21402
''
# Detect hadrian Makefile by checking for the target that has the problem
if grep '^update_package_db' ghc-${version}*/Makefile > /dev/null; then
echo Hadrian bindist, applying workaround for xxx path substitution.
# based on https://gitlab.haskell.org/ghc/ghc/-/commit/dd5fecb0e2990b192d92f4dfd7519ecb33164fad.patch
substituteInPlace ghc-${version}*/Makefile --replace 'xxx' '\0xxx\0'
else
echo Not a hadrian bindist, not applying xxx path workaround.
fi
'';
# fix for `configure: error: Your linker is affected by binutils #16177`
preConfigure = lib.optionalString stdenv.targetPlatform.isAarch32 "LD=ld.gold";
configurePlatforms = [ ];
configureFlags = [
"--with-gmp-includes=${lib.getDev gmp}/include"
# Note `--with-gmp-libraries` does nothing for GHC bindists:
# https://gitlab.haskell.org/ghc/ghc/-/merge_requests/6124
]
++ lib.optional stdenv.hostPlatform.isDarwin "--with-gcc=${./gcc-clang-wrapper.sh}"
# From: https://github.com/NixOS/nixpkgs/pull/43369/commits
++ lib.optional stdenv.hostPlatform.isMusl "--disable-ld-override";
# No building is necessary, but calling make without flags ironically
# calls install-strip ...
dontBuild = true;
# GHC tries to remove xattrs when installing to work around Gatekeeper
# (see https://gitlab.haskell.org/ghc/ghc/-/issues/17418). This step normally
# succeeds in nixpkgs because xattrs are not allowed in the store, but it
# can fail when a file has the `com.apple.provenance` xattr, and it cant be
# modified (such as target of the symlink to `libiconv.dylib`).
# The `com.apple.provenance` xattr is a new feature of macOS as of macOS 13.
# See: https://eclecticlight.co/2023/03/13/ventura-has-changed-app-quarantine-with-a-new-xattr/
makeFlags = lib.optionals stdenv.buildPlatform.isDarwin [ "XATTR=/does-not-exist" ];
# Patch scripts to include runtime dependencies in $PATH.
postInstall = ''
for i in "$out/bin/"*; do
test ! -h "$i" || continue
isScript "$i" || continue
sed -i -e '2i export PATH="${lib.makeBinPath runtimeDeps}:$PATH"' "$i"
done
'';
# Apparently necessary for the ghc Alpine (musl) bindist:
# When we strip, and then run the
# patchelf --set-rpath "${libPath}:$(patchelf --print-rpath $p)" $p
# below, running ghc (e.g. during `installCheckPhase)` gives some apparently
# corrupted rpath or whatever makes the loader work on nonsensical strings:
# running install tests
# Error relocating /nix/store/...-ghc-8.10.2-binary/lib/ghc-8.10.5/bin/ghc: : symbol not found
# Error relocating /nix/store/...-ghc-8.10.2-binary/lib/ghc-8.10.5/bin/ghc: ir6zf6c9f86pfx8sr30n2vjy-ghc-8.10.2-binary/lib/ghc-8.10.5/bin/../lib/x86_64-linux-ghc-8.10.5/libHSexceptions-0.10.4-ghc8.10.5.so: symbol not found
# Error relocating /nix/store/...-ghc-8.10.2-binary/lib/ghc-8.10.5/bin/ghc: y/lib/ghc-8.10.5/bin/../lib/x86_64-linux-ghc-8.10.5/libHStemplate-haskell-2.16.0.0-ghc8.10.5.so: symbol not found
# Error relocating /nix/store/...-ghc-8.10.2-binary/lib/ghc-8.10.5/bin/ghc: 8.10.5/libHStemplate-haskell-2.16.0.0-ghc8.10.5.so: symbol not found
# Error relocating /nix/store/...-ghc-8.10.2-binary/lib/ghc-8.10.5/bin/ghc: <20>: symbol not found
# Error relocating /nix/store/...-ghc-8.10.2-binary/lib/ghc-8.10.5/bin/ghc: <20>?: symbol not found
# Error relocating /nix/store/...-ghc-8.10.2-binary/lib/ghc-8.10.5/bin/ghc: 64-linux-ghc-8.10.5/libHSexceptions-0.10.4-ghc8.10.5.so: symbol not found
# This is extremely bogus and should be investigated.
dontStrip = if stdenv.hostPlatform.isMusl then true else false; # `if` for explicitness
# On Linux, use patchelf to modify the executables so that they can
# find editline/gmp.
postFixup =
lib.optionalString stdenv.hostPlatform.isLinux (
if stdenv.hostPlatform.isAarch64 then
# Keep rpath as small as possible on aarch64 for patchelf#244. All Elfs
# are 2 directories deep from $out/lib, so pooling symlinks there makes
# a short rpath.
''
(cd $out/lib; ln -s ${ncurses6.out}/lib/libtinfo.so.6)
(cd $out/lib; ln -s ${gmp.out}/lib/libgmp.so.10)
(cd $out/lib; ln -s ${numactl.out}/lib/libnuma.so.1)
for p in $(find "$out/lib" -type f -name "*\.so*"); do
(cd $out/lib; ln -s $p)
done
for p in $(find "$out/lib" -type f -executable); do
if isELF "$p"; then
echo "Patchelfing $p"
patchelf --set-rpath "\$ORIGIN:\$ORIGIN/../.." $p
fi
done
''
else
''
for p in $(find "$out" -type f -executable); do
if isELF "$p"; then
echo "Patchelfing $p"
patchelf --set-rpath "${libPath}:$(patchelf --print-rpath $p)" $p
fi
done
''
)
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
# not enough room in the object files for the full path to libiconv :(
for exe in $(find "$out" -type f -executable); do
isScript $exe && continue
ln -fs ${libiconv}/lib/libiconv.dylib $(dirname $exe)/libiconv.dylib
install_name_tool -change /usr/lib/libiconv.2.dylib @executable_path/libiconv.dylib $exe
done
for file in $(find "$out" -name setup-config); do
substituteInPlace $file --replace /usr/bin/ranlib "$(type -P ranlib)"
done
''
+ lib.optionalString minimal ''
# Remove profiling files
find $out -type f -name '*.p_o' -delete
find $out -type f -name '*.p_hi' -delete
find $out -type f -name '*_p.a' -delete
# `-f` because e.g. musl bindist does not have this file.
rm -f $out/lib/ghc-*/bin/ghc-iserv-prof
# Hydra will redistribute this derivation, so we have to keep the docs for
# legal reasons (retaining the legal notices etc)
# As a last resort we could unpack the docs separately and symlink them in.
# They're in $out/share/{doc,man}.
'';
# GHC cannot currently produce outputs that are ready for `-pie` linking.
# Thus, disable `pie` hardening, otherwise `recompile with -fPIE` errors appear.
# See:
# * https://github.com/NixOS/nixpkgs/issues/129247
# * https://gitlab.haskell.org/ghc/ghc/-/issues/19580
hardeningDisable = [ "pie" ];
doInstallCheck = true;
installCheckPhase = ''
# Sanity check, can ghc create executables?
cd $TMP
mkdir test-ghc; cd test-ghc
cat > main.hs << EOF
{-# LANGUAGE TemplateHaskell #-}
module Main where
main = putStrLn \$([|"yes"|])
EOF
env -i $out/bin/ghc --make main.hs || exit 1
echo compilation ok
[ $(./main) == "yes" ]
'';
passthru = {
targetPrefix = "";
enableShared = true;
inherit llvmPackages;
# Our Cabal compiler name
haskellCompilerName = "ghc-${version}";
}
# We duplicate binDistUsed here since we have a sensible default even if no bindist is available,
# this makes sure that getting the `meta` attribute doesn't throw even on unsupported platforms.
// lib.optionalAttrs (ghcBinDists.${distSetName}.${stdenv.hostPlatform.system}.isHadrian or false) {
# Normal GHC derivations expose the hadrian derivation used to build them
# here. In the case of bindists we just make sure that the attribute exists,
# as it is used for checking if a GHC derivation has been built with hadrian.
# The isHadrian mechanism will become obsolete with GHCs that use hadrian
# exclusively, i.e. 9.6 (and 9.4?).
hadrian = null;
};
meta = rec {
homepage = "http://haskell.org/ghc";
description = "Glasgow Haskell Compiler";
license = lib.licenses.bsd3;
# HACK: since we can't encode the libc / abi in platforms, we need
# to make the platform list dependent on the evaluation platform
# in order to avoid eval errors with musl which supports less
# platforms than the default libcs (i. e. glibc / libSystem).
# This is done for the benefit of Hydra, so `packagePlatforms`
# won't return any platforms that would cause an evaluation
# failure for `pkgsMusl.haskell.compiler.ghc8107Binary`, as
# long as the evaluator runs on a platform that supports
# `pkgsMusl`.
platforms = builtins.attrNames ghcBinDists.${distSetName};
maintainers = with lib.maintainers; [ ];
teams = [ lib.teams.haskell ];
};
}

View File

@@ -1,681 +0,0 @@
let
version = "8.10.7";
in
{
lib,
stdenv,
pkgsBuildTarget,
pkgsHostTarget,
buildPackages,
targetPackages,
# build-tools
bootPkgs,
autoreconfHook,
autoconf,
automake,
coreutils,
fetchpatch,
fetchurl,
perl,
python3,
m4,
sphinx,
xattr,
autoSignDarwinBinariesHook,
bash,
libiconv ? null,
ncurses,
# GHC can be built with system libffi or a bundled one.
# we explicitly use libffi-3.3 here because 3.4 removes a flag that causes
# problems for ghc-8.10.7's RTS. See #324384.
# Save for aarch_darwin since libffi-3.3 is broken there but the issue isn't present anyway
libffi ? null,
libffi_3_3 ? null,
useLLVM ? !(import ./common-have-ncg.nix { inherit lib stdenv version; }),
# LLVM is conceptually a run-time-only dependency, but for
# non-x86, we need LLVM to bootstrap later stages, so it becomes a
# build-time dependency too.
buildTargetLlvmPackages,
llvmPackages,
# If enabled, GHC will be built with the GPL-free but slower integer-simple
# library instead of the faster but GPLed integer-gmp library.
enableIntegerSimple ?
!(lib.meta.availableOn stdenv.hostPlatform gmp && lib.meta.availableOn stdenv.targetPlatform gmp),
gmp,
# If enabled, use -fPIC when compiling static libs.
enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform,
# 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
# terminfo can't be built for cross
|| (stdenv.buildPlatform != stdenv.hostPlatform)
|| (stdenv.hostPlatform != stdenv.targetPlatform)
),
# Enable NUMA support in RTS
enableNuma ? lib.meta.availableOn stdenv.targetPlatform numactl,
numactl,
# What flavour to build. An empty string indicates no
# specific flavour and falls back to ghc default values.
ghcFlavour ? lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform) (
if useLLVM then "perf-cross" else "perf-cross-ncg"
),
# Whether to build sphinx documentation.
enableDocs ? (
# Docs disabled if we are building on musl because it's a large task to keep
# all `sphinx` dependencies building in this environment.
!stdenv.buildPlatform.isMusl
),
enableHaddockProgram ?
# Disabled for cross; see note [HADDOCK_DOCS].
(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.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;
# TODO(@Ericson2314) Make unconditional
targetPrefix = lib.optionalString (targetPlatform != hostPlatform) "${targetPlatform.config}-";
buildMK = ''
BuildFlavour = ${ghcFlavour}
ifneq \"\$(BuildFlavour)\" \"\"
include mk/flavours/\$(BuildFlavour).mk
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`
# program is built (which we generally always want to have a complete GHC install)
# and whether it is run on the GHC sources to generate hyperlinked source code
# (which is impossible for cross-compilation); see:
# https://gitlab.haskell.org/ghc/ghc/-/issues/20077
# This implies that currently a cross-compiled GHC will never have a `haddock`
# program, so it can never generate haddocks for any packages.
# If this is solved in the future, we'd like to unconditionally
# build the haddock program (removing the `enableHaddockProgram` option).
''
HADDOCK_DOCS = ${if enableHaddockProgram then "YES" else "NO"}
# Build haddocks for boot packages with hyperlinking
EXTRA_HADDOCK_OPTS += --hyperlinked-source --quickjump
DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"}
INTEGER_LIBRARY = ${if enableIntegerSimple then "integer-simple" else "integer-gmp"}
''
+ lib.optionalString (targetPlatform != hostPlatform) ''
Stage1Only = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"}
CrossCompilePrefix = ${targetPrefix}
''
+ lib.optionalString (!enableProfiledLibs) ''
BUILD_PROF_LIBS = NO
''
+ lib.optionalString enableRelocatedStaticLibs ''
GhcLibHcOpts += -fPIC
GhcRtsHcOpts += -fPIC
''
+ lib.optionalString targetPlatform.useAndroidPrebuilt ''
EXTRA_CC_OPTS += -std=gnu99
''
# While split sections are now enabled by default in ghc 8.8 for windows,
# they seem to lead to `too many sections` errors when building base for
# profiling.
+ lib.optionalString targetPlatform.isWindows ''
SplitSections = NO
'';
# Splicer will pull out correct variations
libDeps =
platform:
lib.optional enableTerminfo ncurses
++ [ args.${libffi_name} ]
++ lib.optional (!enableIntegerSimple) gmp
++ lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv;
# TODO(@sternenseemann): is buildTarget LLVM unnecessary?
# GHC doesn't seem to have {LLC,OPT}_HOST
toolsForTarget = [
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
# the tool from (cc, cc.bintools, cc.bintools.bintools) and adds the correct
# subpath of the tool.
toolPath =
name: cc:
let
tools =
{
"cc" = cc;
"c++" = cc;
as = cc.bintools;
ar = cc.bintools;
ranlib = cc.bintools;
nm = cc.bintools;
readelf = cc.bintools;
objdump = cc.bintools;
ld = cc.bintools;
"ld.gold" = cc.bintools;
otool = cc.bintools.bintools;
# GHC needs install_name_tool on all darwin platforms. The same one can
# be used on both platforms. It is safe to use with linker-generated
# signatures because it will update the signatures automatically after
# modifying the target binary.
install_name_tool = cc.bintools.bintools;
# strip on darwin is wrapped to enable deterministic mode.
strip =
# TODO(@sternenseemann): also use wrapper if linker == "bfd" or "gold"
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}";
# Use gold either following the default, or to avoid the BFD linker due to some bugs / perf issues.
# But we cannot avoid BFD when using musl libc due to https://sourceware.org/bugzilla/show_bug.cgi?id=23856
# see #84670 and #49071 for more background.
useLdGold =
targetPlatform.linker == "gold"
|| (
targetPlatform.linker == "bfd"
&& (targetCC.bintools.bintools.hasGold or false)
&& !targetPlatform.isMusl
);
# Makes debugging easier to see which variant is at play in `nix-store -q --tree`.
variantSuffix = lib.concatStrings [
(lib.optionalString stdenv.hostPlatform.isMusl "-musl")
(lib.optionalString enableIntegerSimple "-integer-simple")
];
libffi_name =
if stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64 then "libffi" else "libffi_3_3";
# 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 numactl;
# dynamic inherits are not possible in Nix
libffi = basePackageSet.${libffi_name};
};
in
stdenv.mkDerivation (
rec {
inherit version;
pname = "${targetPrefix}ghc${variantSuffix}";
src = fetchurl {
url = "https://downloads.haskell.org/ghc/${version}/ghc-${version}-src.tar.xz";
sha256 = "e3eef6229ce9908dfe1ea41436befb0455fefb1932559e860ad4c606b0d03c9d";
};
enableParallelBuilding = true;
outputs = [
"out"
"doc"
];
patches = [
# Fix docs build with sphinx >= 6.0
# https://gitlab.haskell.org/ghc/ghc/-/issues/22766
(fetchpatch {
name = "ghc-docs-sphinx-6.0.patch";
url = "https://gitlab.haskell.org/ghc/ghc/-/commit/10e94a556b4f90769b7fd718b9790d58ae566600.patch";
sha256 = "0kmhfamr16w8gch0lgln2912r8aryjky1hfcda3jkcwa5cdzgjdv";
})
# Determine size of time related types using hsc2hs instead of assuming CLong.
# Prevents failures when e.g. stat(2)ing on 32bit systems with 64bit time_t etc.
# https://github.com/haskell/ghcup-hs/issues/1107
# https://gitlab.haskell.org/ghc/ghc/-/issues/25095
# Note that in normal situations this shouldn't be the case since nixpkgs
# doesn't set -D_FILE_OFFSET_BITS=64 and friends (yet).
(fetchpatch {
name = "unix-fix-ctimeval-size-32-bit.patch";
url = "https://github.com/haskell/unix/commit/8183e05b97ce870dd6582a3677cc82459ae566ec.patch";
sha256 = "17q5yyigqr5kxlwwzb95sx567ysfxlw6bp3j4ji20lz0947aw6gv";
stripLen = 1;
extraPrefix = "libraries/unix/";
})
# See upstream patch at
# https://gitlab.haskell.org/ghc/ghc/-/merge_requests/4885. Since we build
# from source distributions, the auto-generated configure script needs to be
# patched as well, therefore we use an in-tree patch instead of pulling the
# upstream patch. Don't forget to check backport status of the upstream patch
# when adding new GHC releases in nixpkgs.
./respect-ar-path.patch
# fix hyperlinked haddock sources: https://github.com/haskell/haddock/pull/1482
(fetchpatch {
url = "https://patch-diff.githubusercontent.com/raw/haskell/haddock/pull/1482.patch";
sha256 = "sha256-8w8QUCsODaTvknCDGgTfFNZa8ZmvIKaKS+2ZJZ9foYk=";
extraPrefix = "utils/haddock/";
stripLen = 1;
})
# cabal passes incorrect --host= when cross-compiling
# https://github.com/haskell/cabal/issues/5887
(fetchpatch {
url = "https://raw.githubusercontent.com/input-output-hk/haskell.nix/122bd81150386867da07fdc9ad5096db6719545a/overlays/patches/ghc/cabal-host.patch";
sha256 = "sha256:0yd0sajgi24sc1w5m55lkg2lp6kfkgpp3lgija2c8y3cmkwfpdc1";
})
# In order to build ghcjs packages, the Cabal of the ghc used for the ghcjs
# needs to be patched. Ref https://github.com/haskell/cabal/pull/7575
(fetchpatch {
url = "https://github.com/haskell/cabal/commit/369c4a0a54ad08a9e6b0d3bd303fedd7b5e5a336.patch";
sha256 = "120f11hwyaqa0pq9g5l1300crqij49jg0rh83hnp9sa49zfdwx1n";
stripLen = 3;
extraPrefix = "libraries/Cabal/Cabal/";
})
# We need to be able to set AR_STAGE0 and LD_STAGE0 when cross-compiling
(fetchpatch {
url = "https://gitlab.haskell.org/ghc/ghc/-/commit/8f7dd5710b80906ea7a3e15b7bb56a883a49fed8.patch";
hash = "sha256-C636Nq2U8YOG/av7XQmG3L1rU0bmC9/7m7Hty5pm5+s=";
})
# Backport part of <https://gitlab.haskell.org/ghc/ghc/-/merge_requests/7111> to 8.10.7
# The change we are interested in is that Cabal no longer sets include-dirs
# for the GHCi library delegating to the system search path or (in our case)
# cc-wrapper. Without this patch, the target libffi ends up in there (which
# we provide via --with-ffi-includes) which breaks bootstrapping e.g. when
# cross compiling GHC. Without include-dirs, cc-wrapper and splicing will
# correctly pick the suitable libffi out of the build environment.
(fetchpatch {
name = "ghci-no-libffi-include.patch";
url = "https://gitlab.haskell.org/ghc/ghc/-/commit/b2721819f391ab49871271283f32df54810c4387.patch";
sha256 = "1rmv3132xhxbka97v0rx7r6larx5f5nnvs4mgm9q3rmgpjyd1vf9";
includes = [ "libraries/ghci/ghci.cabal.in" ];
})
# Correctly record libnuma's library and include directories in the
# package db. This fixes linking whenever stdenv and propagation won't
# quite pass the correct -L flags to the linker, e.g. when using GHC
# outside of stdenv/nixpkgs or build->build compilation in pkgsStatic.
./ghc-8.10-9.2-rts-package-db-libnuma-dirs.patch
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
# Make Block.h compile with c++ compilers. Remove with the next release
(fetchpatch {
url = "https://gitlab.haskell.org/ghc/ghc/-/commit/97d0b0a367e4c6a52a17c3299439ac7de129da24.patch";
sha256 = "0r4zjj0bv1x1m2dgxp3adsf2xkr94fjnyj1igsivd9ilbs5ja0b5";
})
]
++ 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.
#
# These cause problems as they're not eliminated by GHC's dead code
# elimination on aarch64-darwin. (see
# https://github.com/NixOS/nixpkgs/issues/140774 for details).
./Cabal-3.2-3.4-paths-fix-cycle-aarch64-darwin.patch
];
postPatch = "patchShebangs .";
# GHC is a bit confused on its cross terminology.
# TODO(@sternenseemann): investigate coreutils dependencies and pass absolute paths
preConfigure = ''
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}"
export CXX="${toolPath "c++" targetCC}"
# Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177
export LD="${toolPath "ld${lib.optionalString useLdGold ".gold"}" targetCC}"
export AS="${toolPath "as" targetCC}"
export AR="${toolPath "ar" targetCC}"
export NM="${toolPath "nm" targetCC}"
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}"
''
+ lib.optionalString useLLVM ''
export LLC="${lib.getBin buildTargetLlvmPackages.llvm}/bin/llc"
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
# 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
''
+ lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}"
''
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
export NIX_LDFLAGS+=" -no_dtrace_dof"
# GHC tries the host xattr /usr/bin/xattr by default which fails since it expects python to be 2.7
export XATTR=${lib.getBin xattr}/bin/xattr
''
+ lib.optionalString targetPlatform.useAndroidPrebuilt ''
sed -i -e '5i ,("armv7a-unknown-linux-androideabi", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "cortex-a8", ""))' llvm-targets
''
+ lib.optionalString targetPlatform.isMusl ''
echo "patching llvm-targets for musl targets..."
echo "Cloning these existing '*-linux-gnu*' targets:"
grep linux-gnu llvm-targets | sed 's/^/ /'
echo "(go go gadget sed)"
sed -i 's,\(^.*linux-\)gnu\(.*\)$,\0\n\1musl\2,' llvm-targets
echo "llvm-targets now contains these '*-linux-musl*' targets:"
grep linux-musl llvm-targets | sed 's/^/ /'
echo "And now patching to preserve '-musleabi' as done with '-gnueabi'"
# (aclocal.m4 is actual source, but patch configure as well since we don't re-gen)
for x in configure aclocal.m4; do
substituteInPlace $x \
--replace '*-android*|*-gnueabi*)' \
'*-android*|*-gnueabi*|*-musleabi*)'
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"
]
++ lib.optional (buildPlatform != hostPlatform || targetPlatform != hostPlatform) "target";
# `--with` flags for libraries needed for RTS linker
configureFlags = [
"--datadir=$doc/share/doc/ghc"
]
++ 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=${targetLibs.libffi.dev}/include"
"--with-ffi-libraries=${targetLibs.libffi.out}/lib"
]
++ lib.optionals (targetPlatform == hostPlatform && !enableIntegerSimple) [
"--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"
]
++ lib.optionals (targetPlatform != hostPlatform) [
"--enable-bootstrap-with-devel-snapshot"
]
++ lib.optionals useLdGold [
"CFLAGS=-fuse-ld=gold"
"CONF_GCC_LINKER_OPTS_STAGE1=-fuse-ld=gold"
"CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold"
]
++ lib.optionals (disableLargeAddressSpace) [
"--disable-large-address-space"
]
++ lib.optionals enableNuma [
"--enable-numa"
"--with-libnuma-includes=${lib.getDev targetLibs.numactl}/include"
"--with-libnuma-libraries=${lib.getLib targetLibs.numactl}/lib"
]
++ lib.optionals enableUnregisterised [
"--enable-unregisterised"
];
# Make sure we never relax`$PATH` and hooks support for compatibility.
strictDeps = true;
# Dont add -liconv to LDFLAGS automatically so that GHC will add it itself.
dontAddExtraLibs = true;
nativeBuildInputs = [
perl
autoreconfHook
autoconf
automake
m4
python3
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;
# Prevent stage0 ghc from leaking into the final result. This was an issue
# with GHC 9.6.
disallowedReferences = [
bootPkgs.ghc
];
buildInputs = [ bash ] ++ (libDeps hostPlatform);
# stage1 GHC doesn't need to link against libnuma, so it's target specific
depsTargetTarget = map lib.getDev (
libDeps targetPlatform ++ lib.optionals enableNuma [ targetLibs.numactl ]
);
depsTargetTargetPropagated = map (lib.getOutput "out") (
libDeps targetPlatform ++ lib.optionals enableNuma [ targetLibs.numactl ]
);
# required, because otherwise all symbols from HSffi.o are stripped, and
# that in turn causes GHCi to abort
stripDebugFlags = [ "-S" ] ++ lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols";
checkTarget = "test";
# GHC cannot currently produce outputs that are ready for `-pie` linking.
# Thus, disable `pie` hardening, otherwise `recompile with -fPIE` errors appear.
# See:
# * https://github.com/NixOS/nixpkgs/issues/129247
# * https://gitlab.haskell.org/ghc/ghc/-/issues/19580
hardeningDisable = [
"format"
"pie"
];
# big-parallel allows us to build with more than 2 cores on
# Hydra which already warrants a significant speedup
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
'';
passthru = {
inherit bootPkgs targetPrefix;
inherit llvmPackages;
inherit enableShared;
# This is used by the haskell builder to query
# the presence of the haddock program.
hasHaddock = enableHaddockProgram;
# Our Cabal compiler name
haskellCompilerName = "ghc-${version}";
bootstrapAvailable = lib.meta.availableOn stdenv.buildPlatform bootPkgs.ghc;
};
meta = {
homepage = "http://haskell.org/ghc";
description = "Glasgow Haskell Compiler";
maintainers = with lib.maintainers; [
guibou
];
teams = [ lib.teams.haskell ];
timeout = 24 * 3600;
platforms = lib.platforms.all;
inherit (bootPkgs.ghc.meta) license;
};
}
// lib.optionalAttrs targetPlatform.useAndroidPrebuilt {
dontStrip = true;
dontPatchELF = true;
noAuditTmpdir = true;
}
)

View File

@@ -1,99 +0,0 @@
diff --git a/Cabal/Distribution/Simple/Build/PathsModule.hs b/Cabal/Distribution/Simple/Build/PathsModule.hs
index 5e660e8d6..1ae603c94 100644
--- a/libraries/Cabal/Cabal/Distribution/Simple/Build/PathsModule.hs
+++ b/libraries/Cabal/Cabal/Distribution/Simple/Build/PathsModule.hs
@@ -37,6 +37,9 @@ import System.FilePath ( pathSeparator )
-- * Building Paths_<pkg>.hs
-- ------------------------------------------------------------
+splitPath :: FilePath -> [ String ]
+splitPath = unintersperse pathSeparator
+
generatePathsModule :: PackageDescription -> LocalBuildInfo -> ComponentLocalBuildInfo -> String
generatePathsModule pkg_descr lbi clbi =
let pragmas =
@@ -78,12 +81,44 @@ generatePathsModule pkg_descr lbi clbi =
"import System.Environment (getExecutablePath)\n"
| otherwise = ""
+ dirs = [ (flat_libdir, "LibDir")
+ , (flat_dynlibdir, "DynLibDir")
+ , (flat_datadir, "DataDir")
+ , (flat_libexecdir, "LibexecDir")
+ , (flat_sysconfdir, "SysconfDir") ];
+
+ shouldEmitPath p
+ | (splitPath flat_prefix) `isPrefixOf` (splitPath flat_bindir) = True
+ | (splitPath flat_prefix) `isPrefixOf` (splitPath p) = False
+ | otherwise = True
+
+ shouldEmitDataDir = shouldEmitPath flat_datadir
+
+ nixEmitPathFn (path, name) = let
+ varName = toLower <$> name
+ fnName = "get"++name
+ in if shouldEmitPath path then
+ varName ++ " :: FilePath\n"++
+ varName ++ " = " ++ show path ++
+ "\n" ++ fnName ++ " :: IO FilePath" ++
+ "\n" ++ fnName ++ " = " ++ mkGetEnvOr varName ("return " ++ varName)++"\n"
+ else ""
+
+ absBody = intercalate "\n" $ nixEmitPathFn <$> dirs
+
+ warnPragma = case filter (not . shouldEmitPath . fst) dirs of
+ [] -> ""
+ omittedDirs -> "{-# WARNING \"The functions: "++omittedFns++" Have been omitted by the Nix build system.\" #-}"
+ where omittedFns = intercalate ", " $ map snd omittedDirs
+
+ importList = intercalate ", " $ ("get" ++) . snd <$> filter (shouldEmitPath . fst) dirs
+
header =
pragmas++
- "module " ++ prettyShow paths_modulename ++ " (\n"++
- " version,\n"++
- " getBinDir, getLibDir, getDynLibDir, getDataDir, getLibexecDir,\n"++
- " getDataFileName, getSysconfDir\n"++
+ "module " ++ prettyShow paths_modulename ++ " " ++ warnPragma ++ " (\n"++
+ " version, getBinDir,\n"++
+ (if shouldEmitDataDir then " getDataFileName, \n" else "\n")++
+ " " ++ importList ++"\n"++
" ) where\n"++
"\n"++
foreign_imports++
@@ -136,26 +171,18 @@ generatePathsModule pkg_descr lbi clbi =
"\n"++
filename_stuff
| absolute =
- "\nbindir, libdir, dynlibdir, datadir, libexecdir, sysconfdir :: FilePath\n"++
+ "\nbindir :: FilePath\n"++
"\nbindir = " ++ show flat_bindir ++
- "\nlibdir = " ++ show flat_libdir ++
- "\ndynlibdir = " ++ show flat_dynlibdir ++
- "\ndatadir = " ++ show flat_datadir ++
- "\nlibexecdir = " ++ show flat_libexecdir ++
- "\nsysconfdir = " ++ show flat_sysconfdir ++
"\n"++
- "\ngetBinDir, getLibDir, getDynLibDir, getDataDir, getLibexecDir, getSysconfDir :: IO FilePath\n"++
+ "\ngetBinDir :: IO FilePath\n"++
"getBinDir = "++mkGetEnvOr "bindir" "return bindir"++"\n"++
- "getLibDir = "++mkGetEnvOr "libdir" "return libdir"++"\n"++
- "getDynLibDir = "++mkGetEnvOr "dynlibdir" "return dynlibdir"++"\n"++
- "getDataDir = "++mkGetEnvOr "datadir" "return datadir"++"\n"++
- "getLibexecDir = "++mkGetEnvOr "libexecdir" "return libexecdir"++"\n"++
- "getSysconfDir = "++mkGetEnvOr "sysconfdir" "return sysconfdir"++"\n"++
- "\n"++
- "getDataFileName :: FilePath -> IO FilePath\n"++
- "getDataFileName name = do\n"++
- " dir <- getDataDir\n"++
- " return (dir ++ "++path_sep++" ++ name)\n"
+ absBody ++ "\n"++
+ (if shouldEmitDataDir then
+ "getDataFileName :: FilePath -> IO FilePath\n"++
+ "getDataFileName name = do\n"++
+ " dir <- getDataDir\n"++
+ " return (dir ++ "++path_sep++" ++ name)\n"
+ else "\n")
| otherwise =
"\nprefix, bindirrel :: FilePath" ++
"\nprefix = " ++ show flat_prefix ++

View File

@@ -1971,32 +1971,6 @@ with haskellLib;
# https://github.com/serokell/haskell-crypto/issues/25 # https://github.com/serokell/haskell-crypto/issues/25
crypto-sodium = dontCheck super.crypto-sodium; crypto-sodium = dontCheck super.crypto-sodium;
# Polyfill for GHCs from the integer-simple days that don't bundle ghc-bignum
ghc-bignum = super.ghc-bignum or self.mkDerivation {
pname = "ghc-bignum";
version = "1.0";
sha256 = "0xl848q8z6qx2bi6xil0d35lra7wshwvysyfblki659d7272b1im";
description = "GHC BigNum library";
license = lib.licenses.bsd3;
# ghc-bignum is not buildable if none of the three backends
# is explicitly enabled. We enable Native for now as it doesn't
# depend on anything else as opposed to GMP and FFI.
# Apply patch which fixes a compilation failure we encountered.
# Will need to be kept until we can drop ghc-bignum entirely,
# i. e. if GHC 8.10.* and 8.8.* have been removed.
configureFlags = [
"-f"
"Native"
];
patches = [
(fetchpatch {
url = "https://gitlab.haskell.org/ghc/ghc/-/commit/08d1588bf38d83140a86817a7a615db486357d4f.patch";
sha256 = "sha256-Y9WW0KDQ/qY2L9ObPvh1i/6lxXIlprbxzdSBDfiaMtE=";
relative = "libraries/ghc-bignum";
})
];
};
# 2021-04-09: too strict time bound # 2021-04-09: too strict time bound
# PR pending https://github.com/zohl/cereal-time/pull/2 # PR pending https://github.com/zohl/cereal-time/pull/2
cereal-time = doJailbreak super.cereal-time; cereal-time = doJailbreak super.cereal-time;
@@ -2615,7 +2589,6 @@ with haskellLib;
# 2025-02-06: Allow tasty-quickcheck == 0.11.* # 2025-02-06: Allow tasty-quickcheck == 0.11.*
# https://github.com/google/ghc-source-gen/issues/120 # https://github.com/google/ghc-source-gen/issues/120
ghc-source-gen = doJailbreak super.ghc-source-gen; ghc-source-gen = doJailbreak super.ghc-source-gen;
ghc-source-gen_0_4_5_0 = doJailbreak super.ghc-source-gen_0_4_5_0;
# https://github.com/byteverse/bytebuild/issues/20#issuecomment-2652113837 # https://github.com/byteverse/bytebuild/issues/20#issuecomment-2652113837
bytebuild = doJailbreak super.bytebuild; bytebuild = doJailbreak super.bytebuild;
# https://github.com/haskellari/lattices/issues/132 # https://github.com/haskellari/lattices/issues/132

View File

@@ -1,230 +0,0 @@
{ pkgs, haskellLib }:
with haskellLib;
let
inherit (pkgs.stdenv.hostPlatform) isDarwin;
inherit (pkgs) lib;
in
self: super: {
llvmPackages = pkgs.lib.dontRecurseIntoAttrs self.ghc.llvmPackages;
# Disable GHC 8.10.x core libraries.
array = null;
base = null;
binary = null;
bytestring = null;
Cabal = null;
containers = null;
deepseq = null;
directory = null;
exceptions = null;
filepath = null;
ghc-boot = null;
ghc-boot-th = null;
ghc-compact = null;
ghc-heap = null;
ghc-prim = null;
ghci = null;
haskeline = null;
hpc = null;
integer-gmp = null;
libiserv = null;
mtl = null;
parsec = null;
pretty = null;
process = null;
rts = null;
stm = null;
template-haskell = null;
# GHC only builds terminfo if it is a native compiler
terminfo =
if pkgs.stdenv.hostPlatform == pkgs.stdenv.buildPlatform then
null
else
doDistribute self.terminfo_0_4_1_7;
text = null;
time = null;
transformers = null;
unix = null;
# GHC only bundles the xhtml library if haddock is enabled, check if this is
# still the case when updating: https://gitlab.haskell.org/ghc/ghc/-/blob/0198841877f6f04269d6050892b98b5c3807ce4c/ghc.mk#L463
xhtml = if self.ghc.hasHaddock or true then null else doDistribute self.xhtml_3000_4_0_0;
# Need the Cabal-syntax-3.6.0.0 fake package for Cabal < 3.8 to allow callPackage and the constraint solver to work
Cabal-syntax = self.Cabal-syntax_3_6_0_0;
# These core package only exist for GHC >= 9.4. The best we can do is feign
# their existence to callPackages, but their is no shim for lower GHC versions.
system-cxx-std-lib = null;
# Becomes a core package in GHC >= 9.8
semaphore-compat = doDistribute self.semaphore-compat_1_0_0;
# only broken for >= 9.6
calligraphy = doDistribute (unmarkBroken super.calligraphy);
# Only required for ghc >= 9.2
nothunks = super.nothunks.override {
wherefrom-compat = null;
};
# Tests require nothunks < 0.3 (conflicting with Stackage) for GHC < 9.8
aeson = dontCheck super.aeson;
# For GHC < 9.4, some packages need data-array-byte as an extra dependency
# For GHC < 9.2, os-string is not required.
primitive = addBuildDepends [ self.data-array-byte ] super.primitive;
hashable =
addBuildDepends
[
self.data-array-byte
self.base-orphans
]
(
super.hashable.override {
os-string = null;
}
);
hashable-time = doDistribute (unmarkBroken super.hashable-time);
# Needs base-orphans for GHC < 9.8 / base < 4.19
some = addBuildDepend self.base-orphans super.some;
# Too strict lower bounds on base
primitive-addr = doJailbreak super.primitive-addr;
# Pick right versions for GHC-specific packages
ghc-api-compat = doDistribute (unmarkBroken self.ghc-api-compat_8_10_7);
# Needs to use ghc-lib due to incompatible GHC
ghc-tags = doDistribute self.ghc-tags_1_5;
# Jailbreak to fix the build.
base-noprelude = doJailbreak super.base-noprelude;
unliftio-core = doJailbreak super.unliftio-core;
# Jailbreak to fix the build.
brick = doJailbreak super.brick;
exact-pi = doJailbreak super.exact-pi;
serialise = doJailbreak super.serialise;
setlocale = doJailbreak super.setlocale;
shellmet = doJailbreak super.shellmet;
shower = doJailbreak super.shower;
# hnix 0.9.0 does not provide an executable for ghc < 8.10, so define completions here for now.
hnix = self.generateOptparseApplicativeCompletions [ "hnix" ] (
overrideCabal (drv: {
# executable is allowed for ghc >= 8.10 and needs repline
executableHaskellDepends = drv.executableToolDepends or [ ] ++ [ self.repline ];
}) super.hnix
);
haskell-language-server = throw "haskell-language-server dropped support for ghc 8.10 in version 2.3.0.0 please use a newer ghc version or an older nixpkgs version";
ghc-lib-parser = doDistribute self.ghc-lib-parser_9_2_8_20230729;
ghc-lib-parser-ex = doDistribute self.ghc-lib-parser-ex_9_2_1_1;
ghc-lib = doDistribute self.ghc-lib_9_2_8_20230729;
path-io = doJailbreak super.path-io;
hlint = self.hlint_3_4_1;
# test suite depends on vcr since hpack >= 0.38.1 which requires GHC2021
hpack_0_38_1 = dontCheck super.hpack_0_38_1;
mime-string = disableOptimization super.mime-string;
# weeder 2.3.* no longer supports GHC 8.10
weeder = doDistribute (doJailbreak self.weeder_2_2_0);
# Unnecessarily strict upper bound on lens
weeder_2_2_0 = doJailbreak (
super.weeder_2_2_0.override {
# weeder < 2.6 only supports algebraic-graphs < 0.7
# We no longer have matching test deps for algebraic-graphs 0.6.1 in the set
algebraic-graphs = dontCheck self.algebraic-graphs_0_6_1;
}
);
# Uses haddock placement that isn't supported by the versions of haddock
# bundled with GHC < 9.0.
wai-extra = dontHaddock super.wai-extra;
# tar > 0.6 requires os-string which can't be built with bytestring < 0.11
tar = overrideCabal (drv: {
jailbreak = true;
buildDepends = drv.buildDepends or [ ] ++ [
self.bytestring-handle
];
}) self.tar_0_6_0_0;
# text-metrics >= 0.3.3 requires GHC2021
text-metrics = doDistribute (doJailbreak self.text-metrics_0_3_2);
bytestring-handle = unmarkBroken (doDistribute super.bytestring-handle);
# Doesn't build with 9.0, see https://github.com/yi-editor/yi/issues/1125
yi-core = doDistribute (markUnbroken super.yi-core);
# Temporarily disabled blaze-textual for GHC >= 9.0 causing hackage2nix ignoring it
# https://github.com/paul-rouse/mysql-simple/blob/872604f87044ff6d1a240d9819a16c2bdf4ed8f5/Database/MySQL/Internal/Blaze.hs#L4-L10
mysql-simple = addBuildDepends [
self.blaze-textual
] super.mysql-simple;
taffybar = markUnbroken (doDistribute super.taffybar);
# https://github.com/fpco/inline-c/issues/127 (recommend to upgrade to Nixpkgs GHC >=9.0)
inline-c-cpp = (if isDarwin then dontCheck else x: x) super.inline-c-cpp;
# Depends on OneTuple for GHC < 9.0
universe-base = addBuildDepends [ self.OneTuple ] super.universe-base;
# Not possible to build in the main GHC 9.0 package set
# https://github.com/awakesecurity/spectacle/issues/49
spectacle = doDistribute (markUnbroken super.spectacle);
# doctest-parallel dependency requires newer Cabal
regex-tdfa = dontCheck super.regex-tdfa;
# Unnecessarily strict lower bound on base
# https://github.com/mrkkrp/megaparsec/pull/485#issuecomment-1250051823
megaparsec = doJailbreak super.megaparsec;
retrie = dontCheck self.retrie_1_1_0_0;
# Later versions only support GHC >= 9.2
ghc-exactprint = self.ghc-exactprint_0_6_4;
apply-refact = self.apply-refact_0_9_3_0;
# Needs OneTuple for ghc < 9.2
binary-orphans = addBuildDepends [ self.OneTuple ] super.binary-orphans;
# 0.4.6.0 only supports >= 9.0
ghc-source-gen = doDistribute self.ghc-source-gen_0_4_5_0;
# No instance for (Show B.Builder) arising from a use of print
http-types = dontCheck super.http-types;
# Packages which need compat library for GHC < 9.6
inherit (lib.mapAttrs (_: addBuildDepends [ self.foldable1-classes-compat ]) super)
indexed-traversable
these
;
base-compat-batteries = addBuildDepends [
self.foldable1-classes-compat
self.OneTuple
] super.base-compat-batteries;
# OneTuple needs hashable (instead of ghc-prim) and foldable1-classes-compat for GHC < 9
OneTuple =
addBuildDepends
[
self.foldable1-classes-compat
self.base-orphans
]
(
super.OneTuple.override {
ghc-prim = self.hashable;
}
);
}

View File

@@ -29,8 +29,6 @@ default-package-overrides:
# 2024-12-23: last version to be compatible with Stackage LTS 22/23 (due to data-default) # 2024-12-23: last version to be compatible with Stackage LTS 22/23 (due to data-default)
- diagrams-input < 0.1.4 - diagrams-input < 0.1.4
- extensions < 0.1.0.2 # Incompatible with Cabal < 3.12, the newest extensions version is only needed on ghc 9.10 - extensions < 0.1.0.2 # Incompatible with Cabal < 3.12, the newest extensions version is only needed on ghc 9.10
# 2021-11-09: ghc-bignum is bundled starting with 9.0.1; only 1.0 builds with GHCs prior to 9.2.1
- ghc-bignum == 1.0
# 2025-07-26: HLS doesn't support hiedb >= 0.7 yet # 2025-07-26: HLS doesn't support hiedb >= 0.7 yet
- hiedb < 0.7 - hiedb < 0.7
# 2024-08-17: Stackage doesn't contain hnix-store-core >= 0.8 yet, so we need to restrict hnix-store-remote # 2024-08-17: Stackage doesn't contain hnix-store-core >= 0.8 yet, so we need to restrict hnix-store-remote
@@ -48,7 +46,6 @@ extra-packages:
- algebraic-graphs < 0.7 # 2023-08-14: Needed for building weeder < 2.6.0 - algebraic-graphs < 0.7 # 2023-08-14: Needed for building weeder < 2.6.0
- ansi-wl-pprint >= 0.6 && < 0.7 # 2025-07-07: used by gren <= 0.5.4 - ansi-wl-pprint >= 0.6 && < 0.7 # 2025-07-07: used by gren <= 0.5.4
- attoparsec == 0.13.* # 2022-02-23: Needed to compile elm for now - attoparsec == 0.13.* # 2022-02-23: Needed to compile elm for now
- Cabal == 3.2.* # Used for packages needing newer Cabal on ghc 8.6 and 8.8
- Cabal == 3.10.* - Cabal == 3.10.*
- Cabal == 3.12.* # version required for cabal-install and other packages - Cabal == 3.12.* # version required for cabal-install and other packages
- Cabal-syntax == 3.6.* # Dummy package that ensures packages depending on Cabal-syntax can work for Cabal < 3.8 - Cabal-syntax == 3.6.* # Dummy package that ensures packages depending on Cabal-syntax can work for Cabal < 3.8
@@ -61,7 +58,6 @@ extra-packages:
- fourmolu == 0.16.0.0 # 2025-01-27: for ghc 9.10 compat - fourmolu == 0.16.0.0 # 2025-01-27: for ghc 9.10 compat
- fsnotify < 0.4 # 2024-04-22: required by spago-0.21 - fsnotify < 0.4 # 2024-04-22: required by spago-0.21
- fuzzyset == 0.2.4 # 2023-12-20: Needed for building postgrest > 10 - fuzzyset == 0.2.4 # 2023-12-20: Needed for building postgrest > 10
- ghc-api-compat == 8.10.7 # 2022-02-17: preserve for GHC 8.10.7
- ghc-exactprint == 0.6.* # 2022-12-12: needed for GHC < 9.2 - ghc-exactprint == 0.6.* # 2022-12-12: needed for GHC < 9.2
- ghc-exactprint == 1.5.* # 2023-03-30: needed for GHC == 9.2 - ghc-exactprint == 1.5.* # 2023-03-30: needed for GHC == 9.2
- ghc-exactprint == 1.6.* # 2023-03-30: needed for GHC == 9.4 - ghc-exactprint == 1.6.* # 2023-03-30: needed for GHC == 9.4
@@ -77,7 +73,6 @@ extra-packages:
- ghc-lib-parser-ex == 9.2.* # 2022-07-13: preserve for GHC 8.10, 9.0 - ghc-lib-parser-ex == 9.2.* # 2022-07-13: preserve for GHC 8.10, 9.0
- ghc-lib-parser-ex == 9.6.* # 2024-05-19: preserve for GHC 9.2, 9.4 - ghc-lib-parser-ex == 9.6.* # 2024-05-19: preserve for GHC 9.2, 9.4
- ghc-lib-parser-ex == 9.10.* # 2024-12-26: preserve for 9.10 HLS - ghc-lib-parser-ex == 9.10.* # 2024-12-26: preserve for 9.10 HLS
- ghc-source-gen < 0.4.6.0 # 2024-12-31: support GHC < 9.0
- ghc-tags == 1.5.* # 2023-02-18: preserve for ghc-lib == 9.2.* - ghc-tags == 1.5.* # 2023-02-18: preserve for ghc-lib == 9.2.*
- ghc-tags == 1.7.* # 2023-02-18: preserve for ghc-lib == 9.6.* - ghc-tags == 1.7.* # 2023-02-18: preserve for ghc-lib == 9.6.*
- ghc-tags == 1.8.* # 2023-02-18: preserve for ghc-lib == 9.8.* - ghc-tags == 1.8.* # 2023-02-18: preserve for ghc-lib == 9.8.*
@@ -88,7 +83,6 @@ extra-packages:
- hasql-notifications < 0.2.3 # 2025-01-19: Needed for building postgrest - hasql-notifications < 0.2.3 # 2025-01-19: Needed for building postgrest
- hasql-pool < 1.1 # 2025-01-19: Needed for building postgrest - hasql-pool < 1.1 # 2025-01-19: Needed for building postgrest
- hasql-transaction < 1.1.1 # 2025-01-19: Needed for building postgrest - hasql-transaction < 1.1.1 # 2025-01-19: Needed for building postgrest
- hlint == 3.4.1 # 2022-09-21: preserve for ghc 8.10
- hlint == 3.6.* # 2025-04-14: needed for hls with ghc-lib-parser 9.6 - hlint == 3.6.* # 2025-04-14: needed for hls with ghc-lib-parser 9.6
- hnix-store-core < 0.7 # 2023-12-11: required by hnix-store-remote 0.6 - hnix-store-core < 0.7 # 2023-12-11: required by hnix-store-remote 0.6
- hspec-megaparsec == 2.2.0 # 2023-11-18: Latest version compatible with ghc 9.0 - hspec-megaparsec == 2.2.0 # 2023-11-18: Latest version compatible with ghc 9.0
@@ -110,10 +104,8 @@ extra-packages:
- stylish-haskell == 0.14.5.0 # 2025-04-14: needed for hls with ghc-lib 9.6 - stylish-haskell == 0.14.5.0 # 2025-04-14: needed for hls with ghc-lib 9.6
- stylish-haskell == 0.15.0.1 # 2025-04-14: needed for hls with ghc-lib 9.10 - stylish-haskell == 0.15.0.1 # 2025-04-14: needed for hls with ghc-lib 9.10
- tar == 0.6.0.0 # 2025-02-08: last version to not require os-string (which can't be built with GHC < 9.2) - tar == 0.6.0.0 # 2025-02-08: last version to not require os-string (which can't be built with GHC < 9.2)
- text == 2.0.2 # 2023-09-14: Needed for elm (which is currently on ghc-8.10)
- text-metrics < 0.3.3 # 2025-02-08: >= 0.3.3 uses GHC2021 - text-metrics < 0.3.3 # 2025-02-08: >= 0.3.3 uses GHC2021
- versions < 6 # 2024-04-22: required by spago-0.21 - versions < 6 # 2024-04-22: required by spago-0.21
- weeder == 2.2.* # 2022-02-21: preserve for GHC 8.10.7
- weeder == 2.3.* # 2022-05-31: preserve for GHC 9.0.2 - weeder == 2.3.* # 2022-05-31: preserve for GHC 9.0.2
- weeder == 2.4.* # 2023-02-02: preserve for GHC 9.2.* - weeder == 2.4.* # 2023-02-02: preserve for GHC 9.2.*
# keep-sorted end # keep-sorted end

View File

@@ -5776,104 +5776,6 @@ self: {
opencv_video = null; opencv_video = null;
}; };
"Cabal_3_2_1_0" = callPackage (
{
mkDerivation,
array,
base,
base-compat,
base-orphans,
binary,
bytestring,
containers,
deepseq,
Diff,
directory,
filepath,
integer-logarithms,
mtl,
optparse-applicative,
parsec,
pretty,
process,
QuickCheck,
stm,
tagged,
tar,
tasty,
tasty-golden,
tasty-hunit,
tasty-quickcheck,
temporary,
text,
time,
transformers,
tree-diff,
unix,
}:
mkDerivation {
pname = "Cabal";
version = "3.2.1.0";
sha256 = "1xfn9q6jnbp3jc6swn4hapa83f5m66pjz8fqbqmffydagf36fkzy";
revision = "1";
editedCabalFile = "07brbxkjlf1yqs9bjdwcwq1gx853kh600qnrf6bnya92q1p0fhw7";
setupHaskellDepends = [
mtl
parsec
];
libraryHaskellDepends = [
array
base
binary
bytestring
containers
deepseq
directory
filepath
mtl
parsec
pretty
process
text
time
transformers
unix
];
testHaskellDepends = [
array
base
base-compat
base-orphans
binary
bytestring
containers
deepseq
Diff
directory
filepath
integer-logarithms
optparse-applicative
pretty
process
QuickCheck
stm
tagged
tar
tasty
tasty-golden
tasty-hunit
tasty-quickcheck
temporary
text
tree-diff
];
doCheck = false;
description = "A framework for packaging Haskell software";
license = lib.licenses.bsd3;
hydraPlatforms = lib.platforms.none;
}
) { };
"Cabal_3_10_3_0" = callPackage ( "Cabal_3_10_3_0" = callPackage (
{ {
mkDerivation, mkDerivation,
@@ -257381,28 +257283,6 @@ self: {
genprimopcode = null; genprimopcode = null;
}; };
"ghc-api-compat_8_10_7" = callPackage (
{
mkDerivation,
base,
ghc,
}:
mkDerivation {
pname = "ghc-api-compat";
version = "8.10.7";
sha256 = "1swsly340pj4inmk1l57q4s0dpw8iibl192y1zayvkgc43zky62a";
libraryHaskellDepends = [
base
ghc
];
doHaddock = false;
description = "GHC-API compatibility helpers";
license = lib.licenses.bsd3;
hydraPlatforms = lib.platforms.none;
broken = true;
}
) { };
"ghc-api-compat" = callPackage ( "ghc-api-compat" = callPackage (
{ {
mkDerivation, mkDerivation,
@@ -260884,40 +260764,6 @@ self: {
} }
) { }; ) { };
"ghc-source-gen_0_4_5_0" = callPackage (
{
mkDerivation,
base,
ghc,
ghc-paths,
QuickCheck,
tasty,
tasty-hunit,
tasty-quickcheck,
}:
mkDerivation {
pname = "ghc-source-gen";
version = "0.4.5.0";
sha256 = "18v6i0a6j72brwr7zq0j0igmkzigx3w4a6rdhq8cn768vflpflvv";
libraryHaskellDepends = [
base
ghc
];
testHaskellDepends = [
base
ghc
ghc-paths
QuickCheck
tasty
tasty-hunit
tasty-quickcheck
];
description = "Constructs Haskell syntax trees for the GHC API";
license = lib.licenses.bsd3;
hydraPlatforms = lib.platforms.none;
}
) { };
"ghc-source-gen" = callPackage ( "ghc-source-gen" = callPackage (
{ {
mkDerivation, mkDerivation,
@@ -268874,10 +268720,7 @@ self: {
description = "manage files with git, without checking their contents into git"; description = "manage files with git, without checking their contents into git";
license = lib.licenses.agpl3Only; license = lib.licenses.agpl3Only;
mainProgram = "git-annex"; mainProgram = "git-annex";
maintainers = [ maintainers = [ lib.maintainers.peti ];
lib.maintainers.peti
lib.maintainers.roosemberth
];
} }
) { }; ) { };
@@ -333220,82 +333063,6 @@ self: {
} }
) { inherit (pkgs) libsass; }; ) { inherit (pkgs) libsass; };
"hlint_3_4_1" = callPackage (
{
mkDerivation,
aeson,
ansi-terminal,
base,
bytestring,
cmdargs,
containers,
cpphs,
data-default,
deriving-aeson,
directory,
extra,
file-embed,
filepath,
filepattern,
ghc-lib-parser,
ghc-lib-parser-ex,
hscolour,
process,
refact,
text,
transformers,
uniplate,
unordered-containers,
utf8-string,
vector,
yaml,
}:
mkDerivation {
pname = "hlint";
version = "3.4.1";
sha256 = "0bkk03c9hacvfd73dk89g4r81b50g7pjgw5pavldali4qwss34cz";
revision = "1";
editedCabalFile = "1rdaffg5n179yfcn5zjwjb0bki09qy13gz2ijky455y9pbaz8yz9";
isLibrary = true;
isExecutable = true;
enableSeparateDataOutput = true;
libraryHaskellDepends = [
aeson
ansi-terminal
base
bytestring
cmdargs
containers
cpphs
data-default
deriving-aeson
directory
extra
file-embed
filepath
filepattern
ghc-lib-parser
ghc-lib-parser-ex
hscolour
process
refact
text
transformers
uniplate
unordered-containers
utf8-string
vector
yaml
];
executableHaskellDepends = [ base ];
description = "Source code suggestions";
license = lib.licenses.bsd3;
hydraPlatforms = lib.platforms.none;
mainProgram = "hlint";
maintainers = [ lib.maintainers.maralorn ];
}
) { };
"hlint_3_6_1" = callPackage ( "hlint_3_6_1" = callPackage (
{ {
mkDerivation, mkDerivation,
@@ -666696,75 +666463,6 @@ self: {
} }
) { }; ) { };
"text_2_0_2" = callPackage (
{
mkDerivation,
array,
base,
binary,
bytestring,
containers,
deepseq,
directory,
filepath,
ghc-prim,
QuickCheck,
system-cxx-std-lib,
tasty,
tasty-bench,
tasty-hunit,
tasty-inspection-testing,
tasty-quickcheck,
template-haskell,
transformers,
}:
mkDerivation {
pname = "text";
version = "2.0.2";
sha256 = "1bggb4gq15r7z685w7c7hbm3w4n6day451ickz70d1l919jvwdf7";
revision = "1";
editedCabalFile = "1k25ba7hxgsj155yjmi218lhhyw640r4d4zr105gvhfkcj6gmdbi";
libraryHaskellDepends = [
array
base
binary
bytestring
deepseq
ghc-prim
system-cxx-std-lib
template-haskell
];
testHaskellDepends = [
base
bytestring
deepseq
directory
ghc-prim
QuickCheck
tasty
tasty-hunit
tasty-inspection-testing
tasty-quickcheck
template-haskell
transformers
];
benchmarkHaskellDepends = [
base
bytestring
containers
deepseq
directory
filepath
tasty-bench
transformers
];
doCheck = false;
description = "An efficient packed Unicode text type";
license = lib.licenses.bsd2;
hydraPlatforms = lib.platforms.none;
}
) { };
"text_2_1_2" = callPackage ( "text_2_1_2" = callPackage (
{ {
mkDerivation, mkDerivation,
@@ -721685,66 +721383,6 @@ self: {
} }
) { }; ) { };
"weeder_2_2_0" = callPackage (
{
mkDerivation,
algebraic-graphs,
base,
bytestring,
containers,
dhall,
directory,
filepath,
generic-lens,
ghc,
lens,
mtl,
optparse-applicative,
regex-tdfa,
text,
transformers,
}:
mkDerivation {
pname = "weeder";
version = "2.2.0";
sha256 = "07ylcq8mza4429snaklhfszpg2c0xcp75hyf0jxhi32mpiz7a5v2";
isLibrary = true;
isExecutable = true;
libraryHaskellDepends = [
algebraic-graphs
base
bytestring
containers
dhall
directory
filepath
generic-lens
ghc
lens
mtl
optparse-applicative
regex-tdfa
text
transformers
];
executableHaskellDepends = [
base
bytestring
containers
directory
filepath
ghc
optparse-applicative
transformers
];
description = "Detect dead code";
license = lib.licenses.bsd3;
hydraPlatforms = lib.platforms.none;
mainProgram = "weeder";
maintainers = [ lib.maintainers.maralorn ];
}
) { };
"weeder_2_3_1" = callPackage ( "weeder_2_3_1" = callPackage (
{ {
mkDerivation, mkDerivation,

View File

@@ -9,18 +9,10 @@
}: }:
let let
# These are attributes in compiler that support integer-simple. nativeBignumExcludes = [
integerSimpleIncludes = [
"ghc810"
"ghc8107"
];
nativeBignumExcludes = integerSimpleIncludes ++ [
# haskell.compiler sub groups # haskell.compiler sub groups
"integer-simple"
"native-bignum" "native-bignum"
# Binary GHCs # Binary GHCs
"ghc8107Binary"
"ghc902Binary" "ghc902Binary"
"ghc924Binary" "ghc924Binary"
"ghc963Binary" "ghc963Binary"
@@ -78,10 +70,6 @@ in
bb = pkgsBuildBuild.haskell; bb = pkgsBuildBuild.haskell;
in in
{ {
ghc8107Binary = callPackage ../development/compilers/ghc/8.10.7-binary.nix {
llvmPackages = pkgs.llvmPackages_12;
};
ghc902Binary = callPackage ../development/compilers/ghc/9.0.2-binary.nix { ghc902Binary = callPackage ../development/compilers/ghc/9.0.2-binary.nix {
llvmPackages = pkgs.llvmPackages_12; llvmPackages = pkgs.llvmPackages_12;
}; };
@@ -98,18 +86,6 @@ in
llvmPackages = pkgs.llvmPackages_15; llvmPackages = pkgs.llvmPackages_15;
}; };
ghc8107 = callPackage ../development/compilers/ghc/8.10.7.nix {
bootPkgs = 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
# https://github.com/xattr/xattr/issues/44 and
# https://github.com/xattr/xattr/issues/55 are solved.
inherit (buildPackages.darwin) xattr autoSignDarwinBinariesHook;
buildTargetLlvmPackages = pkgsBuildTarget.llvmPackages_12;
llvmPackages = pkgs.llvmPackages_12;
};
ghc810 = compiler.ghc8107;
ghc928 = callPackage ../development/compilers/ghc/9.2.8.nix { ghc928 = callPackage ../development/compilers/ghc/9.2.8.nix {
bootPkgs = bb.packages.ghc902Binary; bootPkgs = bb.packages.ghc902Binary;
inherit (buildPackages.python311Packages) sphinx; # a distutils issue with 3.12 inherit (buildPackages.python311Packages) sphinx; # a distutils issue with 3.12
@@ -256,20 +232,6 @@ in
llvmPackages = pkgs.llvmPackages_18; llvmPackages = pkgs.llvmPackages_18;
}; };
# The integer-simple attribute set contains all the GHC compilers
# build with integer-simple instead of integer-gmp.
integer-simple =
let
integerSimpleGhcNames = pkgs.lib.filter (name: builtins.elem name integerSimpleIncludes) (
pkgs.lib.attrNames compiler
);
in
pkgs.recurseIntoAttrs (
pkgs.lib.genAttrs integerSimpleGhcNames (
name: compiler.${name}.override { enableIntegerSimple = true; }
)
);
# Starting from GHC 9, integer-{simple,gmp} is replaced by ghc-bignum # Starting from GHC 9, integer-{simple,gmp} is replaced by ghc-bignum
# with "native" and "gmp" backends. # with "native" and "gmp" backends.
native-bignum = native-bignum =
@@ -285,9 +247,11 @@ in
); );
} }
// pkgs.lib.optionalAttrs config.allowAliases { // pkgs.lib.optionalAttrs config.allowAliases {
ghc810 = throw "'haskell.compiler.ghc810' has been removed."; # Added 2025-09-07
ghc90 = throw "'haskell.compiler.ghc90' has been removed."; # Added 2025-09-07 ghc90 = throw "'haskell.compiler.ghc90' has been removed."; # Added 2025-09-07
ghcjs = throw "'haskell.compiler.ghcjs' has been removed. Please use 'pkgsCross.ghcjs' instead."; # Added 2025-09-06 ghcjs = throw "'haskell.compiler.ghcjs' has been removed. Please use 'pkgsCross.ghcjs' instead."; # Added 2025-09-06
ghcjs810 = throw "'haskell.compiler.ghcjs810' has been removed. Please use 'pkgsCross.ghcjs' instead."; # Added 2025-09-06 ghcjs810 = throw "'haskell.compiler.ghcjs810' has been removed. Please use 'pkgsCross.ghcjs' instead."; # Added 2025-09-06
integer-simple = throw "All GHC versions with integer-simple support have been removed."; # Added 2025-09-07
} }
); );
@@ -300,12 +264,6 @@ in
bh = buildPackages.haskell; bh = buildPackages.haskell;
in in
{ {
ghc8107Binary = callPackage ../development/haskell-modules {
buildHaskellPackages = bh.packages.ghc8107Binary;
ghc = bh.compiler.ghc8107Binary;
compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.10.x.nix { };
packageSetConfig = bootstrapPackageSet;
};
ghc902Binary = callPackage ../development/haskell-modules { ghc902Binary = callPackage ../development/haskell-modules {
buildHaskellPackages = bh.packages.ghc902Binary; buildHaskellPackages = bh.packages.ghc902Binary;
ghc = bh.compiler.ghc902Binary; ghc = bh.compiler.ghc902Binary;
@@ -330,12 +288,6 @@ in
compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-9.8.x.nix { }; compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-9.8.x.nix { };
packageSetConfig = bootstrapPackageSet; packageSetConfig = bootstrapPackageSet;
}; };
ghc8107 = callPackage ../development/haskell-modules {
buildHaskellPackages = bh.packages.ghc8107;
ghc = bh.compiler.ghc8107;
compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.10.x.nix { };
};
ghc810 = packages.ghc8107;
ghc928 = callPackage ../development/haskell-modules { ghc928 = callPackage ../development/haskell-modules {
buildHaskellPackages = bh.packages.ghc928; buildHaskellPackages = bh.packages.ghc928;
ghc = bh.compiler.ghc928; ghc = bh.compiler.ghc928;
@@ -393,25 +345,6 @@ in
compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-9.14.x.nix { }; compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-9.14.x.nix { };
}; };
# The integer-simple attribute set contains package sets for all the GHC compilers
# using integer-simple instead of integer-gmp.
integer-simple =
let
integerSimpleGhcNames = pkgs.lib.filter (name: builtins.elem name integerSimpleIncludes) (
pkgs.lib.attrNames packages
);
in
pkgs.lib.genAttrs integerSimpleGhcNames (
name:
packages.${name}.override (oldAttrs: {
ghc = bh.compiler.integer-simple.${name};
buildHaskellPackages = bh.packages.integer-simple.${name};
overrides = pkgs.lib.composeExtensions (oldAttrs.overrides or (_: _: { })) (
_: _: { integer-simple = null; }
);
})
);
native-bignum = native-bignum =
let let
nativeBignumGhcNames = pkgs.lib.filter (name: !(builtins.elem name nativeBignumExcludes)) ( nativeBignumGhcNames = pkgs.lib.filter (name: !(builtins.elem name nativeBignumExcludes)) (
@@ -427,8 +360,10 @@ in
); );
} }
// pkgs.lib.optionalAttrs config.allowAliases { // pkgs.lib.optionalAttrs config.allowAliases {
ghc810 = throw "'haskell.packages.ghc810' has been removed."; # Added 2025-09-07
ghc90 = throw "'haskell.packages.ghc90' has been removed."; # Added 2025-09-07 ghc90 = throw "'haskell.packages.ghc90' has been removed."; # Added 2025-09-07
ghcjs = throw "'haskell.packages.ghcjs' has been removed. Please use 'pkgsCross.ghcjs' instead."; # Added 2025-09-06 ghcjs = throw "'haskell.packages.ghcjs' has been removed. Please use 'pkgsCross.ghcjs' instead."; # Added 2025-09-06
ghcjs810 = throw "'haskell.packages.ghcjs810' has been removed. Please use 'pkgsCross.ghcjs' instead."; # Added 2025-09-06 ghcjs810 = throw "'haskell.packages.ghcjs810' has been removed. Please use 'pkgsCross.ghcjs' instead."; # Added 2025-09-06
integer-simple = throw "All GHC versions with integer-simple support have been removed."; # Added 2025-09-07
}; };
} }

View File

@@ -63,7 +63,6 @@ let
# list of all compilers to test specific packages on # list of all compilers to test specific packages on
released = with compilerNames; [ released = with compilerNames; [
ghc8107
ghc928 ghc928
ghc948 ghc948
ghc963 ghc963
@@ -519,10 +518,6 @@ let
# Cross compilation of GHC # Cross compilation of GHC
haskell.compiler = { haskell.compiler = {
inherit (packagePlatforms pkgs.pkgsCross.riscv64.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. # Latest GHC we are able to cross-compile.
ghc948 ghc948
; ;
@@ -533,8 +528,6 @@ let
# Cross compilation of GHC # Cross compilation of GHC
haskell.compiler = { haskell.compiler = {
inherit (packagePlatforms pkgs.pkgsCross.aarch64-multiplatform.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. # Latest GHC we are able to cross-compile. Uses NCG backend.
ghc948 ghc948
; ;
@@ -554,7 +547,6 @@ let
# from the package sets. Due to (transitively) requiring recent versions # from the package sets. Due to (transitively) requiring recent versions
# of core packages, it is not always reasonable to get cabal-install to # of core packages, it is not always reasonable to get cabal-install to
# work with older compilers. # work with older compilers.
compilerNames.ghc8107
compilerNames.ghc928 compilerNames.ghc928
compilerNames.ghc948 compilerNames.ghc948
] released; ] released;
@@ -574,8 +566,6 @@ let
compilerNames.ghc9102 compilerNames.ghc9102
]; ];
haskell-language-server = lib.subtractLists [ haskell-language-server = lib.subtractLists [
# Support ceased as of 2.3.0.0
compilerNames.ghc8107
# Support ceased as of 2.10.0.0 # Support ceased as of 2.10.0.0
compilerNames.ghc928 compilerNames.ghc928
] released; ] released;
@@ -591,12 +581,6 @@ let
language-nix = released; language-nix = released;
nix-paths = released; nix-paths = released;
titlecase = released; titlecase = released;
ghc-api-compat = [
compilerNames.ghc8107
];
ghc-bignum = [
compilerNames.ghc8107
];
ghc-lib = released; ghc-lib = released;
ghc-lib-parser = released; ghc-lib-parser = released;
ghc-lib-parser-ex = released; ghc-lib-parser-ex = released;
@@ -679,11 +663,8 @@ let
]; ];
}; };
constituents = accumulateDerivations [ constituents = accumulateDerivations [
jobs.pkgsMusl.haskell.compiler.ghc8107Binary
jobs.pkgsMusl.haskell.compiler.ghc8107
jobs.pkgsMusl.haskell.compiler.ghc928 jobs.pkgsMusl.haskell.compiler.ghc928
jobs.pkgsMusl.haskell.compiler.ghcHEAD jobs.pkgsMusl.haskell.compiler.ghcHEAD
jobs.pkgsMusl.haskell.compiler.integer-simple.ghc8107
jobs.pkgsMusl.haskell.compiler.native-bignum.ghc928 jobs.pkgsMusl.haskell.compiler.native-bignum.ghc928
jobs.pkgsMusl.haskell.compiler.native-bignum.ghcHEAD jobs.pkgsMusl.haskell.compiler.native-bignum.ghcHEAD
]; ];