on iko/ghcjs-patch-master help sign in
Cache ghc883 and ghc8101 again (without tests) (#821)
b368a5dHamish Mackenzie
@@ -12,13 +12,24 @@
12 "R1909" = "nixpkgs-1909";
12 "R1909" = "nixpkgs-1909";
13 "R2003" = "nixpkgs-2003";
13 "R2003" = "nixpkgs-2003";
14 };
14 };
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;
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+ {
17− ghc865 = {};
26+ ghc865 = true;
18− } // nixpkgs.lib.optionalAttrs (nixpkgsName == "R2003") {
27+ } // nixpkgs.lib.optionalAttrs (nixpkgsName == "R2003") {
28+ ghc883 = false;
19− ghc884 = {};
29+ ghc884 = true;
30+ ghc8101 = false;
20− ghc8102 = {};
31+ ghc8102 = true;
21− });
32+ });
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
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;
88+ inherit (build) tests;
79− };
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) {
docs/adding-new-ghc.md+4−1
@@ -8,8 +8,11 @@ you update the `spec.sha256` or the other versions source will be used.
8Check the LLVM version that should be used in the
8Check the LLVM version that should be used in the
9[ghc wiki](https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/compiler/backends/llvm/installing).
9[ghc wiki](https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/compiler/backends/llvm/installing).
10
10
11+## Update the list of cached GHC versions in `ci.nix`
11
12
13+## Update [supported ghc versions](supported-ghc-versions.md) document
14+
12−## Update the materialized files
15+## Add the materialized files
13
16
14In the haskell.nix repo run:
17In the haskell.nix repo run:
15
18
docs/supported-ghc-versions.mdnew file+32
@@ -0,0 +1,32 @@
1+# Supported GHC Versions
2+
3+The following versions of GHC built on the CI servers and should be included
4+in the cache (for the default haskell.nix `nixpkgs`).
5+
6+* 8.6.5 `compiler-nix-name = "ghc865";`
7+* 8.8.3 `compiler-nix-name = "ghc883";`
8+* 8.8.4 `compiler-nix-name = "ghc884";`
9+* 8.10.1 `compiler-nix-name = "ghc8101";`
10+* 8.10.2 `compiler-nix-name = "ghc8102";`
11+
12+Full test suite is run against 8.6.5, 8.8.4 and 8.10.2.
13+
14+See [ci.nix](https://github.com/input-output-hk/haskell.nix/blob/master/ci.nix)
15+for the list of tested GHC versions.
16+
17+The following GHC versions are not included in CI and will not be cached:
18+
19+* 8.4.4 `compiler-nix-name = "ghc844";`
20+* 8.6.1 `compiler-nix-name = "ghc861";`
21+* 8.6.2 `compiler-nix-name = "ghc862";`
22+* 8.6.3 `compiler-nix-name = "ghc863";`
23+* 8.6.4 `compiler-nix-name = "ghc864";`
24+* 8.8.1 `compiler-nix-name = "ghc881";`
25+* 8.8.2 `compiler-nix-name = "ghc882";`
26+
27+See [overlays/bootstrap.nix](https://github.com/input-output-hk/haskell.nix/blob/master/overlays/bootstrap.nix)
28+for a list of all the valid `compiler-nix-names`.
29+
30+See also:
31+
32+* [Instructions on adding new ghc versions](adding-new-ghc.md).
test/default.nix+1−5
@@ -214,11 +214,7 @@ let
214 # - input ifdLevel is 3 or greater: return allTests
214 # - input ifdLevel is 3 or greater: return allTests
215 optionalIfdTests = ifdLevel:
215 optionalIfdTests = ifdLevel:
216 pkgs.lib.optionalAttrs (ifdLevel > 1) (allTestsWithIfdInputs ifdLevel);
216 pkgs.lib.optionalAttrs (ifdLevel > 1) (allTestsWithIfdInputs ifdLevel);
217−in
218−
219−pkgs.recurseIntoAttrs {
220− roots = haskell-nix.roots' compiler-nix-name ifdLevel;
221−} // optionalIfdTests ifdLevel
217+in pkgs.recurseIntoAttrs (optionalIfdTests ifdLevel)
222
218
223## more possible test cases
219## more possible test cases
224# 1. fully static linking
220# 1. fully static linking