aboutsummaryrefslogtreecommitdiff
path: root/projects/grpc
diff options
context:
space:
mode:
authorMax Moroz <mmoroz@chromium.org>2018-09-14 14:27:50 -0700
committerMax Moroz <mmoroz@chromium.org>2018-09-14 14:27:50 -0700
commit04537e050a47adbc3cbe1d21635ac55505ccdbdf (patch)
tree6008fec9944899547e4b12a5530e6a424efdeb61 /projects/grpc
parent394edaaa80e8cf9998c3517a185e600ad5affcb4 (diff)
downloadoss-fuzz-04537e050a47adbc3cbe1d21635ac55505ccdbdf.tar.gz
[grpc] An attempt to fix code coverage build (similar to Envoy).
Diffstat (limited to 'projects/grpc')
-rwxr-xr-xprojects/grpc/build.sh13
-rw-r--r--projects/grpc/project.yaml1
2 files changed, 14 insertions, 0 deletions
diff --git a/projects/grpc/build.sh b/projects/grpc/build.sh
index 7b181569c..1f6706450 100755
--- a/projects/grpc/build.sh
+++ b/projects/grpc/build.sh
@@ -59,6 +59,19 @@ bazel build --dynamic_mode=off --spawn_strategy=standalone --genrule_strategy=st
:all test/core/util/... test/core/end2end/... third_party/address_sorting/... \
third_party/nanopb/... @boringssl//:all @com_github_madler_zlib//:all @com_github_cares_cares//:all
+# Copied from projects/envoy/build.sh which also uses Bazel.
+# Profiling with coverage requires that we resolve+copy all Bazel symlinks and
+# also remap everything under proc/self/cwd to correspond to Bazel build paths.
+if [ "$SANITIZER" = "profile" ]
+then
+ # The build invoker looks for sources in $SRC, but it turns out that we need
+ # to not be buried under src/, paths are expected at out/proc/self/cwd by
+ # the profiler.
+ declare -r REMAP_PATH="${OUT}/proc/self/cwd"
+ mkdir -p "${REMAP_PATH}"
+ rsync -av "${SRC}"/grpc "${REMAP_PATH}"
+fi
+
CFLAGS="${CFLAGS} -Iinclude -Ithird_party/nanopb -I."
CXXFLAGS="${CXXFLAGS} -Iinclude -Ithird_party/nanopb -I. -stdlib=libc++"
diff --git a/projects/grpc/project.yaml b/projects/grpc/project.yaml
index c93b9a062..7b6301854 100644
--- a/projects/grpc/project.yaml
+++ b/projects/grpc/project.yaml
@@ -12,3 +12,4 @@ auto_ccs:
- "yashkt@google.com"
- "yuxuanli@google.com"
- "zyc@google.com"
+coverage_extra_args: -ignore-filename-regex=.*\.cache.*