Skip to content

Commit

Permalink
deps: upgrade to libuv 1.32.0
Browse files Browse the repository at this point in the history
Notable changes:

- `uv_tcp_close_reset()` has been added.
- `uv_udp_set_source_membership()` has been added.
- A double free in `uv_free_cpu_info()` on OpenBSD
  has been fixed.
- Defined, but empty environment variables can now
  be read on Windows.
- Several improvements to the cmake build process.
- The `EILSEQ` error code is now mapped by libuv.

PR-URL: #29508
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
cjihrig authored and Trott committed Sep 12, 2019
1 parent 62e8cc5 commit df0e2e3
Show file tree
Hide file tree
Showing 53 changed files with 1,176 additions and 251 deletions.
7 changes: 7 additions & 0 deletions deps/uv/AUTHORS
Expand Up @@ -396,3 +396,10 @@ Nan Xiao <nan@chinadtrace.org>
Ben Davies <kaiepi@outlook.com>
Nhan Khong <knhana7@gmail.com>
Crunkle <justcrunkle@hotmail.co.uk>
Tomas Krizek <tomas.krizek@nic.cz>
Konstantin Podsvirov <konstantin@podsvirov.pro>
seny <arseny.vakhrushev@gmail.com>
Vladimir Karnushin <v.karnushin@mail.ru>
MaYuming <maym@appexnetworks.com>
Eneas U de Queiroz <cotequeiroz@gmail.com>
Daniel Hahler <git@thequod.de>
19 changes: 13 additions & 6 deletions deps/uv/CMakeLists.txt
@@ -1,5 +1,5 @@
# TODO: determine CMAKE_SYSTEM_NAME on OS/390. Currently assumes "OS/390".
cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 2.8.12)
project(libuv)

if(MSVC)
Expand Down Expand Up @@ -116,6 +116,7 @@ set(uv_test_sources
test/test-shutdown-eof.c
test/test-shutdown-twice.c
test/test-signal-multiple-loops.c
test/test-signal-pending-on-close.c
test/test-signal.c
test/test-socket-buffer-size.c
test/test-spawn.c
Expand All @@ -127,6 +128,7 @@ set(uv_test_sources
test/test-tcp-close-accept.c
test/test-tcp-close-while-connecting.c
test/test-tcp-close.c
test/test-tcp-close-reset.c
test/test-tcp-connect-error-after-write.c
test/test-tcp-connect-error.c
test/test-tcp-connect-timeout.c
Expand Down Expand Up @@ -317,6 +319,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "OS/390")
list(APPEND uv_defines _OPEN_MSGQ_EXT)
list(APPEND uv_defines _OPEN_SYS_FILE_EXT)
list(APPEND uv_defines _OPEN_SYS_IF_EXT)
list(APPEND uv_defines _OPEN_SYS_SOCK_EXT3)
list(APPEND uv_defines _OPEN_SYS_SOCK_IPV6)
list(APPEND uv_defines _UNIX03_SOURCE)
list(APPEND uv_defines _UNIX03_THREADS)
Expand All @@ -340,15 +343,17 @@ if(APPLE OR CMAKE_SYSTEM_NAME MATCHES "DragonFly|FreeBSD|Linux|NetBSD|OpenBSD")
endif()

add_library(uv SHARED ${uv_sources})
target_compile_definitions(uv PRIVATE ${uv_defines} BUILDING_UV_SHARED=1)
target_compile_definitions(uv
INTERFACE USING_UV_SHARED=1
PRIVATE ${uv_defines} BUILDING_UV_SHARED=1)
target_compile_options(uv PRIVATE ${uv_cflags})
target_include_directories(uv PRIVATE include src)
target_include_directories(uv PUBLIC include PRIVATE src)
target_link_libraries(uv ${uv_libraries})

add_library(uv_a STATIC ${uv_sources})
target_compile_definitions(uv_a PRIVATE ${uv_defines})
target_compile_options(uv_a PRIVATE ${uv_cflags})
target_include_directories(uv_a PRIVATE include src)
target_include_directories(uv_a PUBLIC include PRIVATE src)
target_link_libraries(uv_a ${uv_libraries})

option(libuv_buildtests "Build the unit tests when BUILD_TESTING is enabled." ON)
Expand All @@ -360,15 +365,13 @@ if(BUILD_TESTING AND libuv_buildtests)
target_compile_definitions(uv_run_tests
PRIVATE ${uv_defines} USING_UV_SHARED=1)
target_compile_options(uv_run_tests PRIVATE ${uv_cflags})
target_include_directories(uv_run_tests PRIVATE include)
target_link_libraries(uv_run_tests uv ${uv_test_libraries})
add_test(NAME uv_test
COMMAND uv_run_tests
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
add_executable(uv_run_tests_a ${uv_test_sources})
target_compile_definitions(uv_run_tests_a PRIVATE ${uv_defines})
target_compile_options(uv_run_tests_a PRIVATE ${uv_cflags})
target_include_directories(uv_run_tests_a PRIVATE include)
target_link_libraries(uv_run_tests_a uv_a ${uv_test_libraries})
add_test(NAME uv_test_a
COMMAND uv_run_tests_a
Expand All @@ -383,6 +386,10 @@ if(UNIX)
endforeach(x)
file(STRINGS configure.ac configure_ac REGEX ^AC_INIT)
string(REGEX MATCH [0-9]+[.][0-9]+[.][0-9]+ PACKAGE_VERSION "${configure_ac}")
string(REGEX MATCH ^[0-9]+ UV_VERSION_MAJOR "${PACKAGE_VERSION}")
# The version in the filename is mirroring the behaviour of autotools.
set_target_properties(uv PROPERTIES VERSION ${UV_VERSION_MAJOR}.0.0
SOVERSION ${UV_VERSION_MAJOR})
set(includedir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR})
set(libdir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
set(prefix ${CMAKE_INSTALL_PREFIX})
Expand Down
75 changes: 75 additions & 0 deletions deps/uv/ChangeLog
@@ -1,3 +1,78 @@
2019.09.10, Version 1.32.0 (Stable), 697bea87b3a0b0e9b4e5ff86b39d1dedb70ee46d

Changes since version 1.31.0:

* misc: enable stalebot (Saúl Ibarra Corretgé)

* win: map ERROR_ENVVAR_NOT_FOUND to UV_ENOENT (cjihrig)

* win: use L'\0' as UTF-16 null terminator (cjihrig)

* win: support retrieving empty env variables (cjihrig)

* unix,stream: fix returned error codes (Santiago Gimeno)

* test: fix typo in DYLD_LIBRARY_PATH (Ben Noordhuis)

* unix,signal: keep handle active if pending signal (Santiago Gimeno)

* openbsd: fix uv_cpu_info (Santiago Gimeno)

* src: move uv_free_cpu_info to uv-common.c (Santiago Gimeno)

* tcp: add uv_tcp_close_reset method (Santiago Gimeno)

* test: fix udp-multicast-join tests (Santiago Gimeno)

* test: remove assertion in fs_statfs test (cjihrig)

* doc: clarify uv_buf_t usage in uv_alloc_cb (Tomas Krizek)

* win: fix typo in preprocessor expression (Konstantin Podsvirov)

* timer: fix uv_timer_start on closing timer (seny)

* udp: add source-specific multicast support (Vladimir Karnushin)

* udp: fix error return values (Santiago Gimeno)

* udp: drop IPV6_SSM_SUPPORT macro (Santiago Gimeno)

* udp: fix uv__udp_set_source_membership6 (Santiago Gimeno)

* udp: use sockaddr_storage instead of union (Santiago Gimeno)

* build,zos: add _OPEN_SYS_SOCK_EXT3 flag (Santiago Gimeno)

* test: add specific source multicast tests (Santiago Gimeno)

* include: map EILSEQ error code (cjihrig)

* win, tty: improve SIGWINCH performance (Bartosz Sosnowski)

* build: fix ios build error (MaYuming)

* aix: replace ECONNRESET with EOF if already closed (Milad Farazmand)

* build: add cmake library VERSION, SOVERSION (Eneas U de Queiroz)

* build: make include/ public in CMakeLists.txt (Ben Noordhuis)

* build: export USING_UV_SHARED=1 to cmake deps (Ben Noordhuis)

* build: cmake_minimum_required(VERSION 2.8.12) (Daniel Hahler)

* aix: Fix broken cmpxchgi() XL C++ specialization. (Andrew Paprocki)

* test: fix -Wsign-compare warning (Ben Noordhuis)

* unix: simplify open(O_CLOEXEC) feature detection (Ben Noordhuis)

* unix: fix UV_FS_O_DIRECT definition on Linux (Joran Dirk Greef)

* doc: uv_handle_t documentation suggestion (Daniel Bevenius)


2019.08.10, Version 1.31.0 (Stable), 0a6771cee4c15184c924bfe9d397bdd0c3b206ba

Changes since version 1.30.1:
Expand Down
3 changes: 3 additions & 0 deletions deps/uv/Makefile.am
Expand Up @@ -248,6 +248,7 @@ test_run_tests_SOURCES = test/blackhole-server.c \
test/test-shutdown-eof.c \
test/test-shutdown-twice.c \
test/test-signal-multiple-loops.c \
test/test-signal-pending-on-close.c \
test/test-signal.c \
test/test-socket-buffer-size.c \
test/test-spawn.c \
Expand All @@ -259,6 +260,7 @@ test_run_tests_SOURCES = test/blackhole-server.c \
test/test-tcp-close-accept.c \
test/test-tcp-close-while-connecting.c \
test/test-tcp-close.c \
test/test-tcp-close-reset.c \
test/test-tcp-create-socket-early.c \
test/test-tcp-connect-error-after-write.c \
test/test-tcp-connect-error.c \
Expand Down Expand Up @@ -517,6 +519,7 @@ libuv_la_CFLAGS += -D_UNIX03_THREADS \
-D_XOPEN_SOURCE_EXTENDED \
-D_ALL_SOURCE \
-D_LARGE_TIME_API \
-D_OPEN_SYS_SOCK_EXT3 \
-D_OPEN_SYS_SOCK_IPV6 \
-D_OPEN_SYS_FILE_EXT \
-DUV_PLATFORM_SEM_T=int \
Expand Down
2 changes: 2 additions & 0 deletions deps/uv/README.md
Expand Up @@ -401,6 +401,8 @@ Check the [SUPPORTED_PLATFORMS file](SUPPORTED_PLATFORMS.md).

### AIX Notes

AIX compilation using IBM XL C/C++ requires version 12.1 or greater.

AIX support for filesystem events requires the non-default IBM `bos.ahafs`
package to be installed. This package provides the AIX Event Infrastructure
that is detected by `autoconf`.
Expand Down
2 changes: 1 addition & 1 deletion deps/uv/configure.ac
Expand Up @@ -13,7 +13,7 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

AC_PREREQ(2.57)
AC_INIT([libuv], [1.31.0], [https://github.com/libuv/libuv/issues])
AC_INIT([libuv], [1.32.0], [https://github.com/libuv/libuv/issues])
AC_CONFIG_MACRO_DIR([m4])
m4_include([m4/libuv-extra-automake-flags.m4])
m4_include([m4/as_case.m4])
Expand Down
5 changes: 4 additions & 1 deletion deps/uv/docs/src/handle.rst
Expand Up @@ -60,6 +60,9 @@ Data types
a ``UV_ENOBUFS`` error will be triggered in the :c:type:`uv_udp_recv_cb` or the
:c:type:`uv_read_cb` callback.

Each buffer is used only once and the user is responsible for freeing it in the
:c:type:`uv_udp_recv_cb` or the :c:type:`uv_read_cb` callback.

A suggested size (65536 at the moment in most cases) is provided, but it's just an indication,
not related in any way to the pending data to be read. The user is free to allocate the amount
of memory they decide.
Expand Down Expand Up @@ -87,7 +90,7 @@ Public members

.. c:member:: uv_loop_t* uv_handle_t.loop
Pointer to the :c:type:`uv_loop_t` where the handle is running on. Readonly.
Pointer to the :c:type:`uv_loop_t` the handle is running on. Readonly.

.. c:member:: uv_handle_type uv_handle_t.type
Expand Down
11 changes: 11 additions & 0 deletions deps/uv/docs/src/signal.rst
Expand Up @@ -20,6 +20,15 @@ Reception of some signals is emulated:
program is given approximately 10 seconds to perform cleanup. After that
Windows will unconditionally terminate it.

* SIGWINCH is raised whenever libuv detects that the console has been
resized. When a libuv app is running under a console emulator, or when a
32-bit libuv app is running on 64-bit system, SIGWINCH will be emulated. In
such cases SIGWINCH signals may not always be delivered in a timely manner.
For a writable :c:type:`uv_tty_t` handle libuv will only detect size changes
when the cursor is moved. When a readable :c:type:`uv_tty_t` handle is used,
resizing of the console buffer will be detected only if the handle is in raw
mode and is being read.

* Watchers for other signals can be successfully created, but these signals
are never received. These signals are: `SIGILL`, `SIGABRT`, `SIGFPE`, `SIGSEGV`,
`SIGTERM` and `SIGKILL.`
Expand All @@ -28,6 +37,8 @@ Reception of some signals is emulated:
not detected by libuv; these will not trigger a signal watcher.

.. versionchanged:: 1.15.0 SIGWINCH support on Windows was improved.
.. versionchanged:: 1.31.0 32-bit libuv SIGWINCH support on 64-bit Windows was
rolled back to old implementation.

Unix notes
----------
Expand Down
4 changes: 2 additions & 2 deletions deps/uv/docs/src/stream.rst
Expand Up @@ -50,8 +50,8 @@ Data types
from the stream again is undefined.

The callee is responsible for freeing the buffer, libuv does not reuse it.
The buffer may be a null buffer (where buf->base=NULL and buf->len=0) on
error.
The buffer may be a null buffer (where `buf->base` == NULL and `buf->len` == 0)
on error.

.. c:type:: void (*uv_write_cb)(uv_write_t* req, int status)
Expand Down
10 changes: 10 additions & 0 deletions deps/uv/docs/src/tcp.rst
Expand Up @@ -113,3 +113,13 @@ API
mapping
.. seealso:: The :c:type:`uv_stream_t` API functions also apply.
.. c:function:: int uv_tcp_close_reset(uv_tcp_t* handle, uv_close_cb close_cb)
Resets a TCP connection by sending a RST packet. This is accomplished by
setting the `SO_LINGER` socket option with a linger interval of zero and
then calling :c:func:`uv_close`.
Due to some platform inconsistencies, mixing of :c:func:`uv_shutdown` and
:c:func:`uv_tcp_close_reset` calls is not allowed.
.. versionadded:: 1.32.0
30 changes: 26 additions & 4 deletions deps/uv/docs/src/udp.rst
Expand Up @@ -56,16 +56,19 @@ Data types

* `handle`: UDP handle
* `nread`: Number of bytes that have been received.
0 if there is no more data to read. You may discard or repurpose
the read buffer. Note that 0 may also mean that an empty datagram
was received (in this case `addr` is not NULL). < 0 if a transmission
error was detected.
0 if there is no more data to read. Note that 0 may also mean that an
empty datagram was received (in this case `addr` is not NULL). < 0 if
a transmission error was detected.
* `buf`: :c:type:`uv_buf_t` with the received data.
* `addr`: ``struct sockaddr*`` containing the address of the sender.
Can be NULL. Valid for the duration of the callback only.
* `flags`: One or more or'ed UV_UDP_* constants. Right now only
``UV_UDP_PARTIAL`` is used.

The callee is responsible for freeing the buffer, libuv does not reuse it.
The buffer may be a null buffer (where `buf->base` == NULL and `buf->len` == 0)
on error.

.. note::
The receive callback will be called with `nread` == 0 and `addr` == NULL when there is
nothing to read, and with `nread` == 0 and `addr` != NULL when an empty UDP packet is
Expand Down Expand Up @@ -219,6 +222,25 @@ API
:returns: 0 on success, or an error code < 0 on failure.
.. c:function:: int uv_udp_set_source_membership(uv_udp_t* handle, const char* multicast_addr, const char* interface_addr, const char* source_addr, uv_membership membership)
Set membership for a source-specific multicast group.
:param handle: UDP handle. Should have been initialized with
:c:func:`uv_udp_init`.
:param multicast_addr: Multicast address to set membership for.
:param interface_addr: Interface address.
:param source_addr: Source address.
:param membership: Should be ``UV_JOIN_GROUP`` or ``UV_LEAVE_GROUP``.
:returns: 0 on success, or an error code < 0 on failure.
.. versionadded:: 1.32.0
.. c:function:: int uv_udp_set_multicast_loop(uv_udp_t* handle, int on)
Set IP multicast loop flag. Makes multicast packets loop back to
Expand Down
11 changes: 11 additions & 0 deletions deps/uv/include/uv.h
Expand Up @@ -27,6 +27,10 @@
extern "C" {
#endif

#if defined(BUILDING_UV_SHARED) && defined(USING_UV_SHARED)
#error "Define either BUILDING_UV_SHARED or USING_UV_SHARED, not both."
#endif

#ifdef _WIN32
/* Windows - set up dll import/export decorators. */
# if defined(BUILDING_UV_SHARED)
Expand Down Expand Up @@ -143,6 +147,7 @@ extern "C" {
XX(EREMOTEIO, "remote I/O error") \
XX(ENOTTY, "inappropriate ioctl for device") \
XX(EFTYPE, "inappropriate file type or format") \
XX(EILSEQ, "illegal byte sequence") \

#define UV_HANDLE_TYPE_MAP(XX) \
XX(ASYNC, async) \
Expand Down Expand Up @@ -559,6 +564,7 @@ UV_EXTERN int uv_tcp_getsockname(const uv_tcp_t* handle,
UV_EXTERN int uv_tcp_getpeername(const uv_tcp_t* handle,
struct sockaddr* name,
int* namelen);
UV_EXTERN int uv_tcp_close_reset(uv_tcp_t* handle, uv_close_cb close_cb);
UV_EXTERN int uv_tcp_connect(uv_connect_t* req,
uv_tcp_t* handle,
const struct sockaddr* addr,
Expand Down Expand Up @@ -645,6 +651,11 @@ UV_EXTERN int uv_udp_set_membership(uv_udp_t* handle,
const char* multicast_addr,
const char* interface_addr,
uv_membership membership);
UV_EXTERN int uv_udp_set_source_membership(uv_udp_t* handle,
const char* multicast_addr,
const char* interface_addr,
const char* source_addr,
uv_membership membership);
UV_EXTERN int uv_udp_set_multicast_loop(uv_udp_t* handle, int on);
UV_EXTERN int uv_udp_set_multicast_ttl(uv_udp_t* handle, int ttl);
UV_EXTERN int uv_udp_set_multicast_interface(uv_udp_t* handle,
Expand Down
5 changes: 5 additions & 0 deletions deps/uv/include/uv/errno.h
Expand Up @@ -439,5 +439,10 @@
# define UV__EFTYPE (-4028)
#endif

#if defined(EILSEQ) && !defined(_WIN32)
# define UV__EILSEQ UV__ERR(EILSEQ)
#else
# define UV__EILSEQ (-4027)
#endif

#endif /* UV_ERRNO_H_ */

0 comments on commit df0e2e3

Please sign in to comment.