Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
fdd1f72
Add prerelease ghc 9.8.1 from GitLab commit
hamishmack Jul 4, 2023
0889324
ifdLevel 0
hamishmack Jul 4, 2023
9bff810
Fixes for ghc 9.8.1
hamishmack Jul 5, 2023
1bde375
Add some materialized files
hamishmack Jul 5, 2023
07d55d7
More materialization
hamishmack Jul 5, 2023
ea7166e
Fixes for ghc js backend 9.6 and 9.8
hamishmack Jul 7, 2023
195c915
Materialized files
hamishmack Jul 7, 2023
67f46e7
JS: support -this-unit-id for programs in the linker
hamishmack Jul 7, 2023
d8b821c
Fix comment
hamishmack Jul 7, 2023
e54a999
ifdLevel 1
hamishmack Jul 7, 2023
99c1095
ifdLevel 2
hamishmack Jul 7, 2023
eba653e
Merge remote-tracking branch 'origin/master' into hkm/ghc-981
hamishmack Jul 7, 2023
b856e20
Merge remote-tracking branch 'origin/master' into hkm/ghc-981
hamishmack Jul 10, 2023
829c72d
Fix tests
hamishmack Jul 10, 2023
cd0edc4
Fix tests
hamishmack Jul 10, 2023
63bab6a
Haskell Language Server 2.0.0.1
hamishmack Jul 10, 2023
c0aff59
ifdLevel 3
hamishmack Jul 10, 2023
6248e83
Fix tests
hamishmack Jul 10, 2023
cc60821
Fix building hoogle with new index-state
hamishmack Jul 10, 2023
7368477
Fix building hoogle
hamishmack Jul 10, 2023
3268011
Fix cabal-simple test
hamishmack Jul 10, 2023
ea9cd2a
Fix cabal-simple-prof test
hamishmack Jul 11, 2023
e0fc082
Fix cabal-source-repo test
hamishmack Jul 11, 2023
4233b16
More ghc 9.8 fixes
hamishmack Jul 11, 2023
370ae03
Fix tests
hamishmack Jul 11, 2023
806dffe
Fix githash test for ghc 9.8
hamishmack Jul 11, 2023
7024cb5
Fix for reinstallable ghc
hamishmack Jul 12, 2023
b1d1efa
Fix genprimopcode
hamishmack Jul 12, 2023
7346549
ifdLevel 0
hamishmack Jul 12, 2023
023ec2d
Fix older hadrian ghc versions
hamishmack Jul 12, 2023
f670217
Enable cross compilers
hamishmack Jul 12, 2023
5e27cec
Fix patch bounds
hamishmack Jul 12, 2023
80cdf25
Patch for windows cross compilation
hamishmack Jul 12, 2023
558f8ab
Fix ghcjs configured-src
hamishmack Jul 12, 2023
0107f3a
Add materialized files
hamishmack Jul 12, 2023
531970c
ifdLevel 2
hamishmack Jul 12, 2023
70e169f
Add materialized files
hamishmack Jul 12, 2023
145d42d
ifdLevel 3
hamishmack Jul 12, 2023
4be2e53
Add materialized files
hamishmack Jul 13, 2023
8224910
Add materialized files
hamishmack Jul 13, 2023
608c063
Mark tests as broken
hamishmack Jul 13, 2023
4806df9
Mark tests as broken
hamishmack Jul 13, 2023
2bdd5b4
Merge remote-tracking branch 'origin/master' into hkm/ghc-981
hamishmack Jul 23, 2023
ed1d794
ifdLevel 0
hamishmack Jul 23, 2023
a6236fe
ifdLevel 1
hamishmack Jul 23, 2023
8ec59dc
ifdLevel 2
hamishmack Jul 24, 2023
6bfac12
ifdLevel 3
hamishmack Jul 24, 2023
9d691b5
Skip tests broken by lens
hamishmack Jul 24, 2023
a3749a1
Merge remote-tracking branch 'origin/master' into hkm/ghc-981
hamishmack Jul 24, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion build.nix
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ in rec {
inherit evalPackages;
src = pkgs.haskell-nix.sources."hls-1.10";
};
} // {
} // pkgs.lib.optionalAttrs (__compareVersions haskell.compiler.${compiler-nix-name}.version "9.8" < 0) {
"hls-20" = tool compiler-nix-name "haskell-language-server" {
inherit evalPackages;
src = pkgs.haskell-nix.sources."hls-2.0";
Expand Down
5 changes: 3 additions & 2 deletions builder/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,11 @@ let
then pkgs.path
else pkgs.haskell-nix.sources.nixpkgs-2205;
nixpkgsHoogle = import (nixpkgs + /pkgs/development/haskell-modules/hoogle.nix);
in { packages ? [], hoogle ? pkgs.buildPackages.haskell-nix.tool "ghc8107" "hoogle" {
in { packages ? [], hoogle ? pkgs.buildPackages.haskell-nix.tool "ghc928" "hoogle" {
inherit evalPackages;
version = "5.0.18.3";
index-state = pkgs.haskell-nix.internalHackageIndexState;
# index-state = pkgs.haskell-nix.internalHackageIndexState;
index-state = "2023-06-05T00:00:00Z";
}
}:
let
Expand Down
15 changes: 8 additions & 7 deletions ci.nix
Original file line number Diff line number Diff line change
Expand Up @@ -66,30 +66,31 @@
ghc928 = true;
ghc945 = true;
ghc962 = true;
ghc9820230704 = true;
}));
crossSystems = nixpkgsName: nixpkgs: compiler-nix-name:
# We need to use the actual nixpkgs version we're working with here, since the values
# of 'lib.systems.examples' are not understood between all versions
let lib = nixpkgs.lib;
in lib.optionalAttrs (nixpkgsName == "unstable"
&& ((system == "x86_64-linux" && __elem compiler-nix-name ["ghc8107" "ghc962"])
|| (system == "aarch64-linux" && __elem compiler-nix-name ["ghc8107" "ghc962"])
|| (system == "x86_64-darwin" && __elem compiler-nix-name ["ghc8107" "ghc962"])
|| (system == "aarch64-darwin" && __elem compiler-nix-name ["ghc8107" "ghc962"])
&& ((system == "x86_64-linux" && __elem compiler-nix-name ["ghc8107" "ghc962" "ghc9820230704"])
|| (system == "aarch64-linux" && __elem compiler-nix-name ["ghc8107" "ghc962" "ghc9820230704"])
|| (system == "x86_64-darwin" && __elem compiler-nix-name ["ghc8107" "ghc962" "ghc9820230704"])
|| (system == "aarch64-darwin" && __elem compiler-nix-name ["ghc8107" "ghc962" "ghc9820230704"])
)) {
inherit (lib.systems.examples) ghcjs;
} // lib.optionalAttrs (nixpkgsName == "unstable"
&& ((system == "x86_64-linux" && __elem compiler-nix-name ["ghc8107" "ghc902" "ghc926" "ghc927" "ghc928" "ghc945" "ghc962"])
&& ((system == "x86_64-linux" && __elem compiler-nix-name ["ghc8107" "ghc902" "ghc926" "ghc927" "ghc928" "ghc945" "ghc962" "ghc9820230704"])
|| (system == "x86_64-darwin" && __elem compiler-nix-name []))) { # TODO add ghc versions when we have more darwin build capacity
inherit (lib.systems.examples) mingwW64;
} // lib.optionalAttrs (system == "x86_64-linux" && nixpkgsName == "unstable" && __elem compiler-nix-name ["ghc8107" "ghc902" "ghc922" "ghc923" "ghc924" "ghc926" "ghc927" "ghc928" "ghc945" "ghc962"]) {
} // lib.optionalAttrs (system == "x86_64-linux" && nixpkgsName == "unstable" && __elem compiler-nix-name ["ghc8107" "ghc902" "ghc922" "ghc923" "ghc924" "ghc926" "ghc927" "ghc928" "ghc945" "ghc962" "ghc9820230704"]) {
# Musl cross only works on linux
# aarch64 cross only works on linux
inherit (lib.systems.examples) musl64 aarch64-multiplatform;
} // lib.optionalAttrs (system == "x86_64-linux" && nixpkgsName == "unstable" && __elem compiler-nix-name ["ghc927" "ghc928"]) {
# TODO fix this for the compilers we build with hadrian (ghc >=9.4)
inherit (lib.systems.examples) aarch64-multiplatform-musl;
} // lib.optionalAttrs (system == "aarch64-linux" && nixpkgsName == "unstable" && __elem compiler-nix-name ["ghc927" "ghc928" "ghc945" "ghc962"]) {
} // lib.optionalAttrs (system == "aarch64-linux" && nixpkgsName == "unstable" && __elem compiler-nix-name ["ghc927" "ghc928" "ghc945" "ghc962" "ghc9820230704"]) {
inherit (lib.systems.examples) aarch64-multiplatform-musl;
};
isDisabled = d: d.meta.disabled or false;
Expand Down
44 changes: 32 additions & 12 deletions compiler/ghc/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ assert enableNativeBignum -> !enableIntegerSimple;
assert enableIntegerSimple -> !enableNativeBignum;

