forked from openebs/mayastor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ci.nix
79 lines (76 loc) · 2.08 KB
/
ci.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
{ nospdk ? false, norust ? false }:
let
sources = import ./nix/sources.nix;
pkgs = import sources.nixpkgs {
overlays =
[ (_: _: { inherit sources; }) (import ./nix/io-engine-overlay.nix) ];
};
in
with pkgs;
let
nospdk_moth =
"You have requested environment without SPDK, you should provide it!";
norust_moth =
"You have requested environment without RUST, you should provide it!";
channel = import ./nix/lib/rust.nix { inherit sources; };
# python environment for test/python
pytest_inputs = python3.withPackages
(ps: with ps; [ virtualenv grpcio grpcio-tools asyncssh black ]);
in
mkShell {
name = "io-engine-dev-shell";
# fortify does not work with -O0 which is used by spdk when --enable-debug
hardeningDisable = [ "fortify" ];
buildInputs = [
clang_11
cowsay
docker
docker-compose
e2fsprogs
etcd
fio
gdb
git
kubernetes-helm
libaio
libbsd
libnvme
libpcap
libudev
liburing
llvmPackages_11.libclang
meson
ninja
nodejs-16_x
nvme-cli
numactl
openssl
pkg-config
pre-commit
procps
pytest_inputs
python3
utillinux
xfsprogs
gnuplot
] ++ (if (nospdk) then [ libspdk-dev.buildInputs ] else [ libspdk-dev ])
++ pkgs.lib.optional (!norust) channel.stable
++ pkgs.lib.optional (!norust) channel.nightly;
RUST_NIGHTLY_PATH = channel.nightly;
LIBCLANG_PATH = io-engine.LIBCLANG_PATH;
PROTOC = io-engine.PROTOC;
PROTOC_INCLUDE = io-engine.PROTOC_INCLUDE;
SPDK_PATH = if nospdk then null else "${libspdk-dev}";
shellHook = ''
${pkgs.lib.optionalString (nospdk) "cowsay ${nospdk_moth}"}
${pkgs.lib.optionalString (nospdk) "export CFLAGS=-msse4"}
${pkgs.lib.optionalString (nospdk) "echo"}
${pkgs.lib.optionalString (norust) "cowsay ${norust_moth}"}
${pkgs.lib.optionalString (norust) "echo 'Hint: use rustup tool.'"}
${pkgs.lib.optionalString (norust) "echo"}
# SRCDIR is needed by docker-compose files as it requires absolute paths
export SRCDIR=`pwd`
pre-commit install
pre-commit install --hook commit-msg
'';
}