on hkm/ghc-core-section help sign in
haskell.nix/release.nix
83 lines 3.4 kB history raw
1{ supportedSystems ? [ "x86_64-linux" "x86_64-darwin" ]
2, scrubJobs ? true
3, haskell-nix ? { outPath = ./.; rev = "abcdef"; }
4, nixpkgsArgs ? {}
5, ifdLevel ? 3
6}:
8let defaultNixpkgs = import ./nixpkgs {}; in
9with defaultNixpkgs.lib;
10let
11 # Remove tests which have meta.disabled = true
12 filterTests = let
13 nonEmpty = attrs: length (attrValues attrs) != 0;
14 removeDisabled = filterAttrs (system: test: !(test.meta.disabled or false));
15 in jobs: jobs // {
16 tests = filterAttrs (_: nonEmpty) (mapAttrs (name: removeDisabled) jobs.tests);
17 };
19 jobs = nixpkgs-pin:
20 # Now we know what nixpkgs-pin we are testing use that one.
21 # This fixes and issue where the vendor has changed from `x86_64-pc-mingw32`
22 # to `x86_64-w64-mingw32` in 19.09.
23 let pinnedNixpkgs = import ./nixpkgs { inherit nixpkgs-pin; }; in
24 with pinnedNixpkgs.lib;
25 let
26 inherit (systems.examples) musl64 mingwW64 aarch64-multiplatform raspberryPi;
27 packages = supportedSystems:
28 with (import (pinnedNixpkgs.path + "/pkgs/top-level/release-lib.nix") {
29 inherit supportedSystems scrubJobs nixpkgsArgs;
30 packageSet = {
31 system ? builtins.currentSystem
32 , crossSystem ? null
33 , nixpkgsArgs ? { inherit system crossSystem; }
34 , ...}@args:
35 import (haskell-nix + /build.nix) (args // {
36 nixpkgsArgs = nixpkgsArgs // {
37 inherit nixpkgs-pin;
38 };
39 inherit ifdLevel;
40 });
41 });
42 {
43 mapTestOn = mapTestOn (packagePlatforms pkgs);
44 mapTestOnCross = p: mapTestOnCross p (packagePlatforms pkgs);
45 };
46 in
47 {
48 native = filterTests ((packages supportedSystems).mapTestOn);
49 # Musl cross compile does not work on macOS
50 "${musl64.config}" = filterTests ((packages (filter (x: x == "x86_64-linux") supportedSystems)).mapTestOnCross musl64);
51 # Windows cross compilation is currently broken on macOS for nixpkgs 19.09 (works on 19.03)
52 "${mingwW64.config}" = filterTests ((packages (filter
53 (x: x == "x86_64-linux" || nixpkgs-pin == "release-19.03") supportedSystems)).mapTestOnCross mingwW64);
54 "${aarch64-multiplatform.config}" = filterTests ((packages (filter (x: x == "x86_64-linux") supportedSystems))
55 .mapTestOnCross aarch64-multiplatform);
56 # "${raspberryPi.config}" = filterTests ((packages (filter (x: x == "x86_64-linux") supportedSystems))
57 # .mapTestOnCross raspberryPi);
58 };
60 allJobs =
61 builtins.mapAttrs (_: nixpkgs-pin: jobs nixpkgs-pin) {
62 "R1903" = "release-19.03";
63 "R1909" = "release-19.09";
64 };
66in allJobs // {
67 # On IOHK Hydra, "required" is a special job that updates the
68 # GitHub CI status.
69 required = defaultNixpkgs.releaseTools.aggregate {
70 name = "haskell.nix-required";
71 meta.description = "All jobs required to pass CI";
72 constituents =
73 collect isDerivation allJobs.R1903.native
74 ++ collect isDerivation allJobs.R1909.native
75 # Windows cross compiling with GHC 8.8.2 is broken
76 # ++ collect isDerivation allJobs.R1903.x86_64-pc-mingw32
77 # ++ collect isDerivation allJobs.R1909.x86_64-w64-mingw32
78 ++ collect isDerivation allJobs.R1903.x86_64-unknown-linux-musl
79 ++ collect isDerivation allJobs.R1909.x86_64-unknown-linux-musl;
80 };
81 }