-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Generating gqlgen
using Go 1.24's go tool
directive results in an error
#3505
Comments
Via golang/go#71448 (comment) it looks like it may need a bump of |
There is already PR #3483 for bumping |
Hi @jamietanna, is it clear what the full error message is, and/or is it possible to modify the user code to dump more of the error, or dump stderr/stdout, or otherwise see more detail? In theory, x/tools should give a good error message if it can't continue because it's not new enough, and it would be good to see if that's happening here. Some background is that for many years, there have been a series of semi-cryptic messages from x/tools when some community tool was using a too-old version of x/tools, such as:
... where that error did not even mention x/tools or x/tools/go/packages. I think that particular cryptic error message was eventually addressed (I'd have to check again to see what change, but maybe golang/tools@edddc5f or similar). Part of the reason the unhelpful messages lingered for years was because the workaround was just to update x/tools and things started working again.... but then 6 or 12 months later, there would be a new round of reports after a subsequent Go release. If there is some new unhelpful error or a reoccurrence of a prior unhelpful error, it would be good to get it resolved in x/tools. Alternatively, if there is a good error from x/tools in this example and it's just that gqlgen is not reporting the full error, it might save some headache in the future for gqlgen to report that error. |
@thepudds If x/tools always gives a cryptic error when it is out of date, that is a chicken and egg problem for gqlgen. gqlgen can never stay on bleeding edge For background, at my day job, we use GCP AppEngine, which always lags by only supporting the oldest possible Go version (and sometimes even older ಠ_ಠ ). Currently GCP AppEngine has GA support only for Go 1.22. While I do almost all of my gqlgen maintenance outside of my day job, their real-world complicated usage lets me find edge cases in gqlgen that I otherwise never would, and they also rely on gqlgen and I rely on them to eat. @jamietanna Sorry, I just noticed this issue! Your stuff is always brilliant and has made my life better. If I can help you in any way, always ping me and let me know. |
@jamietanna Sorry for any notification spam, but just to link all the things together, the draft PR is here: #3528 Your project issue I opened is here: And you (or anyone with a similar problem) can try gqlgen with temporary updated x/tools out using:
|
I just updated one of my projects to go 1.24 and i didn't encounter any problems, even using the new go tool directive and command for gqlgen |
Please see #3537 |
Hey folks, I think this is "fixed" #3537 as I was able to find golang.org/x/[email protected] version that would work with both Go 1.24, Go 1.23, and Go 1.22. I have cut a release including this in v0.17.65 so it can unblock people if this solves their issues. The dependabot upgrades to However, #3532 reports seeing minor differences in The new testing matrix includes Go 1.22, Go 1.23, Go 1.24 so I'm not able to reproduce that problem here (or in my day job stuff), so I would be very grateful for you to report any other issues you find. |
Ok, I'm a doofus. Dependabot threw errors for x/tools upgrades for anything after Go 1.23, but they were trivial to resolve by just also applying them to the _examples and running go mod tidy. I updated x/tools to latest and cut v0.17.66 Please report any minor differences in |
When testing out the new
go tool
support in Go 1.24 (rc2), I've noticed that movinggqlgen
from atools.go
type of ??, to the use ofgo tool
results in an unhelpful error fromgo generate
:When this fails, it also seems to delete the generated files:
It's unclear to me if this is an issue with
gqlgen
or with the Go toolchain itself. I've reported golang/go#71448 as it looks more likely due to the Go toolchain.There is no additional insight given when using
--verbose
:I have created a branch on one of my projects here to indicate the changes and help test:
Diff
The text was updated successfully, but these errors were encountered: