on iko/ghcjs-patch-master help sign in
Better 'required' job that includes everything (#976)
f6bc2f7Michael Peyton Jones
@@ -52,6 +52,9 @@
52 # aarch64 cross only works on linux
52 # aarch64 cross only works on linux
53 inherit (lib.systems.examples) musl64 aarch64-multiplatform;
53 inherit (lib.systems.examples) musl64 aarch64-multiplatform;
54 };
54 };
55+ isDisabled = d:
56+ let meta = d.meta or {};
57+ in meta.disabled or false;
55in
58in
56dimension "Nixpkgs version" nixpkgsVersions (nixpkgsName: nixpkgs-pin:
59dimension "Nixpkgs version" nixpkgsVersions (nixpkgsName: nixpkgs-pin:
57 let pinnedNixpkgsSrc = sources.${nixpkgs-pin};
60 let pinnedNixpkgsSrc = sources.${nixpkgs-pin};
@@ -62,7 +65,7 @@ dimension "Nixpkgs version" nixpkgsVersions (nixpkgsName: nixpkgs-pin:
62 let pkgs = import pinnedNixpkgsSrc (nixpkgsArgs // { inherit system; });
65 let pkgs = import pinnedNixpkgsSrc (nixpkgsArgs // { inherit system; });
63 build = import ./build.nix { inherit pkgs ifdLevel compiler-nix-name; };
66 build = import ./build.nix { inherit pkgs ifdLevel compiler-nix-name; };
64 platformFilter = platformFilterGeneric pkgs system;
67 platformFilter = platformFilterGeneric pkgs system;
65− in filterAttrsOnlyRecursive (_: v: platformFilter v) {
68+ in filterAttrsOnlyRecursive (_: v: platformFilter v && !(isDisabled v)) ({
66 # Native builds
69 # Native builds
67 # TODO: can we merge this into the general case by picking an appropriate "cross system" to mean native?
70 # TODO: can we merge this into the general case by picking an appropriate "cross system" to mean native?
68 native = pkgs.recurseIntoAttrs ({
71 native = pkgs.recurseIntoAttrs ({
@@ -98,7 +101,7 @@ dimension "Nixpkgs version" nixpkgsVersions (nixpkgsName: nixpkgs-pin:
98 } // pkgs.lib.optionalAttrs (ifdLevel >= 3) {
101 } // pkgs.lib.optionalAttrs (ifdLevel >= 3) {
99 hello = (pkgs.haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; inherit compiler-nix-name; }).components.exes.hello;
102 hello = (pkgs.haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; inherit compiler-nix-name; }).components.exes.hello;
100 })
103 })
101− )
104+ ))
102 )
105 )
103 )
106 )
104)
107)
release.nix+30−7
@@ -10,16 +10,39 @@ let
10 lib = genericPkgs.lib;
10 lib = genericPkgs.lib;
11 ci = import ./ci.nix { inherit supportedSystems ifdLevel checkMaterialization; restrictEval = true; };
11 ci = import ./ci.nix { inherit supportedSystems ifdLevel checkMaterialization; restrictEval = true; };
12 allJobs = stripAttrsForHydra (filterDerivations ci);
12 allJobs = stripAttrsForHydra (filterDerivations ci);
13−in allJobs // {
13+ latestJobs = {
14− # On IOHK Hydra, "required" is a special job that updates the
14+ # All the jobs are included in the `requiredJobs`, but the ones
15− # GitHub CI status.
15+ # added here will also included without aggregation, making it easier
16+ # to find a failing test. Keep in mind though that adding too many
17+ # of these will slow down eval times.
18+ linux = allJobs.R2009.ghc8102.linux.native or {};
19+ darwin = allJobs.R2009.ghc8102.darwin.native or {};
20+ };
21+ names = x: lib.filter (n: n != "recurseForDerivations" && n != "meta")
22+ (builtins.attrNames x);
23+ requiredJobs =
24+ builtins.listToAttrs (
25+ lib.concatMap (nixpkgsVer:
26+ let nixpkgsJobs = allJobs.${nixpkgsVer};
27+ in lib.concatMap (compiler-nix-name:
28+ let ghcJobs = nixpkgsJobs.${compiler-nix-name};
29+ in builtins.map (platform: {
30+ name = "required-${nixpkgsVer}-${compiler-nix-name}-${platform}";
31+ value = genericPkgs.releaseTools.aggregate {
32+ name = "haskell.nix-${nixpkgsVer}-${compiler-nix-name}-${platform}";
33+ meta.description = "All ${nixpkgsVer} ${compiler-nix-name} ${platform} jobs";
34+ constituents = lib.collect (d: lib.isDerivation d) ghcJobs.${platform};
35+ };
36+ }) (names ghcJobs)
37+ ) (names nixpkgsJobs)
38+ ) (names allJobs));
39+in latestJobs // requiredJobs // {
16 required = genericPkgs.releaseTools.aggregate {
40 required = genericPkgs.releaseTools.aggregate {
17 name = "haskell.nix-required";
41 name = "haskell.nix-required";
18 meta.description = "All jobs required to pass CI";
42 meta.description = "All jobs required to pass CI";
19− # Hercules will require all of these, we just require the 20.09 jobs
43+ # Using the names here requires https://github.com/NixOS/hydra/issues/715
20− # to avoid stressing Hydra too much
44+ constituents = builtins.attrNames requiredJobs;
21− constituents = lib.collect lib.isDerivation allJobs.R2009.ghc865.linux.native;
22 };
45 };
23− }
46+ }
24
47
25
48
test/builder-haddock/default.nix+5−8
@@ -35,12 +35,7 @@ in
35 buildCommand = let
35 buildCommand = let
36 inherit (packages.test-haddock.components) library;
36 inherit (packages.test-haddock.components) library;
37 noDocLibrary = packages.stm.components.library;
37 noDocLibrary = packages.stm.components.library;
38− in if (stdenv.hostPlatform != stdenv.buildPlatform)
38+ in ''
39− then ''
40− echo "Skipping haddock tests when cross compiling" >& 2
41− touch $out
42− ''
43− else ''
44 ########################################################################
39 ########################################################################
45 # test haddock
40 # test haddock
46
41
@@ -82,6 +77,8 @@ in
82 touch $out
77 touch $out
83 '';
78 '';
84
79
80+ meta = {
85− meta.platforms = platforms.all;
81+ platforms = platforms.all;
86− meta.disabled = stdenv.hostPlatform.isMusl;
82+ disabled = stdenv.hostPlatform != stdenv.buildPlatform || stdenv.hostPlatform.isMusl;
83+ };
87} // { inherit packages pkgSet; }
84} // { inherit packages pkgSet; }
test/cabal-simple-prof/default.nix+5−1
@@ -46,7 +46,11 @@ in recurseIntoAttrs {
46 touch $out
46 touch $out
47 '';
47 '';
48
48
49+ meta = {
49− meta.platforms = platforms.all;
50+ platforms = platforms.all;
51+ # This test seeems to be broken on 8.6 and 8.8
52+ disabled = compiler-nix-name == "ghc865" || compiler-nix-name == "ghc884";
53+ };
50
54
51 passthru = {
55 passthru = {
52 # Used for debugging with nix repl
56 # Used for debugging with nix repl
test/fully-static/default.nix+4−1
@@ -52,7 +52,10 @@ in recurseIntoAttrs {
52
52
53 '') + "touch $out";
53 '') + "touch $out";
54
54
55+ meta = {
56+ # A dependency is broken on Windows, just run on unix
55− meta.platforms = platforms.all;
57+ platforms = platforms.unix;
58+ };
56
59
57 passthru = {
60 passthru = {
58 # Attributes used for debugging with nix repl
61 # Attributes used for debugging with nix repl
test/lookup-sha256/default.nix+3−2
@@ -1,5 +1,6 @@
1{ pkgs, lib, stdenv, haskell-nix, testSrc, zlib, compiler-nix-name } :
1{ pkgs, lib, stdenv, haskell-nix, testSrc, zlib, compiler-nix-name } :
2+ # A dependency is broken on windows, just run this on unix.
2− (haskell-nix.hackage-package {
3+ lib.addMetaAttrs { platforms = lib.platforms.unix; } ((haskell-nix.hackage-package {
3 inherit compiler-nix-name;
4 inherit compiler-nix-name;
4 name = "pandoc";
5 name = "pandoc";
5 version = "2.9.2.1";
6 version = "2.9.2.1";
@@ -10,4 +11,4 @@
10 { "https://github.com/jgm/pandoc-citeproc"."0.17"
11 { "https://github.com/jgm/pandoc-citeproc"."0.17"
11 = "0dxx8cp2xndpw3jwiawch2dkrkp15mil7pyx7dvd810pwc22pm2q"; }
12 = "0dxx8cp2xndpw3jwiawch2dkrkp15mil7pyx7dvd810pwc22pm2q"; }
12 ."${location}"."${tag}";
13 ."${location}"."${tag}";
13− }).components.exes.pandoc
14+ }).components.exes.pandoc)
test/setup-deps/default.nix+11−15
@@ -16,19 +16,17 @@ let
16 };
16 };
17
17
18 packages = project.hsPkgs;
18 packages = project.hsPkgs;
19−in recurseIntoAttrs (if stdenv.buildPlatform != stdenv.hostPlatform
19+ meta = {
20− then
20+ platforms = platforms.unix;
21− let skip = pkgs.runCommand "skip-test-setup-deps" {} ''
21+ # Building reinstallable lib GHC is broken on 8.10, and we require lib ghc so this won't work with cross-compiling.
22− echo "Skipping setup-deps test when cross compiling as it needs the ghc lib" >& 2
22+ # Moreover, even building the plan doesn't seem to work in these circumstances.
23− touch $out
23+ disabled = stdenv.buildPlatform != stdenv.hostPlatform || stdenv.hostPlatform.isMusl || compiler-nix-name == "ghc8102";
24− '';
24+ };
25− in {
25+in
26− ifdInputs = { plan-nix = skip; };
26+
27− run = skip;
27+recurseIntoAttrs ({
28− }
29− else {
30 ifdInputs = {
28 ifdInputs = {
31− inherit (project) plan-nix;
29+ plan-nix = addMetaAttrs meta project.plan-nix;
32 };
30 };
33 run = pkgs.stdenv.mkDerivation {
31 run = pkgs.stdenv.mkDerivation {
34 name = "setup-deps-test";
32 name = "setup-deps-test";
@@ -42,9 +40,7 @@ in recurseIntoAttrs (if stdenv.buildPlatform != stdenv.hostPlatform
42 touch $out
40 touch $out
43 '';
41 '';
44
42
45− meta.platforms = platforms.unix;
43+ inherit meta;
46− meta.disabled = stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isWindows;
47−
48 passthru = {
44 passthru = {
49 # Attributes used for debugging with nix repl
45 # Attributes used for debugging with nix repl
50 inherit project packages;
46 inherit project packages;
test/shell-for-setup-deps/default.nix+10−19
@@ -15,23 +15,7 @@ let
15
15
16 env = project.shellFor {};
16 env = project.shellFor {};
17
17
18−# Making this work for cross compilers will be difficult as setup-deps are
19−# built for the build platform and the shell will be for the host platform.
20−# We probably need a shell that provides both build and host ghc
21−# and corresponding package DBs and a way to use them.
22−# This problem affects musl as well as the build libraries are linked to glibc.
23−in recurseIntoAttrs (if stdenv.buildPlatform != stdenv.hostPlatform
18+in recurseIntoAttrs ({
24− then
25− let skip = runCommand "skipping-test-shell-for-setup-deps" {} ''
26− echo "Skipping shell-for-setup-deps test on cross compilers (does not work yet)" >& 2
27− touch $out
28− '';
29− in {
30− ifdInputs = { plan-nix = skip; };
31− env = skip;
32− run = skip;
33− }
34− else {
35 ifdInputs = {
19 ifdInputs = {
36 inherit (project) plan-nix;
20 inherit (project) plan-nix;
37 };
21 };
@@ -52,8 +36,15 @@ in recurseIntoAttrs (if stdenv.buildPlatform != stdenv.hostPlatform
52 touch $out
36 touch $out
53 '';
37 '';
54
38
39+ meta = {
55− meta.platforms = platforms.all;
40+ platforms = platforms.all;
41+ # Making this work for cross compilers will be difficult as setup-deps are
42+ # built for the build platform and the shell will be for the host platform.
43+ # We probably need a shell that provides both build and host ghc
44+ # and corresponding package DBs and a way to use them.
45+ # This problem affects musl as well as the build libraries are linked to glibc.
56− meta.disabled = stdenv.buildPlatform != stdenv.hostPlatform;
46+ disabled = stdenv.buildPlatform != stdenv.hostPlatform;
47+ };
57
48
58 passthru = {
49 passthru = {
59 # Used for debugging with nix repl
50 # Used for debugging with nix repl
test/shell-for/default.nix+4−2
@@ -64,8 +64,10 @@ in recurseIntoAttrs {
64 touch $out
64 touch $out
65 '';
65 '';
66
66
67+ meta = {
67− meta.platforms = platforms.all;
68+ platforms = platforms.unix;
68− meta.disabled = stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isWindows;
69+ disabled = stdenv.hostPlatform.isMusl;
70+ };
69
71
70 passthru = {
72 passthru = {
71 # Used for debugging with nix repl
73 # Used for debugging with nix repl
test/with-packages/default.nix+4−2
@@ -82,8 +82,10 @@ in recurseIntoAttrs {
82 touch $out
82 touch $out
83 '';
83 '';
84
84
85+ meta = {
85− meta.platforms = platforms.all;
86+ platforms = platforms.all;
86− meta.disabled = stdenv.hostPlatform.isMusl;
87+ disabled = stdenv.hostPlatform.isMusl;
88+ };
87
89
88 passthru = {
90 passthru = {
89 # Used for debugging with nix repl
91 # Used for debugging with nix repl