-
Notifications
You must be signed in to change notification settings - Fork 9.9k
Expand file tree
/
Copy pathbazel.rc
More file actions
146 lines (121 loc) · 5.11 KB
/
bazel.rc
File metadata and controls
146 lines (121 loc) · 5.11 KB
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# load bazelrc from the legacy location
# as recommended in https://github.com/bazelbuild/bazel/issues/6319
# try-import %workspace%/tools/bazel.rc
# +------------------------------------------------------------+
# | Startup Options |
# +------------------------------------------------------------+
startup --batch_cpu_scheduling
startup --host_jvm_args="-XX:-UseParallelGC"
fetch --experimental_multi_threaded_digest=true
# query --experimental_multi_threaded_digest=true
# +------------------------------------------------------------+
# | Common Options |
# +------------------------------------------------------------+
# Force bazel output to use colors (good for jenkins) and print useful errors.
common --color=yes
# +------------------------------------------------------------+
# | Build Configurations |
# +------------------------------------------------------------+
# Make Bazel print out all options from rc files.
# build --announce_rc
build --show_timestamps
# Work around the sandbox issue.
build --spawn_strategy=standalone
# build --experimental_reuse_sandbox_directories
# build --experimental_sandbox_async_tree_delete_idle_threads=1
# Enable colorful output of GCC
build --cxxopt="-fdiagnostics-color=always"
# Do not show warnings from external dependencies.
# build --output_filter="^//"
build --per_file_copt=external/upb/.*@-Wno-sign-compare
# build --copt="-Werror=sign-compare"
build --copt="-Werror=return-type"
# build --copt="-Werror=unused-variable"
build --copt="-Werror=unused-but-set-variable"
build --copt="-Werror=switch"
build --cxxopt="-Werror=reorder"
# Default paths for SYSTEM LIBRARIES
build --define=PREFIX=/usr
build --define=LIBDIR=$(PREFIX)/lib
build --define=INCLUDEDIR=$(PREFIX)/include
build --define=use_fast_cpp_protos=true
# GPU_PLATFORM predefined types
build --define NVIDIA=0
build --define AMD=1
# dbg config, as a shorthand for '--config=optimize -c dbg'
build:dbg -c dbg
build:opt -c opt
# build --config=optimize
# Instruction set optimizations
# build:optimize --copt=-march=native
# build:optimize --host_copt=-march=native
# Now "cpu" configuration was dummy
build:cpu --verbose_failures
# alias gpu to nvidia
build:gpu --config=nvidia
# GPU platform
build:amd --define GPU_PLATFORM=AMD
build:amd --cxxopt="-DGPU_PLATFORM=AMD"
build:amd --define USE_GPU=true
build:amd --cxxopt="-DUSE_GPU=1"
build:amd --cxxopt="-DAMD=1"
build:nvidia --define GPU_PLATFORM=NVIDIA
build:nvidia --cxxopt="-DGPU_PLATFORM=NVIDIA"
build:nvidia --define USE_GPU=true
build:nvidia --cxxopt="-DUSE_GPU=1"
build:nvidia --cxxopt="-DNVIDIA=1"
# Build with profiling
build:prof --linkopt=-lprofiler
build:prof --cxxopt="-DENABLE_PERF=1"
# Build Apollo with C++ 17 features.
build:c++17 --cxxopt=-std=c++1z
# build:c++17 --cxxopt=-stdlib=libc++
build:c++1z --config=c++17
# Enable C++14 (aka c++1y) by default
build --cxxopt="-std=c++14"
build --host_cxxopt="-std=c++14"
# +------------------------------------------------------------+
# | Test Configurations |
# +------------------------------------------------------------+
test --flaky_test_attempts=3
test --test_size_filters=small,medium
# test --test_env=LD_LIBRARY_PATH
# test --test_env=PYTHONPATH
# By default prints output only from failed tests.
test --test_output=errors
test:unit_test --test_verbose_timeout_warnings
# use --copt=-mavx2
# test --copt=-march=native
coverage --javabase="@bazel_tools//tools/jdk:remote_jdk11"
# coverage --host_javabase="@bazel_tools//tools/jdk:remote_jdk11"
coverage --instrument_test_targets
coverage --combined_report=lcov
coverage --nocache_test_results
# coverage --coverage_report_generator="@bazel_tools//tools/test/CoverageOutputGenerator/java/com/google/devtools/coverageoutputgenerator:Main"
coverage --cxxopt=--coverage
coverage --cxxopt=-fprofile-arcs
coverage --cxxopt=-ftest-coverage
coverage --linkopt=-lgcov
# +------------------------------------------------------------+
# | CPP Lint Tests & Unit Tests |
# +------------------------------------------------------------+
# By default, cpplint tests are run as part of `bazel test` alongside all of
# the other compilation and test targets. This is a convenience shortcut to
# only do the cpplint testing and nothing else.
# Do bazel test --config=cpplint <target> to enable this configuration.
# To enable the lint test, the BUILD *must* load the cpplint.bzl by having
# 'load("//tools:cpplint.bzl", "cpplint")' at the beginning and 'cpplint()'
# at the end.
test:cpplint --test_tag_filters=cpplint
test:cpplint --build_tests_only
test:cpplint --test_timeout=3600
test:cpplint --flaky_test_attempts=1
# Regular unit tests.
test:unit_test --test_tag_filters=-cpplint
# Coverage tests
coverage --test_tag_filters=-cpplint
# +------------------------------------------------------------+
# | Python Configurations |
# +------------------------------------------------------------+
# Python support was configured by third_party/py .
# build --remote_cache="http://localhost:8080/