let
src = src-spec.file or fetchurl { inherit (src-spec) url sha256; };
src = src-spec.file or (fetchurl { inherit (src-spec) url sha256; });

inherit (stdenv) buildPlatform hostPlatform targetPlatform;
inherit (haskell-nix.haskellLib) isCrossTarget;
Expand Down Expand Up @@ -241,7 +241,9 @@ let
then ../../materialized/ghc8107/hadrian-ghc92
else if builtins.compareVersions ghc-version "9.6" < 0
then ../../materialized/ghc8107/hadrian-ghc94
else ../../materialized/ghc8107/hadrian-ghc96;
else if builtins.compareVersions ghc-version "9.8" < 0
then ../../materialized/ghc8107/hadrian-ghc96
else ../../materialized/ghc8107/hadrian-ghc98;
modules = [{
# Apply the patches in a way that does not require using something
# like `srcOnly`. The problem with `pkgs.srcOnly` was that it had to run
Expand Down Expand Up @@ -342,9 +344,8 @@ stdenv.mkDerivation (rec {
patches = ghc-patches;

# configure was run by configured-src already.
phases = [ "unpackPhase" "patchPhase" ]
++ lib.optional (ghc-patches != [] && !stdenv.targetPlatform.isGhcjs) "autoreconfPhase" # autoreconf can replace config.sub with one that is missing ghcjs
++ [ "configurePhase" "buildPhase"
phases = [ "unpackPhase" "patchPhase" "autoreconfPhase"
"configurePhase" "buildPhase"
"checkPhase" "installPhase"
"fixupPhase"
"installCheckPhase"
Expand All @@ -358,11 +359,14 @@ stdenv.mkDerivation (rec {
for env in $(env | grep '^TARGET_' | sed -E 's|\+?=.*||'); do
export "''${env#TARGET_}=''${!env}"
done
'' + lib.optionalString (targetPlatform.isGhcjs) ''
''
# Use emscripten and the `config.sub` saved by `postPatch`
+ lib.optionalString (targetPlatform.isGhcjs) ''
export CC="${targetCC}/bin/emcc"
export CXX="${targetCC}/bin/em++"
export LD="${targetCC}/bin/emcc"
export EM_CACHE=$(mktemp -d)
mv config.sub.ghcjs config.sub
''
# GHC is a bit confused on its cross terminology, as these would normally be
# the *host* tools.
Expand Down Expand Up @@ -425,8 +429,8 @@ stdenv.mkDerivation (rec {
echo '${ghc-version-date}' > VERSION_DATE
''
# The official ghc 9.2.3 tarball requires booting.
+ lib.optionalString (ghc-version == "9.2.3") ''
./boot
+ lib.optionalString (ghc-version == "9.2.3" || ghc-version == "9.8.20230704") ''
python3 ./boot
'';

configurePlatforms = [ "build" "host" ] ++ lib.optional (!targetPlatform.isGhcjs) "target";
Expand Down Expand Up @@ -626,14 +630,18 @@ stdenv.mkDerivation (rec {
mkdir $doc
mkdir $generated
'';
phases = [ "unpackPhase" "patchPhase" ]
++ lib.optional (ghc-patches != []) "autoreconfPhase"
++ [ "configurePhase" "installPhase"];
phases = [ "unpackPhase" "patchPhase" "autoreconfPhase"
"configurePhase" "installPhase"];
} // lib.optionalAttrs useHadrian {
postConfigure = ''
for a in libraries/*/*.cabal.in utils/*/*.cabal.in compiler/ghc.cabal.in; do
${hadrian}/bin/hadrian ${hadrianArgs} "''${a%.*}"
done
'' + lib.optionalString (builtins.compareVersions ghc-version "9.8.1" >= 0) ''
for a in bytearray-access-ops.txt.pp addr-access-ops.txt.pp primops.txt; do
${hadrian}/bin/hadrian ${hadrianArgs} _build/stage0/compiler/build/$a
cp _build/stage0/compiler/build/$a compiler/GHC/Builtin/$a
done
'' + lib.optionalString stdenv.isDarwin ''
substituteInPlace mk/system-cxx-std-lib-1.0.conf \
--replace 'dynamic-library-dirs:' 'dynamic-library-dirs: ${libcxx}/lib ${libcxxabi}/lib'
Expand All @@ -644,6 +652,12 @@ stdenv.mkDerivation (rec {
--replace 'cross-compiling = YES' \
'cross-compiling = NO'
'';
} // lib.optionalAttrs targetPlatform.isGhcjs {
# Backup the config.sub that knows what `ghcjs` is in case
# `autoreconfPhase` replaces it
postPatch = ''
cp config.sub config.sub.ghcjs
'';
});

# Used to detect non haskell-nix compilers (accidental use of nixpkgs compilers can lead to unexpected errors)
Expand Down Expand Up @@ -671,6 +685,12 @@ stdenv.mkDerivation (rec {
# Needed for `haddock` to work on source that includes non ASCII chars
LANG = "en_US.UTF-8";
LC_ALL = "en_US.UTF-8";
} // lib.optionalAttrs targetPlatform.isGhcjs {
# Backup the config.sub that knows what `ghcjs` is in case
# `autoreconfPhase` replaces it
postPatch = ''
cp config.sub config.sub.ghcjs
'';
} // lib.optionalAttrs (stdenv.buildPlatform.libc == "glibc") {
LOCALE_ARCHIVE = "${buildPackages.glibcLocales}/lib/locale/locale-archive";
} // lib.optionalAttrs targetPlatform.useAndroidPrebuilt {
Expand Down Expand Up @@ -715,7 +735,7 @@ stdenv.mkDerivation (rec {
'';
buildPhase = ''
${hadrian}/bin/hadrian ${hadrianArgs}
'' + lib.optionalString (installStage1 && !stdenv.targetPlatform.isGhcjs) ''
'' + lib.optionalString (installStage1 && !stdenv.targetPlatform.isGhcjs && builtins.compareVersions ghc-version "9.8" < 0) ''
${hadrian}/bin/hadrian ${hadrianArgs} stage1:lib:libiserv
'' + lib.optionalString targetPlatform.isMusl ''
${hadrian}/bin/hadrian ${hadrianArgs} stage1:lib:terminfo
Expand Down
8 changes: 4 additions & 4 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading