haskell.compiler.ghc8102BinaryMinimal: init

To stay within hydra limit of 2^31 output size on aarch64-linux
This commit is contained in:
Robert Hensing 2020-11-03 10:18:21 +01:00
parent fe9f55907e
commit f8ad73b9d8
2 changed files with 37 additions and 4 deletions

View File

@ -2,6 +2,14 @@
, fetchurl, perl, gcc
, ncurses6, gmp, glibc, libiconv, numactl
, llvmPackages
# 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.
# Examples of unnecessary files are the bundled documentation and files that
# are only needed for profiling builds.
, minimal ? false
}:
# Prebuilt only does native
@ -172,6 +180,13 @@ stdenv.mkDerivation rec {
for file in $(find "$out" -name setup-config); do
substituteInPlace $file --replace /usr/bin/ranlib "$(type -P ranlib)"
done
'' +
stdenv.lib.optionalString minimal ''
# Remove profiling objects
find $out -type f -name '*.p_o' -delete
rm $out/lib/ghc-*/bin/ghc-iserv-prof
# Remove docs
rm -r $out/share/{doc,man}
'';
doInstallCheck = true;
@ -195,11 +210,18 @@ stdenv.mkDerivation rec {
enableShared = true;
};
meta = {
meta = let
platforms = ["x86_64-linux" "armv7l-linux" "aarch64-linux" "i686-linux" "x86_64-darwin"];
in {
homepage = "http://haskell.org/ghc";
description = "The Glasgow Haskell Compiler";
license = stdenv.lib.licenses.bsd3;
platforms = ["x86_64-linux" "armv7l-linux" "aarch64-linux" "i686-linux" "x86_64-darwin"];
# The minimal variation can not be distributed because it removes the
# documentation, including licensing information that is required for
# distribution.
inherit platforms;
hydraPlatforms = stdenv.lib.optionals (!minimal) platforms;
maintainers = with stdenv.lib.maintainers; [ lostnet ];
};
}

View File

@ -54,6 +54,11 @@ in {
llvmPackages = pkgs.llvmPackages_9;
};
ghc8102BinaryMinimal = callPackage ../development/compilers/ghc/8.10.2-binary.nix {
llvmPackages = pkgs.llvmPackages_9;
minimal = true;
};
ghc865 = callPackage ../development/compilers/ghc/8.6.5.nix {
bootPkgs = packages.ghc822Binary;
inherit (buildPackages.python3Packages) sphinx;
@ -75,7 +80,7 @@ in {
ghc884 = callPackage ../development/compilers/ghc/8.8.4.nix {
# aarch64 ghc865Binary gets SEGVs due to haskell#15449 or similar
bootPkgs = if stdenv.isAarch64 then
packages.ghc8102Binary
packages.ghc8102BinaryMinimal
else
packages.ghc865Binary;
inherit (buildPackages.python3Packages) sphinx;
@ -91,7 +96,7 @@ in {
ghc8102 = callPackage ../development/compilers/ghc/8.10.2.nix {
# aarch64 ghc865Binary gets SEGVs due to haskell#15449 or similar
bootPkgs = if stdenv.isAarch64 then
packages.ghc8102Binary
packages.ghc8102BinaryMinimal
else
packages.ghc865Binary;
inherit (buildPackages.python3Packages) sphinx;
@ -164,6 +169,12 @@ in {
compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.10.x.nix { };
packageSetConfig = bootstrapPackageSet;
};
ghc8102BinaryMinimal = callPackage ../development/haskell-modules {
buildHaskellPackages = bh.packages.ghc8102BinaryMinimal;
ghc = bh.compiler.ghc8102BinaryMinimal;
compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.10.x.nix { };
packageSetConfig = bootstrapPackageSet;
};
ghc865 = callPackage ../development/haskell-modules {
buildHaskellPackages = bh.packages.ghc865;
ghc = bh.compiler.ghc865;