88 inherit ( import ./ci-lib.nix ) dimension platformFilterGeneric filterAttrsOnlyRecursive ;
99 inherit ( import ./default.nix { } ) sources nixpkgsArgs ;
1010 nixpkgsVersions = {
11- "R1903" = "nixpkgs-1903" ;
1211 "R1909" = "nixpkgs-1909" ;
12+ "R2003" = "nixpkgs-2003" ;
1313 } ;
1414 systems = nixpkgs : nixpkgs . lib . filterAttrs ( _ : v : builtins . elem v supportedSystems ) {
1515 # I wanted to take these from 'lib.systems.examples', but apparently there isn't one for linux!
2020 # We need to use the actual nixpkgs version we're working with here, since the values
2121 # of 'lib.systems.examples' are not understood between all versions
2222 let lib = nixpkgs . lib ;
23- in lib . optionalAttrs ( system == "x86_64-linux" || nixpkgsName == "R1903" ) {
24- # Windows cross compilation is currently broken on macOS for nixpkgs 19.09 (works on 19.03)
23+ in lib . optionalAttrs ( system == "x86_64-linux" ) {
24+ # Windows cross compilation is currently broken on macOS
2525 inherit ( lib . systems . examples ) mingwW64 ;
2626 } // lib . optionalAttrs ( system == "x86_64-linux" ) {
2727 # Musl cross only works on linux
@@ -37,29 +37,50 @@ dimension "Nixpkgs version" nixpkgsVersions (nixpkgsName: nixpkgs-pin:
3737 let pkgs = import pinnedNixpkgsSrc ( nixpkgsArgs // { inherit system ; } ) ;
3838 build = import ./build.nix { inherit pkgs ifdLevel ; } ;
3939 platformFilter = platformFilterGeneric pkgs system ;
40+ compilers = {
41+ inherit ( pkgs . haskell-nix . compiler ) ghc865 ghc883 ;
42+ } ;
4043 in filterAttrsOnlyRecursive ( _ : v : platformFilter v ) {
4144 # Native builds
4245 # TODO: can we merge this into the general case by picking an appropriate "cross system" to mean native?
43- native = pkgs . recurseIntoAttrs {
44- inherit ( build ) tests maintainer-scripts maintainer-script-cache ;
46+ native = pkgs . recurseIntoAttrs ( {
47+ inherit ( build ) tests tools maintainer-scripts maintainer-script-cache ;
48+ ghc = pkgs . recurseIntoAttrs compilers ;
49+ } // pkgs . lib . optionalAttrs ( ifdLevel >= 1 ) {
50+ iserv-proxy = pkgs . recurseIntoAttrs (
51+ pkgs . lib . mapAttrs ( ghcName : _ :
52+ pkgs . ghc-extra-packages . "${ ghcName } " . iserv-proxy . components . exes . iserv-proxy
53+ ) compilers ) ;
54+ } // pkgs . lib . optionalAttrs ( ifdLevel >= 2 ) {
4555 hello = ( pkgs . haskell-nix . hackage-package { name = "hello" ; version = "1.0.0.2" ; } ) . components . exes . hello ;
46- iserv-proxy = pkgs . ghc-extra-packages . ghc865 . iserv-proxy . components . exes . iserv-proxy ;
47- ghc = pkgs . recurseIntoAttrs pkgs . haskell-nix . compiler ;
48- } ;
56+ } ) ;
4957 }
5058 //
5159 dimension "Cross system" ( crossSystems nixpkgsName genericPkgs system ) ( crossSystemName : crossSystem :
5260 # Cross builds
5361 let pkgs = import pinnedNixpkgsSrc ( nixpkgsArgs // { inherit system crossSystem ; } ) ;
5462 build = import ./build.nix { inherit pkgs ifdLevel ; } ;
55- in pkgs . recurseIntoAttrs {
63+ in pkgs . recurseIntoAttrs ( pkgs . lib . optionalAttrs ( ifdLevel >= 1 ) {
64+ ghc = pkgs . recurseIntoAttrs compilers ;
65+ # TODO: look into making tools work when cross compiling
66+ # inherit (build) tools;
67+ } // pkgs . lib . optionalAttrs ( ifdLevel >= 2 ) {
68+ remote-iserv = pkgs . recurseIntoAttrs (
69+ pkgs . lib . mapAttrs ( ghcName : _ :
70+ pkgs . ghc-extra-packages . "${ ghcName } " . remote-iserv . components . exes . remote-iserv
71+ ) compilers ) ;
72+ iserv-proxy = pkgs . recurseIntoAttrs (
73+ pkgs . lib . mapAttrs ( ghcName : _ :
74+ pkgs . ghc-extra-packages . "${ ghcName } " . iserv-proxy . components . exes . iserv-proxy
75+ ) compilers ) ;
76+ } // pkgs . lib . optionalAttrs ( ifdLevel >= 3 ) {
5677 hello = ( pkgs . haskell-nix . hackage-package { name = "hello" ; version = "1.0.0.2" ; } ) . components . exes . hello ;
57- iserv-proxy = pkgs . ghc-extra-packages . ghc865 . iserv-proxy . components . exes . iserv-proxy ;
58- remote-iserv = pkgs . ghc-extra-packages . ghc865 . remote-iserv . components . exes . remote-iserv ;
5978 }
6079 //
6180 # Tests are broken on aarch64 cross https://github.com/input-output-hk/haskell.nix/issues/513
62- pkgs . lib . optionalAttrs ( crossSystemName != "aarch64-multiplatform" ) build . tests
81+ pkgs . lib . optionalAttrs ( crossSystemName != "aarch64-multiplatform" ) {
82+ inherit ( build ) tests ;
83+ } )
6384 )
6485 )
6586)
0 commit comments