| # Use platforms to build our code. |
| build --incompatible_enable_cc_toolchain_resolution |
| |
| # Rewrite all URLs to be on software.frc971.org |
| common --experimental_downloader_config=tools/dependency_rewrite |
| |
| # Default to py3 since that's all we support |
| build --python_version=PY3 |
| build --incompatible_default_to_explicit_init_py |
| |
| # For now we only support building on x86 Linux so we can hard-code the host |
| # platform. |
| build --host_platform=//tools/platforms:linux_x86 |
| |
| # Always include debug information in the non-.stripped binaries. |
| build --strip=never |
| |
| build --noincompatible_disable_nocopts |
| |
| # Use the malloc we want. |
| build --custom_malloc=//tools/cpp:malloc |
| |
| # Shortcuts for selecting the target platform. |
| build:k8 --platforms=//tools/platforms:linux_x86 |
| build:k8_legacy_python --platforms=//tools/platforms:linux_x86_legacy_python --host_platform=//tools/platforms:linux_x86_legacy_python |
| build:roborio --platforms=//tools/platforms:linux_roborio |
| build:roborio --platform_suffix=-roborio |
| build:arm64 --platforms=//tools/platforms:linux_arm64 |
| build:arm64 --platform_suffix=-arm64 |
| build:cortex-m4f --platforms=//tools/platforms:cortex_m4f |
| build:cortex-m4f --platform_suffix=-cortex-m4f |
| build:rp2040 --platforms=//tools/platforms:rp2040 |
| build:rp2040 --platform_suffix=-rp2040 |
| build:cortex-m4f-imu --platforms=//tools/platforms:cortex-m4f-imu |
| build:cortex-m4f-imu --platform_suffix=-cortex-m4f-imu |
| |
| build:asan --copt -fsanitize=address |
| build:asan --linkopt -fsanitize=address --linkopt -ldl |
| build:asan --platform_suffix=-asan |
| build:asan --test_env ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer-3.6 |
| build: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 |
| build:asan --copt -fsanitize-blacklist=tools/cpp/asan-blacklist |
| build:asan --define have_asan=true |
| |
| build:tsan --copt -fsanitize=thread --copt -DAOS_SANITIZER_thread |
| build:tsan --linkopt -fsanitize=thread |
| build:tsan --platform_suffix=-tsan |
| build:tsan --test_env TSAN_OPTIONS=external_symbolizer_path=/usr/bin/llvm-symbolizer-3.6:detect_deadlocks=1:second_deadlock_stack=1 |
| build:tsan --define have_tsan=true |
| |
| build:isan --copt -fsanitize=integer |
| build:isan --linkopt -fsanitize=integer |
| build:isan --platform_suffix=-isan |
| build:isan --test_env LLVM_SYMBOLIZER=/usr/bin/llvm-symbolizer-3.6 |
| build:isan --define have_isan=true |
| |
| build:ubsan --copt -fsanitize=undefined --copt -fno-sanitize-recover |
| # Bad alignment is just slow on x86 and traps on ARM, so we'll find |
| # it other ways, and some x86 code does it on purpose. |
| build:ubsan --copt -fno-sanitize=alignment |
| build:ubsan --linkopt -fsanitize=undefined |
| # TOOD(Brian): Remove this once Clang adds it itself like it should. |
| build:ubsan --linkopt /usr/lib/llvm-3.6/lib/clang/3.6.2/lib/linux/libclang_rt.ubsan_cxx-x86_64.a |
| build:ubsan --platform_suffix=-ubsan |
| build:ubsan --test_env UBSAN_OPTIONS=external_symbolizer_path=/usr/bin/llvm-symbolizer-3.6:color=always:print_stacktrace=1 |
| build:ubsan --copt -fsanitize-blacklist=tools/cpp/ubsan-blacklist |
| build:ubsan --define have_ubsan=true |
| |
| build:msan --copt -fsanitize=memory --copt -fsanitize-memory-track-origins |
| build:msan --linkopt -fsanitize=memory --linkopt -fsanitize-memory-track-origins |
| build:msan --platform_suffix=-msan |
| build:msan --test_env MSAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer-3.6 |
| build:msan --define have_msan=true |
| |
| # Sometime, we want to be able to have eigen assertions run so that we can |
| # catch potential issues (e.g., accessing invalid indices). |
| build:eigen --copt -UNDEBUG |
| |
| # Show paths to a few more than just 1 target. |
| build --show_result 5 |
| # Dump the output of the failing test to stdout. |
| # Keep the default test timeouts except make 'eternal'=4500 secs |
| test --test_output=errors --test_timeout=-1,-1,-1,5500 |
| |
| build --sandbox_base=/dev/shm/ |
| |
| build --sandbox_fake_hostname=true |
| build --sandbox_fake_username=true |
| |
| startup --host_jvm_args=-Dbazel.DigestFunction=SHA1 |
| |
| common --watchfs |
| |
| # Switch to SHA256 for compatibility with distributed caching. |
| startup --host_jvm_args=-Dbazel.DigestFunction=SHA256 |
| |
| build --spawn_strategy=sandboxed |
| build --sandbox_default_allow_network=false |
| |
| build --strategy=TsProject=sandboxed |
| build --strategy=CopyFile=standalone |
| build --strategy=CopyDirectory=standalone |
| |
| # Use our hermetic JDK. |
| # Note that this doesn't quite work fully, but it should. See |
| # https://github.com/bazelbuild/bazel/issues/6341 for ongoing discussion with |
| # upstream about this. |
| build --java_runtime_version=openjdk_11 --tool_java_runtime_version=openjdk_11 |
| |
| # Prevent falling back to the host JDK. |
| startup --noautodetect_server_javabase |
| |
| # Give each build action and test its own /tmp. |
| build --sandbox_tmpfs_path=/tmp |
| |
| # Prevent cypress from using its own binary. We want to use the hermetic one. |
| build --action_env=CYPRESS_INSTALL_BINARY=0 |
| |
| # From our one and only phil.schrader: https://groups.google.com/g/bazel-discuss/c/5cbRuLuTwNg :) |
| # Enable -Werror and warnings for our code |
| # TODO: It would be nice to enable Wcast-align and Wcast-qual. |
| build --per_file_copt=-third_party/.*,-external/.*@-Werror,-Wextra,-Wpointer-arith,-Wstrict-aliasing,-Wwrite-strings,-Wtype-limits,-Wsign-compare,-Wformat=2 |
| # NOTE: Explicitly disable -Werror because the `-external/.*` filter does not work |
| build --per_file_copt=third_party/.*,external/.*@-Wno-sign-compare,-Wno-cast-align,-Wno-error,-Wno-unused-parameter,-Wno-cast-qual,-Wno-format-nonliteral,-Wno-tautological-type-limit-compare,-Wno-missing-field-initializers,-Wno-unused-function,-Wno-cast-function-type,-Wno-comment,-Wno-typedef-redefinition,-Wno-tautological-unsigned-enum-zero-compare,-Wno-extra,-Wno-type-limits,-Wno-attributes,-Wno-deprecated |
| |
| # Load a local file that users can use to customize bazel invocations. This |
| # should stay the last line in this file so users can override things when they |
| # want. |
| try-import %workspace%/.bazelrc.user |
| |