on fa2fa13 help sign in
45 lines 3.8 kB history raw
1# This is for checking the materialization of new GHC versions
2# See docs/adding-new-ghc.md for more details.
3{ compiler-nix-name ? throw "Please pass `compiler-nix-name` or `compiler-nix-names`", compiler-nix-names ? [ compiler-nix-name ], systems ? [ builtins.currentSystem ] }:
4let
5 eval = (import ../../. {}).pkgs;
6in builtins.listToAttrs (builtins.concatMap (system: builtins.concatMap (compiler-nix-name:
7 let haskellNix = import ../../. { checkMaterialization = true; inherit system; };
8 pkgs = haskellNix.pkgs-unstable;
9 inherit (pkgs.haskell-nix.compiler.${compiler-nix-name}) version;
10 # Older versions of GHC do not work with the latest nixpkgs.
11 pkgsForWindows =
12 if __compareVersions version "8.10" >= 0
13 then pkgs
14 else import haskellNix.sources.nixpkgs-2105
15 (haskellNix.nixpkgsArgs // { localSystem = { inherit system; }; });
16 prefix = "${system}-${compiler-nix-name}";
17 in
18 # Exclude version that are older than the boot compiler
19 eval.lib.optionals (
20 (system != "aarch64-linux" || !__elem compiler-nix-name ["ghc865" "ghc881" "ghc882" "ghc8101" "ghc8102" "ghc8103" "ghc8104" "ghc810420210212"])
21 && (system != "aarch64-darwin" || !__elem compiler-nix-name ["ghc865" "ghc881" "ghc882" "ghc883" "ghc884" "ghc8101" "ghc8102" "ghc8103" "ghc8104" "ghc810420210212" "ghc8105" "ghc8106"])
22 && (system != "x86_64-darwin" || !__elem compiler-nix-name ["ghc8102" "ghc8103"])) ([
23 # This set of derivations should be enough to ensure all the materialized files for a
24 # given GHC version are checked.
25 { name = "${prefix}-cabal-install"; value = pkgs.haskell-nix.cabal-install.${compiler-nix-name}; }
26 { name = "${prefix}-nix-tools"; value = pkgs.haskell-nix.nix-tools.${compiler-nix-name}; }
27 { name = "${prefix}-extra"; value = pkgs.ghc-extra-projects.${compiler-nix-name}.plan-nix; }
28 { name = "${prefix}-boot"; value = pkgs.ghc-boot-packages-nix.${compiler-nix-name}; }
29 { name = "${prefix}-hello"; value = pkgs.haskell-nix.tool compiler-nix-name "hello" {}; }
30] ++ eval.lib.optionals (!__elem system ["aarch64-darwin" "aarch64-linux"]) [
31 { name = "${prefix}-windows"; value = pkgsForWindows.pkgsCross.mingwW64.ghc-extra-projects.${compiler-nix-name}.plan-nix; }
32 { name = "${prefix}-hello-windows"; value = pkgsForWindows.pkgsCross.mingwW64.haskell-nix.tool compiler-nix-name "hello" {}; }
33] ++ eval.lib.optionals (system == "x86_64-linux") [
34 # In some cased you may need comment out one or more of these if the GHC version needed cannot be built.
35 { name = "${prefix}-musl"; value = pkgs.pkgsCross.musl64.ghc-extra-projects.${compiler-nix-name}.plan-nix; }
36 { name = "${prefix}-hello-musl"; value = pkgs.pkgsCross.musl64.haskell-nix.tool compiler-nix-name "hello" {}; }
37] ++ eval.lib.optionals (system == "x86_64-linux" && __elem compiler-nix-name ["ghc884" "ghc8105" "ghc8106" "ghc8107"]) [
38 { name = "${prefix}-arm"; value = pkgs.pkgsCross.aarch64-multiplatform.ghc-extra-projects.${compiler-nix-name}.plan-nix; }
39] ++ eval.lib.optionals (system == "x86_64-linux" && __elem compiler-nix-name ["ghc884" "ghc8106" "ghc8107"]) [
40 { name = "${prefix}-hello-arm"; value = pkgs.pkgsCross.aarch64-multiplatform.haskell-nix.tool compiler-nix-name "hello" {}; }
41] ++ eval.lib.optionals (!__elem system ["aarch64-darwin" "aarch64-linux"] && __elem compiler-nix-name ["ghc865" "ghc884" "ghc8105" "ghc8106" "ghc8107"]) [
42 { name = "${prefix}-ghcjs"; value = pkgs.pkgsCross.ghcjs.ghc-extra-projects.${compiler-nix-name}.plan-nix; }
43 { name = "${prefix}-hello-ghcjs"; value = pkgs.pkgsCross.ghcjs.haskell-nix.tool compiler-nix-name "hello" {}; }
44])) compiler-nix-names) systems)