Skip to content

Commit 8f6387e

Browse files
Try #1761:
2 parents 3a7f069 + e43ddeb commit 8f6387e

File tree

9 files changed

+595
-106
lines changed

9 files changed

+595
-106
lines changed

.buildkite/pipeline.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ steps:
152152

153153
- label: 'Check that evaluation of hydra jobs works without using remote builders'
154154
command:
155-
- nix-instantiate release.nix -A required-unstable-ghc8107-x86_64-darwin-native --show-trace --builders ''
155+
- nix-instantiate release.nix -A x86_64-darwin.required-unstable-ghc8107-native --show-trace --builders ''
156156
agents:
157157
system: x86_64-linux
158158

build.nix

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
#
33
# It is separate from default.nix because that file is the public API
44
# of Haskell.nix, which shouldn't have tests, etc.
5-
let
6-
haskellNix = (import ./default.nix {});
7-
in
85
{ nixpkgs ? haskellNix.sources.nixpkgs-unstable
96
, nixpkgsArgs ? haskellNix.nixpkgsArgs
107
, pkgs ? import nixpkgs nixpkgsArgs
@@ -13,6 +10,7 @@ in
1310
, pkgsForHydra ? import nixpkgsForHydra (nixpkgsArgs // { inherit (pkgs) system; })
1411
, ifdLevel ? 1000
1512
, compiler-nix-name ? throw "No `compiler-nix-name` passed to build.nix"
13+
, haskellNix ? (import ./default.nix {})
1614
}:
1715

1816
let

ci-lib.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
# Generic nixpkgs, use *only* for lib functions that are stable across versions
3-
pkgs ? (import ./. {}).pkgs,
3+
pkgs,
44
lib ? pkgs.lib
55
}: rec {
66
inherit (import ./dimension.nix) dimension;

ci.nix

Lines changed: 37 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,62 @@
11
# 'supportedSystems' restricts the set of systems that we will evaluate for. Useful when you're evaluating
22
# 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
54
# Whether or not we are evaluating in restricted mode. This is true in Hydra, but not in Hercules.
65
, restrictEval ? false
76
, checkMaterialization ? false
8-
, pkgs ? (import ./. {}).pkgs }:
7+
, compat
8+
, system
9+
, evalSystem ? builtins.currentSystem or "x86_64-linux"
10+
, pkgs ? (compat { inherit system; }).pkgs }:
911
let
1012
inherit (import ./ci-lib.nix { inherit pkgs; }) dimension platformFilterGeneric filterAttrsOnlyRecursive;
1113
inherit (pkgs.haskell-nix) sources;
1214
nixpkgsVersions = {
1315
"R2205" = "nixpkgs-2205";
1416
"unstable" = "nixpkgs-unstable";
1517
};
16-
haskellNix = import ./default.nix { inherit checkMaterialization; };
18+
haskellNix = compat { inherit checkMaterialization system; };
1719
nixpkgsArgs = haskellNix.nixpkgsArgs // {
1820
# Needed for dwarf tests
1921
config = haskellNix.nixpkgsArgs.config // {
2022
permittedInsecurePackages = ["libdwarf-20210528" "libdwarf-20181024" "dwarfdump-20181024"];
2123
};
2224
};
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: _:
4428
# We have less x86_64-darwin build capacity so build fewer GhC versions
45-
(v != "x86_64-darwin" || (
29+
(system != "x86_64-darwin" || (
4630
!__elem compiler-nix-name ["ghc8104" "ghc810420210212" "ghc8105" "ghc8106" "ghc901" "ghc921" "ghc922"]))
4731
&&
4832
# aarch64-darwin requires ghc 8.10.7
49-
(v != "aarch64-darwin" || (
33+
(system != "aarch64-darwin" || (
5034
!__elem compiler-nix-name ["ghc865" "ghc884" "ghc8104" "ghc810420210212" "ghc8105" "ghc8106" "ghc901" "ghc921" "ghc922"]))
5135
&&
5236
# aarch64-linux requires ghc 8.8.4
53-
(v != "aarch64-linux" || (
37+
(system != "aarch64-linux" || (
5438
!__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:
5760
# We need to use the actual nixpkgs version we're working with here, since the values
5861
# of 'lib.systems.examples' are not understood between all versions
5962
let lib = nixpkgs.lib;
@@ -74,11 +77,10 @@
7477
in
7578
dimension "Nixpkgs version" nixpkgsVersions (nixpkgsName: nixpkgs-pin:
7679
let pinnedNixpkgsSrc = sources.${nixpkgs-pin};
77-
evalPackages = import pinnedNixpkgsSrc nixpkgsArgs;
80+
evalPackages = import pinnedNixpkgsSrc (nixpkgsArgs // { system = evalSystem; });
7881
in dimension "GHC version" (compilerNixNames nixpkgsName evalPackages) (compiler-nix-name: {runTests}:
79-
dimension "System" (systems nixpkgsName evalPackages compiler-nix-name) (systemName: system:
8082
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; };
8284
platformFilter = platformFilterGeneric pkgs system;
8385
in filterAttrsOnlyRecursive (_: v: platformFilter v && !(isDisabled v)) ({
8486
# Native builds
@@ -95,10 +97,10 @@ dimension "Nixpkgs version" nixpkgsVersions (nixpkgsName: nixpkgs-pin:
9597
});
9698
}
9799
//
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:
99101
# Cross builds
100102
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; };
102104
in pkgs.recurseIntoAttrs (pkgs.lib.optionalAttrs (ifdLevel >= 1) ({
103105
roots = pkgs.haskell-nix.roots' compiler-nix-name ifdLevel;
104106
ghc = pkgs.buildPackages.haskell-nix.compiler."${compiler-nix-name}";
@@ -119,4 +121,3 @@ dimension "Nixpkgs version" nixpkgsVersions (nixpkgsName: nixpkgs-pin:
119121
))
120122
)
121123
)
122-
)

0 commit comments

Comments
 (0)