|
| 1 | +# Placeholder file for Prow |
| 2 | + |
| 3 | +# Required by envoy and its tests |
| 4 | +build --define=grpc_no_ares=true |
| 5 | +build --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 |
| 6 | + |
| 7 | +# We already have absl in the build, define absl=1 to tell googletest to use absl for backtrace. |
| 8 | +build --define absl=1 |
| 9 | + |
| 10 | +# Compile a Position Independent Executable |
| 11 | +# Ref: github.com/envoyproxy/envoy#8792 |
| 12 | +build --copt=-fPIC |
| 13 | + |
| 14 | +# Other flags for the C++ compiler |
| 15 | +build --show_timestamps |
| 16 | + |
| 17 | +# Compilation modes |
| 18 | +build:release -c opt |
| 19 | +build:debug -c dbg |
| 20 | + |
| 21 | +build --experimental_local_memory_estimate |
| 22 | +build --incompatible_strict_action_env=true |
| 23 | +build --host_force_python=PY3 |
| 24 | +build --action_env=BAZEL_LINKLIBS=-l%:libstdc++.a |
| 25 | +build --action_env=BAZEL_LINKOPTS=-lm |
| 26 | + |
| 27 | +# We already have absl in the build, define absl=1 to tell googletest to use absl for backtrace. |
| 28 | +build --define absl=1 |
| 29 | + |
| 30 | +# Pass PATH variable from the environment. CC and CXX are always clang (no gcc). |
| 31 | +build --action_env=CC=clang-14 |
| 32 | +build --action_env=CXX=clang++-14 |
| 33 | +build --action_env=PATH |
| 34 | + |
| 35 | +# Disable ICU linking for googleurl. |
| 36 | + |
| 37 | +# Common flags for sanitizers |
| 38 | +build:sanitizer --define tcmalloc=disabled |
| 39 | +build:sanitizer --linkopt -ldl |
| 40 | +build:sanitizer --build_tag_filters=-no_san |
| 41 | +build:sanitizer --test_tag_filters=-no_san |
| 42 | + |
| 43 | +# Common flags for Clang |
| 44 | +build:clang --action_env=BAZEL_COMPILER=clang |
| 45 | + |
| 46 | +# Compile with the Scudo allocator |
| 47 | +# https://llvm.org/docs/ScudoHardenedAllocator.html |
| 48 | +build:clang --copt -fsanitize=scudo |
| 49 | + |
| 50 | +# Compile with automatic variable initialization |
| 51 | +# https://reviews.llvm.org/rL349442 |
| 52 | +build:clang --copt -ftrivial-auto-var-init=pattern |
| 53 | + |
| 54 | +# Compilation modes |
| 55 | +build:clang-release --config=clang |
| 56 | +build:clang-release --config=release |
| 57 | + |
| 58 | +# Basic ASAN/UBSAN that works for gcc |
| 59 | +build:asan --config=sanitizer |
| 60 | +build:asan --config=debug |
| 61 | +# ASAN install its signal handler, disable ours so the stacktrace will be printed by ASAN |
| 62 | +build:asan --define signal_trace=disabled |
| 63 | +build:asan --define ENVOY_CONFIG_ASAN=1 |
| 64 | + |
| 65 | +build:asan --copt -fsanitize=address,undefined |
| 66 | +build:asan --linkopt -fsanitize=address,undefined |
| 67 | + |
| 68 | + |
| 69 | +build:asan --copt -DADDRESS_SANITIZER=1 |
| 70 | +build:asan --copt -D__SANITIZE_ADDRESS__ |
| 71 | +build:asan --test_env=ASAN_OPTIONS=handle_abort=1:allow_addr2line=true:check_initialization_order=true:strict_init_order=true:detect_odr_violation=1 |
| 72 | +build:asan --test_env=UBSAN_OPTIONS=halt_on_error=true:print_stacktrace=1 |
| 73 | +build:asan --test_env=ASAN_SYMBOLIZER_PATH |
| 74 | + |
| 75 | +build:clang-asan --config=asan |
| 76 | +build:clang-asan --action_env=ENVOY_UBSAN_VPTR=1 |
| 77 | +build:clang-asan --copt -fno-sanitize=vptr,function |
| 78 | +build:clang-asan --linkopt -fno-sanitize=vptr,function |
| 79 | +build:clang-asan --copt -fno-optimize-sibling-calls |
| 80 | +build:clang-asan --copt -fno-omit-frame-pointer |
| 81 | + |
| 82 | + |
| 83 | +build:asan --config=debug |
| 84 | +build:clang-tsan --config=sanitizer |
| 85 | +build:clang-tsan --define ENVOY_CONFIG_TSAN=1 |
| 86 | +build:clang-tsan --copt -fsanitize=thread |
| 87 | +build:clang-tsan --linkopt -fsanitize=thread |
| 88 | +build:clang-tsan --copt -DEVENT__DISABLE_DEBUG_MODE |
| 89 | + |
| 90 | +# Fuzz builds |
| 91 | +build:asan-fuzzer --config=clang-asan |
| 92 | +build:asan-fuzzer -c opt |
| 93 | +build:asan-fuzzer --action_env=CC=clang-14 |
| 94 | +build:asan-fuzzer --action_env=CXX=clang++-14 |
| 95 | +build:asan-fuzzer --nocache_test_results |
| 96 | +build:asan-fuzzer --define=FUZZING_ENGINE=libfuzzer |
| 97 | +build:asan-fuzzer --copt=-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION |
| 98 | +build:asan-fuzzer --copt=-fsanitize=fuzzer-no-link |
| 99 | +# Remove UBSAN halt_on_error to avoid crashing on protobuf errors. |
| 100 | +build:asan-fuzzer --test_env=UBSAN_OPTIONS=print_stacktrace=1 |
| 101 | + |
| 102 | +# Coverage |
| 103 | +coverage --config=coverage |
| 104 | +build:coverage --action_env=BAZEL_USE_LLVM_NATIVE_COVERAGE=1 |
| 105 | +build:coverage --action_env=GCOV=llvm-profdata |
| 106 | +build:coverage --action_env=CC=clang-14 |
| 107 | +build:coverage --action_env=CXX=clang++-14 |
| 108 | +build:coverage --copt=-DNDEBUG |
| 109 | +build:coverage --test_timeout=900 |
| 110 | +build:coverage --define=ENVOY_CONFIG_COVERAGE=1 |
| 111 | +build:coverage --cxxopt="-DENVOY_CONFIG_COVERAGE=1" |
| 112 | +build:coverage --coverage_support=@envoy//bazel/coverage:coverage_support |
| 113 | +build:coverage --test_env=CC_CODE_COVERAGE_SCRIPT=external/envoy/bazel/coverage/collect_cc_coverage.sh |
| 114 | +build:coverage --test_env=HEAPCHECK= |
| 115 | +build:coverage --combined_report=lcov |
| 116 | +build:coverage --strategy=TestRunner=sandboxed,local |
| 117 | +build:coverage --strategy=CoverageReport=sandboxed,local |
| 118 | +build:coverage --experimental_use_llvm_covmap |
| 119 | +build:coverage --collect_code_coverage |
| 120 | +build:coverage --test_tag_filters=-nocoverage |
| 121 | +build:coverage --instrumentation_filter="//src[/:]" |
| 122 | +coverage:test-coverage --test_arg="--log-path /dev/null" |
| 123 | +coverage:test-coverage --test_arg="-l trace" |
| 124 | +coverage:fuzz-coverage --config=asan-fuzzer |
| 125 | +coverage:fuzz-coverage --run_under=@envoy//bazel/coverage:fuzz_coverage_wrapper.sh |
0 commit comments