Skip to content

Commit 650fd83

Browse files
authored
fix: use compile_native_go_fuzzer_v2 compiler for OSS-Fuzz build. (#7296)
Signed-off-by: sudipto baral <sudiptobaral.me@gmail.com>
1 parent fa9f9c3 commit 650fd83

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

test/fuzz/oss_fuzz_build.sh

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,8 @@
99
# from the source file https://github.com/istio/istio/blob/master/tests/fuzz/oss_fuzz_build.sh
1010
# and is provided here subject to the following: Copyright Istio Authors SPDX-License-Identifier: Apache-2.0
1111

12-
# Required by `compile_native_go_fuzzer`
13-
# Ref: https://google.github.io/oss-fuzz/getting-started/new-project-guide/go-lang/#buildsh
14-
cd "$SRC"
15-
git clone --depth=1 https://github.com/AdamKorcz/go-118-fuzz-build --branch=include-all-test-files
16-
cd go-118-fuzz-build
17-
go build .
18-
mv go-118-fuzz-build /root/go/bin/
12+
# Using `compile_native_go_fuzzer_v2`
13+
# Ref: https://github.com/google/oss-fuzz/pull/13835
1914

2015
cd "$SRC"/gateway
2116

@@ -24,16 +19,8 @@ set -o pipefail
2419
set -o errexit
2520
set -x
2621

27-
# Create empty file that imports "github.com/AdamKorcz/go-118-fuzz-build/testing"
28-
# This is a small hack to install this dependency, since it is not used anywhere,
29-
# and Go would therefore remove it from go.mod once we run "go mod tidy && go mod vendor".
30-
printf "package envoygateway\nimport _ \"github.com/AdamKorcz/go-118-fuzz-build/testing\"\n" > register.go
31-
go mod edit -replace github.com/AdamKorcz/go-118-fuzz-build="$SRC"/go-118-fuzz-build
32-
go mod tidy
33-
34-
3522
# compile native-format fuzzers
36-
compile_native_go_fuzzer github.com/envoyproxy/gateway/test/fuzz FuzzGatewayAPIToXDS FuzzGatewayAPIToXDS
23+
compile_native_go_fuzzer_v2 github.com/envoyproxy/gateway/test/fuzz FuzzGatewayAPIToXDS FuzzGatewayAPIToXDS
3724

3825
# add seed corpus
3926
zip -j $OUT/FuzzGatewayAPIToXDS_seed_corpus.zip "$SRC"/gateway/test/fuzz/testdata/FuzzGatewayAPIToXDS/*

0 commit comments

Comments
 (0)