Skip to content

Commit

Permalink
Try #1121:
Browse files Browse the repository at this point in the history
  • Loading branch information
iohk-bors[bot] committed Jun 8, 2021
2 parents ecde924 + 88a1752 commit bed3d9b
Show file tree
Hide file tree
Showing 9 changed files with 7,956 additions and 38 deletions.
10 changes: 5 additions & 5 deletions .buildkite/pipeline.yml
@@ -1,6 +1,6 @@
steps:
- label: 'Run tests with ghc8104'
command: "./test/tests.sh ghc8104"
- label: 'Run tests with ghc8105'
command: "./test/tests.sh ghc8105"
agents:
system: x86_64-linux

Expand All @@ -14,9 +14,9 @@ steps:
agents:
system: x86_64-linux

- label: 'Check closure size with ghc8104'
- label: 'Check closure size with ghc8105'
command:
- nix-build build.nix -A maintainer-scripts.check-closure-size --argstr compiler-nix-name ghc8104 -o check-closure-size.sh
- nix-build build.nix -A maintainer-scripts.check-closure-size --argstr compiler-nix-name ghc8105 -o check-closure-size.sh
- echo "+++ Closure size (MB)"
- ./check-closure-size.sh
agents:
Expand All @@ -36,5 +36,5 @@ steps:

- label: 'Make sure non store paths like can be used as src'
command:
- nix-build build.nix -A maintainer-scripts.check-path-support --argstr compiler-nix-name ghc884 -o check-path-support.sh
- nix-build build.nix -A maintainer-scripts.check-path-support --argstr compiler-nix-name ghc8105 -o check-path-support.sh
- ./check-path-support.sh
5 changes: 3 additions & 2 deletions builder/default.nix
Expand Up @@ -26,8 +26,9 @@ let
# component builder and for nix-shells.
ghcForComponent = import ./ghc-for-component-wrapper.nix {
inherit lib ghc haskellLib;
inherit (buildPackages) stdenv runCommand makeWrapper;
inherit (buildPackages.xorg) lndir;
inherit (buildPackages) stdenv;
inherit (pkgs.evalPackages) runCommand makeWrapper;
inherit (pkgs.evalPackages.xorg) lndir;
};

# Builds a derivation which contains a ghc package-db of
Expand Down
23 changes: 9 additions & 14 deletions ci.nix
Expand Up @@ -9,7 +9,6 @@
inherit (import ./ci-lib.nix) dimension platformFilterGeneric filterAttrsOnlyRecursive;
sources = import ./nix/sources.nix {};
nixpkgsVersions = {
"R2003" = "nixpkgs-2003";
"R2009" = "nixpkgs-2009";
"unstable" = "nixpkgs-unstable";
};
Expand All @@ -24,15 +23,15 @@
# from here (so that is no longer cached) also remove ./materialized/ghcXXX.
# Update supported-ghc-versions.md to reflect any changes made here.
{
ghc865 = true;
ghc8104 = false; # Just included because the native version is needed at eval time
ghc865 = false;
ghc8105 = false; # Just included because the native version is needed at eval time
} // nixpkgs.lib.optionalAttrs (nixpkgsName == "R2009") {
ghc865 = false;
ghc884 = true;
ghc8104 = true;
ghc8105 = true;
} // nixpkgs.lib.optionalAttrs (nixpkgsName == "unstable") {
ghc865 = false;
ghc8104 = true;
ghc884 = false; # Native version is used to boot 9.0.1
ghc8105 = true;
ghc901 = true;
ghc810420210212 = false;
});
Expand All @@ -45,19 +44,15 @@
# 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 (nixpkgsName == "unstable" && (__elem compiler-nix-name ["ghc865" "ghc884" "ghc8104"])) {
in lib.optionalAttrs (nixpkgsName == "unstable" && (__elem compiler-nix-name ["ghc8105"])) {
inherit (lib.systems.examples) ghcjs;
} // lib.optionalAttrs (system == "x86_64-linux" && (
(nixpkgsName == "R2009" && __elem compiler-nix-name ["ghc8101" "ghc8102" "ghc8103" "ghc8104" "ghc810420210212"])
|| (nixpkgsName == "R2003" && __elem compiler-nix-name ["ghc865"]))) {
} // lib.optionalAttrs (system == "x86_64-linux" &&
nixpkgsName == "unstable" && (__elem compiler-nix-name ["ghc8105"])) {
# Windows cross compilation is currently broken on macOS
inherit (lib.systems.examples) mingwW64;
} // lib.optionalAttrs (system == "x86_64-linux"
&& !(nixpkgsName == "R2003" && compiler-nix-name == "ghc8104")) {
} // lib.optionalAttrs (system == "x86_64-linux" && nixpkgsName == "unstable" && compiler-nix-name == "ghc8105") {
# Musl cross only works on linux
# aarch64 cross only works on linux
# We also skip these for the R2003 was build of ghc8104 (we only need the
# native so ifdLevel 1 includes compiler needed in ifdLevel2 eval)
inherit (lib.systems.examples) musl64 aarch64-multiplatform;
};
isDisabled = d: d.meta.disabled or false;
Expand Down
2 changes: 2 additions & 0 deletions lib/ghcjs-project.nix
Expand Up @@ -115,6 +115,8 @@ let
cp ${../overlays/patches/config.sub} ghc/libraries/base/config.sub
cp ${../overlays/patches/config.sub} ghc/libraries/unix/config.sub
sed -i 's/_AC_PROG_CC_C99/AC_PROG_CC_C99/' ghc/aclocal.m4
patchShebangs .
sed -i 's/gcc /cc /g' utils/makePackages.sh
./utils/makePackages.sh copy
Expand Down
6 changes: 3 additions & 3 deletions nix/sources.json
Expand Up @@ -149,10 +149,10 @@
"homepage": "",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "410bbd828cdc6156aecd5bc91772ad3a6b1099c7",
"sha256": "0idvgvpgnzvk03yvd77lrca9qib936fq2x690jvk5gk3blsckz3r",
"rev": "d8eb97e3801bde96491535f40483d550b57605b9",
"sha256": "1bdd7jinq5d40qai45jfkbcw1n96c7fdlams5iidwzy2ag8axlqh",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/410bbd828cdc6156aecd5bc91772ad3a6b1099c7.tar.gz",
"url": "https://github.com/NixOS/nixpkgs/archive/d8eb97e3801bde96491535f40483d550b57605b9.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"old-ghc-nix": {
Expand Down
45 changes: 34 additions & 11 deletions overlays/bootstrap.nix
Expand Up @@ -44,7 +44,7 @@ let
latestVer = {
"8.6" = "8.6.5";
"8.8" = "8.8.4";
"8.10" = "8.10.4";
"8.10" = "8.10.5";
};
traceWarnOld = v: x: __trace
"WARNING: ${x.src-spec.version} is out of date, consider using ${latestVer.${v}}." x;
Expand Down Expand Up @@ -153,13 +153,16 @@ in {
++ from "8.10.1" ./patches/ghc/ghc-acrt-iob-func.patch

++ fromUntil "8.10.1" "8.10.3" ./patches/ghc/ghc-8.10-ubxt.patch
++ fromUntil "8.10.3" "8.11" ./patches/ghc/ghc-8.10.3-ubxt.patch
++ fromUntil "8.10.3" "8.10.5" ./patches/ghc/ghc-8.10.3-ubxt.patch
++ fromUntil "8.10.5" "8.11" ./patches/ghc/ghc-8.10.5-ubxt.patch
++ final.lib.optional (versionAtLeast "8.6.4") ./patches/ghc/Cabal-3886.patch

++ fromUntil "8.10.3" "8.10.5" ./patches/ghc/ghc-8.10.3-rts-make-markLiveObject-thread-safe.patch
++ final.lib.optional (versionAtLeast "8.10.4" && final.targetPlatform.isWindows) ./patches/ghc/ghc-8.10-z-drive-fix.patch
++ final.lib.optional (versionAtLeast "8.6.5") ./patches/ghc/ghc-8.10-windows-add-dependent-file.patch
++ fromUntil "8.10.1" "9.0" ./patches/ghc/Cabal-unbreak-GHCJS.patch
++ until "8.10.5" ./patches/ghc/AC_PROG_CC_99.patch
++ fromUntil "9.0.1" "9.0.2" ./patches/ghc/AC_PROG_CC_99.patch
;
in ({
ghc844 = final.callPackage ../compiler/ghc {
Expand Down Expand Up @@ -432,6 +435,26 @@ in {

ghc-patches = ghc-patches "8.10.4";
};
ghc8105 = final.callPackage ../compiler/ghc {
extra-passthru = { buildGHC = final.buildPackages.haskell-nix.compiler.ghc8105; };

bootPkgs = bootPkgs // {
# Not using 8.8 due to https://gitlab.haskell.org/ghc/ghc/-/issues/18143
ghc = final.buildPackages.buildPackages.haskell-nix.compiler.ghc865;
};
inherit sphinx installDeps;

buildLlvmPackages = final.buildPackages.llvmPackages_9;
llvmPackages = final.llvmPackages_9;

src-spec = rec {
version = "8.10.5";
url = "https://downloads.haskell.org/~ghc/${version}/ghc-${version}-src.tar.xz";
sha256 = "0vq7wch0wfvy2b5dbi308lq5225vf691n95m19c9igagdvql22gi";
};

ghc-patches = ghc-patches "8.10.5";
};
ghc901 = final.callPackage ../compiler/ghc {
extra-passthru = { buildGHC = final.buildPackages.haskell-nix.compiler.ghc901; };

Expand Down Expand Up @@ -588,18 +611,18 @@ in {
cd lib
lndir ${ghcjs884}/lib ${targetPrefix}ghc-8.8.4
'' + installDeps targetPrefix);
ghc8104 = let buildGHC = final.buildPackages.haskell-nix.compiler.ghc8104;
ghc8105 = let buildGHC = final.buildPackages.haskell-nix.compiler.ghc8105;
in let ghcjs8104 = final.callPackage ../compiler/ghcjs/ghcjs.nix {
ghcjsSrcJson = ../compiler/ghcjs/ghcjs810-src.json;
ghcjsVersion = "8.10.2";
ghc = buildGHC;
ghcVersion = "8.10.4";
compiler-nix-name = "ghc8104";
}; in let targetPrefix = "js-unknown-ghcjs-"; in final.runCommand "${targetPrefix}ghc-8.10.4" {
ghcVersion = "8.10.5";
compiler-nix-name = "ghc8105";
}; in let targetPrefix = "js-unknown-ghcjs-"; in final.runCommand "${targetPrefix}ghc-8.10.5" {
nativeBuildInputs = [ final.xorg.lndir ];
passthru = {
inherit targetPrefix;
version = "8.10.4";
version = "8.10.5";
isHaskellNixCompiler = true;
enableShared = false;
inherit (ghcjs8104) configured-src bundled-ghcjs project;
Expand All @@ -618,9 +641,9 @@ in {
ln -s ${ghcjs8104}/bin/ghcjs-pkg ${targetPrefix}ghc-pkg
ln -s ${buildGHC}/bin/hsc2hs ${targetPrefix}hsc2hs
cd ..
mkdir -p lib/${targetPrefix}ghc-8.10.4
mkdir -p lib/${targetPrefix}ghc-8.10.5
cd lib
lndir ${ghcjs8104}/lib ${targetPrefix}ghc-8.10.4
lndir ${ghcjs8104}/lib ${targetPrefix}ghc-8.10.5
'' + installDeps targetPrefix);
}))));

Expand Down Expand Up @@ -697,10 +720,10 @@ in {
final.buildPackages.buildPackages.gitMinimal
final.buildPackages.buildPackages.nix-prefetch-git ];
in
final.symlinkJoin {
final.evalPackages.symlinkJoin {
name = "nix-tools";
paths = exes;
buildInputs = [ final.makeWrapper ];
buildInputs = [ final.evalPackages.makeWrapper ];
meta.platforms = final.lib.platforms.all;
# We wrap the -to-nix executables with the executables from `tools` (e.g. nix-prefetch-git)
# so that consumers of `nix-tools` won't have to provide those tools.
Expand Down
13 changes: 13 additions & 0 deletions overlays/patches/ghc/AC_PROG_CC_99.patch
@@ -0,0 +1,13 @@
diff --git a/aclocal.m4 b/aclocal.m4
index 259db63dbff84c91934100a0cb8ff19a0562e90f..99f77d910cfc2421acf3a7d9ac123d79d6daa2ff 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -659,7 +659,7 @@ AC_DEFUN([FP_SET_CFLAGS_C99],
CPPFLAGS="$$3"
unset ac_cv_prog_cc_c99
dnl perform detection
- _AC_PROG_CC_C99
+ AC_PROG_CC_C99
fp_cc_c99="$ac_cv_prog_cc_c99"
case "x$ac_cv_prog_cc_c99" in
x) ;; # noop

0 comments on commit bed3d9b

Please sign in to comment.