Skip to content

Commit

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

- uv_metrics_idle_time() and UV_METRICS_IDLE_TIME have been added
  for measuring the amount of time the event loop spends idle.
- uv_udp_using_recvmmsg() has been added to determine if a buffer
  is large enough for multiple datagrams should be allocated in
  the allocation callback of uv_udp_recvstart().
- On MinGW, the installation location has been updated to match
  Unix systems rather than Windows.
- uv_fs_copyfile() now tries to use copy_file_range() when
  possible.
- The test suite is now reported to pass on Darwin ARM64 (Apple
  Silicon).
- uv_{get,set}_process_title() now returns an error on platforms
  where uv_setup_args() is required, but has not yet been called.
- The _POSIX_PATH_MAX constant is no longer used, which could
  lead to buffer overflows in uv_fs_readlink() and
  uv_fs_realpath().

PR-URL: #34915
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
  • Loading branch information
cjihrig authored and addaleax committed Sep 22, 2020
1 parent 961844d commit 9b53b4d
Show file tree
Hide file tree
Showing 76 changed files with 2,152 additions and 414 deletions.
3 changes: 3 additions & 0 deletions deps/uv/.mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Maciej Małecki <maciej.malecki@notimplemented.org> <me@mmalecki.com>
Marc Schlaich <marc.schlaich@googlemail.com> <marc.schlaich@gmail.com>
Michael <michael_dawson@ca.ibm.com>
Michael Neumann <mneumann@think.localnet> <mneumann@ntecs.de>
Michael Penick <michael.penick@datastax.com> <mpenick@users.noreply.github.com>
Nicholas Vavilov <vvnicholas@gmail.com>
Nick Logan <ugexe@cpan.org> <nlogan@gmail.com>
Rasmus Christian Pedersen <zerhacken@yahoo.com>
Expand All @@ -41,10 +42,12 @@ Santiago Gimeno <santiago.gimeno@quantion.es> <santiago.gimeno@gmail.com>
Saúl Ibarra Corretgé <saghul@gmail.com>
Saúl Ibarra Corretgé <saghul@gmail.com> <s@saghul.net>
Shigeki Ohtsu <ohtsu@iij.ad.jp> <ohtsu@ohtsu.org>
TK-one <tk5641@naver.com>
Timothy J. Fontaine <tjfontaine@gmail.com>
Yasuhiro Matsumoto <mattn.jp@gmail.com>
Yazhong Liu <yorkiefixer@gmail.com>
Yuki Okumura <mjt@cltn.org>
gengjiawen <technicalcute@gmail.com>
jBarz <jBarz@users.noreply.github.com> <jbarboza@ca.ibm.com>
jBarz <jBarz@users.noreply.github.com> <jbarz@users.noreply.github.com>
ptlomholt <pt@lomholt.com>
Expand Down
8 changes: 8 additions & 0 deletions deps/uv/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -435,3 +435,11 @@ MasterDuke17 <MasterDuke17@users.noreply.github.com>
Alexander Tokmakov <avtokmakov@yandex-team.ru>
Arenoros <arenoros@gmail.com>
lander0s <dh.landeros08@gmail.com>
Turbinya <wownucleos@gmail.com>
OleksandrKvl <oleksandrdvl@gmail.com>
Carter Li <carter.li@eoitek.com>
Juan Sebastian velez Posada <jvelezpo@users.noreply.github.com>
escherstair <ernestviga@gmail.com>
Evan Lucas <evanlucas@me.com>
tjarlama <59913901+tjarlama@users.noreply.github.com>
司徒玟琅 <sanjusss@qq.com>
15 changes: 12 additions & 3 deletions deps/uv/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ check_c_compiler_flag(-Wno-unused-parameter UV_LINT_NO_UNUSED_PARAMETER)
check_c_compiler_flag(-Wstrict-prototypes UV_LINT_STRICT_PROTOTYPES)
check_c_compiler_flag(-Wextra UV_LINT_EXTRA)

check_c_compiler_flag(/utf-8 UV_LINT_UTF8_MSVC)

set(lint-no-unused-parameter $<$<BOOL:${UV_LINT_NO_UNUSED_PARAMETER}>:-Wno-unused-parameter>)
set(lint-strict-prototypes $<$<BOOL:${UV_LINT_STRICT_PROTOTYPES}>:-Wstrict-prototypes>)
set(lint-extra $<$<BOOL:${UV_LINT_EXTRA}>:-Wextra>)
Expand All @@ -76,6 +78,7 @@ set(lint-no-unsafe-msvc $<$<BOOL:${UV_LINT_NO_UNSAFE_MSVC}>:/wd4996>)
string(CONCAT lint-default $<
$<AND:$<BOOL:${UV_LINT_WALL}>,$<NOT:${is-msvc}>>:-Wall
>)
set(lint-utf8-msvc $<$<BOOL:${UV_LINT_UTF8_MSVC}>:/utf-8>)

list(APPEND uv_cflags ${lint-strict-prototypes} ${lint-extra} ${lint-default} ${lint-w4})
list(APPEND uv_cflags ${lint-no-unused-parameter})
Expand All @@ -90,6 +93,7 @@ list(APPEND uv_cflags ${lint-no-hides-param-msvc})
list(APPEND uv_cflags ${lint-no-hides-global-msvc})
list(APPEND uv_cflags ${lint-no-conditional-assignment-msvc})
list(APPEND uv_cflags ${lint-no-unsafe-msvc})
list(APPEND uv_cflags ${lint-utf8-msvc} )

set(uv_sources
src/fs-poll.c
Expand All @@ -107,6 +111,8 @@ if(WIN32)
list(APPEND uv_defines WIN32_LEAN_AND_MEAN _WIN32_WINNT=0x0600)
list(APPEND uv_libraries
psapi
user32
advapi32
iphlpapi
userenv
ws2_32)
Expand Down Expand Up @@ -283,7 +289,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL "OS400")
src/unix/aix-common.c
src/unix/ibmi.c
src/unix/no-fsevents.c
src/unix/no-proctitle.c
src/unix/posix-poll.c)
endif()

Expand Down Expand Up @@ -416,6 +421,7 @@ if(LIBUV_BUILD_TESTS)
test/test-loop-handles.c
test/test-loop-stop.c
test/test-loop-time.c
test/test-metrics.c
test/test-multiple-listen.c
test/test-mutexes.c
test/test-osx-select.c
Expand Down Expand Up @@ -473,6 +479,7 @@ if(LIBUV_BUILD_TESTS)
test/test-tcp-oob.c
test/test-tcp-open.c
test/test-tcp-read-stop.c
test/test-tcp-read-stop-start.c
test/test-tcp-shutdown-after-write.c
test/test-tcp-try-write.c
test/test-tcp-try-write-error.c
Expand All @@ -482,6 +489,7 @@ if(LIBUV_BUILD_TESTS)
test/test-tcp-write-queue-order.c
test/test-tcp-write-to-half-open-connection.c
test/test-tcp-writealot.c
test/test-test-macros.c
test/test-thread-equal.c
test/test-thread.c
test/test-threadpool-cancel.c
Expand All @@ -499,6 +507,7 @@ if(LIBUV_BUILD_TESTS)
test/test-udp-create-socket-early.c
test/test-udp-dgram-too-big.c
test/test-udp-ipv6.c
test/test-udp-mmsg.c
test/test-udp-multicast-interface.c
test/test-udp-multicast-interface6.c
test/test-udp-multicast-join.c
Expand Down Expand Up @@ -541,7 +550,7 @@ if(LIBUV_BUILD_TESTS)
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
endif()

if(UNIX)
if(UNIX OR MINGW)
# Now for some gibbering horrors from beyond the stars...
foreach(lib IN LISTS uv_libraries)
list(APPEND LIBS "-l${lib}")
Expand All @@ -568,7 +577,7 @@ if(UNIX)
install(TARGETS uv_a ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()

if(WIN32)
if(MSVC)
install(DIRECTORY include/ DESTINATION include)
install(FILES LICENSE DESTINATION .)
install(TARGETS uv uv_a
Expand Down
76 changes: 76 additions & 0 deletions deps/uv/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,79 @@
2020.08.26, Version 1.39.0 (Stable), 25f4b8b8a3c0f934158cd37a37b0525d75ca488e

Changes since version 1.38.1:

* unix: use relaxed loads/stores for clock id (Ben Noordhuis)

* build,win: link to user32.lib and advapi32.lib (George Zhao)

* unix: squelch harmless valgrind warning (ssrlive)

* include: fx c++ style comments warnings (Turbinya)

* build,cmake: Change installation location on MinGW (erw7)

* linux: use copy_file_range for uv_fs_copyfile when possible (Carter Li)

* win,tcp: avoid reinserting a pending request (

* docs: improve the descriptions for get memory info (Juan Sebastian velez
Posada)

* test: add udp-mmsg test (Ryan Liptak)

* udp: add uv_udp_using_recvmmsg query (Ryan Liptak)

* doc: add more error constants (TK-one)

* zos: fix potential event loop stall (Trevor Norris)

* include: add internal fields struct to uv_loop_t (Trevor Norris)

* core: add API to measure event loop idle time (Trevor Norris)

* win,fs: use CreateDirectoryW instead of _wmkdir (Mustafa M)

* win,nfc: fix integer comparison signedness (escherstair)

* win,nfc: use

* win,nfc: removed some unused variables (escherstair)

* win,nfc: add missing return statement (escherstair)

* win,nfc: disable clang-format for

* darwin: use IOKit for uv_cpu_info (Evan Lucas)

* test: fix thread race in process_title_threadsafe (Ben Noordhuis)

* win,fs: avoid implicit access to _doserrno (Jameson Nash)

* test: give hrtime test a custom 20s timeout (Jameson Nash)

* build: add more failed test, for qemu version bump (gengjiawen)

* unix: handle src, dest same in uv_fs_copyfile() (cjihrig)

* unix: error when uv_setup_args() is not called (Ryan Liptak)

* aix: protect uv_exepath() from uv_set_process_title() (Richard Lau)

* fs: clobber req->path on uv_fs_mkstemp() error (tjarlama)

* cmake: fix compile error C2001 on Chinese Windows (司徒玟琅)

* test: avoid double evaluation in ASSERT_BASE macro (tjarlama)

* tcp: fail instantly if local port is unbound (Bartosz Sosnowski)

* doc: fix most sphinx warnings (Jameson Nash)

* nfci: address some style nits (Jameson Nash)

* unix: don't use _POSIX_PATH_MAX (Ben Noordhuis)


2020.07.04, Version 1.38.1 (Stable), e8b989ea1f7f9d4083511a2caec7791e9abd1871

Changes since version 1.38.0:
Expand Down
7 changes: 5 additions & 2 deletions deps/uv/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ test_run_tests_SOURCES = test/blackhole-server.c \
test/test-loop-stop.c \
test/test-loop-time.c \
test/test-loop-configure.c \
test/test-metrics.c \
test/test-multiple-listen.c \
test/test-mutexes.c \
test/test-osx-select.c \
Expand Down Expand Up @@ -259,6 +260,7 @@ test_run_tests_SOURCES = test/blackhole-server.c \
test/test-tcp-flags.c \
test/test-tcp-open.c \
test/test-tcp-read-stop.c \
test/test-tcp-read-stop-start.c \
test/test-tcp-shutdown-after-write.c \
test/test-tcp-unexpected-read.c \
test/test-tcp-oob.c \
Expand All @@ -269,6 +271,7 @@ test_run_tests_SOURCES = test/blackhole-server.c \
test/test-tcp-try-write.c \
test/test-tcp-try-write-error.c \
test/test-tcp-write-queue-order.c \
test/test-test-macros.c \
test/test-thread-equal.c \
test/test-thread.c \
test/test-threadpool-cancel.c \
Expand All @@ -286,6 +289,7 @@ test_run_tests_SOURCES = test/blackhole-server.c \
test/test-udp-create-socket-early.c \
test/test-udp-dgram-too-big.c \
test/test-udp-ipv6.c \
test/test-udp-mmsg.c \
test/test-udp-multicast-interface.c \
test/test-udp-multicast-interface6.c \
test/test-udp-multicast-join.c \
Expand Down Expand Up @@ -374,8 +378,7 @@ uvinclude_HEADERS += include/uv/posix.h
libuv_la_SOURCES += src/unix/aix-common.c \
src/unix/ibmi.c \
src/unix/posix-poll.c \
src/unix/no-fsevents.c \
src/unix/no-proctitle.c
src/unix/no-fsevents.c
endif

if ANDROID
Expand Down
2 changes: 1 addition & 1 deletion deps/uv/configure.ac
Original file line number Diff line number Diff line change
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.38.1], [https://github.com/libuv/libuv/issues])
AC_INIT([libuv], [1.39.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
1 change: 1 addition & 0 deletions deps/uv/docs/src/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ API documentation
dll
threading
misc
metrics

2 changes: 1 addition & 1 deletion deps/uv/docs/src/async.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ API
loop thread.
.. note::
:c:func:`uv_async_send` is `async-signal-safe <http://man7.org/linux/man-pages/man7/signal-safety.7.html>`_.
:c:func:`uv_async_send` is `async-signal-safe <https://man7.org/linux/man-pages/man7/signal-safety.7.html>`_.
It's safe to call this function from a signal handler.
.. warning::
Expand Down
14 changes: 13 additions & 1 deletion deps/uv/docs/src/errors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -319,11 +319,23 @@ Error constants
too many links

.. c:macro:: UV_ENOTTY
inappropriate ioctl for device

.. c:macro:: UV_EFTYPE
inappropriate file type or format

.. c:macro:: UV_EILSEQ
illegal byte sequence


API
---

.. c:function:: UV_ERRNO_MAP(iter_macro)
.. c:macro:: UV_ERRNO_MAP(iter_macro)
Macro that expands to a series of invocations of `iter_macro` for
each of the error constants above. `iter_macro` is invoked with two
Expand Down
8 changes: 4 additions & 4 deletions deps/uv/docs/src/fs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Data types
uv_timespec_t st_birthtim;
} uv_stat_t;

.. c:type:: uv_fs_type
.. c:enum:: uv_fs_type
File system request type.

Expand Down Expand Up @@ -122,7 +122,7 @@ Data types
uint64_t f_spare[4];
} uv_statfs_t;

.. c:type:: uv_dirent_t
.. c:enum:: uv_dirent_t
Cross platform (reduced) equivalent of ``struct dirent``.
Used in :c:func:`uv_fs_scandir_next`.
Expand Down Expand Up @@ -535,8 +535,8 @@ Helper functions
For a OS-dependent handle, get the file descriptor in the C runtime.
On UNIX, returns the ``os_fd`` intact. On Windows, this calls `_open_osfhandle <https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/open-osfhandle?view=vs-2019>`_.
Note that the return value is still owned by the CRT,
any attempts to close it or to use it after closing the handle may lead to malfunction.
Note that this consumes the argument, any attempts to close it or to use it
after closing the return value may lead to malfunction.
.. versionadded:: 1.23.0
Expand Down
4 changes: 2 additions & 2 deletions deps/uv/docs/src/handle.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Data types
The base libuv handle type.

.. c:type:: uv_handle_type
.. c:enum:: uv_handle_type
The kind of the libuv handle.

Expand Down Expand Up @@ -104,7 +104,7 @@ Public members
API
---

.. c:function:: UV_HANDLE_TYPE_MAP(iter_macro)
.. c:macro:: UV_HANDLE_TYPE_MAP(iter_macro)
Macro that expands to a series of invocations of `iter_macro` for
each of the handle types. `iter_macro` is invoked with two
Expand Down
7 changes: 6 additions & 1 deletion deps/uv/docs/src/loop.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Data types
Loop data type.

.. c:type:: uv_run_mode
.. c:enum:: uv_run_mode
Mode used to run the loop with :c:func:`uv_run`.

Expand Down Expand Up @@ -68,6 +68,11 @@ API
to suppress unnecessary wakeups when using a sampling profiler.
Requesting other signals will fail with UV_EINVAL.

- UV_METRICS_IDLE_TIME: Accumulate the amount of idle time the event loop
spends in the event provider.

This option is necessary to use :c:func:`uv_metrics_idle_time`.

.. c:function:: int uv_loop_close(uv_loop_t* loop)
Releases all internal loop resources. Call this function only when the loop
Expand Down
25 changes: 25 additions & 0 deletions deps/uv/docs/src/metrics.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

.. _metrics:

Metrics operations
======================

libuv provides a metrics API to track the amount of time the event loop has
spent idle in the kernel's event provider.

API
---

.. c:function:: uint64_t uv_metrics_idle_time(uv_loop_t* loop)
Retrieve the amount of time the event loop has been idle in the kernel's
event provider (e.g. ``epoll_wait``). The call is thread safe.
The return value is the accumulated time spent idle in the kernel's event
provider starting from when the :c:type:`uv_loop_t` was configured to
collect the idle time.
.. note::
The event loop will not begin accumulating the event provider's idle
time until calling :c:type:`uv_loop_configure` with
:c:type:`UV_METRICS_IDLE_TIME`.
Loading

0 comments on commit 9b53b4d

Please sign in to comment.