Skip to content

Commit a2cfd5d

Browse files
hamishmackTeofilC
andauthored
Add GHC 9.8.2 (#2170)
* Add GHC-9.8.2 * Fix for genprimopcode (from angerman/fix-aarch64-musl) * Add dummy-ghc materialized files * Fix patch upper bounds * Add materialized files * Update hackage.head * Use latest double-conversion from hackage * Update ghc git versions to 9.10 and 9.11 (HEAD) * GHC Head Fixes * Skip plugin test for git ghc * Avoid building cabal-install with ghc >=9.9 * Avoid old version of Win32 in plan.json * Fix missing ghc-iserv for musl * Fix for hashable * Fix ghc-iserv for profiling * Fix ghc lib build for ghc HEAD * Update debug info check for ghc-internal --------- Co-authored-by: Teo Camarasu <[email protected]>
1 parent 9004d35 commit a2cfd5d

File tree

150 files changed

+39221
-201
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

150 files changed

+39221
-201
lines changed

builder/comp-builder.nix

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{ pkgs, stdenv, buildPackages, ghc, lib, gobject-introspection ? null, haskellLib, makeConfigFiles, haddockBuilder, ghcForComponent, hsPkgs, compiler, runCommand, libffi, gmp, windows, zlib, ncurses, nodejs, nonReinstallablePkgs }@defaults:
1+
{ pkgs, stdenv, buildPackages, pkgsBuildBuild, ghc, lib, gobject-introspection ? null, haskellLib, makeConfigFiles, haddockBuilder, ghcForComponent, hsPkgs, compiler, runCommand, libffi, gmp, windows, zlib, ncurses, nodejs, nonReinstallablePkgs }@defaults:
22
lib.makeOverridable (
33
let self =
44
{ componentId
@@ -194,8 +194,8 @@ let
194194
++ lib.optional (!stdenv.hostPlatform.isGhcjs && builtins.compareVersions defaults.ghc.version "9.8" >= 0)
195195
"--with-ld=${stdenv.cc.bintools.targetPrefix}ld"
196196
++ lib.optionals (stdenv.hostPlatform.isGhcjs) [
197-
"--with-gcc=${buildPackages.emscripten}/bin/emcc"
198-
"--with-ld=${buildPackages.emscripten}/bin/emcc"
197+
"--with-gcc=${pkgsBuildBuild.emscripten}/bin/emcc"
198+
"--with-ld=${pkgsBuildBuild.emscripten}/bin/emcc"
199199
]
200200
++ [ # other flags
201201
(disableFeature dontStrip "executable-stripping")
@@ -635,7 +635,7 @@ let
635635
''))
636636
+ (lib.optionalString doCoverage ''
637637
mkdir -p $out/share
638-
cp -r dist/hpc $out/share
638+
cp -r dist/${lib.optionalString (builtins.compareVersions defaults.ghc.version "9.9" >= 0) "build/extra-compilation-artifacts/"}hpc $out/share
639639
cp dist/setup-config $out/
640640
'')
641641
}

builder/ghc-for-component-wrapper.nix

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@ let
125125
done
126126
127127
''
128+
+ lib.optionalString (stdenv.targetPlatform.isMusl && !haskellLib.isNativeMusl && builtins.compareVersions ghc.version "9.9" >0) ''
129+
ln -s $wrappedGhc/bin/${ghcCommand}-iserv $wrappedGhc/bin/ghc-iserv
130+
ln -s $wrappedGhc/bin/${ghcCommand}-iserv-prof $wrappedGhc/bin/ghc-iserv-prof
131+
''
128132
# Wrap haddock, if the base GHC provides it.
129133
+ ''
130134
if [[ -x "${haddock}/bin/haddock" ]]; then

builder/hspkg-builder.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ let
4646
pkgconfig = if components ? library then components.library.pkgconfig or [] else [];
4747
};
4848
inherit package name src flags patches defaultSetupSrc;
49-
inherit (pkg) preUnpack postUnpack;
49+
inherit (pkg) preUnpack postUnpack prePatch postPatch;
5050
} // lib.optionalAttrs (package.buildType != "Custom") {
5151
nonReinstallablePkgs = ["base" "Cabal"];
5252
});

