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