on master help sign in
haskell.nix/release.nix
69 lines 3.1 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 x86_64-linux = allJobs.R2111.ghc8107.x86_64-linux.native or {};
25 x86_64-darwin = allJobs.R2111.ghc8107.x86_64-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 windows-secp256k1 =
50 let
51 pkgs = (import ./. {}).pkgs-unstable;
52 makeBinDist = drv: pkgs.runCommand drv.name {
53 nativeBuildInputs = [ pkgs.zip ];
54 } ''
55 mkdir -p $out/nix-support
56 cp -r ${drv}/* .
57 chmod -R +w .
58 zip -r $out/${drv.name}.zip .
59 echo "file binary-dist $out/${drv.name}.zip" > $out/nix-support/hydra-build-products
60 '';
61 in makeBinDist pkgs.pkgsCross.mingwW64.secp256k1;
62 required = genericPkgs.releaseTools.aggregate {
63 name = "haskell.nix-required";
64 meta.description = "All jobs required to pass CI";
65 # Using the names here requires https://github.com/NixOS/hydra/issues/715
66 constituents = builtins.attrNames requiredJobs;
67 };
68 })