From b2daa3e9df6b47da75942cd9297e89efc8ad3193 Mon Sep 17 00:00:00 2001 From: Hidde Beydals Date: Thu, 2 Jun 2022 12:11:49 +0200 Subject: [PATCH] tests/fuzz: update build config Ensure we only download github.com/AdaLogics/go-fuzz-headers once; clearify use `go.mod`. Signed-off-by: Hidde Beydals --- tests/fuzz/go.mod | 2 ++ tests/fuzz/oss_fuzz_build.sh | 7 ++----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/fuzz/go.mod b/tests/fuzz/go.mod index a162cf6..ac8c73a 100644 --- a/tests/fuzz/go.mod +++ b/tests/fuzz/go.mod @@ -1,3 +1,5 @@ +// Used to exclude it from Go mod in repository root. +// Replaced by oss_fuzz_build.sh. module github.com/fluxcd/image-automation-controller/tests/fuzz go 1.17 diff --git a/tests/fuzz/oss_fuzz_build.sh b/tests/fuzz/oss_fuzz_build.sh index 6c6dfde..a51919f 100755 --- a/tests/fuzz/oss_fuzz_build.sh +++ b/tests/fuzz/oss_fuzz_build.sh @@ -54,8 +54,6 @@ export PKG_CONFIG_PATH="${TARGET_DIR}/lib/pkgconfig:${TARGET_DIR}/lib64/pkgconfi export CGO_CFLAGS="-I${TARGET_DIR}/include -I${TARGET_DIR}/include/openssl" export CGO_LDFLAGS="$(pkg-config --libs --static --cflags libssh2 openssl libgit2)" -go get -d github.com/AdaLogics/go-fuzz-headers - pushd "tests/fuzz" # Setup files to be embedded into controllers_fuzzer.go's testFiles variable. @@ -79,6 +77,8 @@ SOURCE_VER=$(go list -m github.com/fluxcd/source-controller/api | awk '{print $2 REFLECTOR_VER=$(go list -m github.com/fluxcd/image-reflector-controller/api | awk '{print $2}') go mod download +go get -d github.com/fluxcd/image-automation-controller +go get -d github.com/AdaLogics/go-fuzz-headers if [ -d "../../controllers/testdata/crds" ]; then cp ../../controllers/testdata/crds/*.yaml testdata/crds @@ -89,9 +89,6 @@ else curl -s --fail https://raw.githubusercontent.com/fluxcd/image-reflector-controller/${REFLECTOR_VER}/config/crd/bases/image.toolkit.fluxcd.io_imagepolicies.yaml -o testdata/crds/imagepolicies.yaml fi -go get -d github.com/AdaLogics/go-fuzz-headers -go get -d github.com/fluxcd/image-automation-controller - # Using compile_go_fuzzer to compile fails when statically linking libgit2 dependencies # via CFLAGS/CXXFLAGS. function go_compile(){