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 + 88b2d9f commit b6afdb8
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 17 deletions.
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
15 changes: 6 additions & 9 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,14 +23,14 @@
# 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;
ghc865 = false;
ghc8104 = false; # Just included because the native version is needed at eval time
} // nixpkgs.lib.optionalAttrs (nixpkgsName == "R2009") {
ghc865 = false;
ghc884 = true;
ghc8104 = true;
} // nixpkgs.lib.optionalAttrs (nixpkgsName == "unstable") {
ghc865 = false;
ghc884 = false; # Native version is used to boot 9.0.1
ghc8104 = true;
ghc901 = true;
ghc810420210212 = false;
Expand All @@ -45,15 +44,13 @@
# 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 ["ghc8104"])) {
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 ["ghc8101" "ghc8102" "ghc8103" "ghc8104"])) {
# 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 == "ghc8104") {
# 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
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
6 changes: 4 additions & 2 deletions overlays/bootstrap.nix
Expand Up @@ -160,6 +160,8 @@ in {
++ 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 @@ -697,10 +699,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
2 changes: 1 addition & 1 deletion release.nix
@@ -1,7 +1,7 @@
# 'supportedSystems' restricts the set of systems that we will evaluate for. Useful when you're evaluating
# on a machine with e.g. no way to build the Darwin IFDs you need!
{ supportedSystems ? [ "x86_64-linux" "x86_64-darwin" ]
, ifdLevel ? 3
, ifdLevel ? 1
, checkMaterialization ? false }:

let
Expand Down

0 comments on commit b6afdb8

Please sign in to comment.