|
1 | 1 | # 'supportedSystems' restricts the set of systems that we will evaluate for. Useful when you're evaluating
|
2 | 2 | # on a machine with e.g. no way to build the Darwin IFDs you need!
|
3 | 3 | { ifdLevel ? 3
|
4 |
| -# Whether or not we are evaluating in restricted mode. This is true in Hydra, but not in Hercules. |
5 |
| -, restrictEval ? false |
6 | 4 | , checkMaterialization ? false
|
7 |
| -, compat |
8 |
| -, system |
| 5 | +, system ? builtins.currentSystem |
9 | 6 | , evalSystem ? builtins.currentSystem or "x86_64-linux"
|
10 |
| -, pkgs ? (compat { inherit system; }).pkgs }: |
| 7 | + # NOTE: we apply checkMaterialization when defining nixpkgsArgs |
| 8 | +, haskellNix ? import ./default.nix { inherit system ; } |
| 9 | +}: |
11 | 10 | let
|
12 |
| - inherit (import ./ci-lib.nix { inherit pkgs; }) dimension platformFilterGeneric filterAttrsOnlyRecursive; |
13 |
| - inherit (pkgs.haskell-nix) sources; |
| 11 | + inherit (haskellNix) inputs; |
| 12 | + inherit (inputs.nixpkgs) lib; |
| 13 | + inherit |
| 14 | + (import ./ci-lib.nix { inherit lib; }) |
| 15 | + dimension |
| 16 | + platformFilterGeneric |
| 17 | + filterAttrsOnlyRecursive; |
| 18 | + |
| 19 | + # short names for nixpkgs versions |
14 | 20 | nixpkgsVersions = {
|
15 |
| - "R2205" = "nixpkgs-2205"; |
16 |
| - "R2211" = "nixpkgs-2211"; |
17 |
| - "R2305" = "nixpkgs-2305"; |
18 |
| - "unstable" = "nixpkgs-unstable"; |
| 21 | + "R2205" = inputs.nixpkgs-2205; |
| 22 | + "R2211" = inputs.nixpkgs-2211; |
| 23 | + "R2305" = inputs.nixpkgs-2305; |
| 24 | + "unstable" = inputs.nixpkgs-unstable; |
19 | 25 | };
|
20 |
| - haskellNix = compat { inherit checkMaterialization system; }; |
21 |
| - nixpkgsArgs = haskellNix.nixpkgsArgs // { |
| 26 | + |
| 27 | + nixpkgsArgs = { |
| 28 | + # set checkMaterialization as per top-level argument |
| 29 | + overlays = [ |
| 30 | + haskellNix.overlay |
| 31 | + (final: prev: { |
| 32 | + haskell-nix = prev.haskell-nix // { |
| 33 | + inherit checkMaterialization; |
| 34 | + }; |
| 35 | + }) |
| 36 | + ]; |
22 | 37 | # Needed for dwarf tests
|
23 |
| - config = haskellNix.nixpkgsArgs.config // { |
24 |
| - permittedInsecurePackages = ["libdwarf-20210528" "libdwarf-20181024" "dwarfdump-20181024"]; |
| 38 | + config = haskellNix.config // { |
| 39 | + permittedInsecurePackages = [ |
| 40 | + "libdwarf-20210528" |
| 41 | + "libdwarf-20181024" |
| 42 | + "dwarfdump-20181024" |
| 43 | + ]; |
25 | 44 | };
|
26 | 45 | };
|
| 46 | + |
27 | 47 | compilerNixNames = nixpkgsName: nixpkgs:
|
28 | 48 | # Include only the GHC versions that are supported by haskell.nix
|
29 | 49 | nixpkgs.lib.filterAttrs (compiler-nix-name: _:
|
|
73 | 93 | # of 'lib.systems.examples' are not understood between all versions
|
74 | 94 | let lib = nixpkgs.lib;
|
75 | 95 | in lib.optionalAttrs (nixpkgsName == "unstable"
|
76 |
| - && ((system == "x86_64-linux" && __elem compiler-nix-name ["ghc8107" "ghc962" "ghc9820230704"]) |
77 |
| - || (system == "aarch64-linux" && __elem compiler-nix-name ["ghc8107" "ghc962" "ghc9820230704"]) |
78 |
| - || (system == "x86_64-darwin" && __elem compiler-nix-name ["ghc8107" "ghc962" "ghc9820230704"]) |
79 |
| - || (system == "aarch64-darwin" && __elem compiler-nix-name ["ghc8107" "ghc962" "ghc9820230704"]) |
| 96 | + && ((system == "x86_64-linux" && builtins.elem compiler-nix-name ["ghc8107" "ghc962" "ghc9820230704"]) |
| 97 | + || (system == "aarch64-linux" && builtins.elem compiler-nix-name ["ghc8107" "ghc962" "ghc9820230704"]) |
| 98 | + || (system == "x86_64-darwin" && builtins.elem compiler-nix-name ["ghc8107" "ghc962" "ghc9820230704"]) |
| 99 | + || (system == "aarch64-darwin" && builtins.elem compiler-nix-name ["ghc8107" "ghc962" "ghc9820230704"]) |
80 | 100 | )) {
|
81 | 101 | inherit (lib.systems.examples) ghcjs;
|
82 | 102 | } // lib.optionalAttrs (nixpkgsName == "unstable"
|
83 |
| - && ((system == "x86_64-linux" && __elem compiler-nix-name ["ghc8107" "ghc902" "ghc926" "ghc927" "ghc928" "ghc947" "ghc962" "ghc9820230704"]) |
84 |
| - || (system == "x86_64-darwin" && __elem compiler-nix-name []))) { # TODO add ghc versions when we have more darwin build capacity |
| 103 | + && ((system == "x86_64-linux" && builtins.elem compiler-nix-name ["ghc8107" "ghc902" "ghc926" "ghc927" "ghc928" "ghc947" "ghc962" "ghc9820230704"]) |
| 104 | + || (system == "x86_64-darwin" && builtins.elem compiler-nix-name []))) { # TODO add ghc versions when we have more darwin build capacity |
85 | 105 | inherit (lib.systems.examples) mingwW64;
|
86 |
| - } // lib.optionalAttrs (system == "x86_64-linux" && nixpkgsName == "unstable" && __elem compiler-nix-name ["ghc8107" "ghc902" "ghc922" "ghc923" "ghc924" "ghc926" "ghc927" "ghc928" "ghc947" "ghc962" "ghc9820230704"]) { |
| 106 | + } // lib.optionalAttrs (system == "x86_64-linux" && nixpkgsName == "unstable" && builtins.elem compiler-nix-name ["ghc8107" "ghc902" "ghc922" "ghc923" "ghc924" "ghc926" "ghc927" "ghc928" "ghc947" "ghc962" "ghc9820230704"]) { |
87 | 107 | # Musl cross only works on linux
|
88 | 108 | # aarch64 cross only works on linux
|
89 | 109 | inherit (lib.systems.examples) musl64 aarch64-multiplatform;
|
90 |
| - } // lib.optionalAttrs (system == "x86_64-linux" && nixpkgsName == "unstable" && __elem compiler-nix-name ["ghc927" "ghc928"]) { |
| 110 | + } // lib.optionalAttrs (system == "x86_64-linux" && nixpkgsName == "unstable" && builtins.elem compiler-nix-name ["ghc927" "ghc928"]) { |
91 | 111 | # TODO fix this for the compilers we build with hadrian (ghc >=9.4)
|
92 | 112 | inherit (lib.systems.examples) aarch64-multiplatform-musl;
|
93 |
| - } // lib.optionalAttrs (system == "aarch64-linux" && nixpkgsName == "unstable" && __elem compiler-nix-name ["ghc927" "ghc928" "ghc947" "ghc962" "ghc9820230704"]) { |
| 113 | + } // lib.optionalAttrs (system == "aarch64-linux" && nixpkgsName == "unstable" && builtins.elem compiler-nix-name ["ghc927" "ghc928" "ghc947" "ghc962" "ghc9820230704"]) { |
94 | 114 | inherit (lib.systems.examples) aarch64-multiplatform-musl;
|
95 | 115 | };
|
96 | 116 | isDisabled = d: d.meta.disabled or false;
|
97 | 117 | in
|
98 |
| -dimension "Nixpkgs version" nixpkgsVersions (nixpkgsName: nixpkgs-pin: |
99 |
| - let pinnedNixpkgsSrc = sources.${nixpkgs-pin}; |
100 |
| - evalPackages = import pinnedNixpkgsSrc (nixpkgsArgs // { system = evalSystem; }); |
| 118 | +dimension "Nixpkgs version" nixpkgsVersions (nixpkgsName: pinnedNixpkgsSrc: |
| 119 | + let evalPackages = import pinnedNixpkgsSrc (nixpkgsArgs // { system = evalSystem; }); |
101 | 120 | in dimension "GHC version" (compilerNixNames nixpkgsName evalPackages) (compiler-nix-name: {runTests}:
|
102 | 121 | let pkgs = import pinnedNixpkgsSrc (nixpkgsArgs // { inherit system; });
|
103 | 122 | build = import ./build.nix { inherit pkgs evalPackages ifdLevel compiler-nix-name haskellNix; };
|
|
0 commit comments