builder/setup-builder.nix

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
let self =
44
{ component, package, name, src, enableDWARF ? false, flags ? {}, revision ? null, patches ? [], defaultSetupSrc
55
, preUnpack ? component.preUnpack, postUnpack ? component.postUnpack
6-
, prePatch ? null, postPatch ? null
6+
, prePatch ? component.prePatch, postPatch ? component.postPatch
77
, preBuild ? component.preBuild , postBuild ? component.postBuild
88
, preInstall ? component.preInstall , postInstall ? component.postInstall
99
, cleanSrc ? haskellLib.cleanCabalComponent package component "setup" src
@@ -24,9 +24,22 @@ let
2424
inherit fullName flags component enableDWARF nonReinstallablePkgs;
2525
};
2626
hooks = haskellLib.optionalHooks {
27+
prePatch =
28+
# If the package is in a sub directory `cd` there first.
29+
# In some cases the `cleanSrc.subDir` will be empty and the `.cabal`
30+
# file will be in the root of `src` (`cleanSrc.root`). This
31+
# will happen when:
32+
# * the .cabal file is in the projects `src.origSrc or src`
33+
# * the package src was overridden with a value that does not
34+
# include an `origSubDir`
35+
(lib.optionalString (cleanSrc'.subDir != "") ''
36+
cd ${lib.removePrefix "/" cleanSrc'.subDir}
37+
''
38+
) + lib.optionalString (prePatch != null) "\n${prePatch}";
39+
2740
inherit
2841
preUnpack postUnpack
29-
prePatch postPatch
42+
postPatch
3043
preBuild postBuild
3144
preInstall postInstall
3245
;
@@ -109,14 +122,12 @@ let
109122
diff ./Setup $out/bin/Setup
110123
'';
111124
}
112-
// (lib.optionalAttrs (cleanSrc'.subDir != "") {
113-
prePatch =
114-
# If the package is in a sub directory `cd` there first
115-
''
116-
cd ${lib.removePrefix "/" cleanSrc'.subDir}
117-
'';
118-
})
119-
// (lib.optionalAttrs (patches != []) { patches = map (p: if builtins.isFunction p then p { inherit (package.identifier) version; } else p) patches; })
125+
// lib.optionalAttrs (patches != []) {
126+
patches = map (p:
127+
if builtins.isFunction p
128+
then p { inherit (package.identifier) version; }
129+
else p) patches;
130+
}
120131
// hooks
121132
);
122133
in drv; in self

ci.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@
7373
ghc96llvm = true;
7474
ghc98 = true;
7575
ghc98llvm = true;
76-
# ghc98X = true; Disabled for now as there are no changes since 9.8.1 release yet and the current source does not boot with 9.8.1
77-
ghc99 = true;
76+
ghc910X = true;
77+
ghc911 = true;
7878
})));
7979
crossSystems = nixpkgsName: nixpkgs: compiler-nix-name:
8080
# We need to use the actual nixpkgs version we're working with here, since the values

compiler/ghc/default.nix

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,9 @@ let
141141
CrossCompilePrefix = ${targetPrefix}
142142
'' + lib.optionalString isCrossTarget ''
143143
Stage1Only = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"}
144-
''
145-
# GHC 9.0.1 fails to compile for musl unless HADDOC_DOCS = NO
146-
+ lib.optionalString (isCrossTarget || (targetPlatform.isMusl && builtins.compareVersions ghc-version "9.0.1" >= 0)) ''
144+
'' + lib.optionalString (isCrossTarget || targetPlatform.isMusl) ''
147145
HADDOCK_DOCS = NO
146+
'' + ''
148147
BUILD_SPHINX_HTML = NO
149148
BUILD_SPHINX_PDF = NO
150149
'' + lib.optionalString enableRelocatedStaticLibs ''
@@ -247,8 +246,6 @@ let
247246
then "ghc928"
248247
else "ghc962";
249248
in
250-
assert (buildPackages.haskell.compiler ? ${compiler-nix-name}
251-
|| throw "Expected pkgs.haskell.compiler.${compiler-nix-name} for building hadrian");
252249
buildPackages.pinned-haskell-nix.tool compiler-nix-name "hadrian" {
253250
compilerSelection = p: p.haskell.compiler;
254251
index-state = buildPackages.haskell-nix.internalHackageIndexState;
@@ -548,6 +545,10 @@ stdenv.mkDerivation (rec {
548545
mkdir -p $generated/compiler/stage2/build/GHC/Settings
549546
cp _build/stage1/compiler/build/GHC/Settings/Config.hs $generated/compiler/stage2/build/GHC/Settings
550547
fi
548+
if [[ -f compiler/GHC/CmmToLlvm/Version/Bounds.hs ]]; then
549+
mkdir -p $generated/compiler/GHC/CmmToLlvm/Version
550+
cp compiler/GHC/CmmToLlvm/Version/Bounds.hs $generated/compiler/GHC/CmmToLlvm/Version/Bounds.hs
551+
fi
551552
cp _build/stage1/compiler/build/*.hs-incl $generated/compiler/stage2/build || true
552553
''
553554
# Save generated files for needed when building ghc-boot
@@ -773,10 +774,8 @@ stdenv.mkDerivation (rec {
773774
${hadrian}/bin/hadrian ${hadrianArgs} stage1:lib:terminfo
774775
'' + lib.optionalString (installStage1 && !haskell-nix.haskellLib.isCrossTarget) ''
775776
${hadrian}/bin/hadrian ${hadrianArgs} stage2:exe:iserv
776-
# I don't seem to be able to build _build/stage1/lib/bin/ghc-iserv-prof
777-
# by asking hadrian for this. The issue is likely that the profiling way
778-
# is probably missing from hadrian m(
779-
${hadrian}/bin/hadrian ${hadrianArgs} _build/stage1/lib/bin/ghc-iserv-prof
777+
${hadrian}/bin/hadrian ${hadrianArgs} _build/stage1/${
778+
lib.optionalString (builtins.compareVersions ghc-version "9.9" < 0) "lib/"}bin/ghc-iserv-prof
780779
pushd _build/stage1/bin
781780
for exe in *; do
782781
mv $exe ${targetPrefix}$exe
@@ -793,19 +792,17 @@ stdenv.mkDerivation (rec {
793792
then ''
794793
mkdir $out
795794
cp -r _build/stage1/bin $out
796-
${
797-
# These are needed when building the reinstallable lib ghc
798-
if targetPlatform.isMusl
799-
then ''
800-
cp _build/stageBoot/bin/genprimopcode $out/bin
801-
cp _build/stageBoot/bin/deriveConstants $out/bin
802-
'' else ''
803-
cp _build/stageBoot/bin/${targetPrefix}genprimopcode $out/bin
804-
ln -s $out/bin/${targetPrefix}genprimopcode $out/bin/genprimopcode
805-
cp _build/stageBoot/bin/${targetPrefix}deriveConstants $out/bin
806-
ln -s $out/bin/${targetPrefix}deriveConstants $out/bin/deriveConstants
807-
''
808-
}
795+
# let's assume that if we find a non-prefixed genprimop,
796+
# we also find a non-prefixed deriveConstants
797+
if [ -f _build/stageBoot/bin/genprimopcode ]; then
798+
cp _build/stageBoot/bin/genprimopcode $out/bin
799+
cp _build/stageBoot/bin/deriveConstants $out/bin
800+
else
801+
cp _build/stageBoot/bin/${targetPrefix}genprimopcode $out/bin
802+
ln -s $out/bin/${targetPrefix}genprimopcode $out/bin/genprimopcode
803+
cp _build/stageBoot/bin/${targetPrefix}deriveConstants $out/bin
804+
ln -s $out/bin/${targetPrefix}deriveConstants $out/bin/deriveConstants
805+
fi
809806
cp -r _build/stage1/lib $out
810807
mkdir $doc
811808
cp -r _build/stage1/share $doc

flake.lock

Lines changed: 24 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
# And later it breaks in th-dll due to some change in the windows libs. We should probably
1515
# drop unsable.
1616
nixpkgs-unstable = { url = "github:NixOS/nixpkgs?rev=47585496bcb13fb72e4a90daeea2f434e2501998"; }; # nixpkgs-unstable };
17-
ghc98X = {
17+
ghc910X = {
1818
flake = false;
19-
url = "git+https://gitlab.haskell.org/ghc/ghc?ref=ghc-9.8&submodules=1";
19+
url = "git+https://gitlab.haskell.org/ghc/ghc?ref=ghc-9.10&submodules=1";
2020
};
21-
ghc99 = {
21+
ghc911 = {
2222
flake = false;
2323
url = "git+https://gitlab.haskell.org/ghc/ghc?submodules=1";
2424
};
@@ -79,9 +79,7 @@
7979
flake = false;
8080
};
8181
iserv-proxy = {
82-
type = "git";
83-
url = "https://gitlab.haskell.org/hamishmack/iserv-proxy.git";
84-
ref = "hkm/remote-iserv";
82+
url = "github:stable-haskell/iserv-proxy?ref=iserv-syms";
8583
flake = false;
8684
};
8785
};

lib/cover-project.nix

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ in pkgs.runCommand "project-coverage-report"
8282
fi
8383
8484
# Copy mix, tix, and html information over from each report
85-
if [ -d "$report/share/hpc/vanilla/mix/$identifier" ]; then
86-
cp -Rn $report/share/hpc/vanilla/mix/$identifier $out/share/hpc/vanilla/mix/
87-
fi
85+
for f in $report/share/hpc/vanilla/mix/$identifier*; do
86+
cp -Rn $f $out/share/hpc/vanilla/mix
87+
done
8888
cp -R $report/share/hpc/vanilla/tix/* $out/share/hpc/vanilla/tix/
8989
cp -R $report/share/hpc/vanilla/html/* $out/share/hpc/vanilla/html/
9090
'') coverageReports)}

lib/cover.nix

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
}:
1717

1818
let
19-
mixDir = l: "${l}/share/hpc/vanilla/mix/${l.identifier.name}-${l.identifier.version}";
20-
mixDirs = map mixDir mixLibraries;
21-
2219
srcDirs = map (l: l.srcSubDirPath) mixLibraries;
2320

2421
in pkgs.runCommand (name + "-coverage-report")
@@ -49,13 +46,17 @@ in pkgs.runCommand (name + "-coverage-report")
4946
}
5047
local mixDirArgs=$(mktemp)
5148
${ # Copy out mix files used for this report
52-
lib.concatStrings (map (mixDir: ''
53-
local dir=${mixDir}
54-
echo --hpcdir=$dir >> $mixDirArgs
49+
lib.concatStrings (map (l: ''
50+
local mixDir=${l}/share/hpc/vanilla/mix
51+
local dir=$mixDir/${l.identifier.name}-${l.identifier.version}
5552
if [ -d $dir ]; then
56-
cp -R "$dir" $out/share/hpc/vanilla/mix/
53+
echo --hpcdir=$dir >> $mixDirArgs
54+
cp -R $dir $out/share/hpc/vanilla/mix/
55+
elif [ -n "$(ls -A $mixDir)" ]; then
56+
echo --hpcdir=$mixDir >> $mixDirArgs
57+
cp -R $mixDir/* $out/share/hpc/vanilla/mix/
5758
fi
58-
'') mixDirs)
59+
'') mixLibraries)
5960
}
6061
local includeArgs=$(mktemp)
6162
find $out/share/hpc/vanilla/mix/ -type f \

0 commit comments

Comments
 (0)