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

Align go.mod version with Kubernetes (Go 1.20) #1134

Merged
merged 2 commits into from
Jun 27, 2023
Merged

Conversation

stefanprodan
Copy link
Member

@stefanprodan stefanprodan commented Jun 26, 2023

Bump Go to 1.20 in go.mod

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
@stefanprodan
Copy link
Member Author

Pinging @pjbgf @AdamKorcz Looks like oss-fuzz is requiring Go 1.19 that will be EOL in a couple of weeks. Is there anything we can do to get Go 1.20 in the base image?

@AdamKorcz
Copy link
Contributor

@stefanprodan You can do the same as here: https://github.com/google/oss-fuzz/blob/43ec92a9737b2d962a774de4bc646d6a9c1e6a7a/projects/istio/Dockerfile#L20-L24

Doing it in Fluxcd's Dockerfile will after all the Flux projects that OSS-Fuzz is fuzzing, or you can do it in source-controllers own build file.

@stefanprodan
Copy link
Member Author

Updated Go to 1.20 and now fails like this:

Building ./internal/controller/gitrepository_controller_fuzz_test.go.FuzzRandomGitFiles into FuzzRandomGitFiles
+ echo 'Building ./internal/controller/gitrepository_controller_fuzz_test.go.FuzzRandomGitFiles into FuzzRandomGitFiles'
+ compile_native_go_fuzzer ./internal/controller FuzzRandomGitFiles FuzzRandomGitFiles
/usr/bin/ld: /usr/bin/ld: DWARF error: invalid or unhandled FORM value: 0x25
FuzzRandomGitFiles.a(000020.o): in function `_cgo_cbcce81e6342_C2func_res_search':
cgo_unix_cgo_res.cgo2.c:(.text+0x32): undefined reference to `__res_search'
/usr/bin/ld: FuzzRandomGitFiles.a(000020.o): in function `_cgo_cbcce81e6342_Cfunc_res_search':
cgo_unix_cgo_res.cgo2.c:(.text+0x81): undefined reference to `__res_search'
clang-15: error: linker command failed with exit code 1 (use -v to see invocation)

@AdamKorcz
Copy link
Contributor

Updated Go to 1.20 and now fails like this:

Building ./internal/controller/gitrepository_controller_fuzz_test.go.FuzzRandomGitFiles into FuzzRandomGitFiles
+ echo 'Building ./internal/controller/gitrepository_controller_fuzz_test.go.FuzzRandomGitFiles into FuzzRandomGitFiles'
+ compile_native_go_fuzzer ./internal/controller FuzzRandomGitFiles FuzzRandomGitFiles
/usr/bin/ld: /usr/bin/ld: DWARF error: invalid or unhandled FORM value: 0x25
FuzzRandomGitFiles.a(000020.o): in function `_cgo_cbcce81e6342_C2func_res_search':
cgo_unix_cgo_res.cgo2.c:(.text+0x32): undefined reference to `__res_search'
/usr/bin/ld: FuzzRandomGitFiles.a(000020.o): in function `_cgo_cbcce81e6342_Cfunc_res_search':
cgo_unix_cgo_res.cgo2.c:(.text+0x81): undefined reference to `__res_search'
clang-15: error: linker command failed with exit code 1 (use -v to see invocation)

This will fix it: https://github.com/google/oss-fuzz/blob/43ec92a9737b2d962a774de4bc646d6a9c1e6a7a/projects/istio/build.sh#L18-L19

@stefanprodan
Copy link
Member Author

@AdamKorcz so what should I do, should I open a PR in oss-fuzz to update the Flux dockerfile and script?

@AdamKorcz
Copy link
Contributor

@AdamKorcz so what should I do, should I open a PR in oss-fuzz to update the Flux dockerfile and script?

Yes.

Note that if the other Flux projects have not bumped their go.mod files to 1.20 then they would break.

@stefanprodan
Copy link
Member Author

Note that if the other Flux projects have not bumped their go.mod files to 1.20 then they would break.

I plan to update all Flux controllers to Go 1.20 today and release it with Flux GA this week.

@stefanprodan
Copy link
Member Author

stefanprodan commented Jun 26, 2023

@AdamKorcz here is the PR google/oss-fuzz#10597 Thanks

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
@stefanprodan stefanprodan changed the title Align go.mod version with Kubernetes Align go.mod version with Kubernetes (Go 1.20) Jun 26, 2023
@stefanprodan stefanprodan added the area/ci CI related issues and pull requests label Jun 26, 2023
@stefanprodan stefanprodan changed the title Align go.mod version with Kubernetes (Go 1.20) Align go.mod version with Kubernetes (Go 1.20) Jun 26, 2023
@stefanprodan stefanprodan merged commit 85a93d8 into main Jun 27, 2023
10 checks passed
@stefanprodan stefanprodan deleted the go.mod-1.20 branch June 27, 2023 05:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ci CI related issues and pull requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants