Skip to content

cmake: add pre-fills for DragonFly BSD and MidnightBSD - #22138

Closed
vszakats wants to merge 5 commits into
curl:masterfrom
vszakats:cm-prefill-midnightbsd
Closed

vszakats wants to merge 5 commits into
curl:masterfrom
vszakats:cm-prefill-midnightbsd

Conversation

@vszakats

@vszakats vszakats commented Jun 22, 2026 •

Copy link
Copy Markdown
Member

@github-actions github-actions Bot added the CI Continuous Integration label Jun 22, 2026
@vszakats vszakats changed the title cmake: add pre-fills for MidnightBSD cmake: add pre-fills for DragonFlyBSD and MidnightBSD Jun 22, 2026
@vszakats vszakats changed the title cmake: add pre-fills for DragonFlyBSD and MidnightBSD cmake: add pre-fills for DragonFly BSD and MidnightBSD Jun 22, 2026
@vszakats vszakats closed this in 364d6c1 Jun 22, 2026
@vszakats
vszakats deleted the cm-prefill-midnightbsd branch June 22, 2026 20:57
@vszakats

vszakats commented Jun 22, 2026 •

Copy link
Copy Markdown
Member Author

The DragonFly BSD HAVE_GETADDRINFO_THREADSAFE detection result
is possibly bogus.

The logic origins from curl-functions.m4, having a whitelist for BSDs with
support, and disabling it for the rest of BSDs. It checks host_os for *bsd*
to detect BSDs, but so it happens that DragonFly BSD doesn't have bsd
there (it has dragonfly6.4). This steers it to an always-on detection result
reserved for non-BSDs.

I copied this logic to CMake via 04a3a37,
but missed this detail, so CMake is correctly disabling it. But since couldn't figure
out how to install cmake in the DragonFly CI job, it uses autotools, and I used
its result in this PR.

(will fix (not critical, prefills are for internal use and not enabled even here),
though for now I'm in the rabbit hole of threadsafe getaddrinfo detection.
Which would be likely to do in C with proper version cutoffs, a outside of
the build-system. If possible. Current cutoff versions may also need
adjustments)

(I may also happen that the autotools detection is correct by accident.)

https://github.com/DragonFlyBSD/DragonFlyBSD/blob/master/lib/libc/net/getaddrinfo.c

edit: OpenBSD is missing from the whitelist.

edit 2: this looks like large sync-up commit bringing re-entrant getaddrinfo
to DragonFly BSD from the FreeBSD codebase, on 2008-12-28:
DragonFlyBSD/DragonFlyBSD@21fcee4#diff-498ff649e8770eb9a94e99a399a4b473fcea41ef58b033a2a2dae3809e17bb04
Tagged v2.2.0.

edit 3: here's my assessment, based on CPython research, and
re-verifying and adjusting/complementing based on the BSD's
source repos:

  • macOS 10.5+ 2007-10-26 / iOS/others: all versions
  • DragonFly BSD 2.2.0+ 2009-02-17
  • FreeBSD 5.5+ 2006-05-25 (or 6.0+ 2005-11-04)
  • MidnightBSD all versions 0.1+ 2007-08-06 (forked from FreeBSD 6.1)
  • NetBSD 4.0+ 2007-12-19 (possibly earlier, commit is from 2004-05-21)
  • OpenBSD 5.4+ 2013-11-01

vszakats added a commit that referenced this pull request Jun 23, 2026
- add autotools jobs for MidnightBSD, NetBSD, OpenBSD.
  Takes under 3 minutes per new job, under +6m in total.
  - comment out MidnightBSD to save CI time.
  - to make them as fast as possible, skip building tests and examples,
    and omit libidn2, openldap dependencies.
- add DragonFly BSD cmake job, which finally works.
  (keep it commented out since the package server fails frequently.)
- do `mport index/upgrade` to make MidnightBSD autotools builds work.
- rework filtering MidnightBSD package manager's excessive log output.
- fixup OpenBSD autotools job to uninstall system curl to avoid linking
  against it (and breaking debug builds).
- make OpenBSD package manager commands non-interactive.
- specify install packages for each matrix entry.
- make autotools build step verbose (to ease debugging).
- add link to DragonFly BSD package repo.
- bump cross-platform-actions from 1.1.0 to 1.3.0.
- bump FreeBSD 15.0 to 15.1.
- bump OpenBSD to 7.7 to 7.9.
  This did not go well last time with 7.8, let's see with 7.9.
  Ref: 8d00e28 #19372
  Ref: c3b890b #19368
- sync test-skipper keywords with rest of workflows.
- drop installing impacket. It was unused.
  (also a slow install with many dependencies)

The original motivation was to prepare fixing OpenBSD's (and possibly
other platforms) `getaddrinfo()` thread-safety check.
Ref: #22138 (comment)

Closes #22145
vszakats added a commit that referenced this pull request Jun 25, 2026
…-ups

Aka `HAVE_GETADDRINFO_THREADSAFE`.

- enable it for OpenBSD 5.4+ (2013-11-01).
  Also adjust cmake pre-fill.

- explicitly opt-in DragonFly BSD, for 2.2.0+ (2009-02-17).
  Assuming this commit implemented this feature:
  DragonFlyBSD/DragonFlyBSD@21fcee4#diff-498ff649e8770eb9a94e99a399a4b473fcea41ef58b033a2a2dae3809e17bb04
  Prior to this patch it was enabled in autotools by accident, because
  its host ID misses `bsd` so the global BSD disable was not applied.

- autotools: fix to enable for Darwin 9+ / macOS 10.5+ (2007-10-26).
  Prior to this patch it was Darwin 6 / macOS 10.2.
  Source: python/cpython#70112
  Ref: https://en.wikipedia.org/wiki/MacOS_version_history
  10.5 was the first one UNIX '03 certified, which requires this
  feature. iOS and others were forked from this codebase, so they also
  have support.

- cmake: add version numbers as comments.
  Sadly the OS versions are not verified. This and the autotools logic
  could possibly be implemented in `curl-setup.h` more accurately, for
  all build systems, without duplicating logic.

Also:
- cmake: `BSD` variable requires CMake 3.25+, add fallback code where
  missing.
  Ref: https://cmake.org/cmake/help/v3.25/variable/BSD.html
- unix-cache.cmake: stop listing all BSDs for `HAVE_PIPE2`,
  and fix generic BSD filter for CMake <3.25.
- unix-cache.cmake: stop listing all BSDs, since it's prefilled anyway
  for those via `OtherTests.cmake`.

Ref: #22138 (comment)

Closes #22148
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Continuous Integration cmake performance

Development

Successfully merging this pull request may close these issues.

1 participant