Skip to content

Commit

Permalink
First crack at bumping Nixpkgs
Browse files Browse the repository at this point in the history
  • Loading branch information
Ericson2314 committed Jan 23, 2022
1 parent bd09ddb commit 86407a5
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 176 deletions.
7 changes: 7 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ This project's release branch is `master`. This log is written from the perspect

## Unreleased

* Bump
* Nixpkgs to 21.05

* Drop GHC 8.6 support which was removed in the new Nixpkgs.

## Unreleased

* Always use GHC 8.10.7, not GHC 8.10.4, for GHC 8.10.
Previously we were using mixed GHC 8.10 versions to avoid issues.

Expand Down
4 changes: 2 additions & 2 deletions HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ Many different platform are provided for you. A partial list of
possible platforms include:

- ghc
- ghc8_6
- ghc8_10
- ghcjs
- ghcjs8_6
- ghcjs8_10

In addition, instead of specifying the name of the platform, you can
specify a path to a Nix expression file representing a Haskell
Expand Down
118 changes: 12 additions & 106 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,6 @@ let iosSupport = system == "x86_64-darwin";
splicesEval = self: super: {
haskell = super.haskell // {
compiler = super.haskell.compiler // {
ghcSplices-8_6 = super.haskell.compiler.ghc865.overrideAttrs (drv: {
enableParallelBuilding = false;
src = nixpkgs.hackGet ./haskell-overlays/splices-load-save/dep/ghc-8.6;
# When building from the ghc git repo, ./boot must be run before configuring, whereas
# in the distribution tarball on the haskell.org downloads page, ./boot has already been
# run.
preConfigure= ''
echo ${drv.version} >VERSION
./boot
'' + drv.preConfigure or "";
# Our fork of 8.6 with splices includes these patches.
# Specifically, is up to date with the `ghc-8.6` branch upstream,
# which contains various backports for any potential newer 8.6.x
# release. Nixpkgs manually applied some of those backports as
# patches onto 8.6.5 ahead of such a release, but now we get them
# from the src proper.
patches = [];
});
ghcSplices-8_10 = (super.haskell.compiler.ghc8107.override {
# New option for GHC 8.10. Explicitly enable profiling builds
enableProfiledLibs = true;
Expand All @@ -64,10 +46,6 @@ let iosSupport = system == "x86_64-darwin";
});
};
packages = super.haskell.packages // {
ghcSplices-8_6 = super.haskell.packages.ghc865.override {
buildHaskellPackages = self.buildPackages.haskell.packages.ghcSplices-8_6;
ghc = self.buildPackages.haskell.compiler.ghcSplices-8_6;
};
ghcSplices-8_10 = super.haskell.packages.ghc8107.override {
buildHaskellPackages = self.buildPackages.haskell.packages.ghcSplices-8_10;
ghc = self.buildPackages.haskell.compiler.ghcSplices-8_10;
Expand All @@ -90,7 +68,7 @@ let iosSupport = system == "x86_64-darwin";
useTextJSString enableExposeAllUnfoldings __useTemplateHaskell
haskellOverlaysPre
haskellOverlaysPost;
inherit ghcSavedSplices-8_6 ghcSavedSplices-8_10;
inherit ghcSavedSplices-8_10;
};
};
};
Expand Down Expand Up @@ -139,7 +117,7 @@ let iosSupport = system == "x86_64-darwin";
inherit (nixpkgs) lib fetchurl fetchgit fetchgitPrivate fetchFromGitHub fetchFromBitbucket;

