-
-
Notifications
You must be signed in to change notification settings - Fork 271
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
add support for Go 1.23 #871
Conversation
This teaches the program how to collect information from multiple Go versions and join it together. For this to work, it needs to select the Go versions itself, which is now possible via GOTOOLCHAIN. The merging of data is fairly simple; we join the results from all versions, and we remove duplicates from older Go versions. Start producing output with the Go version noted on every data point, so that we can easily scan what each Go version is contributing.
Rebasing the Go 1.22 patches on top of Go 1.23.0, as published on burrowers/go-patches#7. Updates burrowers#859.
In particular, x/tools so that we get a newer go/ssa version with support for the latest language features such as range over func. Updates burrowers#859.
As of Go 1.23, these are forbidden by https://go.dev/issue/67401. Updates burrowers#859.
And update some actions and staticcheck while here. Drop the testing of Go master as well, as I haven't used or maintained such a setup for a while now. We can simply add Go 1.24 RC versions to the go-version matrix once they come out. Fixes burrowers#859.
Since some packages are in some Go versions but not others. We had a version of this check when we last supported two Go versions.
Recently, a patch changed the argument `-mod=` to `-mod=readonly` as the former is not really a valid flag value, and broke with go.work. However, the latter seems to break our tests on Go 1.22.6 when listing all of runtimeLinknamed: panic: failed to load missing runtime-linknamed packages: golang.org/x/[email protected]: reading http://127.0.0.1:43357/mod/golang.org/x/crypto/@v/v0.16.1-0.20231129163542-152cdb1503eb.mod: 404 Not Found It seems like, somehow, listing std packages was trying to download x/crypto from GOPROXY - which is a local server with testdata/mod, and so it does not contain x/crypto. However, this is entirely wrong, as std vendors dependencies, including this very version of x/crypto. Reverting the change to `-mod=readonly` resolves this issue, which explains why we hadn't encountered this surprising GOPROXY error, but the revert would also break users of go.work files. Luckily, we have a better alternative: rather than trying to override the value of the flags by adding more arguments, delete them entirely.
It took some head banging, but I figured out the last bug. FYI this should be ready to review. Apologies that there are a number of changes, but I tried to split up every necessary change along the way for the sake of the reviewer. |
Otherwise we miscalculate int sizes, type sizes, alignments, and so on. Caught by the GOARCH=386 go test on CI, since the os package imports internal/syscall/unix, which uses arch-dependent padding. The different padding between our incorrect use of go/types and the correct typechecking done by the compiler caused different obfuscation of fields, as the struct types stringified differently, and they are used as a hash salt for field name obfuscation.
OK, spotted yet another bug. This time, we hadn't been correctly computing type sizes at all, at any point in the past. I guess we were lucky that it never caused issues. |
In particular, wireguard had Go runtime hacks that broke with Go 1.23, and the latest master version resolves this issue.
Green at last! |
Given how Go 1.23.0 came out a few weeks ago, and many users of Garble are waiting for this, and it passes CI and it seems correct as far as I'm aware, I'm going to merge as-is without reviews. Any late reviews or post-merge changes via PRs are of course welcome; I just don't want to let these patches sit here for longer. |
(see commit messages - please do not squash)
Fixes #859.
Updates #859.