Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(build): fix build on FreeBSD (#1639)
## Checklist - [x] I have read the [contribution guidelines](https://github.com/ooni/probe-cli/blob/master/CONTRIBUTING.md) - [x] reference issue for this pull request: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=270020 - [ ] if you changed anything related to how experiments work and you need to reflect these changes in the ooni/spec repository, please link to the related ooni/spec pull request: <!-- add URL here --> - [ ] if you changed code inside an experiment, make sure you bump its version number <!-- Reminder: Location of the issue tracker: https://github.com/ooni/probe --> ## Description The build of ooni-probe currently fails on FreeBSD because the compiler cannot find some required symbols (C.SOCK_STREAM, C.AF_INET, C.AF_INET6 and C.AF_UNSPEC). This causes the package [net/ooni-probe-cli](https://www.freshports.org/net/ooni-probe-cli/) to be unavailable. Fix this by including sys/socket.h when building on FreeBSD. See also these FreeBSD bug reports (the second report also applies to Go 1.21 and Go 1.22): - [270020: net/ooni-probe-cli: update 3.21.1 → 3.22.0, fix build](https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=270020) - [272643: lang/go120: Build of one port fails with could not determine kind of name for C.AF_INET, etc](https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=272643) I took a bit of a shortcut for the fix in the first URL by omitting the #ifdef as that patch would only exist in the FreeBSD port anyway. Both URLs also discuss if this is a problem in OONI or Go itself. --------- Co-authored-by: René Ladan <rene0+ooni@freedom.nl>
- Loading branch information