12
12
"R1909" = "nixpkgs-1909" ;
13
13
"R2003" = "nixpkgs-2003" ;
14
14
} ;
15
- compilerNixNames = nixpkgsName : nixpkgs : builtins . mapAttrs ( compiler-nix-name : _ :
16
- ( import ./default.nix { inherit checkMaterialization ; } ) . nixpkgsArgs ) ( {
17
- ghc865 = { } ;
18
- } // nixpkgs . lib . optionalAttrs ( nixpkgsName == "R2003" ) {
19
- ghc884 = { } ;
20
- ghc8102 = { } ;
21
- } ) ;
15
+ compilerNixNames = nixpkgsName : nixpkgs : builtins . mapAttrs ( compiler-nix-name : runTests : {
16
+ inherit ( import ./default.nix { inherit checkMaterialization ; } ) nixpkgsArgs ;
17
+ inherit runTests ;
18
+ } ) (
19
+ # GHC version to cache and whether to run the tests against them.
20
+ # This list of GHC versions should include everything for which we
21
+ # have a ./materialized/ghcXXX directory containing the materialized
22
+ # cabal-install and nix-tools plans. When removing a ghc version
23
+ # from here (so that is no longer cached) also remove ./materialized/ghcXXX.
24
+ # Update supported-ghc-versions.md to reflect any changes made here.
25
+ {
26
+ ghc865 = true ;
27
+ } // nixpkgs . lib . optionalAttrs ( nixpkgsName == "R2003" ) {
28
+ ghc883 = false ;
29
+ ghc884 = true ;
30
+ ghc8101 = false ;
31
+ ghc8102 = true ;
32
+ } ) ;
22
33
systems = nixpkgs : nixpkgs . lib . filterAttrs ( _ : v : builtins . elem v supportedSystems ) {
23
34
# I wanted to take these from 'lib.systems.examples', but apparently there isn't one for linux!
24
35
linux = "x86_64-linux" ;
28
39
# We need to use the actual nixpkgs version we're working with here, since the values
29
40
# of 'lib.systems.examples' are not understood between all versions
30
41
let lib = nixpkgs . lib ;
31
- in lib . optionalAttrs ( system == "x86_64-linux" && compiler-nix-name != "ghc8102" ) {
42
+ in lib . optionalAttrs ( system == "x86_64-linux" && compiler-nix-name != "ghc8101" && compiler-nix-name != " ghc8102") {
32
43
# Windows cross compilation is currently broken on macOS
33
44
inherit ( lib . systems . examples ) mingwW64 ;
34
45
} // lib . optionalAttrs ( system == "x86_64-linux" ) {
@@ -41,7 +52,7 @@ dimension "Nixpkgs version" nixpkgsVersions (nixpkgsName: nixpkgs-pin:
41
52
let pinnedNixpkgsSrc = sources . ${ nixpkgs-pin } ;
42
53
# We need this for generic nixpkgs stuff at the right version
43
54
genericPkgs = import pinnedNixpkgsSrc { } ;
44
- in dimension "GHC version" ( compilerNixNames nixpkgsName genericPkgs ) ( compiler-nix-name : nixpkgsArgs :
55
+ in dimension "GHC version" ( compilerNixNames nixpkgsName genericPkgs ) ( compiler-nix-name : { nixpkgsArgs , runTests } :
45
56
dimension "System" ( systems genericPkgs ) ( systemName : system :
46
57
let pkgs = import pinnedNixpkgsSrc ( nixpkgsArgs // { inherit system ; } ) ;
47
58
build = import ./build.nix { inherit pkgs ifdLevel compiler-nix-name ; } ;
@@ -50,8 +61,10 @@ dimension "Nixpkgs version" nixpkgsVersions (nixpkgsName: nixpkgs-pin:
50
61
# Native builds
51
62
# TODO: can we merge this into the general case by picking an appropriate "cross system" to mean native?
52
63
native = pkgs . recurseIntoAttrs ( {
53
- inherit ( build ) tests tools maintainer-scripts maintainer-script-cache ;
64
+ roots = pkgs . haskell-nix . roots' compiler-nix-name ifdLevel ;
54
65
ghc = pkgs . buildPackages . haskell-nix . compiler . "${ compiler-nix-name } " ;
66
+ } // pkgs . lib . optionalAttrs runTests {
67
+ inherit ( build ) tests tools maintainer-scripts maintainer-script-cache ;
55
68
} // pkgs . lib . optionalAttrs ( ifdLevel >= 1 ) {
56
69
iserv-proxy = pkgs . ghc-extra-packages . "${ compiler-nix-name } " . iserv-proxy . components . exes . iserv-proxy ;
57
70
} // pkgs . lib . optionalAttrs ( ifdLevel >= 3 ) {
@@ -63,21 +76,17 @@ dimension "Nixpkgs version" nixpkgsVersions (nixpkgsName: nixpkgs-pin:
63
76
# Cross builds
64
77
let pkgs = import pinnedNixpkgsSrc ( nixpkgsArgs // { inherit system crossSystem ; } ) ;
65
78
build = import ./build.nix { inherit pkgs ifdLevel compiler-nix-name ; } ;
66
- in pkgs . recurseIntoAttrs ( pkgs . lib . optionalAttrs ( ifdLevel >= 1 ) {
67
- ghc = pkgs . buildPackages . haskell-nix . compiler . "${ compiler-nix-name } " ;
68
- # TODO: look into cross compiling ghc itself
69
- # ghc = pkgs.haskell-nix.compiler."${compiler-nix-name}";
70
- # TODO: look into making tools work when cross compiling
71
- # inherit (build) tools;
72
- # Tests are broken on aarch64 cross https://github.com/input-output-hk/haskell.nix/issues/513
73
- tests =
74
- if ( crossSystemName != "aarch64-multiplatform" )
75
- then build . tests
76
- else pkgs . recurseIntoAttrs {
77
- # Even on aarch64 we still want to build the pinned files
78
- inherit ( build . tests ) roots ;
79
- } ;
80
- } // pkgs . lib . optionalAttrs ( ifdLevel >= 2 ) {
79
+ in pkgs . recurseIntoAttrs ( pkgs . lib . optionalAttrs ( ifdLevel >= 1 ) ( {
80
+ roots = pkgs . haskell-nix . roots' compiler-nix-name ifdLevel ;
81
+ ghc = pkgs . buildPackages . haskell-nix . compiler . "${ compiler-nix-name } " ;
82
+ # TODO: look into cross compiling ghc itself
83
+ # ghc = pkgs.haskell-nix.compiler."${compiler-nix-name}";
84
+ # TODO: look into making tools work when cross compiling
85
+ # inherit (build) tools;
86
+ } // pkgs . lib . optionalAttrs ( runTests && crossSystemName != "aarch64-multiplatform" ) {
87
+ # Tests are broken on aarch64 cross https://github.com/input-output-hk/haskell.nix/issues/513
88
+ inherit ( build ) tests ;
89
+ } ) // pkgs . lib . optionalAttrs ( ifdLevel >= 2 ) {
81
90
remote-iserv = pkgs . ghc-extra-packages . "${ compiler-nix-name } " . remote-iserv . components . exes . remote-iserv ;
82
91
iserv-proxy = pkgs . ghc-extra-packages . "${ compiler-nix-name } " . iserv-proxy . components . exes . iserv-proxy ;
83
92
} // pkgs . lib . optionalAttrs ( ifdLevel >= 3 ) {
0 commit comments