forked from input-output-hk/haskell.nix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.nix
69 lines (67 loc) · 3.07 KB
/
release.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# 'supportedSystems' restricts the set of systems that we will evaluate for. Useful when you're evaluating
# on a machine with e.g. no way to build the Darwin IFDs you need!
{ supportedSystems ? [ "x86_64-linux" "x86_64-darwin" ]
, ifdLevel ? 3
, checkMaterialization ? false }:
let
traceNames = prefix: builtins.mapAttrs (n: v:
if builtins.isAttrs v
then if v ? type && v.type == "derivation"
then __trace (prefix + n) v
else traceNames (prefix + n + ".") v
else v);
inherit (import ./ci-lib.nix { pkgs = genericPkgs; }) stripAttrsForHydra filterDerivations;
genericPkgs = (import ./. {}).pkgs;
lib = genericPkgs.lib;
ci = import ./ci.nix { inherit supportedSystems ifdLevel checkMaterialization; restrictEval = true; };
allJobs = stripAttrsForHydra (filterDerivations ci);
latestJobs = {
# All the jobs are included in the `requiredJobs`, but the ones
# added here will also included without aggregation, making it easier
# to find a failing test. Keep in mind though that adding too many
# of these will slow down eval times.
x86_64-linux = allJobs.unstable.ghc8107.x86_64-linux.native or {};
x86_64-darwin = allJobs.unstable.ghc8107.x86_64-darwin.native or {};
};
names = x: lib.filter (n: n != "recurseForDerivations" && n != "meta")
(builtins.attrNames x);
requiredJobs =
builtins.listToAttrs (
lib.concatMap (nixpkgsVer:
let nixpkgsJobs = allJobs.${nixpkgsVer};
in lib.concatMap (compiler-nix-name:
let ghcJobs = nixpkgsJobs.${compiler-nix-name};
in builtins.concatMap (platform:
let platformJobs = ghcJobs.${platform};
in builtins.map (crossPlatform: {
name = "required-${nixpkgsVer}-${compiler-nix-name}-${platform}-${crossPlatform}";
value = genericPkgs.releaseTools.aggregate {
name = "haskell.nix-${nixpkgsVer}-${compiler-nix-name}-${platform}-${crossPlatform}";
meta.description = "All ${nixpkgsVer} ${compiler-nix-name} ${platform} ${crossPlatform} jobs";
constituents = lib.collect (d: lib.isDerivation d) platformJobs.${crossPlatform};
};
}) (names platformJobs)
) (names ghcJobs)
) (names nixpkgsJobs)
) (names allJobs));
in traceNames "job " (latestJobs // requiredJobs // {
windows-secp256k1 =
let
pkgs = (import ./. {}).pkgs-unstable;
makeBinDist = drv: pkgs.runCommand drv.name {
nativeBuildInputs = [ pkgs.zip ];
} ''
mkdir -p $out/nix-support
cp -r ${drv}/* .
chmod -R +w .
zip -r $out/${drv.name}.zip .
echo "file binary-dist $out/${drv.name}.zip" > $out/nix-support/hydra-build-products
'';
in makeBinDist pkgs.pkgsCross.mingwW64.secp256k1;
required = genericPkgs.releaseTools.aggregate {
name = "haskell.nix-required";
meta.description = "All jobs required to pass CI";
# Using the names here requires https://github.com/NixOS/hydra/issues/715
constituents = builtins.attrNames requiredJobs;
};
})