wasmCross = nixpkgs.hackGet ./wasm-cross;
webGhcSrc = (import (wasmCross + /webghc.nix) { inherit fetchgit; }).ghc865SplicesSrc;
webGhcSrc = (import (wasmCross + /webghc.nix) { inherit fetchgit; }).ghc8107SplicesSrc;
nixpkgsCross = {
android = lib.mapAttrs (_: args: nixpkgsFunc (nixpkgsArgs // args)) rec {
aarch64 = {
Expand Down Expand Up @@ -204,23 +182,7 @@ let iosSupport = system == "x86_64-darwin";
sha256 = null;
});

ghcSavedSplices = ghcSavedSplices-8_6;
ghcSavedSplices-8_6 = (makeRecursivelyOverridable nixpkgs.haskell.packages.integer-simple.ghcSplices-8_6).override {
overrides = lib.foldr lib.composeExtensions (_: _: {}) (let
haskellOverlays = nixpkgs.haskell.overlays;
in [
haskellOverlays.combined
(haskellOverlays.saveSplices "8.6")
(self: super: with haskellLib; {
blaze-textual = haskellLib.enableCabalFlag super.blaze-textual "integer-simple";
cryptonite = disableCabalFlag super.cryptonite "integer-gmp";
integer-logarithms = disableCabalFlag super.integer-logarithms "integer-gmp";
scientific = enableCabalFlag super.scientific "integer-simple";
dependent-sum-template = dontCheck super.dependent-sum-template;
generic-deriving = dontCheck super.generic-deriving;
})
]);
};
ghcSavedSplices = ghcSavedSplices-8_10;
ghcSavedSplices-8_10 = (makeRecursivelyOverridable nixpkgs.haskell.packages.integer-simple.ghcSplices-8_10).override {
overrides = lib.foldr lib.composeExtensions (_: _: {}) (let
haskellOverlays = nixpkgs.haskell.overlays;
Expand All @@ -235,43 +197,27 @@ let iosSupport = system == "x86_64-darwin";
})
]);
};
ghcjs = ghcjs8_6;
ghcjs8_6 = (makeRecursivelyOverridable (nixpkgsCross.ghcjs.haskell.packages.ghcjs86.override (old: {
ghc = old.ghc.override {
bootPkgs = nixpkgsCross.ghcjs.buildPackages.haskell.packages.ghc865;
ghcjsSrc = fetchgit {
url = "https://github.com/obsidiansystems/ghcjs.git";
rev = "a00ecf0b2eaddbc4101c76e6ac95fc97b0f75840"; # ghc-8.6 branch
sha256 = "06cwpijwhj4jpprn07y3pkxmv40pwmqqw5jbdv4s7c67j5pmirnc";
fetchSubmodules = true;
};
};
}))).override {
overrides = nixpkgsCross.ghcjs.haskell.overlays.combined;
};

ghcjs = ghcjs8_10;
ghcjs8_10 = (makeRecursivelyOverridable nixpkgsCross.ghcjs.haskell.packages.ghcjs810).override {
overrides = nixpkgsCross.ghcjs.haskell.overlays.combined;
};

