on iko/ghcjs-patch-master help sign in
Add missing pins and test ghc865 and ghc883 (#641)

Now that the defaultCompilerNixName is used to choose which GHC to use for tools we need to update haskellNixRoots to make sure the common tools wind up in the cache. To do this we add the compilerNixName as a dimension in ci.nix. This has the added bonus of ensuring the tests a run with the supported versions of ghc (not just the default one). haskellNixRoots is also updated to include the tools built with the defaultCompilerNixName (in particular cabal-install was not pinned and this was the likely cause of significant builds due to cache misses).

commitff9a01e82e78f03c091b024267da1be0b1e64c32 authorHamish Mackenzie <Hamish.Mackenzie@iohk.io> dateTue 2 Jun 2020, 11:44 (6 years ago) parente5a0522
11 files changed+60−62
ci.nix+45−48 overlays/haskell.nix+6−5 release.nix+1−1 test/buildable/default.nix+1−1 test/cabal-source-repo/default.nix+1−1 test/call-cabal-project-to-nix/default.nix+1−1 test/ghc-options/cabal.nix+1−1 test/lookup-sha256/default.nix+1−1 test/project-flags/cabal.nix+1−1 test/setup-deps/cabal.project+1−1 test/shell-for-setup-deps/cabal.project+1−1
ci.nix+45−48
@@ -3,14 +3,20 @@
33{ supportedSystems ? [ "x86_64-linux" "x86_64-darwin" ]
44, ifdLevel ? 3
55# Whether or not we are evaluating in restricted mode. This is true in Hydra, but not in Hercules.
6−, restrictEval ? false }:
7−let
6+, restrictEval ? false
7+, checkMaterialization ? false }:
8+ let
89 inherit (import ./ci-lib.nix) dimension platformFilterGeneric filterAttrsOnlyRecursive;
9− inherit (import ./default.nix { checkMaterialization = false; }) sources nixpkgsArgs;
10+ sources = import ./nix/sources.nix {};
1011 nixpkgsVersions = {
1112 "R1909" = "nixpkgs-1909";
1213 "R2003" = "nixpkgs-2003";
1314 };
15+ compilerNixNames = builtins.mapAttrs (defaultCompilerNixName: _:
16+ (import ./default.nix { inherit checkMaterialization defaultCompilerNixName; }).nixpkgsArgs) {
17+ ghc865 = {};
18+ ghc883 = {};
19+ };
1420 systems = nixpkgs: nixpkgs.lib.filterAttrs (_: v: builtins.elem v supportedSystems) {
1521 # I wanted to take these from 'lib.systems.examples', but apparently there isn't one for linux!
1622 linux = "x86_64-linux";
@@ -33,54 +39,45 @@ dimension "Nixpkgs version" nixpkgsVersions (nixpkgsName: nixpkgs-pin:
3339 let pinnedNixpkgsSrc = sources.${nixpkgs-pin};
3440 # We need this for generic nixpkgs stuff at the right version
3541 genericPkgs = import pinnedNixpkgsSrc {};
36− in dimension "System" (systems genericPkgs) (systemName: system:
37− let pkgs = import pinnedNixpkgsSrc (nixpkgsArgs // { inherit system; });
38− build = import ./build.nix { inherit pkgs ifdLevel; };
39− platformFilter = platformFilterGeneric pkgs system;
40− compilers = {
41− inherit (pkgs.haskell-nix.compiler) ghc865 ghc883;
42− };
43− in filterAttrsOnlyRecursive (_: v: platformFilter v) {
44− # Native builds
45− # TODO: can we merge this into the general case by picking an appropriate "cross system" to mean native?
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) {
55− hello = (pkgs.haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; }).components.exes.hello;
56− });
57− }
58− //
59− dimension "Cross system" (crossSystems nixpkgsName genericPkgs system) (crossSystemName: crossSystem:
60− # Cross builds
61− let pkgs = import pinnedNixpkgsSrc (nixpkgsArgs // { inherit system crossSystem; });
42+ in dimension "GHC version" compilerNixNames (compilerNixName: nixpkgsArgs:
43+ dimension "System" (systems genericPkgs) (systemName: system:
44+ let pkgs = import pinnedNixpkgsSrc (nixpkgsArgs // { inherit system; });
6245 build = import ./build.nix { inherit pkgs ifdLevel; };
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) {
77− hello = (pkgs.haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; }).components.exes.hello;
46+ platformFilter = platformFilterGeneric pkgs system;
47+ in filterAttrsOnlyRecursive (_: v: platformFilter v) {
48+ # Native builds
49+ # TODO: can we merge this into the general case by picking an appropriate "cross system" to mean native?
50+ native = pkgs.recurseIntoAttrs ({
51+ inherit (build) tests tools maintainer-scripts maintainer-script-cache;
52+ ghc = pkgs.haskell-nix.compiler."${compilerNixName}";
53+ } // pkgs.lib.optionalAttrs (ifdLevel >= 1) {
54+ iserv-proxy = pkgs.ghc-extra-packages."${compilerNixName}".iserv-proxy.components.exes.iserv-proxy;
55+ } // pkgs.lib.optionalAttrs (ifdLevel >= 2) {
56+ hello = (pkgs.haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; }).components.exes.hello;
57+ });
7858 }
7959 //
80− # Tests are broken on aarch64 cross https://github.com/input-output-hk/haskell.nix/issues/513
81− pkgs.lib.optionalAttrs (crossSystemName != "aarch64-multiplatform") {
82− inherit (build) tests;
83− })
60+ dimension "Cross system" (crossSystems nixpkgsName genericPkgs system) (crossSystemName: crossSystem:
61+ # Cross builds
62+ let pkgs = import pinnedNixpkgsSrc (nixpkgsArgs // { inherit system crossSystem; });
63+ build = import ./build.nix { inherit pkgs ifdLevel; };
64+ in pkgs.recurseIntoAttrs (pkgs.lib.optionalAttrs (ifdLevel >= 1) {
65+ # TODO: look into cross compiling ghc itself
66+ # ghc = pkgs.haskell-nix.compiler."${compilerNixName}";
67+ # TODO: look into making tools work when cross compiling
68+ # inherit (build) tools;
69+ } // pkgs.lib.optionalAttrs (ifdLevel >= 2) {
70+ remote-iserv = pkgs.ghc-extra-packages."${compilerNixName}".remote-iserv.components.exes.remote-iserv;
71+ iserv-proxy = pkgs.ghc-extra-packages."${compilerNixName}".iserv-proxy.components.exes.iserv-proxy;
72+ } // pkgs.lib.optionalAttrs (ifdLevel >= 3) {
73+ hello = (pkgs.haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; }).components.exes.hello;
74+ }
75+ //
76+ # Tests are broken on aarch64 cross https://github.com/input-output-hk/haskell.nix/issues/513
77+ pkgs.lib.optionalAttrs (crossSystemName != "aarch64-multiplatform") {
78+ inherit (build) tests;
79+ })
80+ )
8481 )
8582 )
8683)
overlays/haskell.nix+6−5
@@ -527,12 +527,12 @@ final: prev: {
527527 let filterSupportedGhc = final.lib.filterAttrs (n: _: n == "ghc865" || n == "ghc883");
528528 in final.recurseIntoAttrs ({
529529 # Things that require no IFD to build
530− inherit (final.buildPackages.haskell-nix) nix-tools source-pins;
530+ inherit (final.buildPackages.haskell-nix) source-pins;
531531 } // final.lib.optionalAttrs (ifdLevel > 0) {
532532 # Things that require one IFD to build (the inputs should be in level 0)
533− alex = final.buildPackages.haskell-nix.bootstrap.packages.alex;
534− happy = final.buildPackages.haskell-nix.bootstrap.packages.happy;
535− hscolour = final.buildPackages.haskell-nix.bootstrap.packages.hscolour;
533+ boot-alex = final.buildPackages.haskell-nix.bootstrap.packages.alex;
534+ boot-happy = final.buildPackages.haskell-nix.bootstrap.packages.happy;
535+ boot-hscolour = final.buildPackages.haskell-nix.bootstrap.packages.hscolour;
536536 ghc865 = final.buildPackages.haskell-nix.compiler.ghc865;
537537 ghc883 = final.buildPackages.haskell-nix.compiler.ghc883;
538538 ghc-boot-packages-nix = final.recurseIntoAttrs
@@ -542,7 +542,8 @@ final: prev: {
542542 (filterSupportedGhc final.ghc-extra-projects));
543543 } // final.lib.optionalAttrs (ifdLevel > 1) {
544544 # Things that require two levels of IFD to build (inputs should be in level 1)
545− inherit (final.haskell-nix) nix-tools;
545+ inherit (final.buildPackages.haskell-nix.haskellPackages.hpack.components.exes) hpack;
546+ inherit (final.buildPackages.haskell-nix) cabal-install dotCabal nix-tools alex happy;
546547 # These seem to be the only things we use from `ghc-extra-packages`
547548 # in haskell.nix itfinal.
548549 iserv-proxy = final.recurseIntoAttrs
release.nix+1−1
@@ -17,7 +17,7 @@ in allJobs // {
1717 meta.description = "All jobs required to pass CI";
1818 # Hercules will require all of these, we just require the 20.03 jobs
1919 # to avoid stressing Hydra too much
20− constituents = lib.collect lib.isDerivation allJobs.R2003.linux.native;
20+ constituents = lib.collect lib.isDerivation allJobs.R2003.ghc865.linux.native;
2121 };
2222 }
2323
test/buildable/default.nix+1−1
@@ -4,7 +4,7 @@ with stdenv.lib;
44
55let
66 project = cabalProject' {
7− index-state = "2019-04-30T00:00:00Z";
7+ index-state = "2020-05-25T00:00:00Z";
88 src = testSrc "buildable";
99 modules = [ { packages.buildable-test.flags.exclude-broken = true; } ];
1010 };
test/cabal-source-repo/default.nix+1−1
@@ -4,7 +4,7 @@ with stdenv.lib;
44
55let
66 project = cabalProject' {
7− index-state = "2019-04-30T00:00:00Z";
7+ index-state = "2020-05-25T00:00:00Z";
88 src = testSrc "cabal-source-repo";
99 };
1010 packages = project.hsPkgs;
test/call-cabal-project-to-nix/default.nix+1−1
@@ -6,7 +6,7 @@ let
66 # This test could use cabalProject', but it does so that it
77 # tests using callCabalProjectToNix and importAndFilterProject
88 plan = (importAndFilterProject (callCabalProjectToNix {
9− index-state = "2019-04-30T00:00:00Z";
9+ index-state = "2020-05-25T00:00:00Z";
1010 # reuse the cabal-simple test project
1111 src = testSrc "cabal-simple";
1212 }));
test/ghc-options/cabal.nix+1−1
@@ -4,7 +4,7 @@ with stdenv.lib;
44
55let
66 project = cabalProject' {
7− index-state = "2019-04-30T00:00:00Z";
7+ index-state = "2020-05-25T00:00:00Z";
88 src = testSrc "ghc-options";
99 # TODO find a way to get the ghc-options into plan.json so we can use it in plan-to-nix
1010 modules = [ { packages.test-ghc-options.package.ghcOptions = "-DTEST_GHC_OPTION"; } ];
test/lookup-sha256/default.nix+1−1
@@ -2,7 +2,7 @@
22 (haskell-nix.hackage-package {
33 name = "pandoc";
44 version = "2.9.2.1";
5− index-state = "2020-04-15T00:00:00Z";
5+ index-state = "2020-05-25T00:00:00Z";
66 # Function that returns a sha256 string by looking up the location
77 # and tag in a nested attrset
88 lookupSha256 = { location, tag, ... }:
test/project-flags/cabal.nix+1−1
@@ -4,7 +4,7 @@ with stdenv.lib;
44
55let
66 project = cabalProject' {
7− index-state = "2019-04-30T00:00:00Z";
7+ index-state = "2020-05-25T00:00:00Z";
88 src = testSrc "project-flags";
99 };
1010 packages = project.hsPkgs;
test/setup-deps/cabal.project+1−1
@@ -1,3 +1,3 @@
1−index-state: 2019-10-01T00:00:00Z
1+index-state: 2020-05-25T00:00:00Z
22
33packages: pkg
test/shell-for-setup-deps/cabal.project+1−1
@@ -1,3 +1,3 @@
1−index-state: 2019-10-01T00:00:00Z
1+index-state: 2020-05-25T00:00:00Z
22
33packages: pkg