blob: 53f34e8d2d962fa7e11df541bf305cda3f451604 [file] [log] [blame]
Philipp Schraderdada1072020-11-24 11:34:46 -08001# Use platforms to build our code.
2build --incompatible_enable_cc_toolchain_resolution
3
Austin Schuh085eab92020-11-26 13:54:51 -08004# Default to py3 since that's all we support
5build --python_version=PY3
6
Philipp Schraderdada1072020-11-24 11:34:46 -08007# For now we only support building on x86 Linux so we can hard-code the host
8# platform.
9build --host_platform=//tools/platforms:linux_x86
Brian Silvermanfbe4fd52015-10-26 10:40:55 -040010
Brian Silverman5bc54342015-11-26 22:57:46 -050011# Always include debug information in the non-.stripped binaries.
12build --strip=never
13
Austin Schuhda9d0602019-09-15 17:29:38 -070014build --noincompatible_disable_nocopts
Brian Silverman78aab862020-12-16 14:15:05 -080015common --noincompatible_restrict_string_escapes
Austin Schuhda9d0602019-09-15 17:29:38 -070016
Brian Silverman516ceb22015-11-27 01:29:05 -050017# Use the malloc we want.
18build --custom_malloc=//tools/cpp:malloc
19
Philipp Schraderdada1072020-11-24 11:34:46 -080020# Shortcuts for selecting the target platform.
21build:k8 --platforms=//tools/platforms:linux_x86
22build:roborio --platforms=//tools/platforms:linux_roborio
23build:armhf-debian --platforms=//tools/platforms:linux_armhf
24build:cortex-m4f --platforms=//tools/platforms:cortex_m4f
Austin Schuh0a96ea32022-01-01 22:29:30 -080025build:rp2040 --platforms=//tools/platforms:rp2040
Philipp Schraderdada1072020-11-24 11:34:46 -080026
Austin Schuhc4788d12021-01-23 17:23:37 -080027# Without this, we end up rebuilding from scratch every time we change compilers. This is needed to make --cpu work (even though it shouldn't be used).
28build --crosstool_top=@//tools/cpp:toolchain --host_crosstool_top=@//tools/cpp:toolchain
29
Brian Silverman63889f92015-11-27 01:33:56 -050030build:asan --copt -fsanitize=address
31build:asan --linkopt -fsanitize=address --linkopt -ldl
32build:asan --platform_suffix=-asan
33build:asan --test_env ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer-3.6
34build:asan --test_env ASAN_OPTIONS=detect_leaks=1:check_initialization_order=1:strict_init_order=1:detect_stack_use_after_return=1:detect_odr_violation=2:allow_user_segv_handler=1
Brian Silvermanb466eef2015-11-28 20:33:44 -050035build:asan --copt -fsanitize-blacklist=tools/cpp/asan-blacklist
Brian Silverman7dc6adb2017-02-19 17:04:36 -080036build:asan --define have_asan=true
Brian Silverman63889f92015-11-27 01:33:56 -050037
38build:tsan --copt -fsanitize=thread --copt -DAOS_SANITIZER_thread
39build:tsan --linkopt -fsanitize=thread
40build:tsan --platform_suffix=-tsan
41build:tsan --test_env TSAN_OPTIONS=external_symbolizer_path=/usr/bin/llvm-symbolizer-3.6:detect_deadlocks=1:second_deadlock_stack=1
Brian Silverman7dc6adb2017-02-19 17:04:36 -080042build:tsan --define have_tsan=true
Brian Silverman63889f92015-11-27 01:33:56 -050043
44build:isan --copt -fsanitize=integer
45build:isan --linkopt -fsanitize=integer
46build:isan --platform_suffix=-isan
47build:isan --test_env LLVM_SYMBOLIZER=/usr/bin/llvm-symbolizer-3.6
Brian Silverman7dc6adb2017-02-19 17:04:36 -080048build:isan --define have_isan=true
Brian Silverman63889f92015-11-27 01:33:56 -050049
Brian Silvermana4a4ea62015-11-27 10:27:53 -050050build:ubsan --copt -fsanitize=undefined --copt -fno-sanitize-recover
51# Bad alignment is just slow on x86 and traps on ARM, so we'll find
52# it other ways, and some x86 code does it on purpose.
53build:ubsan --copt -fno-sanitize=alignment
Brian Silverman63889f92015-11-27 01:33:56 -050054build:ubsan --linkopt -fsanitize=undefined
Brian Silvermanb466eef2015-11-28 20:33:44 -050055# TOOD(Brian): Remove this once Clang adds it itself like it should.
56build:ubsan --linkopt /usr/lib/llvm-3.6/lib/clang/3.6.2/lib/linux/libclang_rt.ubsan_cxx-x86_64.a
Brian Silverman63889f92015-11-27 01:33:56 -050057build:ubsan --platform_suffix=-ubsan
Brian Silvermanb466eef2015-11-28 20:33:44 -050058build:ubsan --test_env UBSAN_OPTIONS=external_symbolizer_path=/usr/bin/llvm-symbolizer-3.6:color=always:print_stacktrace=1
59build:ubsan --copt -fsanitize-blacklist=tools/cpp/ubsan-blacklist
Brian Silverman7dc6adb2017-02-19 17:04:36 -080060build:ubsan --define have_ubsan=true
Brian Silverman63889f92015-11-27 01:33:56 -050061
Brian Silvermana4a4ea62015-11-27 10:27:53 -050062build:msan --copt -fsanitize=memory --copt -fsanitize-memory-track-origins
Brian Silvermanb466eef2015-11-28 20:33:44 -050063build:msan --linkopt -fsanitize=memory --linkopt -fsanitize-memory-track-origins
Brian Silverman63889f92015-11-27 01:33:56 -050064build:msan --platform_suffix=-msan
65build:msan --test_env MSAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer-3.6
Brian Silverman7dc6adb2017-02-19 17:04:36 -080066build:msan --define have_msan=true
Brian Silverman63889f92015-11-27 01:33:56 -050067
James Kuszmaul2af1ba82019-02-09 22:16:53 -080068# Sometime, we want to be able to have eigen assertions run so that we can
69# catch potential issues (e.g., accessing invalid indices).
70build:eigen --copt -UNDEBUG
71
Brian Silverman12b3fc52015-10-11 19:38:33 -040072# Show paths to a few more than just 1 target.
Austin Schuh00bc0932016-02-14 21:05:34 -080073build --show_result 5
Brian Silverman12b3fc52015-10-11 19:38:33 -040074# Dump the output of the failing test to stdout.
75test --test_output=errors
Brian Silvermanb200c172017-01-02 17:35:35 -080076
Austin Schuh9d92e6b2017-10-17 01:19:38 -070077build --experimental_sandbox_base=/dev/shm/
Austin Schuh35c75e82017-03-11 21:54:05 -080078build --experimental_multi_threaded_digest
Austin Schuh9d92e6b2017-10-17 01:19:38 -070079
80build --sandbox_fake_hostname=true
81build --sandbox_fake_username=true
82
Austin Schuh9d92e6b2017-10-17 01:19:38 -070083startup --host_jvm_args=-Dbazel.DigestFunction=SHA1
84
85common --watchfs
Austin Schuhe18baff2018-10-20 17:40:42 -070086
87# Switch to SHA256 for compatibility with distributed caching.
88startup --host_jvm_args=-Dbazel.DigestFunction=SHA256
89
Austin Schuhb6043b22017-11-29 00:14:39 -080090build --spawn_strategy=linux-sandbox
Austin Schuhe18baff2018-10-20 17:40:42 -070091build --experimental_sandbox_default_allow_network=false
92
Austin Schuh89a95052019-04-14 14:51:14 -070093build --strategy=TypeScriptCompile=worker --strategy=AngularTemplateCompile=worker
94
Austin Schuhe18baff2018-10-20 17:40:42 -070095# Use our hermetic JDK.
96# Note that this doesn't quite work fully, but it should. See
97# https://github.com/bazelbuild/bazel/issues/6341 for ongoing discussion with
98# upstream about this.
99build --javabase=@openjdk_linux_archive//:jdk --host_javabase=@openjdk_linux_archive//:jdk
Philipp Schraderd64e1302020-12-12 18:53:00 -0800100
101# Prevent falling back to the host JDK.
102startup --noautodetect_server_javabase