• Home
  • Raw
  • Download

Lines Matching +full:bazel +full:- +full:0

1 #!/bin/bash -eu
8 # http://www.apache.org/licenses/LICENSE-2.0
18 declare -r FUZZ_TARGET_QUERY='
20 $all_fuzz_tests - attr(tags, "no_fuzz", $all_fuzz_tests)
22 declare -r OSS_FUZZ_TARGETS="$(bazel query "${FUZZ_TARGET_QUERY}" | sed 's/$/_oss_fuzz/')"
24 declare -r EXTRA_BAZEL_FLAGS="$(
27 …# Bazel uses clang to link binary, which does not link clang_rt ubsan library for C++ automaticall…
28 # See issue: https://github.com/bazelbuild/bazel/issues/8777
29 …echo "--linkopt=\"$(find $(llvm-config --libdir) -name libclang_rt.ubsan_standalone_cxx-x86_64.a |…
32 echo "--copt=-D__SANITIZE_ADDRESS__" "--copt=-DADDRESS_SANITIZER=1" "--linkopt=-fsanitize=address"
43 # The following disables both coverage-instrumentation and other sanitizer instrumentation.
57 # libprotobuf-mutator
60 # In addition to this, we disable instrumentation in all *.pb.cc (protobuf-generated files)
61 # and everything in the bazel-out directory.
62 declare -r DI="$(
66 echo " --per_file_copt=^.*source/extensions/access_loggers/.*\.cc\$@-fsanitize-coverage=0"
67 echo " --per_file_copt=^.*source/common/protobuf/.*\.cc\$@-fsanitize-coverage=0"
70 echo " --per_file_copt=^.*test/.*\.cc\$@-fsanitize-coverage=0"
73 echo " --per_file_copt=^.*antlr4_runtimes.*\.cpp\$@-fsanitize-coverage=0,-fno-sanitize=all"
74 echo " --per_file_copt=^.*com_google_protobuf.*\.cc\$@-fsanitize-coverage=0,-fno-sanitize=all"
75 echo " --per_file_copt=^.*com_google_absl.*\.cc\$@-fsanitize-coverage=0,-fno-sanitize=all"
76 echo " --per_file_copt=^.*googletest.*\.cc\$@-fsanitize-coverage=0,-fno-sanitize=all"
77 echo " --per_file_copt=^.*com_github_grpc_grpc.*\.cc\$@-fsanitize-coverage=0,-fno-sanitize=all"
78 echo " --per_file_copt=^.*boringssl.*\.cc\$@-fsanitize-coverage=0,-fno-sanitize=all"
79 …echo " --per_file_copt=^.*com_googlesource_code_re2.*\.cc\$@-fsanitize-coverage=0,-fno-sanitize=al…
80 echo " --per_file_copt=^.*upb.*\.cpp\$@-fsanitize-coverage=0,-fno-sanitize=all"
81 echo " --per_file_copt=^.*org_brotli.*\.cpp\$@-fsanitize-coverage=0,-fno-sanitize=all"
82 echo " --per_file_copt=^.*com_google_cel_cpp.*\.cpp\$@-fsanitize-coverage=0,-fno-sanitize=all"
83 …echo " --per_file_copt=^.*com_github_jbeder_yaml_cpp.*\.cpp\$@-fsanitize-coverage=0,-fno-sanitize=…
84 echo " --per_file_copt=^.*proxy_wasm_cpp_host/.*\.cc\$@-fsanitize-coverage=0,-fno-sanitize=all"
85 …echo " --per_file_copt=^.*com_github_google_libprotobuf_mutator/.*\.cc\$@-fsanitize-coverage=0,-fn…
86 …echo " --per_file_copt=^.*com_googlesource_googleurl/.*\.cc\$@-fsanitize-coverage=0,-fno-sanitize=…
87 …echo " --per_file_copt=^.*com_lightstep_tracer_cpp/.*\.cc\$@-fsanitize-coverage=0,-fno-sanitize=al…
89 # All protobuf code and code in bazel-out
90 echo " --per_file_copt=^.*\.pb\.cc\$@-fsanitize-coverage=0,-fno-sanitize=all"
91 echo " --per_file_copt=^.*bazel-out/.*\.cc\$@-fsanitize-coverage=0,-fno-sanitize=all"
98 bazel build --verbose_failures --dynamic_mode=off ${DI} \
99 --spawn_strategy=standalone --genrule_strategy=standalone \
100 --local_cpu_resources=HOST_CPUS*0.32 \
101 --//source/extensions/wasm_runtime/v8:enabled=false \
102 --build_tag_filters=-no_asan --config=oss-fuzz \
106 # Profiling with coverage requires that we resolve+copy all Bazel symlinks and
107 # also remap everything under proc/self/cwd to correspond to Bazel build paths.
113 declare -r REMAP_PATH="${OUT}/proc/self/cwd"
114 mkdir -p "${REMAP_PATH}"
116 rsync -av "${SRC}"/envoy/source "${REMAP_PATH}"
117 rsync -av "${SRC}"/envoy/test "${REMAP_PATH}"
119 rm -rf "${SRC}"/envoy/bazel-envoy/external/envoy
121 …find "${SRC}"/envoy/bazel-envoy/external -follow -type l -ls -delete || echo "Symlink cleanup soft…
122 rsync -avLk "${SRC}"/envoy/bazel-envoy/external "${REMAP_PATH}"
123 # For .h, and some generated artifacts, we need bazel-out/. Need to heavily
124 # filter out the build objects from bazel-out/. Also need to resolve symlinks,
126 declare -r RSYNC_FILTER_ARGS=("--include" "*.h" "--include" "*.cc" "--include" \
127 "*.hpp" "--include" "*.cpp" "--include" "*.c" "--include" "*/" "--exclude" "*")
128 rsync -avLk "${RSYNC_FILTER_ARGS[@]}" "${SRC}"/envoy/bazel-out "${REMAP_PATH}"
129 rsync -avLkR "${RSYNC_FILTER_ARGS[@]}" "${HOME}" "${OUT}"
130 rsync -avLkR "${RSYNC_FILTER_ARGS[@]}" /tmp "${OUT}"
133 for oss_fuzz_archive in $(find bazel-bin/ -name '*_oss_fuzz.tar'); do
134 tar -xvf "${oss_fuzz_archive}" -C "${OUT}"
137 # Cleanup bazel- symlinks to avoid oss-fuzz trying to copy out of the build
139 rm -f bazel-*