1# 'supportedSystems' restricts the set of systems that we will evaluate for. Useful when you're evaluating
2# on a machine with e.g. no way to build the Darwin IFDs you need!
3{ supportedSystems ? [ "x86_64-linux" "x86_64-darwin" ]
5# Whether or not we are evaluating in restricted mode. This is true in Hydra, but not in Hercules.
7, checkMaterialization ? false }:
9 inherit (import ./ci-lib.nix) dimension platformFilterGeneric filterAttrsOnlyRecursive;
10 sources = import ./nix/sources.nix {};
12 "R2003" = "nixpkgs-2003";
13 "R2009" = "nixpkgs-2009";
14 "unstable" = "nixpkgs-unstable";
16 compilerNixNames = nixpkgsName: nixpkgs: builtins.mapAttrs (compiler-nix-name: runTests: {
17 inherit (import ./default.nix { inherit checkMaterialization; }) nixpkgsArgs;
20 # GHC version to cache and whether to run the tests against them.
21 # This list of GHC versions should include everything for which we
22 # have a ./materialized/ghcXXX directory containing the materialized
23 # cabal-install and nix-tools plans. When removing a ghc version
24 # from here (so that is no longer cached) also remove ./materialized/ghcXXX.
25 # Update supported-ghc-versions.md to reflect any changes made here.
28 ghc884 = false; # Just included because the native version is needed at eval time
29 } // nixpkgs.lib.optionalAttrs (nixpkgsName == "R2009") {
32 ghc810220201118 = false;
33 } // nixpkgs.lib.optionalAttrs (nixpkgsName == "unstable") {
37 systems = nixpkgs: nixpkgs.lib.filterAttrs (_: v: builtins.elem v supportedSystems) {
38 # I wanted to take these from 'lib.systems.examples', but apparently there isn't one for linux!
39 linux = "x86_64-linux";
40 darwin = "x86_64-darwin";
42 crossSystems = nixpkgsName: nixpkgs: compiler-nix-name: system:
43 # We need to use the actual nixpkgs version we're working with here, since the values
44 # of 'lib.systems.examples' are not understood between all versions
45 let lib = nixpkgs.lib;
46 in lib.optionalAttrs (nixpkgsName == "unstable" && (__elem compiler-nix-name ["ghc865" "ghc884"])) {
47 inherit (lib.systems.examples) ghcjs;
48 } // lib.optionalAttrs (system == "x86_64-linux" && (
49 (nixpkgsName == "R2009" && __elem compiler-nix-name ["ghc8101" "ghc8102" "ghc8103" "ghc8104" "ghc810220201118"])
50 || (nixpkgsName == "R2003" && __elem compiler-nix-name ["ghc865"]))) {
51 # Windows cross compilation is currently broken on macOS
52 inherit (lib.systems.examples) mingwW64;
53 } // lib.optionalAttrs (system == "x86_64-linux"
54 && !(nixpkgsName == "R2003" && compiler-nix-name == "ghc884")) {
55 # Musl cross only works on linux
56 # aarch64 cross only works on linux
57 # We also skip these for the R2003 was build of ghc884 (we only need the
58 # native so ifdLevel 1 includes compiler needed in ifdLevel2 eval)
59 inherit (lib.systems.examples) musl64 aarch64-multiplatform;
62 let meta = d.meta or {};
63 in meta.disabled or false;
65dimension "Nixpkgs version" nixpkgsVersions (nixpkgsName: nixpkgs-pin:
66 let pinnedNixpkgsSrc = sources.${nixpkgs-pin};
67 # We need this for generic nixpkgs stuff at the right version
68 genericPkgs = import pinnedNixpkgsSrc {};
69 in dimension "GHC version" (compilerNixNames nixpkgsName genericPkgs) (compiler-nix-name: {nixpkgsArgs, runTests}:
70 dimension "System" (systems genericPkgs) (systemName: system:
71 let pkgs = import pinnedNixpkgsSrc (nixpkgsArgs // { inherit system; });
72 build = import ./build.nix { inherit pkgs ifdLevel compiler-nix-name; };
73 platformFilter = platformFilterGeneric pkgs system;
74 in filterAttrsOnlyRecursive (_: v: platformFilter v && !(isDisabled v)) ({
76 # TODO: can we merge this into the general case by picking an appropriate "cross system" to mean native?
77 native = pkgs.recurseIntoAttrs ({
78 roots = pkgs.haskell-nix.roots' compiler-nix-name ifdLevel;
79 ghc = pkgs.buildPackages.haskell-nix.compiler."${compiler-nix-name}";
80 } // pkgs.lib.optionalAttrs runTests {
81 inherit (build) tests tools maintainer-scripts maintainer-script-cache;
82 } // pkgs.lib.optionalAttrs (ifdLevel >= 1) {
83 iserv-proxy = pkgs.ghc-extra-packages."${compiler-nix-name}".iserv-proxy.components.exes.iserv-proxy;
84 } // pkgs.lib.optionalAttrs (ifdLevel >= 3) {
85 hello = (pkgs.haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; inherit compiler-nix-name; }).components.exes.hello;
89 dimension "Cross system" (crossSystems nixpkgsName genericPkgs compiler-nix-name system) (crossSystemName: crossSystem:
91 let pkgs = import pinnedNixpkgsSrc (nixpkgsArgs // { inherit system crossSystem; });
92 build = import ./build.nix { inherit pkgs ifdLevel compiler-nix-name; };
93 in pkgs.recurseIntoAttrs (pkgs.lib.optionalAttrs (ifdLevel >= 1) ({
94 roots = pkgs.haskell-nix.roots' compiler-nix-name ifdLevel;
95 ghc = pkgs.buildPackages.haskell-nix.compiler."${compiler-nix-name}";
96 # TODO: look into cross compiling ghc itself
97 # ghc = pkgs.haskell-nix.compiler."${compiler-nix-name}";
98 # TODO: look into making tools work when cross compiling
99 # inherit (build) tools;
100 } // pkgs.lib.optionalAttrs (runTests && crossSystemName != "aarch64-multiplatform") {
101 # Tests are broken on aarch64 cross https://github.com/input-output-hk/haskell.nix/issues/513
102 inherit (build) tests;
103 }) // pkgs.lib.optionalAttrs (ifdLevel >= 2 && crossSystemName != "ghcjs") {
104 # GHCJS builds its own template haskell runner.
105 remote-iserv = pkgs.ghc-extra-packages."${compiler-nix-name}".remote-iserv.components.exes.remote-iserv;
106 iserv-proxy = pkgs.ghc-extra-packages."${compiler-nix-name}".iserv-proxy.components.exes.iserv-proxy;
107 } // pkgs.lib.optionalAttrs (ifdLevel >= 3) {
108 hello = (pkgs.haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; inherit compiler-nix-name; }).components.exes.hello;
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list