forked from chipsalliance/verible
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshell.nix
66 lines (55 loc) · 2.08 KB
/
shell.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
# This is a nix-shell for use with the nix package manager.
# If you have nix installed, you may simply run `nix-shell`
# in this repo, and have all dependencies ready in the new shell.
{ pkgs ? import <nixpkgs> {} }:
let
verible_used_stdenv = pkgs.stdenv;
# Alternatively, use ccache stddev, so after bazel clean
# it is much cheaper to rebuild the world.
#
# This requires that you add a line to your ~/.bazelrc
# echo "build --sandbox_writable_path=$HOME/.cache/ccache" >> ~/.bazelrc
# Works on nixos, but noticed issues with just nix package manager.
#verible_used_stdenv = pkgs.ccacheStdenv;
# Testing with specific compilers
#verible_used_stdenv = pkgs.gcc13Stdenv;
# Using clang stdenv does not work yet out of the box yet
# https://github.com/NixOS/nixpkgs/issues/216047
#verible_used_stdenv = pkgs.clang13Stdenv;
in
verible_used_stdenv.mkDerivation {
name = "verible-build-environment";
buildInputs = with pkgs;
[
bazel_5
jdk11
git
# For scripts used inside bzl rules and tests
gnused
python3
# To run error-log-analyzer
python3Packages.mdutils
ripgrep
# For using --//bazel:use_local_flex_bison if desired
flex
bison
# To build vscode vsix package
nodejs
# Ease development
lcov # coverage html generation.
bazel-buildtools # buildifier
# TODO: would it be possible to define two variables here
# clang_for_formatting, clang_for_tidy so that we don't have
# to re-type the version below in the shell hook ?
clang-tools_15 # For clang-format (see below)
clang-tools_17 # For clang-tidy (see below)
];
shellHook = ''
# We choose the last clang-format that produces the same result
# as the one used on the github CI (newer ones arrange some things
# slightly differently, so would result in a conflict).
export CLANG_FORMAT=${pkgs.clang-tools_15}/bin/clang-tidy
# Use latest clang-tidy we can get for most detailed
export CLANG_TIDY=${pkgs.clang-tools_17}/bin/clang-tidy
'';
}