wasm = ghcWasm32-8_6;
ghcWasm32-8_6 = makeRecursivelyOverridableBHPToo ((makeRecursivelyOverridable (nixpkgsCross.wasm.haskell.packages.ghcWasm.override (old: {
wasm = ghcWasm32-8_10;
ghcWasm32-8_10 = makeRecursivelyOverridableBHPToo ((makeRecursivelyOverridable (nixpkgsCross.wasm.haskell.packages.ghcWasm.override (old: {
# Due to the splices changes the parallel build fails while building the libraries
ghc = old.ghc.overrideAttrs (drv: { enableParallelBuilding = false; });
}))).override {
overrides = nixpkgsCross.wasm.haskell.overlays.combined;
});

ghc = ghc8_6;
ghc = ghc8_10;
ghcHEAD = (makeRecursivelyOverridable nixpkgs.haskell.packages.ghcHEAD).override {
overrides = nixpkgs.haskell.overlays.combined;
};
ghc8_10 = (makeRecursivelyOverridable nixpkgs.haskell.packages.ghc8107).override {
overrides = nixpkgs.haskell.overlays.combined;
};
ghc8_6 = (makeRecursivelyOverridable nixpkgs.haskell.packages.ghc865).override {
overrides = nixpkgs.haskell.overlays.combined;
};

# Takes a package set with `makeRecursivelyOverridable` and ensures that any
# future overrides will be applied to both the package set itself and it's
Expand All @@ -287,39 +233,24 @@ let iosSupport = system == "x86_64-darwin";
new));
};

ghcAndroidAarch64 = ghcAndroidAarch64-8_6;
ghcAndroidAarch64-8_6 = makeRecursivelyOverridableBHPToo ((makeRecursivelyOverridable nixpkgsCross.android.aarch64.haskell.packages.integer-simple.ghcSplices-8_6).override {
overrides = nixpkgsCross.android.aarch64.haskell.overlays.combined;
});
ghcAndroidAarch64 = ghcAndroidAarch64-8_10;
ghcAndroidAarch64-8_10 = makeRecursivelyOverridableBHPToo ((makeRecursivelyOverridable nixpkgsCross.android.aarch64.haskell.packages.integer-simple.ghcSplices-8_10).override {
overrides = nixpkgsCross.android.aarch64.haskell.overlays.combined;
});
ghcAndroidAarch32 = ghcAndroidAarch32-8_6;
ghcAndroidAarch32-8_6 = makeRecursivelyOverridableBHPToo ((makeRecursivelyOverridable nixpkgsCross.android.aarch32.haskell.packages.integer-simple.ghcSplices-8_6).override {
overrides = nixpkgsCross.android.aarch32.haskell.overlays.combined;
});
ghcAndroidAarch32 = ghcAndroidAarch32-8_10;
ghcAndroidAarch32-8_10 = makeRecursivelyOverridableBHPToo ((makeRecursivelyOverridable nixpkgsCross.android.aarch32.haskell.packages.integer-simple.ghcSplices-8_10).override {
overrides = nixpkgsCross.android.aarch32.haskell.overlays.combined;
});

ghcIosSimulator64 = ghcIosSimulator64-8_6;
ghcIosSimulator64-8_6 = makeRecursivelyOverridableBHPToo ((makeRecursivelyOverridable nixpkgsCross.ios.simulator64.haskell.packages.integer-simple.ghcSplices-8_6).override {
overrides = nixpkgsCross.ios.simulator64.haskell.overlays.combined;
});
ghcIosSimulator64 = ghcIosSimulator64-8_10;
ghcIosSimulator64-8_10 = makeRecursivelyOverridableBHPToo ((makeRecursivelyOverridable nixpkgsCross.ios.simulator64.haskell.packages.integer-simple.ghcSplices-8_10).override {
overrides = nixpkgsCross.ios.simulator64.haskell.overlays.combined;
});
ghcIosAarch64 = ghcIosAarch64-8_6;
ghcIosAarch64-8_6 = makeRecursivelyOverridableBHPToo ((makeRecursivelyOverridable nixpkgsCross.ios.aarch64.haskell.packages.integer-simple.ghcSplices-8_6).override {
overrides = nixpkgsCross.ios.aarch64.haskell.overlays.combined;
});
ghcIosAarch64 = ghcIosAarch64-8_10;
ghcIosAarch64-8_10 = makeRecursivelyOverridableBHPToo ((makeRecursivelyOverridable nixpkgsCross.ios.aarch64.haskell.packages.integer-simple.ghcSplices-8_10).override {
overrides = nixpkgsCross.ios.aarch64.haskell.overlays.combined;
});
ghcIosAarch32 = ghcIosAarch32-8_6;
ghcIosAarch32-8_6 = makeRecursivelyOverridableBHPToo ((makeRecursivelyOverridable nixpkgsCross.ios.aarch32.haskell.packages.integer-simple.ghcSplices-8_6).override {
overrides = nixpkgsCross.ios.aarch32.haskell.overlays.combined;
});
ghcIosAarch32 = ghcIosAarch32-8_10;
ghcIosAarch32-8_10 = makeRecursivelyOverridableBHPToo ((makeRecursivelyOverridable nixpkgsCross.ios.aarch32.haskell.packages.integer-simple.ghcSplices-8_10).override {
overrides = nixpkgsCross.ios.aarch32.haskell.overlays.combined;
});
Expand All @@ -329,10 +260,6 @@ let iosSupport = system == "x86_64-darwin";
android = androidWithHaskellPackages {
inherit ghcAndroidAarch64 ghcAndroidAarch32;
};
android-8_6 = androidWithHaskellPackages {
ghcAndroidAarch64 = ghcAndroidAarch64-8_6;
ghcAndroidAarch32 = ghcAndroidAarch32-8_6;
};
android-8_10 = androidWithHaskellPackages {
ghcAndroidAarch64 = ghcAndroidAarch64-8_10;
ghcAndroidAarch32 = ghcAndroidAarch32-8_10;
Expand All @@ -342,10 +269,8 @@ let iosSupport = system == "x86_64-darwin";
acceptAndroidSdkLicenses = config.android_sdk.accept_license or false;
};
iosAarch64 = iosWithHaskellPackages ghcIosAarch64;
iosAarch64-8_6 = iosWithHaskellPackages ghcIosAarch64-8_6;
iosAarch64-8_10 = iosWithHaskellPackages ghcIosAarch64-8_10;
iosAarch32 = iosWithHaskellPackages ghcIosAarch32;
iosAarch32-8_6 = iosWithHaskellPackages ghcIosAarch32-8_6;
iosAarch32-8_10 = iosWithHaskellPackages ghcIosAarch32-8_10;
iosSimulator = {
buildApp = nixpkgs.lib.makeOverridable (import ./ios { inherit nixpkgs; ghc = ghcIosSimulator64; withSimulator = true; });
Expand All @@ -365,26 +290,19 @@ in let this = rec {
overrideCabal
ghc
ghcHEAD
ghc8_6
ghc8_10
ghcIosSimulator64
ghcIosAarch64
ghcIosAarch64-8_6
ghcIosAarch64-8_10
ghcIosAarch32
ghcIosAarch32-8_6
ghcIosAarch32-8_10
ghcAndroidAarch64
ghcAndroidAarch64-8_6
ghcAndroidAarch64-8_10
ghcAndroidAarch32
ghcAndroidAarch32-8_6
ghcAndroidAarch32-8_10
ghcjs
ghcjs8_6
ghcjs8_10
ghcSavedSplices
ghcSavedSplices-8_6
ghcSavedSplices-8_10
android
androidWithHaskellPackages
Expand All @@ -408,12 +326,6 @@ in let this = rec {
applicationId = "org.reflexfrp.todomvc";
displayName = "Reflex TodoMVC";
};
androidReflexTodomvc-8_6 = android-8_6.buildApp {
package = p: p.reflex-todomvc;
executableName = "reflex-todomvc";
applicationId = "org.reflexfrp.todomvc.via_8_6";
displayName = "Reflex TodoMVC via GHC 8.6";
};
androidReflexTodomvc-8_10 = android-8_10.buildApp {
package = p: p.reflex-todomvc;
executableName = "reflex-todomvc";
Expand All @@ -426,12 +338,6 @@ in let this = rec {
bundleIdentifier = "org.reflexfrp.todomvc";
bundleName = "Reflex TodoMVC";
};
iosReflexTodomvc-8_6 = iosAarch64-8_6.buildApp {
package = p: p.reflex-todomvc;
executableName = "reflex-todomvc";
bundleIdentifier = "org.reflexfrp.todomvc.via_8_6";
bundleName = "Reflex TodoMVC via GHC 8.6";
};
iosReflexTodomvc-8_10 = iosAarch64-8_10.buildApp {
package = p: p.reflex-todomvc;
executableName = "reflex-todomvc";
Expand Down
49 changes: 0 additions & 49 deletions haskell-overlays/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
, nixpkgs
, useFastWeak, useReflexOptimizer, enableLibraryProfiling, enableTraceReflexEvents
, useTextJSString, enableExposeAllUnfoldings, __useTemplateHaskell
, ghcSavedSplices-8_6
, ghcSavedSplices-8_10
, haskellOverlaysPre
, haskellOverlaysPost
Expand Down Expand Up @@ -47,7 +46,6 @@ rec {
(optionalExtension (!(super.ghc.isGhcjs or false)) combined-ghc)
(optionalExtension (super.ghc.isGhcjs or false) combined-ghcjs)

(optionalExtension (with nixpkgs.stdenv; versionWildcard [ 8 6 ] super.ghc.version && !(super.ghc.isGhcjs or false) && hostPlatform != buildPlatform) loadSplices-8_6)
(optionalExtension (with nixpkgs.stdenv; versionWildcard [ 8 10 ] super.ghc.version && !(super.ghc.isGhcjs or false) && hostPlatform != buildPlatform) loadSplices-8_10)

(optionalExtension (nixpkgs.stdenv.hostPlatform.useAndroidPrebuilt or false) android)
Expand All @@ -64,30 +62,18 @@ rec {

combined-any-8 = self: super: foldExtensions [
any-8
(optionalExtension (versionWildcard [ 8 6 ] (getGhcVersion super.ghc)) any-8_6)
(optionalExtension (versionWildcard [ 8 6 ] (getGhcVersion super.ghc)) haskell-gi-8_6)
(optionalExtension (versionWildcard [ 8 10 ] (getGhcVersion super.ghc)) haskell-gi-8_10)
(optionalExtension (lib.versionOlder "8.11" (getGhcVersion super.ghc)) any-head)
] self super;

combined-ghc = self: super: foldExtensions [
(optionalExtension (versionWildcard [ 8 6 ] super.ghc.version) ghc-8_6)
(optionalExtension (lib.versionOlder "8.11" super.ghc.version) ghc-head)
] self super;

combined-ghcjs = self: super: foldExtensions [
(optionalExtension (versionWildcard [ 8 6 ] (getGhcVersion super.ghc)) combined-ghcjs-8_6)
(optionalExtension (versionWildcard [ 8 10 ] (getGhcVersion super.ghc)) combined-ghcjs-8_10)
] self super;

combined-ghcjs-8_6 = self: super: foldExtensions [
ghcjs_8_6
(optionalExtension useTextJSString textJSString)
(optionalExtension useTextJSString textJSString-8_6)
(optionalExtension useTextJSString ghcjs-textJSString-8_6)
(optionalExtension useFastWeak ghcjs-fast-weak_8_6)
] self super;

combined-ghcjs-8_10 = self: super: foldExtensions [
(optionalExtension useTextJSString textJSString)
(optionalExtension useTextJSString textJSString-8_10)
Expand All @@ -110,11 +96,9 @@ rec {
# For GHC and GHCJS
any = _: _: {};
any-8 = import ./any-8.nix { inherit haskellLib lib getGhcVersion; };
any-8_6 = import ./any-8.6.nix { inherit haskellLib fetchFromGitHub; inherit (nixpkgs) pkgs; };
any-head = import ./any-head.nix { inherit haskellLib fetchFromGitHub; };

# Just for GHC, usually to sync with GHCJS
ghc-8_6 = _: _: {};
ghc-head = _: _: {};

profiling = import ./profiling.nix {
Expand All @@ -126,32 +110,13 @@ rec {
inherit lib haskellLib fetchFromGitHub ghcVersion;
};

loadSplices-8_6 = import ./splices-load-save/load-splices.nix {
inherit lib haskellLib fetchFromGitHub;
isExternalPlugin = false;
splicedHaskellPackages = ghcSavedSplices-8_6;
};

loadSplices-8_10 = import ./splices-load-save/load-splices.nix {
inherit lib haskellLib fetchFromGitHub;
isExternalPlugin = true;
splicedHaskellPackages = ghcSavedSplices-8_10;
};

# Just for GHCJS
ghcjs_8_6 = import ./ghcjs-8.6 {
inherit
lib haskellLib nixpkgs fetchgit fetchFromGitHub
useReflexOptimizer
useTextJSString
enableLibraryProfiling
;
};

ghcjs-textJSString-8_6 = import ./ghcjs-text-jsstring-8.6 {
inherit lib fetchgit;
};

ghcjs-textJSString-8_10 = import ./ghcjs-text-jsstring-8.10 {
inherit lib fetchgit;
};
Expand All @@ -161,20 +126,11 @@ rec {
inherit (nixpkgs) fetchpatch thunkSet;
};

textJSString-8_6 = import ./text-jsstring-8.6 {
inherit lib haskellLib fetchFromGitHub versionWildcard;
inherit (nixpkgs) fetchpatch thunkSet;
};

textJSString-8_10 = import ./text-jsstring-8.10 {
inherit lib haskellLib fetchFromGitHub versionWildcard;
inherit (nixpkgs) fetchpatch thunkSet;
};

ghcjs-fast-weak_8_6 = import ./ghcjs-8.6-fast-weak {
inherit lib;
};

ghcjs-fast-weak_8_10 = import ./ghcjs-8.10-fast-weak {
inherit lib;
};
Expand All @@ -189,11 +145,6 @@ rec {
inherit (nixpkgs) lib;
};

haskell-gi-8_6 = import ./haskell-gi-8.6 {
inherit haskellLib;
inherit fetchFromGitHub;
inherit nixpkgs;
};
haskell-gi-8_10 = import ./haskell-gi-8.10 {
inherit haskellLib;
inherit fetchFromGitHub;
Expand Down
Loading

0 comments on commit 86407a5

Please sign in to comment.