Skip to content

Commit

Permalink
Add GHC 9.0.1
Browse files Browse the repository at this point in the history
Also refactors the way tests are filtered to use `meta.disabled` where possible.
  • Loading branch information
hamishmack committed Mar 28, 2021
2 parents 0b53ee4 + e10e8ab commit a6f4e13
Show file tree
Hide file tree
Showing 97 changed files with 12,175 additions and 91 deletions.
5 changes: 3 additions & 2 deletions build.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ in rec {
tests = import ./test/default.nix { inherit pkgs ifdLevel compiler-nix-name; };

tools = pkgs.lib.optionalAttrs (ifdLevel >= 3) (
pkgs.recurseIntoAttrs {
pkgs.recurseIntoAttrs ({
cabal-latest = tool compiler-nix-name "cabal" "latest";
} // pkgs.lib.optionalAttrs (compiler-nix-name != "ghc901") {
hls-latest = tool compiler-nix-name "haskell-language-server" "latest";
hlint-latest = tool compiler-nix-name "hlint" (if compiler-nix-name == "ghc865" then "3.2.7" else "latest");
}
})
);

# Scripts for keeping Hackage and Stackage up to date, and CI tasks.
Expand Down
7 changes: 3 additions & 4 deletions ci.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@
ghc884 = true;
ghc8104 = true;
} // nixpkgs.lib.optionalAttrs (nixpkgsName == "unstable") {
ghc884 = true;
ghc884 = false;
ghc8104 = true;
ghc901 = true;
ghc810420210212 = false;
});
systems = nixpkgs: nixpkgs.lib.filterAttrs (_: v: builtins.elem v supportedSystems) {
Expand All @@ -58,9 +59,7 @@
# native so ifdLevel 1 includes compiler needed in ifdLevel2 eval)
inherit (lib.systems.examples) musl64 aarch64-multiplatform;
};
isDisabled = d:
let meta = d.meta or {};
in meta.disabled or false;
isDisabled = d: d.meta.disabled or false;
in
dimension "Nixpkgs version" nixpkgsVersions (nixpkgsName: nixpkgs-pin:
let pinnedNixpkgsSrc = sources.${nixpkgs-pin};
Expand Down
9 changes: 9 additions & 0 deletions compiler/ghc/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ let self =

# build-tools
, bootPkgs
, buildPackages
, autoconf, automake, coreutils, fetchurl, fetchpatch, perl, python3, m4, sphinx, numactl, elfutils
, autoreconfHook
, bash
Expand Down Expand Up @@ -100,6 +101,9 @@ let
CrossCompilePrefix = ${targetPrefix}
'' + lib.optionalString isCrossTarget ''
Stage1Only = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"}
''
# GHC 9.0.1 fails to compile for musl unless HADDOC_DOCS = NO
+ lib.optionalString (isCrossTarget || (targetPlatform.isMusl && builtins.compareVersions ghc-version "9.0.1" >= 0)) ''
HADDOCK_DOCS = NO
BUILD_SPHINX_HTML = NO
BUILD_SPHINX_PDF = NO
Expand Down Expand Up @@ -337,6 +341,11 @@ stdenv.mkDerivation (rec {
inherit (ghc.meta) license platforms;
};

# Needed for `haddock` to work on source that includes non ASCII chars
LANG = "en_US.UTF-8";
LC_ALL = "en_US.UTF-8";
} // lib.optionalAttrs (stdenv.buildPlatform.libc == "glibc") {
LOCALE_ARCHIVE = "${buildPackages.glibcLocales}/lib/locale/locale-archive";
} // lib.optionalAttrs targetPlatform.useAndroidPrebuilt {
dontStrip = true;
dontPatchELF = true;
Expand Down

Large diffs are not rendered by default.

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

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

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

Loading

0 comments on commit a6f4e13

Please sign in to comment.