forked from input-output-hk/cardano-sl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault.nix
94 lines (85 loc) · 3.61 KB
/
default.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
let
localLib = import ./lib.nix;
in
{ system ? builtins.currentSystem
, config ? {}
, gitrev ? localLib.commitIdFromGitRepo ./.git
, pkgs ? (import (localLib.fetchNixPkgs) { inherit system config; })
# profiling slows down performance by 50% so we don't enable it by default
, enableProfiling ? false
, enableDebugging ? false
}:
with pkgs.lib;
with pkgs.haskell.lib;
let
addGitRev = subject: subject.overrideAttrs (drv: { GITREV = gitrev; });
cardanoPkgs = ((import ./pkgs { inherit pkgs; }).override {
overrides = self: super: {
cardano-sl-core = overrideCabal super.cardano-sl-core (drv: {
configureFlags = (drv.configureFlags or []) ++ [
"-f-asserts"
];
});
cardano-sl = overrideCabal super.cardano-sl (drv: {
# production full nodes shouldn't use wallet as it means different constants
configureFlags = (drv.configureFlags or []) ++ [
"-f-asserts"
];
testTarget = "--log=test.log || (sleep 10 && kill $TAILPID && false)";
preCheck = ''
mkdir -p dist/test
touch dist/test/test.log
tail -F dist/test/test.log &
export TAILPID=$!
'';
postCheck = ''
sleep 10
kill $TAILPID
'';
# waiting on load-command size fix in dyld
doCheck = ! pkgs.stdenv.isDarwin;
enableExecutableProfiling = enableProfiling;
passthru = {
inherit enableProfiling;
};
});
cardano-sl-auxx = addGitRev super.cardano-sl-auxx;
cardano-sl-node = addGitRev super.cardano-sl-node;
cardano-sl-wallet = addGitRev (justStaticExecutables super.cardano-sl-wallet);
cardano-sl-tools = justStaticExecutables (overrideCabal super.cardano-sl-tools (drv: {
# waiting on load-command size fix in dyld
doCheck = ! pkgs.stdenv.isDarwin;
}));
cardano-sl-static = justStaticExecutables self.cardano-sl;
cardano-sl-explorer-static = addGitRev (justStaticExecutables self.cardano-sl-explorer);
cardano-report-server-static = justStaticExecutables self.cardano-report-server;
# Undo configuration-nix.nix change to hardcode security binary on darwin
# This is needed for macOS binary not to fail during update system (using http-client-tls)
# Instead, now the binary is just looked up in $PATH as it should be installed on any macOS
x509-system = overrideDerivation super.x509-system (drv: {
postPatch = ":";
});
# TODO: get rid of pthreads option once cryptonite 0.25 is released
# DEVOPS-393: https://github.com/haskell-crypto/cryptonite/issues/193
cryptonite = appendPatch (appendConfigureFlag super.cryptonite "--ghc-option=-optl-pthread") ./pkgs/cryptonite-segfault-blake.patch;
# Due to https://github.com/input-output-hk/stack2nix/issues/56
hfsevents = self.callPackage ./pkgs/hfsevents.nix { inherit (pkgs.darwin.apple_sdk.frameworks) Cocoa CoreServices; };
mkDerivation = args: super.mkDerivation (args // {
enableLibraryProfiling = enableProfiling;
} // optionalAttrs enableDebugging {
# TODO: DEVOPS-355
dontStrip = true;
configureFlags = (args.configureFlags or []) ++ [ "--ghc-options=-g --disable-executable-stripping --disable-library-stripping" ];
});
};
});
upstream = {
stack2nix = import (pkgs.fetchFromGitHub {
owner = "input-output-hk";
repo = "stack2nix";
rev = "be52e67113332280911bcc4924d42f90e21f1144";
sha256 = "13n7gjyzll3prvdsb6kjyxk9g0by5bv0q34ld7a2nbvdcl1q67fb";
}) { inherit pkgs; };
inherit (pkgs) purescript;
};
in cardanoPkgs // upstream