Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Go 1.20 #9950

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Upgrade to Go 1.20 #9950

wants to merge 1 commit into from

Conversation

clfs
Copy link

@clfs clfs commented Mar 19, 2023

This PR is meant to address issue #9949.

install_go.sh says it downloads and installs the latest stable Go, but it uses Go 1.19 instead.

# Download and install the latest stable Go.
wget -q https://storage.googleapis.com/golang/getgo/installer_linux -O $SRC/installer_linux
chmod +x $SRC/installer_linux
SHELL="bash" $SRC/installer_linux -version 1.19

We should either use Go 1.20 (the latest stable Go at time of writing) or remove the misleading comment.

@jonathanmetzman
Copy link
Contributor

/gcbrun trial_build.py go

Copy link
Contributor

@jonathanmetzman jonathanmetzman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@jonathanmetzman
Copy link
Contributor

This breaks a bunch of projects. here's a representative example, loki:

Step #19 - "compile-libfuzzer-address-x86_64": Running go-fuzz -tags gofuzz -func FuzzParseExpr -o fuzz_parse_expr.a github.com/grafana/loki/pkg/logql/syntax
Step #19 - "compile-libfuzzer-address-x86_64": /usr/bin/ld: /usr/bin/ld: DWARF error: invalid or unhandled FORM value: 0x25
Step #19 - "compile-libfuzzer-address-x86_64": fuzz_parse_expr.a(000020.o): in function `_cgo_cbcce81e6342_C2func_res_search':
Step #19 - "compile-libfuzzer-address-x86_64": cgo_unix_cgo_res.cgo2.c:(.text+0x32): undefined reference to `__res_search'
Step #19 - "compile-libfuzzer-address-x86_64": /usr/bin/ld: fuzz_parse_expr.a(000020.o): in function `_cgo_cbcce81e6342_Cfunc_res_search':
Step #19 - "compile-libfuzzer-address-x86_64": cgo_unix_cgo_res.cgo2.c:(.text+0x81): undefined reference to `__res_search'
Step #19 - "compile-libfuzzer-address-x86_64": clang-15: error: linker command failed with exit code 1 (use -v to see invocation)

@clfs
Copy link
Author

clfs commented Mar 21, 2023

@jonathanmetzman Thanks for checking. In that case, I'll just install Go 1.20 over the version that gcr.io/oss-fuzz-base/base-builder-go:v1 provides.

OSS-Fuzz's upgrade to Go 1.19 seemed pretty straightforward, so I'm not sure what changed this time around.

@jonathanmetzman
Copy link
Contributor

Looks like others have encountered this @DavidKorczynski (see containerd/containerd#8103 (comment))

@DavidKorczynski
Copy link
Collaborator

@AdamKorcz can you assist here? Is it that some projects aren't 1.20 ready yet or should we be able to upgrade this without disabling projects?

@DavidKorczynski
Copy link
Collaborator

DavidKorczynski commented Mar 28, 2023

@clfs did you test this on a number of OSS-Fuzz projects? If so, how many approximately? By default not all go projects are bumped to 1.20 and each project will individually have to resolve some things to be compatible with this change.

@clfs
Copy link
Author

clfs commented Mar 31, 2023

@DavidKorczynski Yes, but only go-json-iterator and protoreflect, so definitely not thorough on my part. Sorry!

I can look through the incompatible projects and put out Go 1.20 upgrade PRs for a few.

@phisco
Copy link
Contributor

phisco commented Apr 6, 2023

We bumped as requested by @clfs the Go version, but it looks like that broke our build as gcr.io/oss-fuzz-base/base-builder-go:latest only has go1.19 and we are trying to go mod tidy and we get:

Step #3 - "compile-libfuzzer-address-x86_64": + go mod tidy
Step #3 - "compile-libfuzzer-address-x86_64": go: go.mod file indicates go 1.20, but maximum version supported by tidy is 1.19
Step #3 - "compile-libfuzzer-address-x86_64": ********************************************************************************
Step #3 - "compile-libfuzzer-address-x86_64": Failed to build.

@catenacyber
Copy link
Contributor

@DavidKorczynski Do you know where this stand now that go 1.21 is out ?
For info, ngolo-fuzzing is broken cf https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=60807 with some message building_Go_requires_Go_1_20_6_or_later

@catenacyber catenacyber mentioned this pull request Sep 6, 2023
jonathanmetzman pushed a commit that referenced this pull request Sep 13, 2023
gedigi pushed a commit to gedigi/oss-fuzz that referenced this pull request Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants