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
8, pkgs ? (import ./. {}).pkgs }:
10 inherit (import ./ci-lib.nix { inherit pkgs; }) dimension platformFilterGeneric filterAttrsOnlyRecursive;
11 inherit (pkgs.haskell-nix) sources;
13 "R2009" = "nixpkgs-2009";
14 "R2105" = "nixpkgs-2105";
15 "unstable" = "nixpkgs-unstable";
17 compilerNixNames = nixpkgsName: nixpkgs: builtins.mapAttrs (compiler-nix-name: runTests: {
18 inherit (import ./default.nix { inherit checkMaterialization; }) nixpkgsArgs;
21 # GHC version to cache and whether to run the tests against them.
22 # This list of GHC versions should include everything for which we
23 # have a ./materialized/ghcXXX directory containing the materialized
24 # cabal-install and nix-tools plans. When removing a ghc version
25 # from here (so that is no longer cached) also remove ./materialized/ghcXXX.
26 # Update supported-ghc-versions.md to reflect any changes made here.
27 nixpkgs.lib.optionalAttrs (nixpkgsName == "R2009") {
30 } // nixpkgs.lib.optionalAttrs (nixpkgsName == "R2105") {
33 } // nixpkgs.lib.optionalAttrs (nixpkgsName == "unstable") {
35 ghc884 = false; # Native version is used to boot 9.0.1
41 ghc810420210212 = false;
43 systems = nixpkgs: nixpkgs.lib.filterAttrs (_: v: builtins.elem v supportedSystems) {
44 # I wanted to take these from 'lib.systems.examples', but apparently there isn't one for linux!
45 linux = "x86_64-linux";
46 darwin = "x86_64-darwin";
48 crossSystems = nixpkgsName: nixpkgs: compiler-nix-name: system:
49 # We need to use the actual nixpkgs version we're working with here, since the values
50 # of 'lib.systems.examples' are not understood between all versions
51 let lib = nixpkgs.lib;
52 in lib.optionalAttrs (nixpkgsName == "unstable" && (__elem compiler-nix-name ["ghc8107"])) {
53 inherit (lib.systems.examples) ghcjs;
54 } // lib.optionalAttrs (system == "x86_64-linux" &&
55 nixpkgsName == "unstable" && (__elem compiler-nix-name ["ghc8107"])) {
56 # Windows cross compilation is currently broken on macOS
57 inherit (lib.systems.examples) mingwW64;
58 } // lib.optionalAttrs (system == "x86_64-linux" && nixpkgsName == "unstable" && compiler-nix-name == "ghc8107") {
59 # Musl cross only works on linux
60 # aarch64 cross only works on linux
61 inherit (lib.systems.examples) musl64 aarch64-multiplatform;
63 isDisabled = d: d.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-projects."${compiler-nix-name}".getComponent "iserv-proxy:exe: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; }).getComponent "exe: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-projects."${compiler-nix-name}".getComponent "remote-iserv:exe:remote-iserv";
106 iserv-proxy = pkgs.ghc-extra-projects."${compiler-nix-name}".getComponent "iserv-proxy:exe: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; }).getComponent "exe: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