forked from magma/magma
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bazelrc
75 lines (61 loc) · 2.88 KB
/
.bazelrc
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
startup --output_base=/tmp/bazel
# STYLE CONFIGS
build --announce_rc
build --color=yes
build:production --config=lsan --strip=never --copt=-O3
# C/C++ CONFIGS
build --cxxopt=-std=c++14
build --experimental_strict_action_env
build --compilation_mode=dbg
# Default test configuration
test --test_output=errors
test --flaky_test_attempts=5
# MAGMA VM CONFIGS
build:specify_vm_cc --action_env=CC=/usr/bin/gcc
build:vm --disk_cache=/home/vagrant/magma/.bazel-cache
common:vm --repository_cache=/home/vagrant/magma/.bazel-cache-repo
build:vm --define=folly_so=1
build:vm --config=specify_vm_cc
# MAGMA-BUILDER DOCKER CONTAINER CONFIGS
build:docker --disk_cache=/magma/.bazel-cache
common:docker --repository_cache=/magma/.bazel-cache-repo
# DEVCONTAINER CONFIGS
build:devcontainer --disk_cache=/workspaces/magma/.bazel-cache
common:devcontainer --repository_cache=/workspaces/magma/.bazel-cache-repo
build:devcontainer --define=folly_so=1
# TEST CONFIGS
# Bazel test runtime default: PATH=/bin:/usr/bin:/usr/local/bin
# Some python tests require access to /usr/sbin binaries (e.g. route, ifconfig)
build --test_env=PATH=/bin:/usr/bin:/usr/local/bin:/usr/sbin
# Use MAGMA_ROOT from the host system in tests.
# Needed by python tests (e.g. freedomfi_one_tests in enodebd)
build --test_env=MAGMA_ROOT
# MME specific compile time defines
# Compile mme libraries with unit test flag
test --per_file_copt=^lte/gateway/c/core/.*$@-DMME_UNIT_TEST
# TODO: deprecate these flags used for logging if possible
build --per_file_copt=^lte/gateway/c/core/.*$@-DPACKAGE_BUGREPORT=\"TBD\"
build --per_file_copt=^lte/gateway/c/core/.*$@-DPACKAGE_VERSION=\"0.1\"
build --per_file_copt=^lte/gateway/c/core/oai/tasks/amf/.*$@-DPACKAGE_NAME=\"AMF\"
build --per_file_copt=^lte/gateway/c/core/oai/tasks/mme_app/.*$@-DPACKAGE_NAME=\"MME\"
build --per_file_copt=^lte/gateway/c/core/oai/tasks/sgw/.*$@-DPACKAGE_NAME=\"S/P-GW\"
# CODE COVERAGE CONFIGS
build --javacopt="-source 8"
build --javacopt="-target 8"
build --host_javabase=@bazel_tools//tools/jdk:remote_jdk11
build --javabase=@bazel_tools//tools/jdk:remote_jdk11
build --host_java_toolchain=@bazel_tools//tools/jdk:toolchain_java11
build --java_toolchain=@bazel_tools//tools/jdk:toolchain_java11
coverage --config=coverage
build:coverage --combined_report=lcov
build:coverage --instrumentation_filter="//(orc8r|lte)/gateway/(c|python)[/:],-//(orc8r|lte)/protos[/:],-/*/test[/:]"
# ASAN
build:asan --linkopt=-fsanitize=address
build:asan --linkopt=-fsanitize=undefined
build:asan --action_env=ASAN_OPTIONS=detect_leaks=1:color=always
build:asan --per_file_copt=^.*/gateway/c/.*$@-fsanitize=address,-fsanitize=undefined,-O0,-fno-omit-frame-pointer
# LSAN
build:lsan --linkopt=-fsanitize=leak
build:lsan --per_file_copt=^.*/gateway/c/.*$@-fsanitize=leak,-fno-omit-frame-pointer
# system bazelrc should include config specific to different build envs (--config=vm, --config=devcontainer, etc.)
try-import /etc/bazelrc