git.iko.soy/typeable/nixpkgs
on master help sign in
ghc: Make deterministic profiling patches opt-in.

The patch changes some pieces of the exposed API, so we can't have our default GHC changed in this way.

commit7ac6c77323dc5faf12427b310a417fb06915d936 authorShea Levy <shea@shealevy.com> dateFri 9 Feb 2018, 07:50 (9 years ago) parent9dfbb52
3 files changed+18−10
pkgs/development/compilers/ghc/8.2.2.nix+6−2 pkgs/development/compilers/ghc/8.4.1.nix+6−3 pkgs/development/haskell-modules/configuration-common.nix+6−5
pkgs/development/compilers/ghc/8.2.2.nix+6−2
@@ -26,6 +26,10 @@
2626 !(targetPlatform.isDarwin
2727 # On iOS, dynamic linking is not supported
2828 && (targetPlatform.isAarch64 || targetPlatform.isArm))
29+, # Whether to backport https://phabricator.haskell.org/D4388 for
30+ # deterministic profiling symbol names, at the cost of a slightly
31+ # non-standard GHC API
32+ deterministicProfiling ? false
2933}:
3034
3135assert !enableIntegerSimple -> gmp != null;
@@ -85,11 +89,11 @@ stdenv.mkDerivation rec {
8589 url = "https://git.haskell.org/ghc.git/commitdiff_plain/2fc8ce5f0c8c81771c26266ac0b150ca9b75c5f3";
8690 sha256 = "03253ci40np1v6k0wmi4aypj3nmj3rdyvb1k6rwqipb30nfc719f";
8791 })
92+ ] ++ stdenv.lib.optional deterministicProfiling
8893 (fetchpatch { # Backport of https://phabricator.haskell.org/D4388 for more determinism
8994 url = "https://github.com/shlevy/ghc/commit/fec1b8d3555c447c0d8da0e96b659be67c8bb4bc.patch";
9095 sha256 = "1lyysz6hfd1njcigpm8xppbnkadqfs0kvrp7s8vqgb38pjswj5hg";
91− })
92− ];
96+ });
9397
9498 postPatch = "patchShebangs .";
9599
pkgs/development/compilers/ghc/8.4.1.nix+6−3
@@ -25,6 +25,10 @@
2525 enableShared ? true
2626
2727, version ? "8.4.0.20180204"
28+, # Whether to backport https://phabricator.haskell.org/D4388 for
29+ # deterministic profiling symbol names, at the cost of a slightly
30+ # non-standard GHC API
31+ deterministicProfiling ? false
2832}:
2933
3034assert !enableIntegerSimple -> gmp != null;
@@ -81,12 +85,11 @@ stdenv.mkDerivation rec {
8185
8286 outputs = [ "out" "doc" ];
8387
84− patches = [
88+ patches = stdenv.lib.optional deterministicProfiling
8589 (fetchpatch { # https://phabricator.haskell.org/D4388 for more determinism
8690 url = "https://github.com/shlevy/ghc/commit/8b2dbd869d1a64de3e99fa8b1c9bb1140eee7099.patch";
8791 sha256 = "0hxpiwhbg64rsyjdr4psh6dwyp58b96mad3adccvfr0x8hc6ba2m";
88− })
89− ];
92+ });
9093
9194 postPatch = "patchShebangs .";
9295
pkgs/development/haskell-modules/configuration-common.nix+6−5
@@ -1000,14 +1000,15 @@ self: super: {
10001000 '';
10011001 });
10021002
1003− # Fix for our backport of D4388 to GHC 8.2. This is in
1004− # configuration-common because we will need the same patch if/when
1005− # liquidhaskell is bumped to support GHC 8.4
1003+ # Add a flag to enable building against GHC with D4388 applied (the
1004+ # deterministic profiling symbols patch). The flag is disabled by
1005+ # default, so we can apply this patch globally.
1006+ #
10061007 # https://github.com/ucsd-progsys/liquidhaskell/pull/1233
10071008 liquidhaskell =
10081009 let patch = pkgs.fetchpatch
1009− { url = https://github.com/ucsd-progsys/liquidhaskell/commit/635338e6ef0aec01d4f6a21058cabd24a521e63f.patch;
1010− sha256 = "0lg40qn2w3kn6zk5r38mp6hndpnswzrqhk38059h0ljhw9md72s8";
1010+ { url = https://github.com/ucsd-progsys/liquidhaskell/commit/1aeef1871760b2be46cc1cabd51311997d1d0bc0.patch;
1011+ sha256 = "0i55n6p3x9as648as0lvxy2alqb1n7c10xv9gp15cvq7zx6c8ydg";
10111012 };
10121013 in appendPatch super.liquidhaskell patch;
10131014