Use compile_go_fuzzer (#4710)

This commit is contained in:
Will 2020-11-24 19:20:21 -08:00 committed by GitHub
parent ea136f5106
commit d126898bde
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 13 deletions

View File

@ -25,19 +25,7 @@ function compile_ds_fuzzer {
DS_PROVIDERS="$2" go generate
fi
# vendor dependencies since go-fuzz doesn't play nicely with go mod.
rm -rf vendor .gopath || true
go mod vendor
mkdir .gopath
cd .gopath
ln -s ../vendor src
cd ..
# Compile and instrument all Go files relevant to this fuzz target.
GO111MODULE=off GOPATH=$PWD/.gopath go-fuzz -o $fuzzer.a .
# Link Go code ($fuzzer.a) with fuzzing engine to produce fuzz target binary.
$CXX $CXXFLAGS $LIB_FUZZING_ENGINE $fuzzer.a -o $OUT/$fuzzer
compile_go_fuzzer github.com/ipfs/go-datastore/fuzz Fuzz $fuzzer
}
compile_ds_fuzzer ipfs_ds_flatfs