-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
cmd/cgo: fails to generate certain types with Go 1.14 #37621
Comments
/cc @ianlancetaylor |
@gopherbot please consider this for backport to 1.14, it's a regression. |
Backport issue(s) opened: #37622 (for 1.14). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://golang.org/wiki/MinorReleases. |
FWIW, this was the resulting diff when I tried to regenerate the files in
|
See also #37479. I guess we need to figure this out. |
Possibly a side-effect of CL 181857? |
Yes, CL 181857 seems to have introduced this regression. If I revert the CL, the generated code is as expected. @ianlancetaylor also traced down #37479 to the same CL. |
CL 181857 broke the translation of certain C types when using cmd/cgo -godefs. Updates golang#31891 Fixes golang#37479 Fixes golang#37621 Change-Id: I301a749ec89585789cb0d213593bb8b7341beb88
Change https://golang.org/cl/226341 mentions this issue: |
Change https://golang.org/cl/226497 mentions this issue: |
Change https://golang.org/cl/226577 mentions this issue: |
We cannot update to Go 1.14 yet, since cgo code generation for certain types is broken due to golang/go#37621. Change-Id: I7b60d23ff4e79a7bb7fa4f0e0625893e4eff81f1 Reviewed-on: https://go-review.googlesource.com/c/sys/+/226577 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matt Layher <mdlayher@gmail.com>
Change https://golang.org/cl/227678 mentions this issue: |
Go 1.14.2 fixes golang/go#37621 which allows the Go types to be generated properly again. Change-Id: I556c7dd37713d68ef6aad79adc33b2d227e8bbd3 Reviewed-on: https://go-review.googlesource.com/c/sys/+/227678 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Matt Layher <mdlayher@gmail.com> Reviewed-by: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes, it also reproduces with tip. However, it doesn't reproduce with go1.13.8
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
For some reason cgo is unable to resolve
__Ctype_struct_timespec
toTimespec
in Go 1.14, while it does with Go 1.13 (see below). This looks like a regression to me.Found while trying to update the code generation in
golang.org/x/sys/unix
to use Go 1.14.What did you expect to see?
What did you see instead?
See output of
go1.14 tool cgo -godefs repro.go
above.The text was updated successfully, but these errors were encountered: