codeql-action: Autobuild breaks with Go 1.18 code

Go 1.18 introduced generics, and projects which are starting to use generics will no longer work with Autobuild, which seems to be built with Go 1.17.

Here’s an example of a workflow that fails due to this issue:

https://github.com/hairyhenderson/go-fsimpl/runs/6335289871?check_suite_focus=true

Notable log messages:

...
[2022-05-07 15:31:05] [build-stderr] 2022/05/07 15:31:05 Autobuilder was built with go1.17.9, environment has go1.17.9
...
[2022-05-07 15:31:52] [build-stderr] 2022/05/07 15:31:52 Error running go tooling: err: exit status 1: stderr: go build github.com/Azure/azure-sdk-for-go/sdk/storage/azblob: build constraints exclude all Go files in /home/runner/go/pkg/mod/github.com/!azure/azure-sdk-for-go/sdk/storage/azblob@v0.4.0

I looked in the documentation for a way to force Autobuild to use Go 1.18, but couldn’t find one - is there a workaround?

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 19 (10 by maintainers)

Commits related to this issue

Most upvoted comments

Thanks you for the repro example! I’ll pass this along to the Go team so they can have a look.

I’m maybe in a better position to give you information on when this will be out (although this still isn’t a promise, as things may go wrong and affect this timeline). Support for Go 1.18 is in the 2.9.2 release of CodeQL, which is currently undergoing testing and is due to be released early this week (possibly even later today if all goes smoothly).

We roll out new releases of CodeQL to all our users in a few stages. Initially, you would only get this release if you explicitly requested it, which is a bit awkward to do and I would not recommend as it will result in you not getting updates. Around 1-2 working days after a release is live, you will get it if you specify tools: latest in the parameters (the with: block) of the init step of your workflow, which opts you into getting bleeding edge releases (note that doing this adds a short time to your workflow, as the release has to be downloaded rather already being present on GitHub Actions runners). Otherwise, it will take around 2 weeks from the release date to have it on all GitHub Actions runners and therefore be the default release for everyone.

I can’t make any promises on when it will be delivered, but I can say that it is actively being worked on. Please keep an eye on the releases of codeql.