Upgrade infra and projects to go1.18 (#7791)

* Replace go get with go install in the scritp

* Remove go get from projects

* Replace gotip with go

* Fix CI

* Add missing dependency for cryptofuzz
This commit is contained in:
Navidem 2022-06-05 20:31:04 -05:00 committed by GitHub
parent f99ec824ca
commit ae83c88a54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 23 additions and 26 deletions

View File

@ -58,7 +58,7 @@ function build_native_go_fuzzer() {
abspath_repo=`go list -m $tags -f {{.Dir}} $fuzzed_repo || go list $tags -f {{.Dir}} $fuzzed_repo`
# give equivalence to absolute paths in another file, as go test -cover uses golangish pkg.Dir
echo "s=$fuzzed_repo"="$abspath_repo"= > $OUT/$fuzzer.gocovpath
gotip test -run Test${function}Corpus -v $tags -coverpkg $fuzzed_repo/... -c -o $OUT/$fuzzer $path
go test -run Test${function}Corpus -v $tags -coverpkg $fuzzed_repo/... -c -o $OUT/$fuzzer $path
rm ./"${function,,}"_test.go
else

View File

@ -18,24 +18,21 @@
cd /tmp
curl -O https://storage.googleapis.com/golang/getgo/installer_linux
chmod +x ./installer_linux
SHELL="bash" ./installer_linux -version=1.17
SHELL="bash" ./installer_linux -version=1.18
rm -rf ./installer_linux
echo 'Set "GOPATH=/root/go"'
echo 'Set "PATH=$PATH:/root/.go/bin:$GOPATH/bin"'
go get -u github.com/mdempsky/go114-fuzz-build
go install github.com/mdempsky/go114-fuzz-build@latest
ln -s $GOPATH/bin/go114-fuzz-build $GOPATH/bin/go-fuzz
go install golang.org/dl/gotip@latest \
&& gotip download
cd /tmp
git clone https://github.com/AdamKorcz/go-118-fuzz-build
cd go-118-fuzz-build
gotip build
go build
mv go-118-fuzz-build $GOPATH/bin/
cd addimport
gotip build
go build
mv addimport $GOPATH/bin/

View File

@ -27,7 +27,7 @@ RUN mkdir LPM; \
RUN git clone --depth 1 https://github.com/mdempsky/go114-fuzz-build.git
RUN go get google.golang.org/protobuf/cmd/protoc-gen-go
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
COPY go-lpm.cc $SRC/

View File

@ -51,10 +51,8 @@ export INCLUDE_PATH_FLAGS=""
cd $SRC/cryptofuzz
python gen_repository.py
go get golang.org/x/crypto/blake2b
go get golang.org/x/crypto/blake2s
go get golang.org/x/crypto/md4
go get golang.org/x/crypto/ripemd160
git clone https://github.com/golang/crypto $GOPATH/src/golang.org/x/crypto
git clone https://github.com/golang/sys.git $GOPATH/src/golang.org/x/sys
# This enables runtime checks for C++-specific undefined behaviour.
export CXXFLAGS="$CXXFLAGS -D_GLIBCXX_DEBUG"

View File

@ -16,6 +16,6 @@
FROM gcr.io/oss-fuzz-base/base-builder-go
LABEL maintainer="codyoss@google.com"
RUN go get cloud.google.com/go/spanner
RUN git clone https://github.com/googleapis/google-cloud-go
COPY build.sh $SRC/
WORKDIR $SRC/
WORKDIR $SRC/google-cloud-go/spanner/

View File

@ -16,7 +16,7 @@
#FROM gcr.io/oss-fuzz-base/base-builder-go-codeintelligencetesting
FROM gcr.io/oss-fuzz-base/base-builder-go
RUN go get -t github.com/miekg/dns
RUN git clone https://github.com/miekg/dns.git
COPY build.sh $SRC/
WORKDIR $SRC/
WORKDIR $SRC/dns

View File

@ -19,7 +19,7 @@ FROM gcr.io/oss-fuzz-base/base-builder-go
ENV GO111MODULE="on"
ENV GOFUZZ111MODULE="on"
RUN go get google.golang.org/protobuf/proto
RUN git clone https://github.com/protocolbuffers/protobuf-go.git
RUN git clone https://go.googlesource.com/protobuf $GOPATH/src/google.golang.org/protobuf
COPY build.sh $SRC/
WORKDIR $GOPATH/src/google.golang.org/protobuf

View File

@ -18,7 +18,7 @@ rm -r parser
mkdir math && cp $SRC/math_big_fuzzer.go ./math/
go get -u golang.org/x/text
git clone https://github.com/golang/text $GOPATH/src/golang.org/x/text
mkdir text && cp $SRC/text_fuzzer.go ./text/
go mod init "github.com/dvyukov/go-fuzz-corpus"

View File

@ -15,7 +15,7 @@
################################################################################
FROM gcr.io/oss-fuzz-base/base-builder-go
RUN go get github.com/google/gopacket
RUN git clone https://github.com/google/gopacket.git
COPY build.sh $SRC/
WORKDIR $SRC
WORKDIR $SRC/gopacket

View File

@ -17,7 +17,7 @@
if [ "$SANITIZER" = "coverage" ]
then
go get github.com/grpc-ecosystem/grpc-gateway/...
git clone https://github.com/grpc-ecosystem/grpc-gateway.git
compile_go_fuzzer github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule Fuzz fuzz gofuzz
else
compile_go_fuzzer github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule Fuzz fuzz gofuzz

View File

@ -16,7 +16,9 @@
FROM gcr.io/oss-fuzz-base/base-builder-go
ENV GO111MODULE=on
RUN go get google.golang.org/protobuf/cmd/protoc-gen-go google.golang.org/grpc/cmd/protoc-gen-go-grpc
RUN git clone https://github.com/protocolbuffers/protobuf-go
RUN git clone https://github.com/grpc/grpc-go
RUN git clone --depth 1 https://github.com/grpc/grpc-go $GOPATH/src/google.golang.org/grpc
COPY build.sh fuzz_*.go $SRC/

View File

@ -16,8 +16,8 @@
FROM gcr.io/oss-fuzz-base/base-builder-go
MAINTAINER william@influxdata.com
RUN go get github.com/influxdata/influxdb
RUN go get github.com/dgrijalva/jwt-go
RUN git clone https://github.com/influxdata/influxdb.git
RUN git clone https://github.com/dgrijalva/jwt-go.git
COPY build.sh $SRC/
WORKDIR $SRC/

View File

@ -16,7 +16,7 @@
FROM gcr.io/oss-fuzz-base/base-builder-go
RUN go get github.com/ianlancetaylor/demangle
RUN git clone https://github.com/ianlancetaylor/demangle.git
RUN git clone --depth 1 https://github.com/kubernetes/kubernetes.git
RUN git clone --depth 1 https://github.com/google/AFL
RUN git clone --depth 1 https://github.com/dvyukov/go-fuzz-corpus