2019-12-17 17:33:33 -08:00
|
|
|
# Must be first. Enables build:windows, build:linux, build:macos, build:freebsd, build:openbsd
|
|
|
|
build --enable_platform_specific_config
|
|
|
|
###############################################################################
|
2020-02-26 12:28:13 -08:00
|
|
|
# On Windows, provide: USE_CLANG_CL=1, CC=clang, BAZEL_LLVM, BAZEL_SH
|
2020-05-05 10:47:49 -07:00
|
|
|
# On all platforms, provide: PYTHON3_BIN_PATH=python
|
2020-02-26 12:28:13 -08:00
|
|
|
###############################################################################
|
2019-03-23 10:44:11 +08:00
|
|
|
build --action_env=PATH
|
2020-06-05 05:36:10 -07:00
|
|
|
# For --compilation_mode=dbg, consider enabling checks in the standard library as well (below).
|
2020-05-12 22:06:04 -07:00
|
|
|
build --compilation_mode=opt
|
2020-02-11 12:11:53 -08:00
|
|
|
# This workaround is needed to prevent Bazel from compiling the same file twice (once PIC and once not).
|
|
|
|
build:linux --force_pic
|
|
|
|
build:macos --force_pic
|
2019-12-01 15:05:50 -08:00
|
|
|
# TODO(mehrdadn): Revert the "-\\.(asm|S)$" exclusion when this Bazel bug
|
|
|
|
# for compiling assembly files is fixed on Windows:
|
|
|
|
# https://github.com/bazelbuild/bazel/issues/8924
|
2019-08-07 14:04:05 -07:00
|
|
|
# Warnings should be errors
|
2019-12-01 15:05:50 -08:00
|
|
|
build --per_file_copt="-\\.(asm|S)$,-.*/arrow/util/logging\\.cc@-Werror"
|
2019-08-07 14:04:05 -07:00
|
|
|
# Ignore warnings for protobuf generated files and external projects.
|
2019-12-01 15:05:50 -08:00
|
|
|
build --per_file_copt="-\\.(asm|S)$,\\.pb\\.cc$@-w"
|
|
|
|
build --per_file_copt="-\\.(asm|S)$,external/.*@-w"
|
2020-02-11 16:49:33 -08:00
|
|
|
# Ignore this warning since it's impractical to fix in the relevant headers
|
|
|
|
build --per_file_copt="-\\.(asm|S)$,.*/ray/raylet/reconstruction_policy_test\\.cc@-Wno-inconsistent-missing-override"
|
2020-04-01 10:03:23 -07:00
|
|
|
# Ignore this warning since CPython and Cython have issue removing deprecated tp_print on MacOS
|
|
|
|
build --per_file_copt="-\\.(asm|S)$,.*/_raylet\\.cpp@-Wno-deprecated-declarations"
|
|
|
|
build --per_file_copt="-\\.(asm|S)$,.*/_streaming\\.cpp@-Wno-deprecated-declarations"
|
2019-11-18 20:54:23 -08:00
|
|
|
# Ignore minor warnings for host tools, which we generally can't control
|
|
|
|
build --host_copt="-Wno-builtin-macro-redefined"
|
|
|
|
build --host_copt="-Wno-inconsistent-missing-override"
|
|
|
|
build --host_copt="-Wno-microsoft-unqualified-friend"
|
2019-06-17 19:00:50 +08:00
|
|
|
# This workaround is needed due to https://github.com/bazelbuild/bazel/issues/4341
|
2019-12-01 15:05:50 -08:00
|
|
|
build --per_file_copt="-\\.(asm|S)$,external/com_github_grpc_grpc/.*@-DGRPC_BAZEL_BUILD"
|
2019-08-19 16:26:58 -07:00
|
|
|
build --http_timeout_scaling=5.0
|
2020-02-07 16:19:46 -08:00
|
|
|
build:iwyu --experimental_action_listener=//:iwyu_cpp
|
2020-01-05 16:18:21 -08:00
|
|
|
|
2020-02-11 16:49:33 -08:00
|
|
|
# Print relative paths when possible
|
|
|
|
build:windows --attempt_to_print_relative_paths
|
|
|
|
# Save disk space by hardlinking cache hits instead of copying
|
|
|
|
build:windows --experimental_repository_cache_hardlinks
|
|
|
|
# Avoid duplicate noise in the build output
|
|
|
|
build:windows --experimental_ui_deduplicate
|
|
|
|
# Clean the environment before building, to make builds more deterministic
|
|
|
|
build:windows --incompatible_strict_action_env
|
|
|
|
# For colored output (seems necessary on Windows)
|
|
|
|
build:windows --color=yes
|
|
|
|
# For compiler colored output (seems necessary on Windows)
|
|
|
|
build:windows --per_file_copt="-\\.(asm|S)$@-fansi-escape-codes"
|
|
|
|
build:windows --per_file_copt="-\\.(asm|S)$@-fcolor-diagnostics"
|
|
|
|
|
2020-06-05 05:36:10 -07:00
|
|
|
# Debug build flags. Uncomment in '-c dbg' builds to enable checks in the C++ standard library:
|
|
|
|
#build:linux --cxxopt="-D_GLIBCXX_DEBUG=1"
|
|
|
|
#build:linux --cxxopt="-D_GLIBCXX_DEBUG_PEDANTIC=1"
|
|
|
|
#build:linux --cxxopt="-D_LIBCPP_DEBUG=1"
|
|
|
|
#build:macos --cxxopt="-D_GLIBCXX_DEBUG=1"
|
|
|
|
#build:macos --cxxopt="-D_GLIBCXX_DEBUG_PEDANTIC=1"
|
|
|
|
#build:windows --cxxopt="-D_ITERATOR_DEBUG_LEVEL=2"
|
|
|
|
|
2020-01-05 16:18:21 -08:00
|
|
|
# Thread sanitizer configuration:
|
|
|
|
build:tsan --strip=never
|
|
|
|
build:tsan --copt -fsanitize=thread
|
|
|
|
build:tsan --copt -DTHREAD_SANITIZER
|
|
|
|
build:tsan --copt -g
|
|
|
|
build:tsan --copt -fno-omit-frame-pointer
|
|
|
|
build:tsan --linkopt -fsanitize=thread
|
2020-02-26 12:28:13 -08:00
|
|
|
|
2020-05-21 15:11:03 -07:00
|
|
|
# Memory sanitizer configuration:
|
|
|
|
build:asan --strip=never
|
|
|
|
build:asan --copt -g
|
|
|
|
build:asan --copt -fsanitize=address
|
|
|
|
build:asan --copt -fno-sanitize=vptr
|
|
|
|
build:asan --copt -DADDRESS_SANITIZER
|
|
|
|
build:asan --copt -fno-omit-frame-pointer
|
|
|
|
build:asan --linkopt -fsanitize=address
|
|
|
|
build:asan --linkopt -fno-sanitize=vptr
|
|
|
|
test:asan --action_env=ASAN_OPTIONS=detect_leaks=0
|
|
|
|
# This LD_PRELOAD is set for Travis. You will need to change it for local debugging.
|
|
|
|
test:asan --action_env=LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libasan.so.2
|
|
|
|
# For example, for Ubuntu 18.04 libasan can be found here:
|
|
|
|
# test:asan --action_env=LD_PRELOAD=/usr/lib/gcc/x86_64-linux-gnu/7/libasan.so
|
|
|
|
|
2020-04-10 13:26:28 -07:00
|
|
|
test:ci --flaky_test_attempts=3
|
|
|
|
test:ci --nocache_test_results
|
|
|
|
test:ci --progress_report_interval=100
|
|
|
|
test:ci --show_progress_rate_limit=100
|
|
|
|
test:ci --show_timestamps
|
|
|
|
test:ci --spawn_strategy=local
|
|
|
|
test:ci --test_output=errors
|
|
|
|
test:ci --test_verbose_timeout_warnings
|
|
|
|
|
2020-02-26 12:28:13 -08:00
|
|
|
# [Linux] Uncomment this line to print a stack trace on exit.
|
|
|
|
#test:linux --run_under="bash -c 'if command -v strace >/dev/null && strace -qq -k -e exit true 2>/dev/null; then strace -qq -k -e exit -e trace=\"!all\" -s 32768 -f -o >(awk \"/^[0-9]+ / { y = \\$3 != \\\"SIGCHLD\\\" && \\$3 != \\\"SIGTERM\\\" && \\$5 != \\\"SIGTERM\\\" && \\$5 != \\\"SIGKILL2\\\"; } y { print; }\" 1>&2 && cat 1>&2) -- \"$@\"; else \"$@\"; fi' -"
|
|
|
|
# [Linux] Uncomment this line to preload libSegFault.so if available, to print a stack trace on aborts and segfault. (Note: This doesn't always work.)
|
|
|
|
#test:linux --run_under="bash -c 'unset GREP_OPTIONS && if ! grep -q -o Microsoft /proc/version 2>/dev/null; then libs=\"$(command -v ldconfig >/dev/null && ldconfig -p | grep -F -o -e \"libSegFault.so\" | uniq | tr \"\\\\n\" :)\" && if [ -n \"${libs%:}\" ]; then export SEGFAULT_SIGNALS=\"abrt segv\" LD_PRELOAD=\"${libs}${LD_PRELOAD-}\"; fi; fi && \"$@\"' -"
|