forked from input-output-hk/haskell.nix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.nix
57 lines (52 loc) · 1.97 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
# TODO remove this file when we no longer need to build with the
# non flake hydra configuration.
{
supportedSystems ? ["x86_64-linux" "x86_64-darwin"]
, include ? (compiler-nix-name: true)
}:
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);
defaultNix = import ./. {};
inherit (defaultNix) pkgs;
inherit (pkgs) lib;
filterCiJobs = __mapAttrs (systemName: system:
lib.optionalAttrs (__elem systemName supportedSystems) (
__mapAttrs (n: jobs:
let ghcMatch = __match ".*-(ghc[0-9]*)-.*" n;
in
lib.optionalAttrs (
(n == "latest" && include "ghc8107")
|| (ghcMatch != null && include (__head ghcMatch))) jobs) system));
jobs = lib.getAttrs supportedSystems (filterCiJobs defaultNix.ciJobs);
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;
# This job causes in eval if we include everything.
# For now just including some darwin checks (since thos are not done on cicero)
required = defaultNix.pkgs.releaseTools.aggregate {
name = "github-required";
meta.description = "All jobs required to pass CI";
constituents = lib.collect lib.isDerivation (
lib.optionalAttrs (jobs ? x86_64-darwin) {
darwin-ghc8107 = jobs.x86_64-darwin.required-unstable-ghc8107-native;
darwin-ghc927 = jobs.x86_64-darwin.required-unstable-ghc927-native;
}
);
};
in
traceNames "job " (jobs // { inherit windows-secp256k1 required; })