1
1
# 'supportedSystems' restricts the set of systems that we will evaluate for. Useful when you're evaluating
2
2
# on a machine with e.g. no way to build the Darwin IFDs you need!
3
- { supportedSystems ? [ "x86_64-linux" "x86_64-darwin" ]
4
- , ifdLevel ? 3
3
+ { ifdLevel ? 2
5
4
# Whether or not we are evaluating in restricted mode. This is true in Hydra, but not in Hercules.
6
5
, restrictEval ? false
7
6
, checkMaterialization ? false
8
- , pkgs ? ( import ./. { } ) . pkgs } :
7
+ , compat
8
+ , system
9
+ , pkgs ? ( compat { inherit system ; } ) . pkgs } :
9
10
let
10
11
inherit ( import ./ci-lib.nix { inherit pkgs ; } ) dimension platformFilterGeneric filterAttrsOnlyRecursive ;
11
12
inherit ( pkgs . haskell-nix ) sources ;
12
13
nixpkgsVersions = {
13
14
"R2205" = "nixpkgs-2205" ;
14
15
"unstable" = "nixpkgs-unstable" ;
15
16
} ;
16
- haskellNix = import ./default.nix { inherit checkMaterialization ; } ;
17
+ haskellNix = compat { inherit checkMaterialization system ; } ;
17
18
nixpkgsArgs = haskellNix . nixpkgsArgs // {
18
19
# Needed for dwarf tests
19
20
config = haskellNix . nixpkgsArgs . config // {
20
21
permittedInsecurePackages = [ "libdwarf-20210528" "libdwarf-20181024" "dwarfdump-20181024" ] ;
21
22
} ;
22
23
} ;
23
- compilerNixNames = nixpkgsName : nixpkgs : builtins . mapAttrs ( compiler-nix-name : runTests : {
24
- inherit runTests ;
25
- } ) (
26
- # GHC version to cache and whether to run the tests against them.
27
- # This list of GHC versions should include everything for which we
28
- # have a ./materialized/ghcXXX directory containing the materialized
29
- # cabal-install and nix-tools plans. When removing a ghc version
30
- # from here (so that is no longer cached) also remove ./materialized/ghcXXX.
31
- # Update supported-ghc-versions.md to reflect any changes made here.
32
- nixpkgs . lib . optionalAttrs ( nixpkgsName == "R2205" ) {
33
- ghc865 = false ;
34
- ghc8107 = false ;
35
- } // nixpkgs . lib . optionalAttrs ( nixpkgsName == "unstable" ) {
36
- ghc865 = false ;
37
- ghc884 = false ; # Native version is used to boot 9.0.1
38
- ghc8107 = true ;
39
- ghc902 = false ;
40
- ghc924 = true ;
41
- } ) ;
42
- systems = nixpkgsName : nixpkgs : compiler-nix-name : nixpkgs . lib . genAttrs (
43
- nixpkgs . lib . filter ( v :
24
+ compilerNixNames = nixpkgsName : nixpkgs :
25
+ # Include only the GHC versions that are supported by haskell.nix
26
+ nixpkgs . lib . filterAttrs ( compiler-nix-name : _ :
44
27
# We have less x86_64-darwin build capacity so build fewer GhC versions
45
- ( v != "x86_64-darwin" || (
28
+ ( system != "x86_64-darwin" || (
46
29
! __elem compiler-nix-name [ "ghc8104" "ghc810420210212" "ghc8105" "ghc8106" "ghc901" "ghc921" "ghc922" ] ) )
47
30
&&
48
31
# aarch64-darwin requires ghc 8.10.7
49
- ( v != "aarch64-darwin" || (
32
+ ( system != "aarch64-darwin" || (
50
33
! __elem compiler-nix-name [ "ghc865" "ghc884" "ghc8104" "ghc810420210212" "ghc8105" "ghc8106" "ghc901" "ghc921" "ghc922" ] ) )
51
34
&&
52
35
# aarch64-linux requires ghc 8.8.4
53
- ( v != "aarch64-linux" || (
36
+ ( system != "aarch64-linux" || (
54
37
! __elem compiler-nix-name [ "ghc865" "ghc8104" "ghc810420210212" "ghc8105" "ghc8106" "ghc901" "ghc921" "ghc922" ]
55
- ) ) ) supportedSystems ) ( v : v ) ;
56
- crossSystems = nixpkgsName : nixpkgs : compiler-nix-name : system :
38
+ ) ) )
39
+ ( builtins . mapAttrs ( compiler-nix-name : runTests : {
40
+ inherit runTests ;
41
+ } ) (
42
+ # GHC version to cache and whether to run the tests against them.
43
+ # This list of GHC versions should include everything for which we
44
+ # have a ./materialized/ghcXXX directory containing the materialized
45
+ # cabal-install and nix-tools plans. When removing a ghc version
46
+ # from here (so that is no longer cached) also remove ./materialized/ghcXXX.
47
+ # Update supported-ghc-versions.md to reflect any changes made here.
48
+ nixpkgs . lib . optionalAttrs ( nixpkgsName == "R2205" ) {
49
+ ghc865 = false ;
50
+ ghc8107 = false ;
51
+ } // nixpkgs . lib . optionalAttrs ( nixpkgsName == "unstable" ) {
52
+ ghc865 = false ;
53
+ ghc884 = false ; # Native version is used to boot 9.0.1
54
+ ghc8107 = true ;
55
+ ghc902 = false ;
56
+ ghc924 = true ;
57
+ } ) ) ;
58
+ crossSystems = nixpkgsName : nixpkgs : compiler-nix-name :
57
59
# We need to use the actual nixpkgs version we're working with here, since the values
58
60
# of 'lib.systems.examples' are not understood between all versions
59
61
let lib = nixpkgs . lib ;
@@ -76,9 +78,8 @@ dimension "Nixpkgs version" nixpkgsVersions (nixpkgsName: nixpkgs-pin:
76
78
let pinnedNixpkgsSrc = sources . ${ nixpkgs-pin } ;
77
79
evalPackages = import pinnedNixpkgsSrc nixpkgsArgs ;
78
80
in dimension "GHC version" ( compilerNixNames nixpkgsName evalPackages ) ( compiler-nix-name : { runTests } :
79
- dimension "System" ( systems nixpkgsName evalPackages compiler-nix-name ) ( systemName : system :
80
81
let pkgs = import pinnedNixpkgsSrc ( nixpkgsArgs // { inherit system ; } ) ;
81
- build = import ./build.nix { inherit pkgs evalPackages ifdLevel compiler-nix-name ; } ;
82
+ build = import ./build.nix { inherit pkgs evalPackages ifdLevel compiler-nix-name haskellNix ; } ;
82
83
platformFilter = platformFilterGeneric pkgs system ;
83
84
in filterAttrsOnlyRecursive ( _ : v : platformFilter v && ! ( isDisabled v ) ) ( {
84
85
# Native builds
@@ -95,10 +96,10 @@ dimension "Nixpkgs version" nixpkgsVersions (nixpkgsName: nixpkgs-pin:
95
96
} ) ;
96
97
}
97
98
//
98
- dimension "Cross system" ( crossSystems nixpkgsName evalPackages compiler-nix-name system ) ( crossSystemName : crossSystem :
99
+ dimension "Cross system" ( crossSystems nixpkgsName evalPackages compiler-nix-name ) ( crossSystemName : crossSystem :
99
100
# Cross builds
100
101
let pkgs = import pinnedNixpkgsSrc ( nixpkgsArgs // { inherit system crossSystem ; } ) ;
101
- build = import ./build.nix { inherit pkgs evalPackages ifdLevel compiler-nix-name ; } ;
102
+ build = import ./build.nix { inherit pkgs evalPackages ifdLevel compiler-nix-name haskellNix ; } ;
102
103
in pkgs . recurseIntoAttrs ( pkgs . lib . optionalAttrs ( ifdLevel >= 1 ) ( {
103
104
roots = pkgs . haskell-nix . roots' compiler-nix-name ifdLevel ;
104
105
ghc = pkgs . buildPackages . haskell-nix . compiler . "${ compiler-nix-name } " ;
@@ -119,4 +120,3 @@ dimension "Nixpkgs version" nixpkgsVersions (nixpkgsName: nixpkgs-pin:
119
120
) )
120
121
)
121
122
)
122
- )
0 commit comments