-
Notifications
You must be signed in to change notification settings - Fork 338
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
Issue with Autobuild for go 1.21.0 modules #1842
Comments
Thanks for reporting. It looks like this problem has recently been fixed by updating a dependency: https://github.com/github/codeql/blob/main/go/vendor/golang.org/x/mod/modfile/rule.go#L306 . A next release of CodeQL should include this improvement. |
Great, thanks! I'll look forward to the next CodeQL release. |
@gilcrest FYI: I expect this change to be in 2.14.3, the 2.14.2 version which is about to be released doesn't contain the fix. |
@aibaars Any update on this? Upgrading to version 2.14.3 did not solve the issue for us. |
@joaonsantos Do you have a log file you can share? |
@aibaars this is run using 2.21.5, hope it helps https://github.com/risor-io/risor/actions/runs/6000614660/job/16273044121 relates to risor-io/risor#99 |
Hi @chenrui333, thank you for providing the extra context! I have reviewed the build log and your PR. The problem here is not directly about CodeQL, but rather that the GitHub Actions runner image still uses Go 1.20 by default. CodeQL uses the version of Go that is installed on the runner to perform the build. Since Go 1.20 does not recognise the diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
index c074d25..bdc8039 100644
--- a/.github/workflows/codeql.yml
+++ b/.github/workflows/codeql.yml
@@ -40,6 +40,11 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3
+ - name: Install Go
+ uses: actions/setup-go@v4
+ with:
+ go-version-file: go.mod
+
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@100912429fab4cb230e66ffb11e738ac5194e73a This will automatically pull the right Go version from your |
* Go 1.21 * Explicitly setup Go in CodeQL Related to github/codeql-action#1842
This workflow has been failing for a while because it's been using go1.20, which is incompatible with the go.mod file generated by go1.21 :/. I found this solution from: github/codeql-action#1842 (comment).
`go.mod` requires Go 1.21, but the GitHub Actions runner image still uses Go 1.20 by default. github/codeql-action#1842 (comment)
This workflow has been failing for a while because it's been using go1.20, which is incompatible with the go.mod file generated by go1.21 :/. I found this solution from: github/codeql-action#1842 (comment).
Without this, CodeQL may hit cases where it can't parse the Go version in the `go.mod`, even though the version of CodeQL should be able to parse it. Also see github/codeql-action#1842 (comment)
Found a solution here: github/codeql-action#1842
I've created a PR in actions/runner-images to bump the default version to Update: they closed the PR 😂 - I'll stick to the provided workaround above here I guess. |
In CodeQL logs there is an error: `Autobuilder was built with go1.21.4, environment has go1.20.11`. This commit contains temporary fix (according to <github/codeql-action#1842>).
In CodeQL logs there is an error: `Autobuilder was built with go1.21.4, environment has go1.20.11`. This commit contains temporary fix (according to <github/codeql-action#1842>).
Update stdlib to 1.21.4 and update crypto and go-git packages. Also implemented a workaround described here: github/codeql-action#1842 (comment) for codeql
since codeql does not (yet) support Go 1.21, see github/codeql-action#1842
* Bump Golang Use Golang 1.21 locally on the dev machine and bump Golang to 1.21 in Dockerfile make manifests * Support RabbitMQ operator policies Closes #202 * Add workaround for Go 1.21 since codeql does not (yet) support Go 1.21, see github/codeql-action#1842 * Fix test flake * Add missing test * Apply feedback
Hello! I'm not sure if this is the correct place to open this issue, but I recently updated my repo to the latest version of go (1.21). As per their release notes:
When updating modules now this new release numbering is used - see https://github.com/gilcrest/diygoapi/blob/main/go.mod
After updating to this, Autobuild on Github has the following errors.
Any help you can provide for this is much appreciated!
Best,
Dan
The text was updated successfully, but these errors were encountered: