on 19052d8 help sign in
haskell.nix/release.nix
56 lines 2.6 kB history raw
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" ]
4, ifdLevel ? 3
5, checkMaterialization ? false }:
7let
8 traceNames = prefix: builtins.mapAttrs (n: v:
9 if builtins.isAttrs v
10 then if v ? type && v.type == "derivation"
11 then __trace (prefix + n) v
12 else traceNames (prefix + n + ".") v
13 else v);
14 inherit (import ./ci-lib.nix { pkgs = genericPkgs; }) stripAttrsForHydra filterDerivations;
15 genericPkgs = (import ./. {}).pkgs;
16 lib = genericPkgs.lib;
17 ci = import ./ci.nix { inherit supportedSystems ifdLevel checkMaterialization; restrictEval = true; };
18 allJobs = stripAttrsForHydra (filterDerivations ci);
19 latestJobs = {
20 # All the jobs are included in the `requiredJobs`, but the ones
21 # added here will also included without aggregation, making it easier
22 # to find a failing test. Keep in mind though that adding too many
23 # of these will slow down eval times.
24 linux = allJobs.R2105.ghc8107.linux.native or {};
25 darwin = allJobs.R2105.ghc8107.darwin.native or {};
26 };
27 names = x: lib.filter (n: n != "recurseForDerivations" && n != "meta")
28 (builtins.attrNames x);
29 requiredJobs =
30 builtins.listToAttrs (
31 lib.concatMap (nixpkgsVer:
32 let nixpkgsJobs = allJobs.${nixpkgsVer};
33 in lib.concatMap (compiler-nix-name:
34 let ghcJobs = nixpkgsJobs.${compiler-nix-name};
35 in builtins.concatMap (platform:
36 let platformJobs = ghcJobs.${platform};
37 in builtins.map (crossPlatform: {
38 name = "required-${nixpkgsVer}-${compiler-nix-name}-${platform}-${crossPlatform}";
39 value = genericPkgs.releaseTools.aggregate {
40 name = "haskell.nix-${nixpkgsVer}-${compiler-nix-name}-${platform}-${crossPlatform}";
41 meta.description = "All ${nixpkgsVer} ${compiler-nix-name} ${platform} ${crossPlatform} jobs";
42 constituents = lib.collect (d: lib.isDerivation d) platformJobs.${crossPlatform};
43 };
44 }) (names platformJobs)
45 ) (names ghcJobs)
46 ) (names nixpkgsJobs)
47 ) (names allJobs));
48in traceNames "job " (latestJobs // requiredJobs // {
49 required = genericPkgs.releaseTools.aggregate {
50 name = "haskell.nix-required";
51 meta.description = "All jobs required to pass CI";
52 # Using the names here requires https://github.com/NixOS/hydra/issues/715
53 constituents = builtins.attrNames requiredJobs;
54 };
55 })