@@ -29,111 +29,25 @@ with pkgs.lib;
29
29
with pkgs . haskell . lib ;
30
30
31
31
let
32
- justStaticExecutablesGitRev = import ./scripts/set-git-rev {
33
- inherit pkgs gitrev ;
34
- inherit ( cardanoPkgs ) ghc ;
35
- } ;
36
- addRealTimeTestLogs = drv : overrideCabal drv ( attrs : {
37
- testTarget = "--show-details=streaming" ;
32
+ # the GHC we are using
33
+ # at some point use: pkgs.haskell.compiler.ghc843;
34
+ ghc = overrideDerivation pkgs . haskell . compiler . ghc822 ( drv : {
35
+ patches = drv . patches ++ [ ./ghc-8.0.2-darwin-rec-link.patch ] ;
38
36
} ) ;
39
37
40
- requiredOverlay = self : super : {
41
- inherit pkgs ;
42
- srcroot = ./. ;
43
- cardano-sl-core = overrideCabal super . cardano-sl-core ( drv : {
44
- configureFlags = ( drv . configureFlags or [ ] ) ++ [
45
- "-f-asserts"
46
- ] ;
47
- } ) ;
48
- cardano-sl = overrideCabal super . cardano-sl ( drv : {
49
- # production full nodes shouldn't use wallet as it means different constants
50
- configureFlags = ( drv . configureFlags or [ ] ) ++ [
51
- "-f-asserts"
52
- ] ;
53
- passthru = {
54
- inherit enableProfiling ;
55
- } ;
56
- } ) ;
57
- cardano-sl-wallet-static = justStaticExecutablesGitRev self . cardano-sl-wallet ;
58
- cardano-sl-client = addRealTimeTestLogs super . cardano-sl-client ;
59
- cardano-sl-generator = addRealTimeTestLogs super . cardano-sl-generator ;
60
- cardano-sl-networking = addRealTimeTestLogs super . cardano-sl-networking ;
61
- cardano-sl-auxx-static = justStaticExecutablesGitRev self . cardano-sl-auxx ;
62
- cardano-sl-wallet-new-static = justStaticExecutablesGitRev self . cardano-sl-wallet-new ;
63
- cardano-sl-node-static = justStaticExecutablesGitRev self . cardano-sl-node ;
64
- cardano-sl-explorer-static = justStaticExecutablesGitRev self . cardano-sl-explorer ;
65
- cardano-report-server-static = justStaticExecutablesGitRev self . cardano-report-server ;
66
- cardano-sl-faucet-static = justStaticExecutablesGitRev self . cardano-sl-faucet ;
67
- cardano-sl-tools-static = justStaticExecutablesGitRev self . cardano-sl-tools ;
68
- # Undo configuration-nix.nix change to hardcode security binary on darwin
69
- # This is needed for macOS binary not to fail during update system (using http-client-tls)
70
- # Instead, now the binary is just looked up in $PATH as it should be installed on any macOS
71
- x509-system = overrideDerivation super . x509-system ( drv : {
72
- postPatch = ":" ;
73
- } ) ;
74
-
75
- # TODO: get rid of pthreads option once cryptonite 0.25 is released
76
- # DEVOPS-393: https://github.com/haskell-crypto/cryptonite/issues/193
77
- cryptonite = appendPatch ( appendConfigureFlag super . cryptonite "--ghc-option=-optl-pthread" ) ./pkgs/cryptonite-segfault-blake.patch ;
78
-
79
- # Due to https://github.com/input-output-hk/stack2nix/issues/56
80
- hfsevents = self . callPackage ./pkgs/hfsevents.nix { inherit ( pkgs . darwin . apple_sdk . frameworks ) Cocoa CoreServices ; } ;
81
- mkDerivation = args : super . mkDerivation ( args // {
82
- enableLibraryProfiling = enableProfiling ;
83
- enableExecutableProfiling = enableProfiling ;
84
- # Static linking for everything to work around
85
- # https://ghc.haskell.org/trac/ghc/ticket/14444
86
- # This will be the default in nixpkgs since
87
- # https://github.com/NixOS/nixpkgs/issues/29011
88
- enableSharedExecutables = false ;
89
- } // optionalAttrs ( args ? src ) {
90
- src = localLib . cleanSourceTree args . src ;
91
- } ) ;
92
- } ;
93
- benchmarkOverlay = self : super : {
94
- mkDerivation = args : super . mkDerivation ( args // optionalAttrs ( localLib . isCardanoSL args . pname ) {
95
- # Enables building but not running of benchmarks for all
96
- # cardano-sl packages when enableBenchmarks argument is true.
97
- doBenchmark = true ;
98
- configureFlags = ( args . configureFlags or [ ] ) ++ [ "--enable-benchmarks" ] ;
99
- } // optionalAttrs ( localLib . isBenchmark args ) {
100
- # Provide a dummy installPhase for benchmark packages.
101
- installPhase = "mkdir -p $out" ;
102
- } ) ;
103
- } ;
104
-
105
- debugOverlay = self : super : {
106
- mkDerivation = args : super . mkDerivation ( args // {
107
- # TODO: DEVOPS-355
108
- dontStrip = true ;
109
- configureFlags = ( args . configureFlags or [ ] ) ++ [ "--ghc-options=-g --disable-executable-stripping --disable-library-stripping" "--profiling-detail=toplevel-functions" ] ;
110
- } ) ;
111
- } ;
112
-
38
+ # Overlay logic for *haskell* packages.
39
+ requiredOverlay = import ./nix/overlays/required.nix pkgs localLib enableProfiling gitrev ghc ;
40
+ benchmarkOverlay = import ./nix/overlays/benchmark.nix pkgs localLib ;
41
+ debugOverlay = import ./nix/overlays/debug.nix pkgs ;
113
42
# Disabling optimization for cardano-sl packages will
114
43
# return a build ~20% faster (measured in DEVOPS-1032).
115
- fasterBuildOverlay = self : super : {
116
- mkDerivation = args : super . mkDerivation ( args // optionalAttrs ( localLib . isCardanoSL args . pname ) {
117
- configureFlags = ( args . configureFlags or [ ] ) ++ [ "--ghc-options=-O0" ] ;
118
- } ) ;
119
- } ;
120
-
121
- dontCheckOverlay = self : super : {
122
- mkDerivation = args : super . mkDerivation ( args // {
123
- doCheck = false ;
124
- } ) ;
125
- } ;
126
-
127
- metricOverlay = self : super : {
128
- mkDerivation = args : super . mkDerivation ( args // {
129
- enablePhaseMetrics = true ;
130
- } ) ;
131
- } ;
44
+ fasterBuildOverlay = import ./nix/overlays/faster-build.nix pkgs localLib ;
45
+ dontCheckOverlay = import ./nix/overlays/dont-check.nix pkgs ;
46
+ metricOverlay = import ./nix/overlays/metric.nix pkgs ;
132
47
48
+ # This will yield a set of haskell packages, based on the given compiler.
133
49
cardanoPkgsBase = ( ( import ./pkgs { inherit pkgs ; } ) . override {
134
- ghc = overrideDerivation pkgs . haskell . compiler . ghc822 ( drv : {
135
- patches = drv . patches ++ [ ./ghc-8.0.2-darwin-rec-link.patch ] ;
136
- } ) ;
50
+ inherit ghc ;
137
51
} ) ;
138
52
139
53
activeOverlays = [ requiredOverlay ]
0 commit comments