aboutsummaryrefslogtreecommitdiff
path: root/projects/lotus/build.sh
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2021-04-02 19:51:01 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-04-02 19:51:01 +0000
commit75c8dcf71ca8652f671b4ca5fea780a558c86e08 (patch)
tree328e6c9629b196cec1de3a94ee804d9fee3a0524 /projects/lotus/build.sh
parent378a8d19d33a5a62afbbe33b7f7b87b67db47236 (diff)
parent235e96b2f8ab4e43316158a2e6fa69e75a219e23 (diff)
downloadoss-fuzz-75c8dcf71ca8652f671b4ca5fea780a558c86e08.tar.gz
Original change: https://android-review.googlesource.com/c/platform/external/oss-fuzz/+/1662261 Change-Id: Ib7b7a79b38e1261c1d5fb4ccb1a5dfd106588996
Diffstat (limited to 'projects/lotus/build.sh')
-rw-r--r--projects/lotus/build.sh25
1 files changed, 24 insertions, 1 deletions
diff --git a/projects/lotus/build.sh b/projects/lotus/build.sh
index 2d4cf9e6c..64603099b 100644
--- a/projects/lotus/build.sh
+++ b/projects/lotus/build.sh
@@ -17,8 +17,31 @@
make
-compile_go_fuzzer github.com/filecoin-project/lotus/chain/types FuzzMessage fuzz_message gofuzz
+# Not all fuzzers can be compiled with --sanitizer=coverage.
+# The specific issue is that gofuzz.NewFromGofuzz is not supported when compiling with coverage.
+# The current status of the coverage build is that we do not break it for the fuzzers that cannot be compiled.
+#The reason that we don't break the build script is to create coverage reports for the fuzzers that compile.
+if [[ $SANITIZER = *coverage* ]]; then
+ compile_go_fuzzer github.com/filecoin-project/lotus/chain/types FuzzMessage fuzz_message gofuzz
+ mkdir fuzzing
+ cp ../fuzzing-lotus/fuzz/fuzz.go fuzzing/
+ compile_go_fuzzer github.com/filecoin-project/lotus/fuzzing FuzzBlockMsg fuzz_block_msg || true
+ compile_go_fuzzer github.com/filecoin-project/lotus/fuzzing FuzzBlockMsgStructural fuzz_block_msg_structural || true
+ compile_go_fuzzer github.com/filecoin-project/lotus/fuzzing FuzzBlockHeader fuzz_block_header || true
+ compile_go_fuzzer github.com/filecoin-project/lotus/fuzzing FuzzNodesForHeight fuzz_nodes_for_height || true
+ exit 0
+fi
+
+compile_go_fuzzer ./chain/types FuzzMessage fuzz_message gofuzz
+
+
+# Fuzzers from fuzzing-lotus
+cd ../fuzzing-lotus/fuzz
+rm -Rf libfuzzer
+go mod init github.com/filecoin-project/fuzzing-lotus/fuzz
+
compile_go_fuzzer github.com/filecoin-project/fuzzing-lotus/fuzz FuzzBlockMsg fuzz_block_msg
compile_go_fuzzer github.com/filecoin-project/fuzzing-lotus/fuzz FuzzBlockMsgStructural fuzz_block_msg_structural
compile_go_fuzzer github.com/filecoin-project/fuzzing-lotus/fuzz FuzzBlockHeader fuzz_block_header
compile_go_fuzzer github.com/filecoin-project/fuzzing-lotus/fuzz FuzzNodesForHeight fuzz_nodes_for_height
+exit 0