Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into nixpkgs-21.05
Browse files Browse the repository at this point in the history
* origin/develop:
  Update README.md (#791)
  HACKING.md: hack-off snipped fixed fixed (#789)
  Adds a new flag that allows the usage of a newer compiler (8.10)
  Updating nixpkgs back to reflex-platform-20.09
  Bump ghcjs; Switch back os fork of ghc
  Bump
  Bump ghcjs-8.10
  Bump ghcjs-8.10
  • Loading branch information
ali-abrar committed Jul 13, 2022
2 parents 3de2376 + 661eed4 commit 51eb8a6
Show file tree
Hide file tree
Showing 6 changed files with 167 additions and 13 deletions.
2 changes: 1 addition & 1 deletion HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ When you are completely done with a sub-repository, you can remove it
using `hack-off`:

```
~/reflex-platform/scripts/hack-add haskell-overlays/reflex-packages/dep/reflex
~/reflex-platform/scripts/hack-off haskell-overlays/reflex-packages/dep/reflex
```

This will remove the repository and replace the `default.nix` and
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ If you're using one of these platforms, please take a look at notes before you b

If you encounter any problems that may be specific to your platform, please submit an issue or pull request so that we can add a note for future users.

#### Windows

Reflex Platform will not work on Windows because we rely on [Nix](https://nixos.org/nix/) to define and construct our environment. You may have some success by using the Windows Subsystem for Linux, but we do not provide support for this platform.

### Memory Requirements

GHCJS uses a lot of memory during compilation.
Expand Down
113 changes: 104 additions & 9 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
, useReflexOptimizer ? false
, useTextJSString ? true # Use an implementation of "Data.Text" that uses the more performant "Data.JSString" from ghcjs-base under the hood.
, __useTemplateHaskell ? true # Deprecated, just here until we remove feature from reflex and stop CIing it
, __useNewerCompiler ? false
, iosSdkVersion ? "13.2"
, nixpkgsOverlays ? []
, haskellOverlays ? [] # TODO deprecate
Expand All @@ -27,6 +28,24 @@ 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 @@ -47,6 +66,10 @@ 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 @@ -69,7 +92,7 @@ let iosSupport = system == "x86_64-darwin";
useTextJSString enableExposeAllUnfoldings __useTemplateHaskell
haskellOverlaysPre
haskellOverlaysPost;
inherit ghcSavedSplices-8_10;
inherit ghcSavedSplices-8_6 ghcSavedSplices-8_10;
};
};
};
Expand Down Expand Up @@ -187,7 +210,23 @@ let iosSupport = system == "x86_64-darwin";
sha256 = null;
});

ghcSavedSplices = ghcSavedSplices-8_10;
ghcSavedSplices = if __useNewerCompiler then ghcSavedSplices-8_10 else 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-8_10 = (makeRecursivelyOverridable nixpkgs.haskell.packages.integer-simple.ghcSplices-8_10).override {
overrides = lib.foldr lib.composeExtensions (_: _: {}) (let
haskellOverlays = nixpkgs.haskell.overlays;
Expand All @@ -202,8 +241,21 @@ let iosSupport = system == "x86_64-darwin";
})
]);
};
ghcjs = if __useNewerCompiler then ghcjs8_10 else 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;
};
Expand All @@ -216,13 +268,16 @@ let iosSupport = system == "x86_64-darwin";
overrides = nixpkgsCross.wasm.haskell.overlays.combined;
});

ghc = ghc8_10;
ghc = if __useNewerCompiler then ghc8_10 else ghc8_6;
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 @@ -238,24 +293,39 @@ let iosSupport = system == "x86_64-darwin";
new));
};

ghcAndroidAarch64 = ghcAndroidAarch64-8_10;
ghcAndroidAarch64 = if __useNewerCompiler then ghcAndroidAarch64-8_10 else 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-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_10;
ghcAndroidAarch32 = if __useNewerCompiler then ghcAndroidAarch32-8_10 else 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-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_10;
ghcIosSimulator64 = if __useNewerCompiler then ghcIosSimulator64-8_10 else 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-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_10;
ghcIosAarch64 = if __useNewerCompiler then ghcIosAarch64-8_10 else 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-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_10;
ghcIosAarch32 = if __useNewerCompiler then ghcIosAarch32-8_10 else 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-8_10 = makeRecursivelyOverridableBHPToo ((makeRecursivelyOverridable nixpkgsCross.ios.aarch32.haskell.packages.integer-simple.ghcSplices-8_10).override {
overrides = nixpkgsCross.ios.aarch32.haskell.overlays.combined;
});
Expand All @@ -265,6 +335,10 @@ 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 @@ -274,8 +348,10 @@ 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 @@ -295,19 +371,26 @@ 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 @@ -331,6 +414,12 @@ 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 @@ -343,6 +432,12 @@ 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: 49 additions & 0 deletions haskell-overlays/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
, nixpkgs
, useFastWeak, useReflexOptimizer, enableLibraryProfiling, enableTraceReflexEvents
, useTextJSString, enableExposeAllUnfoldings, __useTemplateHaskell
, ghcSavedSplices-8_6
, ghcSavedSplices-8_10
, haskellOverlaysPre
, haskellOverlaysPost
Expand Down Expand Up @@ -46,6 +47,7 @@ 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 @@ -62,18 +64,30 @@ 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 @@ -96,9 +110,11 @@ 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 @@ -110,13 +126,32 @@ 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 @@ -126,11 +161,20 @@ 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 @@ -145,6 +189,11 @@ 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
6 changes: 3 additions & 3 deletions nixpkgs/github.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"owner": "obsidiansystems",
"repo": "nixpkgs",
"branch": "reflex-platform-21.05",
"branch": "aa/reflex-platform-21.05-backport-ghc8.6.5",
"private": false,
"rev": "24838c86026f59bf04f48f3a718cd3c7077fdb87",
"sha256": "1isfgv0qjq6xq4s9y1ngrkdjsqa1pkgaxwr212ay2fpn1md30kvw"
"rev": "9a2d27982da00326631cb6004d58fecefae10fc2",
"sha256": "1jn52fjqgyy1fcq1kqya57n7bzyc30gvgr158q6fdj2vdm46a7bj"
}
Loading

0 comments on commit 51eb8a6

Please sign in to comment.