Skip to content

Commit

Permalink
deps: update c-ares to v1.32.0
Browse files Browse the repository at this point in the history
PR-URL: #53722
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Marco Ippolito <[email protected]>
  • Loading branch information
nodejs-github-bot authored and aduh95 committed Jul 16, 2024
1 parent e17c261 commit 76032fd
Show file tree
Hide file tree
Showing 140 changed files with 3,457 additions and 2,667 deletions.
11 changes: 7 additions & 4 deletions deps/cares/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ INCLUDE (CheckCSourceCompiles)
INCLUDE (CheckStructHasMember)
INCLUDE (CheckLibraryExists)

PROJECT (c-ares LANGUAGES C VERSION "1.31.0" )
PROJECT (c-ares LANGUAGES C VERSION "1.32.0" )

# Set this version before release
SET (CARES_VERSION "${PROJECT_VERSION}")
Expand All @@ -30,7 +30,7 @@ INCLUDE (GNUInstallDirs) # include this *AFTER* PROJECT(), otherwise paths are w
# For example, a version of 4:0:2 would generate output such as:
# libname.so -> libname.so.2
# libname.so.2 -> libname.so.2.2.0
SET (CARES_LIB_VERSIONINFO "18:0:16")
SET (CARES_LIB_VERSIONINFO "19:0:17")


OPTION (CARES_STATIC "Build as a static library" OFF)
Expand Down Expand Up @@ -62,8 +62,8 @@ ENDIF ()

INCLUDE (EnableWarnings)

# allow linking against the static runtime library in msvc
IF (MSVC)
# allow linking against the static runtime library in msvc
OPTION (CARES_MSVC_STATIC_RUNTIME "Link against the static runtime library" OFF)
IF (CARES_MSVC_STATIC_RUNTIME)
# CMAKE_CONFIGURATION_TYPES is empty on non-IDE generators (Ninja, NMake)
Expand Down Expand Up @@ -564,7 +564,7 @@ SET (RECVFROM_TYPE_ARG5 "struct sockaddr *")
SET (RECV_TYPE_ARG4 int)
SET (GETNAMEINFO_TYPE_ARG1 "struct sockaddr *")
SET (GETNAMEINFO_TYPE_ARG7 int)
SET (SEND_TYPE_ARG2 "void *")
SET (SEND_TYPE_ARG2 "const void *")
SET (SEND_TYPE_ARG4 int)
################################################################################

Expand Down Expand Up @@ -663,6 +663,9 @@ ENDIF ()
IF (HAVE_SYS_SOCKET_H)
SET (CARES_HAVE_SYS_SOCKET_H 1)
ENDIF()
IF (HAVE_SYS_SELECT_H)
SET (CARES_HAVE_SYS_SELECT_H 1)
ENDIF()
IF (HAVE_WS2TCPIP_H)
SET (CARES_HAVE_WS2TCPIP_H 1)
ENDIF()
Expand Down
55 changes: 45 additions & 10 deletions deps/cares/INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ unpacked the source archive):
You probably need to be root when doing the last command.

If you have checked out the sources from the git repository, read the
[GIT-INFO](GIT_INFO) on how to proceed.
[GIT-INFO](GIT-INFO) on how to proceed.

Get a full listing of all available configure options by invoking it like:

Expand Down Expand Up @@ -307,6 +307,16 @@ first to rebuild every single library your app uses as well as your
app using the debug multithreaded dynamic C runtime.


### MSYS

Building is supported for native windows via both AutoTools and CMake. When
building with autotools, you can only build either a shared version or a static
version (use `--disable-shared` or `--disable-static`). CMake can build both
simultaneously.

All of the MSYS environments are supported: `MINGW32`, `MINGW64`, `UCRT64`,
`CLANG32`, `CLANG64`, `CLANGARM64`.

### MingW32

Make sure that MinGW32's bin dir is in the search path, for example:
Expand Down Expand Up @@ -339,6 +349,26 @@ add `-DCARES_STATICLIB` to your `CFLAGS`. Otherwise the linker will look for
dynamic import symbols.


DOS
---

c-ares supports building as a 32bit protected mode application via
[DJGPP](https://www.delorie.com/djgpp/). It is recommended to use a DJGPP
cross compiler from [Andrew Wu](https://github.com/andrewwutw/build-djgpp)
as building directly in a DOS environment can be difficult.

It is required to also have [Watt-32](https://www.watt-32.net/) available
built using the same compiler. It is recommended to build the latest `master`
branch from [GitHub](https://github.com/sezero/watt32/tree/master).

Finally, the `DJ_PREFIX` and `WATT_ROOT` environment variables must be set
appropriately before calling `make Makefile.dj` to build c-ares.

Please refer to our CI
[GitHub Actions Workflow](https://github.com/c-ares/c-ares/blob/main/.github/workflows/djgpp.yml)
for a full build example, including building the latest Watt-32 release.


IBM OS/2
--------

Expand Down Expand Up @@ -418,20 +448,25 @@ This is a probably incomplete list of known hardware and operating systems
that c-ares has been compiled for. If you know a system c-ares compiles and
runs on, that isn't listed, please let us know!

- Alpha Tru64 v5.0 5.1
- ARM Android 1.5, 2.1, 2.3
- MIPS IRIX 6.2, 6.5
- Power AIX 3.2.5, 4.2, 4.3.1, 4.3.2, 5.1, 5.2
- i386 Linux 1.3, 2.0, 2.2, 2.3, 2.4, 2.6
- i386 Novell NetWare
- i386 Windows 95, 98, ME, NT, 2000, XP, 2003
- x86_64 Linux
- Linux (i686, x86_64, AARCH64, and more)
- MacOS 10.4+
- iOS
- Windows 8+ (i686, x86_64)
- Android (ARM, AARCH64, x86_64)
- FreeBSD
- NetBSD
- OpenBSD
- Solaris (SPARC, x86_64)
- AIX (POWER)
- Tru64 (Alpha)
- IRIX (MIPS)
- Novell NetWare (i386)


Useful URLs
===========

- c-ares: https://c-ares.org/
- MingW: http://www.mingw.org/
- MinGW-w64: http://mingw-w64.sourceforge.net/
- MSYS2: https://msys2.org
- OpenWatcom: http://www.openwatcom.org/
43 changes: 42 additions & 1 deletion deps/cares/Makefile.dj
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,51 @@ WATT32_LIB = $(WATT32_ROOT)/lib/libwatt.a
OBJ_DIR = djgpp

CFLAGS = -g -O2 -I./include -I./src/lib \
-I$(WATT32_ROOT)/inc -Wall \
-I$(WATT32_ROOT)/inc \
-Wall \
-Wextra \
-Waggregate-return \
-Wcast-align \
-Wcast-qual \
-Wconversion \
-Wdeclaration-after-statement \
-Wdouble-promotion \
-Wfloat-equal \
-Winit-self \
-Wjump-misses-init \
-Wlogical-op \
-Wmissing-braces \
-Wmissing-declarations \
-Wmissing-format-attribute \
-Wmissing-include-dirs \
-Wmissing-prototypes \
-Wnested-externs \
-Wno-coverage-mismatch \
-Wold-style-definition \
-Wpacked \
-Wpointer-arith \
-Wshadow \
-Wsign-conversion \
-Wstrict-overflow \
-Wstrict-prototypes \
-Wtrampolines \
-Wundef \
-Wunreachable-code \
-Wunused \
-Wvariadic-macros \
-Wvla \
-Wwrite-strings \
-Werror=implicit-int \
-Werror=implicit-function-declaration \
-Wno-long-long \
-DWATT32 -DHAVE_CONFIG_H \
-D_REENTRANT \
-DCARES_NO_DEPRECATED \
-Dselect=select_s

# Can't enable -Wredundant-decls due to WATT32 issues


LDFLAGS = -s

ifeq ($(OS),Windows_NT)
Expand Down
1 change: 0 additions & 1 deletion deps/cares/Makefile.m32
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ install:
${INSTALL} -m 444 ${srcdir}/include/ares.h ${DESTDIR}${includedir}
${INSTALL} -m 444 ${srcdir}/include/ares_build.h ${DESTDIR}${includedir}
${INSTALL} -m 444 ${srcdir}/include/ares_dns_record.h ${DESTDIR}${includedir}
${INSTALL} -m 444 ${srcdir}/include/ares_rules.h ${DESTDIR}${includedir}
${INSTALL} -m 444 ${srcdir}/include/ares_version.h ${DESTDIR}${includedir}
(for man in $(MANPAGES); do \
${INSTALL} -m 444 ${srcdir}/$${man} ${DESTDIR}${mandir}/man3; \
Expand Down
3 changes: 1 addition & 2 deletions deps/cares/Makefile.msvc
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ RT_ERROR_CHECKING = /RTCsu

CC_CMD_REL = cl.exe /nologo $(RTLIB) /DNDEBUG /O2
CC_CMD_DBG = cl.exe /nologo $(RTLIBD) /D_DEBUG /Od /Zi $(RT_ERROR_CHECKING)
CC_CFLAGS = $(CFLAGS) /I.\src\lib /I.\include /W3 /EHsc /FD
CC_CFLAGS = $(CFLAGS) /D_REENTRANT /I.\src\lib /I.\include /W3 /EHsc /FD

RC_CMD_REL = rc.exe /l 0x409 /d "NDEBUG"
RC_CMD_DBG = rc.exe /l 0x409 /d "_DEBUG"
Expand Down Expand Up @@ -440,7 +440,6 @@ install:
@copy /y $(CARES_OUTDIR)\*.* "$(INSTALL_DIR_LIB)" >NUL
@copy /y $(SRCDIR)\include\ares.h "$(INSTALL_DIR_INC)" >NUL
@copy /y $(SRCDIR)\include\ares_build.h "$(INSTALL_DIR_INC)" >NUL
@copy /y $(SRCDIR)\include\ares_rules.h "$(INSTALL_DIR_INC)" >NUL
@copy /y $(SRCDIR)\include\ares_version.h "$(INSTALL_DIR_INC)" >NUL
@copy /y $(SRCDIR)\include\ares_dns_record.h "$(INSTALL_DIR_INC)" >NUL
@echo Installed c-ares $(CFG)
Expand Down
3 changes: 1 addition & 2 deletions deps/cares/Makefile.netware
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,8 @@ ifeq ($(LIBARCH),CLIB)
@echo $(DL)#define RECVFROM_TYPE_ARG5 struct sockaddr$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG6 int$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_RETV int$(DL) >> $@
@echo $(DL)#define SEND_QUAL_ARG2$(DL) >> $@
@echo $(DL)#define SEND_TYPE_ARG1 int$(DL) >> $@
@echo $(DL)#define SEND_TYPE_ARG2 char *$(DL) >> $@
@echo $(DL)#define SEND_TYPE_ARG2 const char *$(DL) >> $@
@echo $(DL)#define SEND_TYPE_ARG3 int$(DL) >> $@
@echo $(DL)#define SEND_TYPE_ARG4 int$(DL) >> $@
@echo $(DL)#define SEND_TYPE_RETV int$(DL) >> $@
Expand Down
34 changes: 24 additions & 10 deletions deps/cares/RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,38 @@
## c-ares version 1.31.0 - June 18 2024
## c-ares version 1.32.0 - July 4 2024

This is a maintenance and bugfix release.
This is a feature and bugfix release.

Features:

* Add support for DNS 0x20 to help prevent cache poisoning attacks, enabled
by specifying `ARES_FLAG_DNS0x20`. Disabled by default. [PR #800](https://github.com/c-ares/c-ares/pull/800)
* Rework query timeout logic to automatically adjust timeouts based on network
conditions. The timeout specified now is only used as a hint until there
is enough history to calculate a more valid timeout. [PR #794](https://github.com/c-ares/c-ares/pull/794)

Changes:

* Enable Query Cache by default. [PR #786](https://github.com/c-ares/c-ares/pull/786)
* DNS RR TXT strings should not be automatically concatenated as there are use
cases outside of RFC 7208. In order to maintain ABI compliance, the ability
to retrieve TXT strings concatenated is retained as well as a new API to
retrieve the individual strings. This restores behavior from c-ares 1.20.0.
[PR #801](https://github.com/c-ares/c-ares/pull/801)
* Clean up header inclusion logic to make hacking on code easier. [PR #797](https://github.com/c-ares/c-ares/pull/797)
* GCC/Clang: Enable even more strict warnings to catch more coding flaws. [253bdee](https://github.com/c-ares/c-ares/commit/253bdee)
* MSVC: Enable `/W4` warning level. [PR #792](https://github.com/c-ares/c-ares/pull/792)

Bugfixes:

* Enhance Windows DNS configuration change detection to also detect manual DNS
configuration changes. [PR #785](https://github.com/c-ares/c-ares/issues/785)
* Various legacy MacOS Build fixes. [Issue #782](https://github.com/c-ares/c-ares/issues/782)
* Ndots value of zero in resolv.conf was not being honored. [852a60a](https://github.com/c-ares/c-ares/commit/852a60a)
* Watt-32 build support had been broken for some time. [PR #781](https://github.com/c-ares/c-ares/pull/781)
* Distribute `ares_dns_rec_type_tostr` manpage. [PR #778](https://github.com/c-ares/c-ares/pull/778)
* Tests: Fix thread race condition in test cases for EventThread. [PR #803](https://github.com/c-ares/c-ares/pull/803)
* Windows: Fix building with UNICODE. [PR #802](https://github.com/c-ares/c-ares/pull/802)
* Thread Saftey: `ares_timeout()` was missing lock. [74a64e4](https://github.com/c-ares/c-ares/commit/74a64e4)
* Fix building with DJGPP (32bit protected mode DOS). [PR #789](https://github.com/c-ares/c-ares/pull/789)

Thanks go to these friendly people for their efforts and contributions for this
release:

* Brad House (@bradh352)
* Gregor Jasny (@gjasny)
* Cheng (@zcbenz)



2 changes: 1 addition & 1 deletion deps/cares/aminclude_static.am
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

# aminclude_static.am generated automatically by Autoconf
# from AX_AM_MACROS_STATIC on Tue Jun 18 05:51:32 EDT 2024
# from AX_AM_MACROS_STATIC on Thu Jul 4 07:03:12 EDT 2024


# Code coverage
Expand Down
6 changes: 4 additions & 2 deletions deps/cares/cares.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
'include/ares_dns.h',
'include/ares_dns_record.h',
'include/ares_nameser.h',
'include/ares_rules.h',
'include/ares_version.h',
'src/lib/ares__addrinfo2hostent.c',
'src/lib/ares__addrinfo_localhost.c',
Expand Down Expand Up @@ -43,6 +42,8 @@
'src/lib/ares_data.h',
'src/lib/ares_destroy.c',
'src/lib/ares_dns_mapping.c',
'src/lib/ares_dns_multistring.c',
'src/lib/ares_dns_multistring.h',
'src/lib/ares_dns_name.c',
'src/lib/ares_dns_parse.c',
'src/lib/ares_dns_record.c',
Expand Down Expand Up @@ -76,6 +77,7 @@
'src/lib/ares_library_init.c',
'src/lib/ares_ipv6.h',
'src/lib/ares_math.c',
'src/lib/ares_metrics.c',
'src/lib/ares_options.c',
'src/lib/ares_parse_a_reply.c',
'src/lib/ares_parse_aaaa_reply.c',
Expand Down Expand Up @@ -112,7 +114,6 @@
'src/lib/ares_version.c',
'src/lib/inet_net_pton.c',
'src/lib/inet_ntop.c',
'src/lib/setup_once.h',
'src/tools/ares_getopt.c',
'src/tools/ares_getopt.h',
],
Expand All @@ -122,6 +123,7 @@
'src/lib/thirdparty/apple/dnsinfo.h',
],
'cares_sources_win': [
'src/lib/ares_sysconfig_win.c',
'src/lib/config-win32.h',
'src/lib/windows_port.c',
],
Expand Down
Loading

0 comments on commit 76032fd

Please sign in to comment.