@@ -12,13 +12,24 @@
12 "R1909" = "nixpkgs-1909";
12 "R1909" = "nixpkgs-1909";
13 "R2003" = "nixpkgs-2003";
13 "R2003" = "nixpkgs-2003";
15− compilerNixNames = nixpkgsName: nixpkgs: builtins.mapAttrs (compiler-nix-name: _:
15+ compilerNixNames = nixpkgsName: nixpkgs: builtins.mapAttrs (compiler-nix-name: runTests: {
16− (import ./default.nix { inherit checkMaterialization; }).nixpkgsArgs) ({
16+ inherit (import ./default.nix { inherit checkMaterialization; }) nixpkgsArgs;
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.
17− ghc865 = {};
26+ ghc865 = true;
18− } // nixpkgs.lib.optionalAttrs (nixpkgsName == "R2003") {
27+ } // nixpkgs.lib.optionalAttrs (nixpkgsName == "R2003") {
19− ghc884 = {};
29+ ghc884 = true;
20− ghc8102 = {};
31+ ghc8102 = true;
22 systems = nixpkgs: nixpkgs.lib.filterAttrs (_: v: builtins.elem v supportedSystems) {
33 systems = nixpkgs: nixpkgs.lib.filterAttrs (_: v: builtins.elem v supportedSystems) {
23 # I wanted to take these from 'lib.systems.examples', but apparently there isn't one for linux!
34 # I wanted to take these from 'lib.systems.examples', but apparently there isn't one for linux!
24 linux = "x86_64-linux";
35 linux = "x86_64-linux";
@@ -28,7 +39,7 @@
28 # We need to use the actual nixpkgs version we're working with here, since the values
39 # We need to use the actual nixpkgs version we're working with here, since the values
29 # of 'lib.systems.examples' are not understood between all versions
40 # of 'lib.systems.examples' are not understood between all versions
30 let lib = nixpkgs.lib;
41 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") {
32 # Windows cross compilation is currently broken on macOS
43 # Windows cross compilation is currently broken on macOS
33 inherit (lib.systems.examples) mingwW64;
44 inherit (lib.systems.examples) mingwW64;
34 } // lib.optionalAttrs (system == "x86_64-linux") {
45 } // lib.optionalAttrs (system == "x86_64-linux") {
@@ -41,7 +52,7 @@ dimension "Nixpkgs version" nixpkgsVersions (nixpkgsName: nixpkgs-pin:
41 let pinnedNixpkgsSrc = sources.${nixpkgs-pin};
52 let pinnedNixpkgsSrc = sources.${nixpkgs-pin};
42 # We need this for generic nixpkgs stuff at the right version
53 # We need this for generic nixpkgs stuff at the right version
43 genericPkgs = import pinnedNixpkgsSrc {};
54 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}:
45 dimension "System" (systems genericPkgs) (systemName: system:
56 dimension "System" (systems genericPkgs) (systemName: system:
46 let pkgs = import pinnedNixpkgsSrc (nixpkgsArgs // { inherit system; });
57 let pkgs = import pinnedNixpkgsSrc (nixpkgsArgs // { inherit system; });
47 build = import ./build.nix { inherit pkgs ifdLevel compiler-nix-name; };
58 build = import ./build.nix { inherit pkgs ifdLevel compiler-nix-name; };
@@ -50,8 +61,10 @@ dimension "Nixpkgs version" nixpkgsVersions (nixpkgsName: nixpkgs-pin:
50 # Native builds
61 # Native builds
51 # TODO: can we merge this into the general case by picking an appropriate "cross system" to mean native?
62 # TODO: can we merge this into the general case by picking an appropriate "cross system" to mean native?
52 native = pkgs.recurseIntoAttrs ({
63 native = pkgs.recurseIntoAttrs ({
53− inherit (build) tests tools maintainer-scripts maintainer-script-cache;
64+ roots = pkgs.haskell-nix.roots' compiler-nix-name ifdLevel;
54 ghc = pkgs.buildPackages.haskell-nix.compiler."${compiler-nix-name}";
65 ghc = pkgs.buildPackages.haskell-nix.compiler."${compiler-nix-name}";
66+ } // pkgs.lib.optionalAttrs runTests {
67+ inherit (build) tests tools maintainer-scripts maintainer-script-cache;
55 } // pkgs.lib.optionalAttrs (ifdLevel >= 1) {
68 } // pkgs.lib.optionalAttrs (ifdLevel >= 1) {
56 iserv-proxy = pkgs.ghc-extra-packages."${compiler-nix-name}".iserv-proxy.components.exes.iserv-proxy;
69 iserv-proxy = pkgs.ghc-extra-packages."${compiler-nix-name}".iserv-proxy.components.exes.iserv-proxy;
57 } // pkgs.lib.optionalAttrs (ifdLevel >= 3) {
70 } // pkgs.lib.optionalAttrs (ifdLevel >= 3) {
@@ -63,21 +76,17 @@ dimension "Nixpkgs version" nixpkgsVersions (nixpkgsName: nixpkgs-pin:
63 # Cross builds
76 # Cross builds
64 let pkgs = import pinnedNixpkgsSrc (nixpkgsArgs // { inherit system crossSystem; });
77 let pkgs = import pinnedNixpkgsSrc (nixpkgsArgs // { inherit system crossSystem; });
65 build = import ./build.nix { inherit pkgs ifdLevel compiler-nix-name; };
78 build = import ./build.nix { inherit pkgs ifdLevel compiler-nix-name; };
66− in pkgs.recurseIntoAttrs (pkgs.lib.optionalAttrs (ifdLevel >= 1) {
79+ in pkgs.recurseIntoAttrs (pkgs.lib.optionalAttrs (ifdLevel >= 1) ({
80+ roots = pkgs.haskell-nix.roots' compiler-nix-name ifdLevel;
67− ghc = pkgs.buildPackages.haskell-nix.compiler."${compiler-nix-name}";
81+ ghc = pkgs.buildPackages.haskell-nix.compiler."${compiler-nix-name}";
68− # TODO: look into cross compiling ghc itself
82+ # TODO: look into cross compiling ghc itself
69− # ghc = pkgs.haskell-nix.compiler."${compiler-nix-name}";
83+ # ghc = pkgs.haskell-nix.compiler."${compiler-nix-name}";
70− # TODO: look into making tools work when cross compiling
84+ # TODO: look into making tools work when cross compiling
71− # inherit (build) tools;
85+ # inherit (build) tools;
86+ } // pkgs.lib.optionalAttrs (runTests && crossSystemName != "aarch64-multiplatform") {
72− # Tests are broken on aarch64 cross https://github.com/input-output-hk/haskell.nix/issues/513
87+ # Tests are broken on aarch64 cross https://github.com/input-output-hk/haskell.nix/issues/513
74− if (crossSystemName != "aarch64-multiplatform")
76− else pkgs.recurseIntoAttrs {
77− # Even on aarch64 we still want to build the pinned files
78− inherit (build.tests) roots;
88+ inherit (build) tests;
80− } // pkgs.lib.optionalAttrs (ifdLevel >= 2) {
89+ }) // pkgs.lib.optionalAttrs (ifdLevel >= 2) {
81 remote-iserv = pkgs.ghc-extra-packages."${compiler-nix-name}".remote-iserv.components.exes.remote-iserv;
90 remote-iserv = pkgs.ghc-extra-packages."${compiler-nix-name}".remote-iserv.components.exes.remote-iserv;
82 iserv-proxy = pkgs.ghc-extra-packages."${compiler-nix-name}".iserv-proxy.components.exes.iserv-proxy;
91 iserv-proxy = pkgs.ghc-extra-packages."${compiler-nix-name}".iserv-proxy.components.exes.iserv-proxy;
83 } // pkgs.lib.optionalAttrs (ifdLevel >= 3) {
92 } // pkgs.lib.optionalAttrs (ifdLevel >= 3) {