Bug 272643 - lang/go120: Build of one port fails with could not determine kind of name for C.AF_INET, etc
Summary: lang/go120: Build of one port fails with could not determine kind of name for...
Status: Closed Works As Intended
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Golang Team (Nobody)
URL:
Keywords:
Depends on:
Blocks: 270020
  Show dependency treegraph
 
Reported: 2023-07-21 17:42 UTC by Yuri Victorovich
Modified: 2024-08-11 10:03 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (go)


Attachments
reproducer.shar (1.94 KB, text/plain)
2023-07-21 17:42 UTC, Yuri Victorovich
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yuri Victorovich freebsd_committer freebsd_triage 2023-07-21 17:42:38 UTC
Created attachment 243528 [details]
reproducer.shar

See the attached port.


Errors:
> internal/netxlite/getaddrinfo_cgo.go:203:7: could not determine kind of name for C.AF_INET
> internal/netxlite/getaddrinfo_cgo.go:207:7: could not determine kind of name for C.AF_INET6
> internal/netxlite/getaddrinfo_cgo.go:141:20: could not determine kind of name for C.AF_UNSPEC
> internal/netxlite/getaddrinfo_cgo.go:140:22: could not determine kind of name for C.SOCK_STREAM
Comment 1 Vinícius Zavam freebsd_committer freebsd_triage 2023-09-06 19:57:08 UTC
(In reply to Yuri Victorovich from comment #0)

diff updating the actual/current port, and poudriere build log available on https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=270020

linked this bug as blocker for that one, but missed adding the context.
Comment 2 Älven 2023-11-04 12:42:58 UTC
The same errors on lang/go121. Is upstream aware of this?
Comment 3 Älven 2024-03-26 22:55:11 UTC
The same errors on lang/go122. Is upstream aware of this?
Comment 4 Rene Ladan freebsd_committer freebsd_triage 2024-07-27 13:50:53 UTC
See this patch in PR 270020, it fixes the build of net/ooni-probe-cli : https://bugs.freebsd.org/bugzilla/attachment.cgi?id=252287
Comment 5 Rene Ladan freebsd_committer freebsd_triage 2024-07-27 13:53:01 UTC
(In reply to Rene Ladan from comment #4)

Linked the wrong patch somehow, use this one: https://bz-attachments.freebsd.org/attachment.cgi?id=252320
Comment 6 Rene Ladan freebsd_committer freebsd_triage 2024-07-27 17:28:00 UTC
I don't think this is a bug in Go itself, unlike what this PR suggests. If you look at the offending file you can see that it includes /usr/include/netdb.h (because we are not on _WIN32) but that file does not define the four C.AF_* and C.SOCK_STREAM values anywhere, also not via recursive includes. These values are defined in /usr/include/sys/socket.h, which is what my patch ends up including and which fixes the build of the port.
Comment 7 Rene Ladan freebsd_committer freebsd_triage 2024-07-27 17:28:37 UTC
I don't think this is a bug in Go itself, unlike what this PR suggests. If you look at the offending file you can see that it includes /usr/include/netdb.h (because we are not on _WIN32) but that file does not define the four C.AF_* and C.SOCK_STREAM values anywhere, also not via recursive includes. These values are defined in /usr/include/sys/socket.h, which is what my patch ends up including and which fixes the build of the port.
Comment 8 Rene Ladan freebsd_committer freebsd_triage 2024-08-08 19:44:40 UTC
(In reply to Rene Ladan from comment #7)

Upstream OONI confirms this is a bug on their side, it is not a bug in Go.
See https://github.com/ooni/probe-cli/pull/1639#issuecomment-2272804013

Closing this PR.
Comment 9 Älven 2024-08-11 10:03:36 UTC
Thank you for the explanation!