Skip to content

Commit

Permalink
Add ghc 8.10.1 (#541)
Browse files Browse the repository at this point in the history
* ghc 8.10
* Adds/Updates/Removes materialization files
* Disable one-shot-kqueue-on-macos patch on ghc-8.10
* Test ghc883 and ghc8101 but only with nix 20.03
* Various smaller fixes.

This should fix the infinite recursion issue with #654

Co-authored-by: Lennart Spitzner <[email protected]>
  • Loading branch information
hamishmack and lspitzner authored Jun 7, 2020
1 parent 2f81e72 commit 15fc6b3
Show file tree
Hide file tree
Showing 103 changed files with 15,764 additions and 135 deletions.
34 changes: 20 additions & 14 deletions ci.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,23 @@
"R1909" = "nixpkgs-1909";
"R2003" = "nixpkgs-2003";
};
compilerNixNames = builtins.mapAttrs (defaultCompilerNixName: _:
(import ./default.nix { inherit checkMaterialization defaultCompilerNixName; }).nixpkgsArgs) {
compilerNixNames = nixpkgsName: nixpkgs: builtins.mapAttrs (defaultCompilerNixName: _:
(import ./default.nix { inherit checkMaterialization defaultCompilerNixName; }).nixpkgsArgs) ({
ghc865 = {};
} // nixpkgs.lib.optionalAttrs (nixpkgsName == "R2003") {
ghc883 = {};
};
ghc8101 = {};
});
systems = nixpkgs: nixpkgs.lib.filterAttrs (_: v: builtins.elem v supportedSystems) {
# I wanted to take these from 'lib.systems.examples', but apparently there isn't one for linux!
linux = "x86_64-linux";
darwin = "x86_64-darwin";
};
crossSystems = nixpkgsName: nixpkgs: system:
crossSystems = nixpkgsName: nixpkgs: compilerNixName: system:
# We need to use the actual nixpkgs version we're working with here, since the values
# of 'lib.systems.examples' are not understood between all versions
let lib = nixpkgs.lib;
in lib.optionalAttrs (system == "x86_64-linux") {
in lib.optionalAttrs (system == "x86_64-linux" && compilerNixName != "ghc8101") {
# Windows cross compilation is currently broken on macOS
inherit (lib.systems.examples) mingwW64;
} // lib.optionalAttrs (system == "x86_64-linux") {
Expand All @@ -39,7 +41,7 @@ dimension "Nixpkgs version" nixpkgsVersions (nixpkgsName: nixpkgs-pin:
let pinnedNixpkgsSrc = sources.${nixpkgs-pin};
# We need this for generic nixpkgs stuff at the right version
genericPkgs = import pinnedNixpkgsSrc {};
in dimension "GHC version" compilerNixNames (compilerNixName: nixpkgsArgs:
in dimension "GHC version" (compilerNixNames nixpkgsName genericPkgs) (compilerNixName: nixpkgsArgs:
dimension "System" (systems genericPkgs) (systemName: system:
let pkgs = import pinnedNixpkgsSrc (nixpkgsArgs // { inherit system; });
build = import ./build.nix { inherit pkgs ifdLevel; };
Expand All @@ -49,33 +51,37 @@ dimension "Nixpkgs version" nixpkgsVersions (nixpkgsName: nixpkgs-pin:
# TODO: can we merge this into the general case by picking an appropriate "cross system" to mean native?
native = pkgs.recurseIntoAttrs ({
inherit (build) tests tools maintainer-scripts maintainer-script-cache;
ghc = pkgs.haskell-nix.compiler."${compilerNixName}";
ghc = pkgs.buildPackages.haskell-nix.compiler."${compilerNixName}";
} // pkgs.lib.optionalAttrs (ifdLevel >= 1) {
iserv-proxy = pkgs.ghc-extra-packages."${compilerNixName}".iserv-proxy.components.exes.iserv-proxy;
} // pkgs.lib.optionalAttrs (ifdLevel >= 2) {
} // pkgs.lib.optionalAttrs (ifdLevel >= 3) {
hello = (pkgs.haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; }).components.exes.hello;
});
}
//
dimension "Cross system" (crossSystems nixpkgsName genericPkgs system) (crossSystemName: crossSystem:
dimension "Cross system" (crossSystems nixpkgsName genericPkgs compilerNixName system) (crossSystemName: crossSystem:
# Cross builds
let pkgs = import pinnedNixpkgsSrc (nixpkgsArgs // { inherit system crossSystem; });
build = import ./build.nix { inherit pkgs ifdLevel; };
in pkgs.recurseIntoAttrs (pkgs.lib.optionalAttrs (ifdLevel >= 1) {
ghc = pkgs.buildPackages.haskell-nix.compiler."${compilerNixName}";
# TODO: look into cross compiling ghc itself
# ghc = pkgs.haskell-nix.compiler."${compilerNixName}";
# TODO: look into making tools work when cross compiling
# inherit (build) tools;
# Tests are broken on aarch64 cross https://github.com/input-output-hk/haskell.nix/issues/513
tests =
if (crossSystemName != "aarch64-multiplatform")
then build.tests
else pkgs.recurseIntoAttrs {
# Even on aarch64 we still want to build the pinned files
inherit (build.tests) haskellNixRoots;
};
} // pkgs.lib.optionalAttrs (ifdLevel >= 2) {
remote-iserv = pkgs.ghc-extra-packages."${compilerNixName}".remote-iserv.components.exes.remote-iserv;
iserv-proxy = pkgs.ghc-extra-packages."${compilerNixName}".iserv-proxy.components.exes.iserv-proxy;
} // pkgs.lib.optionalAttrs (ifdLevel >= 3) {
hello = (pkgs.haskell-nix.hackage-package { name = "hello"; version = "1.0.0.2"; }).components.exes.hello;
}
//
# Tests are broken on aarch64 cross https://github.com/input-output-hk/haskell.nix/issues/513
pkgs.lib.optionalAttrs (crossSystemName != "aarch64-multiplatform") {
inherit (build) tests;
})
)
)
Expand Down
2 changes: 1 addition & 1 deletion lib/call-cabal-project-to-nix.nix
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ let
fetchRepo = repo:
let sha256 = repo."--sha256" or (lookupSha256 repo);
in (if sha256 != null
then pkgs.fetchgit {
then pkgs.evalPackages.fetchgit {
url = repo.location;
rev = repo.tag;
inherit sha256;
Expand Down
9 changes: 5 additions & 4 deletions lib/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
with haskellLib;

let
# Why `final.evalPackages.buildPackages.git`?
# Why not just final.evalPackages.git?
# Why `final.evalPackages.buildPackages.gitMinimal`?
# Why not just final.evalPackages.gitMinimal?
#
# A problem arises when `evalPackages` is `buildPackages`.i
# As may be the case in a flake.
Expand All @@ -24,7 +24,7 @@ let
# * When `gdb` does not exist for `js`, so when cross
# compiling with ghcjs `final.buildPackages.git` fails
# to build at all.
inherit (pkgs.evalPackages.buildPackages) git;
inherit (pkgs.evalPackages.buildPackages) gitMinimal;

in {
# Within the package components, these are the attribute names of
Expand Down Expand Up @@ -204,7 +204,8 @@ in {

# Clean git directory based on `git ls-files --recurse-submodules`
cleanGit = import ./clean-git.nix {
inherit lib git cleanSourceWith;
inherit lib cleanSourceWith;
git = gitMinimal;
inherit (pkgs.evalPackages) runCommand;
};

Expand Down
3 changes: 1 addition & 2 deletions materialized/bootstrap/ghc844/hscolour/default.nix

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

160 changes: 160 additions & 0 deletions materialized/bootstrap/ghc882/alex/.plan.nix/alex.nix

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 49 additions & 0 deletions materialized/bootstrap/ghc882/alex/default.nix

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 15fc6b3

Please sign in to comment.