@@ -12,13 +12,24 @@
1212 "R1909" = "nixpkgs-1909";
1313 "R2003" = "nixpkgs-2003";
1414 };
15− compilerNixNames = nixpkgsName: nixpkgs: builtins.mapAttrs (compiler-nix-name: _:
16− (import ./default.nix { inherit checkMaterialization; }).nixpkgsArgs) ({
17− ghc865 = {};
18− } // nixpkgs.lib.optionalAttrs (nixpkgsName == "R2003") {
19− ghc884 = {};
20− ghc8102 = {};
21− });
15+ compilerNixNames = nixpkgsName: nixpkgs: builtins.mapAttrs (compiler-nix-name: runTests: {
16+ inherit (import ./default.nix { inherit checkMaterialization; }) nixpkgsArgs;
17+ inherit runTests;
18+ }) (
19+ # GHC version to cache and whether to run the tests against them.
20+ # This list of GHC versions should include everything for which we
21+ # have a ./materialized/ghcXXX directory containing the materialized
22+ # cabal-install and nix-tools plans. When removing a ghc version
23+ # from here (so that is no longer cached) also remove ./materialized/ghcXXX.
24+ # Update supported-ghc-versions.md to reflect any changes made here.
25+ {
26+ ghc865 = true;
27+ } // nixpkgs.lib.optionalAttrs (nixpkgsName == "R2003") {
28+ ghc883 = false;
29+ ghc884 = true;
30+ ghc8101 = false;
31+ ghc8102 = true;
32+ });
2233 systems = nixpkgs: nixpkgs.lib.filterAttrs (_: v: builtins.elem v supportedSystems) {
2334 # I wanted to take these from 'lib.systems.examples', but apparently there isn't one for linux!
2435 linux = "x86_64-linux";
@@ -28,7 +39,7 @@
2839 # We need to use the actual nixpkgs version we're working with here, since the values
2940 # of 'lib.systems.examples' are not understood between all versions
3041 let lib = nixpkgs.lib;
31− in lib.optionalAttrs (system == "x86_64-linux" && compiler-nix-name != "ghc8102") {
42+ in lib.optionalAttrs (system == "x86_64-linux" && compiler-nix-name != "ghc8101" && compiler-nix-name != "ghc8102") {
3243 # Windows cross compilation is currently broken on macOS
3344 inherit (lib.systems.examples) mingwW64;
3445 } // lib.optionalAttrs (system == "x86_64-linux") {
@@ -41,7 +52,7 @@ dimension "Nixpkgs version" nixpkgsVersions (nixpkgsName: nixpkgs-pin:
4152 let pinnedNixpkgsSrc = sources.${nixpkgs-pin};
4253 # We need this for generic nixpkgs stuff at the right version
4354 genericPkgs = import pinnedNixpkgsSrc {};
44− in dimension "GHC version" (compilerNixNames nixpkgsName genericPkgs) (compiler-nix-name: nixpkgsArgs:
55+ in dimension "GHC version" (compilerNixNames nixpkgsName genericPkgs) (compiler-nix-name: {nixpkgsArgs, runTests}:
4556 dimension "System" (systems genericPkgs) (systemName: system:
4657 let pkgs = import pinnedNixpkgsSrc (nixpkgsArgs // { inherit system; });
4758 build = import ./build.nix { inherit pkgs ifdLevel compiler-nix-name; };
@@ -50,8 +61,10 @@ dimension "Nixpkgs version" nixpkgsVersions (nixpkgsName: nixpkgs-pin:
5061 # Native builds
5162 # TODO: can we merge this into the general case by picking an appropriate "cross system" to mean native?
5263 native = pkgs.recurseIntoAttrs ({
53− inherit (build) tests tools maintainer-scripts maintainer-script-cache;
64+ roots = pkgs.haskell-nix.roots' compiler-nix-name ifdLevel;
5465 ghc = pkgs.buildPackages.haskell-nix.compiler."${compiler-nix-name}";
66+ } // pkgs.lib.optionalAttrs runTests {
67+ inherit (build) tests tools maintainer-scripts maintainer-script-cache;
5568 } // pkgs.lib.optionalAttrs (ifdLevel >= 1) {
5669 iserv-proxy = pkgs.ghc-extra-packages."${compiler-nix-name}".iserv-proxy.components.exes.iserv-proxy;
5770 } // pkgs.lib.optionalAttrs (ifdLevel >= 3) {
@@ -63,21 +76,17 @@ dimension "Nixpkgs version" nixpkgsVersions (nixpkgsName: nixpkgs-pin:
6376 # Cross builds
6477 let pkgs = import pinnedNixpkgsSrc (nixpkgsArgs // { inherit system crossSystem; });
6578 build = import ./build.nix { inherit pkgs ifdLevel compiler-nix-name; };
66− in pkgs.recurseIntoAttrs (pkgs.lib.optionalAttrs (ifdLevel >= 1) {
67− ghc = pkgs.buildPackages.haskell-nix.compiler."${compiler-nix-name}";
68− # TODO: look into cross compiling ghc itself
69− # ghc = pkgs.haskell-nix.compiler."${compiler-nix-name}";
70− # TODO: look into making tools work when cross compiling
71− # inherit (build) tools;
72− # Tests are broken on aarch64 cross https://github.com/input-output-hk/haskell.nix/issues/513
73− tests =
74− if (crossSystemName != "aarch64-multiplatform")
75− then build.tests
76− else pkgs.recurseIntoAttrs {
77− # Even on aarch64 we still want to build the pinned files
78− inherit (build.tests) roots;
79− };
80− } // pkgs.lib.optionalAttrs (ifdLevel >= 2) {
79+ in pkgs.recurseIntoAttrs (pkgs.lib.optionalAttrs (ifdLevel >= 1) ({
80+ roots = pkgs.haskell-nix.roots' compiler-nix-name ifdLevel;
81+ ghc = pkgs.buildPackages.haskell-nix.compiler."${compiler-nix-name}";
82+ # TODO: look into cross compiling ghc itself
83+ # ghc = pkgs.haskell-nix.compiler."${compiler-nix-name}";
84+ # TODO: look into making tools work when cross compiling
85+ # inherit (build) tools;
86+ } // pkgs.lib.optionalAttrs (runTests && crossSystemName != "aarch64-multiplatform") {
87+ # Tests are broken on aarch64 cross https://github.com/input-output-hk/haskell.nix/issues/513
88+ inherit (build) tests;
89+ }) // pkgs.lib.optionalAttrs (ifdLevel >= 2) {
8190 remote-iserv = pkgs.ghc-extra-packages."${compiler-nix-name}".remote-iserv.components.exes.remote-iserv;
8291 iserv-proxy = pkgs.ghc-extra-packages."${compiler-nix-name}".iserv-proxy.components.exes.iserv-proxy;
8392 } // pkgs.lib.optionalAttrs (ifdLevel >= 3) {