-
Notifications
You must be signed in to change notification settings - Fork 204
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
workflowcheck v0.1.0 fails with Go 1.22 #1382
Comments
There is already a fix merged for this 72a5b6f. We will release a |
Roger! I did see that you'd upgraded x/tools already but I wasn't sure if this specific issue was on your radar for an upcoming release. Thanks for confirming! |
I saw 1.26.0 was released with the fix - will workflowcheck 0.2.0 be released soon? I see the latest version still crashes. |
Yes it will be |
Closing since workflowcheck v0.2.0 is released https://github.com/temporalio/sdk-go/releases/tag/contrib%2Ftools%2Fworkflowcheck%2Fv0.2.0 |
Enumer is currently crashing if `make go-generate` is run with Go 1.22: alvaroloes/enumer#71 Temporal helpfully found an easy fix: temporalio/sdk-go#1382 For the underlying cause: golang/go#62167 So I've mimicked that by just doing a `go get golang.org/x/tools@latest` in the tools-module. And now `make clean` -> `GOTOOLCHAIN=[go1.20.1 or go1.22.1] make go-generate` both work correctly. (you need Go 1.21 or newer to use GOTOOLCHAIN. highly recommended!) Since this only affects build-time tools and doesn't change any generated code, it seems trivially safe, but I have not checked what all has changed in golang.org/x/tools across these versions.
Expected Behavior
workflowcheck@latest (which points to 0.1.0, the only version available at pkg.go.dev) should work with the Go 1.22 toolchain.
Actual Behavior
When built with Go 1.22, workflowcheck fails with:
As far as I can tell, this is a known/expected issue resulting from a Go change in 1.22: golang/go#62167. Other libraries/packages have also run into this and fixed it, e.g. ent/ent#3864.
And indeed from what I can tell, you've already fixed this in workflowcheck on HEAD, you just need to publish a new version. TL;DR of the issue, as I understand it, is that Go analyzers when built with the 1.22 toolchain also require a version of
x/tools
at least as new as v0.13.0. workflowcheck's go.mod has x/tools v0.13.0 now in the repo, but workflowcheck v0.1.0 depends on x/tools v0.10.0.Steps to Reproduce the Problem
Minimal example showing the error with Go 1.22:
But it works fine with Go 1.21.7, as expected:
Alternatively, a consumer can work around it by adding workflowcheck to one's go.mod/tools.go while ensuring you have a version of x/tools at least as new as v0.13.0, and then omitting
@latest
whengo install
ing workflowcheck so that it builds in module-aware mode, using the newer version of x/tools from the consumer's go.mod.That seems like a best practice anyway so I'll stick with that, but nonetheless wanted to give you a heads up about this issue so you can publish a new version of workflowcheck.
Specifications
The text was updated successfully, but these errors were encountered: