-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go: bootstrapped vet tool for 1.23 lacks GODEBUG=gotypesalias=1 #68797
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
Comments
Related Issues and Documentation
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.) |
@adonovan notices the following:
Note the value of DefaultGODEBUG has gotypesalias=0. That is wrong. Marking as a release blocker until we understand better. |
I know I'm confused, but I thought that gotypesalias=1 was going to be the default for 1.24, not for 1.23. |
Typically when you say you're confused, it's because I am mistaken and have confused you, but not in this instance: https://tip.golang.org/doc/go1.23#gotypespkggotypes:
I had to check to convince myself. ;-) |
I am confused. |
I believe the latter is intended, see here and here. My current (and possibly mistaken or only partial) understanding of what's happening is that the cmd/go binary is built in a temporary work directory that has a go.mod file (to fix #44209), and that go.mod file doesn't contain a go directive, so cmd/go ends up falling back to the default of 1.16. At tip, including "go 1.24" in that temporary go.mod file seems to be enough to fix the original reproducer. workdir = xworkdir()
-if err := os.WriteFile(pathf("%s/go.mod", workdir), []byte("module bootstrap"), 0666); err != nil {
+if err := os.WriteFile(pathf("%s/go.mod", workdir), []byte("module bootstrap\ngo 1.24\n"), 0666); err != nil {
fatalf("cannot write stub go.mod: %s", err)
} |
Based on internal discussions, it sounds like we're comfortable with the status quo for 1.23, since this GODEBUG issue has existed since Go 1.17. We can fix for 1.24. Then we also don't need to backport the fix for #68796 to 1.23. Thanks everyone for your help with the urgent investigation here. |
Thanks for the explanations, sorry for the noise. |
Change https://go.dev/cl/604799 mentions this issue: |
As reported in #68796, it appears that the cmd/vet built by
make.bash
lacks GODEBUG=gotypesalias=1, which should have been the default in 1.23. See below: the bug of #68796 only appears if GODEBUG=gotypesalias=1 is explicitly set in the environment, or if cmd/vet is reinstalled (apparently, reinstalling picks up the correct GODEBUG defaults).While I think #68796 is a release blocker, this may not be a release blocker: if cmd/vet works as expected, it doesn't really matter which gotypesalias value it observes.
CC @matloob @samthanawalla
The text was updated successfully, but these errors were encountered: