build: enable thread-safe getaddrinfo() for OpenBSD, and other tidy-ups#22148
Closed
vszakats wants to merge 11 commits into
Closed
build: enable thread-safe getaddrinfo() for OpenBSD, and other tidy-ups#22148vszakats wants to merge 11 commits into
getaddrinfo() for OpenBSD, and other tidy-ups#22148vszakats wants to merge 11 commits into
Conversation
stop disabling for OpenBSD, also stop listing all BSDs, they are opted in via OtherTests.cmake anyway. We do the same on Windows.
getaddrinfo() detection on some BSDsgetaddrinfo() for OpenBSD, and other tidy-ups
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
bsdso 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: investigate if getaddrinfo(3) on OSX is thread-safe 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.hmore accurately, forall build systems, without duplicating logic.
Also:
BSDvariable requires CMake 3.25+, add fallback code wheremissing.
Ref: https://cmake.org/cmake/help/v3.25/variable/BSD.html
HAVE_PIPE2,and fix generic BSD filter for CMake <3.25.
for those via
OtherTests.cmake.Ref: #22138 (comment)
Investigation:
Mac OS X 10.5+ Leopard October 26, 2007 / Darwin 9+ (UNIX '03 certified) + all iOS and other forks
python/cpython#70112
https://en.wikipedia.org/wiki/MacOS_version_history (for macOS vs Darwin table)
MidnightBSD was forked from FreeBSD 6.1, which already had support
https://en.wikipedia.org/wiki/MidnightBSD
Sources:
freebsd/freebsd-src@9def31d 6.0.0+ Apr 4, 2005 (via NetBSD)
python/cpython#42363 wrong? 5.3+ Sep 12, 2005 [confirmed wrong]
https://github.com/freebsd/freebsd-src/blob/release/5.3.0/lib/libc/net/getaddrinfo.c (not re-entrant)
https://www.freebsd.org/releases/5.3R/announce/ 06 Nov 2004 "The network and socket subsystems are now multi-threaded and reentrant"
https://github.com/freebsd/freebsd-src/blob/release/5.4.0/lib/libc/net/getaddrinfo.c (not re-entrant)
https://www.freebsd.org/releases/5.4R/announce/ 09 May 2005 (no mention)
https://github.com/freebsd/freebsd-src/blob/release/6.0.0/lib/libc/net/getaddrinfo.c (re-entrant) initial
https://www.freebsd.org/releases/6.0R/announce/ 04 Nov 2005 (no mention)
https://github.com/freebsd/freebsd-src/blob/release/5.5.0/lib/libc/net/getaddrinfo.c (re-entrant) backported
https://www.freebsd.org/releases/5.5R/announce/ 25 May 2006 (no mention) BUT YES!
DragonFlyBSD/DragonFlyBSD@21fcee4 2.2.0+ commit Dec 28, 2008 (via FreeBSD)
DragonFlyBSD/DragonFlyBSD@21fcee4#diff-498ff649e8770eb9a94e99a399a4b473fcea41ef58b033a2a2dae3809e17bb04
https://www.dragonflybsd.org/releases/ 2.2.0 = February 17, 2009, 2.2.1 = April 26, 2009
openbsd/src@bd62015 Mar 31, 2013
http://www.openbsd.org/plus54.html 5.4+ 2013-11-01 "getaddrinfo(3) is now thread-safe."
NetBSD/src@d14c191 3.x May 21, 2004 (via Bind9)
NetBSD/src@e59232f (follow-up) May 21, 2004
NetBSD/src@6b7bf05 (became official) July 18, 2006
https://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/net/getaddrinfo.c.diff?r1=1.82&r2=1.83
NetBSD 4.0+ was released 2007-12-19.
https://bugs.python.org/issue26406
https://github.com/python/cpython/pull/20177/files guards
https://emptysqua.re/blog/getaddrinfo-cpython-mac-and-bsd/
python/cpython#70594 NetBSD/OpenBSD
Summary:
Code (from CPython):