Skip to content

Commit 6244368

Browse files
cjihrignodejs-github-bot
authored andcommitted
deps: upgrade to libuv 1.39.0
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 <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: David Carlier <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Beth Griggs <[email protected]>
1 parent 010383a commit 6244368

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+2154
-418
lines changed

deps/uv/.mailmap

+3
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Maciej Małecki <[email protected]> <[email protected]>
2727
2828
2929
30+
3031
Nicholas Vavilov <[email protected]>
3132
3233
Rasmus Christian Pedersen <[email protected]>
@@ -41,10 +42,12 @@ Santiago Gimeno <[email protected]> <[email protected]>
4142
Saúl Ibarra Corretgé <[email protected]>
4243
Saúl Ibarra Corretgé <[email protected]> <[email protected]>
4344
45+
4446
Timothy J. Fontaine <[email protected]>
4547
Yasuhiro Matsumoto <[email protected]>
4648
Yazhong Liu <[email protected]>
4749
Yuki Okumura <[email protected]>
50+
gengjiawen <[email protected]>
4851
4952
5053
ptlomholt <[email protected]>

deps/uv/AUTHORS

+8
Original file line numberDiff line numberDiff line change
@@ -435,3 +435,11 @@ MasterDuke17 <[email protected]>
435435
Alexander Tokmakov <[email protected]>
436436
437437
438+
439+
OleksandrKvl <[email protected]>
440+
Carter Li <[email protected]>
441+
Juan Sebastian velez Posada <[email protected]>
442+
escherstair <[email protected]>
443+
Evan Lucas <[email protected]>
444+
445+
司徒玟琅 <[email protected]>

deps/uv/CMakeLists.txt

+12-3
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ check_c_compiler_flag(-Wno-unused-parameter UV_LINT_NO_UNUSED_PARAMETER)
5656
check_c_compiler_flag(-Wstrict-prototypes UV_LINT_STRICT_PROTOTYPES)
5757
check_c_compiler_flag(-Wextra UV_LINT_EXTRA)
5858

59+
check_c_compiler_flag(/utf-8 UV_LINT_UTF8_MSVC)
60+
5961
set(lint-no-unused-parameter $<$<BOOL:${UV_LINT_NO_UNUSED_PARAMETER}>:-Wno-unused-parameter>)
6062
set(lint-strict-prototypes $<$<BOOL:${UV_LINT_STRICT_PROTOTYPES}>:-Wstrict-prototypes>)
6163
set(lint-extra $<$<BOOL:${UV_LINT_EXTRA}>:-Wextra>)
@@ -76,6 +78,7 @@ set(lint-no-unsafe-msvc $<$<BOOL:${UV_LINT_NO_UNSAFE_MSVC}>:/wd4996>)
7678
string(CONCAT lint-default $<
7779
$<AND:$<BOOL:${UV_LINT_WALL}>,$<NOT:${is-msvc}>>:-Wall
7880
>)
81+
set(lint-utf8-msvc $<$<BOOL:${UV_LINT_UTF8_MSVC}>:/utf-8>)
7982

8083
list(APPEND uv_cflags ${lint-strict-prototypes} ${lint-extra} ${lint-default} ${lint-w4})
8184
list(APPEND uv_cflags ${lint-no-unused-parameter})
@@ -90,6 +93,7 @@ list(APPEND uv_cflags ${lint-no-hides-param-msvc})
9093
list(APPEND uv_cflags ${lint-no-hides-global-msvc})
9194
list(APPEND uv_cflags ${lint-no-conditional-assignment-msvc})
9295
list(APPEND uv_cflags ${lint-no-unsafe-msvc})
96+
list(APPEND uv_cflags ${lint-utf8-msvc} )
9397

9498
set(uv_sources
9599
src/fs-poll.c
@@ -107,6 +111,8 @@ if(WIN32)
107111
list(APPEND uv_defines WIN32_LEAN_AND_MEAN _WIN32_WINNT=0x0600)
108112
list(APPEND uv_libraries
109113
psapi
114+
user32
115+
advapi32
110116
iphlpapi
111117
userenv
112118
ws2_32)
@@ -283,7 +289,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL "OS400")
283289
src/unix/aix-common.c
284290
src/unix/ibmi.c
285291
src/unix/no-fsevents.c
286-
src/unix/no-proctitle.c
287292
src/unix/posix-poll.c)
288293
endif()
289294

@@ -416,6 +421,7 @@ if(LIBUV_BUILD_TESTS)
416421
test/test-loop-handles.c
417422
test/test-loop-stop.c
418423
test/test-loop-time.c
424+
test/test-metrics.c
419425
test/test-multiple-listen.c
420426
test/test-mutexes.c
421427
test/test-osx-select.c
@@ -473,6 +479,7 @@ if(LIBUV_BUILD_TESTS)
473479
test/test-tcp-oob.c
474480
test/test-tcp-open.c
475481
test/test-tcp-read-stop.c
482+
test/test-tcp-read-stop-start.c
476483
test/test-tcp-shutdown-after-write.c
477484
test/test-tcp-try-write.c
478485
test/test-tcp-try-write-error.c
@@ -482,6 +489,7 @@ if(LIBUV_BUILD_TESTS)
482489
test/test-tcp-write-queue-order.c
483490
test/test-tcp-write-to-half-open-connection.c
484491
test/test-tcp-writealot.c
492+
test/test-test-macros.c
485493
test/test-thread-equal.c
486494
test/test-thread.c
487495
test/test-threadpool-cancel.c
@@ -499,6 +507,7 @@ if(LIBUV_BUILD_TESTS)
499507
test/test-udp-create-socket-early.c
500508
test/test-udp-dgram-too-big.c
501509
test/test-udp-ipv6.c
510+
test/test-udp-mmsg.c
502511
test/test-udp-multicast-interface.c
503512
test/test-udp-multicast-interface6.c
504513
test/test-udp-multicast-join.c
@@ -541,7 +550,7 @@ if(LIBUV_BUILD_TESTS)
541550
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
542551
endif()
543552

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

571-
if(WIN32)
580+
if(MSVC)
572581
install(DIRECTORY include/ DESTINATION include)
573582
install(FILES LICENSE DESTINATION .)
574583
install(TARGETS uv uv_a

deps/uv/ChangeLog

+76
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,79 @@
1+
2020.08.26, Version 1.39.0 (Stable), 25f4b8b8a3c0f934158cd37a37b0525d75ca488e
2+
3+
Changes since version 1.38.1:
4+
5+
* unix: use relaxed loads/stores for clock id (Ben Noordhuis)
6+
7+
* build,win: link to user32.lib and advapi32.lib (George Zhao)
8+
9+
* unix: squelch harmless valgrind warning (ssrlive)
10+
11+
* include: fx c++ style comments warnings (Turbinya)
12+
13+
* build,cmake: Change installation location on MinGW (erw7)
14+
15+
* linux: use copy_file_range for uv_fs_copyfile when possible (Carter Li)
16+
17+
* win,tcp: avoid reinserting a pending request (
18+
19+
* docs: improve the descriptions for get memory info (Juan Sebastian velez
20+
Posada)
21+
22+
* test: add udp-mmsg test (Ryan Liptak)
23+
24+
* udp: add uv_udp_using_recvmmsg query (Ryan Liptak)
25+
26+
* doc: add more error constants (TK-one)
27+
28+
* zos: fix potential event loop stall (Trevor Norris)
29+
30+
* include: add internal fields struct to uv_loop_t (Trevor Norris)
31+
32+
* core: add API to measure event loop idle time (Trevor Norris)
33+
34+
* win,fs: use CreateDirectoryW instead of _wmkdir (Mustafa M)
35+
36+
* win,nfc: fix integer comparison signedness (escherstair)
37+
38+
* win,nfc: use
39+
40+
* win,nfc: removed some unused variables (escherstair)
41+
42+
* win,nfc: add missing return statement (escherstair)
43+
44+
* win,nfc: disable clang-format for
45+
46+
* darwin: use IOKit for uv_cpu_info (Evan Lucas)
47+
48+
* test: fix thread race in process_title_threadsafe (Ben Noordhuis)
49+
50+
* win,fs: avoid implicit access to _doserrno (Jameson Nash)
51+
52+
* test: give hrtime test a custom 20s timeout (Jameson Nash)
53+
54+
* build: add more failed test, for qemu version bump (gengjiawen)
55+
56+
* unix: handle src, dest same in uv_fs_copyfile() (cjihrig)
57+
58+
* unix: error when uv_setup_args() is not called (Ryan Liptak)
59+
60+
* aix: protect uv_exepath() from uv_set_process_title() (Richard Lau)
61+
62+
* fs: clobber req->path on uv_fs_mkstemp() error (tjarlama)
63+
64+
* cmake: fix compile error C2001 on Chinese Windows (司徒玟琅)
65+
66+
* test: avoid double evaluation in ASSERT_BASE macro (tjarlama)
67+
68+
* tcp: fail instantly if local port is unbound (Bartosz Sosnowski)
69+
70+
* doc: fix most sphinx warnings (Jameson Nash)
71+
72+
* nfci: address some style nits (Jameson Nash)
73+
74+
* unix: don't use _POSIX_PATH_MAX (Ben Noordhuis)
75+
76+
177
2020.07.04, Version 1.38.1 (Stable), e8b989ea1f7f9d4083511a2caec7791e9abd1871
278

379
Changes since version 1.38.0:

deps/uv/Makefile.am

+5-2
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ test_run_tests_SOURCES = test/blackhole-server.c \
203203
test/test-loop-stop.c \
204204
test/test-loop-time.c \
205205
test/test-loop-configure.c \
206+
test/test-metrics.c \
206207
test/test-multiple-listen.c \
207208
test/test-mutexes.c \
208209
test/test-osx-select.c \
@@ -259,6 +260,7 @@ test_run_tests_SOURCES = test/blackhole-server.c \
259260
test/test-tcp-flags.c \
260261
test/test-tcp-open.c \
261262
test/test-tcp-read-stop.c \
263+
test/test-tcp-read-stop-start.c \
262264
test/test-tcp-shutdown-after-write.c \
263265
test/test-tcp-unexpected-read.c \
264266
test/test-tcp-oob.c \
@@ -269,6 +271,7 @@ test_run_tests_SOURCES = test/blackhole-server.c \
269271
test/test-tcp-try-write.c \
270272
test/test-tcp-try-write-error.c \
271273
test/test-tcp-write-queue-order.c \
274+
test/test-test-macros.c \
272275
test/test-thread-equal.c \
273276
test/test-thread.c \
274277
test/test-threadpool-cancel.c \
@@ -286,6 +289,7 @@ test_run_tests_SOURCES = test/blackhole-server.c \
286289
test/test-udp-create-socket-early.c \
287290
test/test-udp-dgram-too-big.c \
288291
test/test-udp-ipv6.c \
292+
test/test-udp-mmsg.c \
289293
test/test-udp-multicast-interface.c \
290294
test/test-udp-multicast-interface6.c \
291295
test/test-udp-multicast-join.c \
@@ -374,8 +378,7 @@ uvinclude_HEADERS += include/uv/posix.h
374378
libuv_la_SOURCES += src/unix/aix-common.c \
375379
src/unix/ibmi.c \
376380
src/unix/posix-poll.c \
377-
src/unix/no-fsevents.c \
378-
src/unix/no-proctitle.c
381+
src/unix/no-fsevents.c
379382
endif
380383

381384
if ANDROID

deps/uv/configure.ac

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1414

1515
AC_PREREQ(2.57)
16-
AC_INIT([libuv], [1.38.1], [https://github.com/libuv/libuv/issues])
16+
AC_INIT([libuv], [1.39.0], [https://github.com/libuv/libuv/issues])
1717
AC_CONFIG_MACRO_DIR([m4])
1818
m4_include([m4/libuv-extra-automake-flags.m4])
1919
m4_include([m4/as_case.m4])

deps/uv/docs/src/api.rst

+1
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,5 @@ API documentation
3232
dll
3333
threading
3434
misc
35+
metrics
3536

deps/uv/docs/src/async.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ API
5151
loop thread.
5252
5353
.. note::
54-
:c:func:`uv_async_send` is `async-signal-safe <http://man7.org/linux/man-pages/man7/signal-safety.7.html>`_.
54+
:c:func:`uv_async_send` is `async-signal-safe <https://man7.org/linux/man-pages/man7/signal-safety.7.html>`_.
5555
It's safe to call this function from a signal handler.
5656
5757
.. warning::

deps/uv/docs/src/errors.rst

+13-1
Original file line numberDiff line numberDiff line change
@@ -319,11 +319,23 @@ Error constants
319319
320320
too many links
321321

322+
.. c:macro:: UV_ENOTTY
323+
324+
inappropriate ioctl for device
325+
326+
.. c:macro:: UV_EFTYPE
327+
328+
inappropriate file type or format
329+
330+
.. c:macro:: UV_EILSEQ
331+
332+
illegal byte sequence
333+
322334

323335
API
324336
---
325337

326-
.. c:function:: UV_ERRNO_MAP(iter_macro)
338+
.. c:macro:: UV_ERRNO_MAP(iter_macro)
327339
328340
Macro that expands to a series of invocations of `iter_macro` for
329341
each of the error constants above. `iter_macro` is invoked with two

deps/uv/docs/src/fs.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Data types
5858
uv_timespec_t st_birthtim;
5959
} uv_stat_t;
6060

61-
.. c:type:: uv_fs_type
61+
.. c:enum:: uv_fs_type
6262
6363
File system request type.
6464

@@ -122,7 +122,7 @@ Data types
122122
uint64_t f_spare[4];
123123
} uv_statfs_t;
124124

125-
.. c:type:: uv_dirent_t
125+
.. c:enum:: uv_dirent_t
126126
127127
Cross platform (reduced) equivalent of ``struct dirent``.
128128
Used in :c:func:`uv_fs_scandir_next`.
@@ -535,8 +535,8 @@ Helper functions
535535
536536
For a OS-dependent handle, get the file descriptor in the C runtime.
537537
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>`_.
538-
Note that the return value is still owned by the CRT,
539-
any attempts to close it or to use it after closing the handle may lead to malfunction.
538+
Note that this consumes the argument, any attempts to close it or to use it
539+
after closing the return value may lead to malfunction.
540540
541541
.. versionadded:: 1.23.0
542542

deps/uv/docs/src/handle.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Data types
2020
2121
The base libuv handle type.
2222

23-
.. c:type:: uv_handle_type
23+
.. c:enum:: uv_handle_type
2424
2525
The kind of the libuv handle.
2626

@@ -104,7 +104,7 @@ Public members
104104
API
105105
---
106106

107-
.. c:function:: UV_HANDLE_TYPE_MAP(iter_macro)
107+
.. c:macro:: UV_HANDLE_TYPE_MAP(iter_macro)
108108
109109
Macro that expands to a series of invocations of `iter_macro` for
110110
each of the handle types. `iter_macro` is invoked with two

deps/uv/docs/src/loop.rst

+6-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Data types
1616
1717
Loop data type.
1818

19-
.. c:type:: uv_run_mode
19+
.. c:enum:: uv_run_mode
2020
2121
Mode used to run the loop with :c:func:`uv_run`.
2222

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

71+
- UV_METRICS_IDLE_TIME: Accumulate the amount of idle time the event loop
72+
spends in the event provider.
73+
74+
This option is necessary to use :c:func:`uv_metrics_idle_time`.
75+
7176
.. c:function:: int uv_loop_close(uv_loop_t* loop)
7277
7378
Releases all internal loop resources. Call this function only when the loop

deps/uv/docs/src/metrics.rst

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
.. _metrics:
3+
4+
Metrics operations
5+
======================
6+
7+
libuv provides a metrics API to track the amount of time the event loop has
8+
spent idle in the kernel's event provider.
9+
10+
API
11+
---
12+
13+
.. c:function:: uint64_t uv_metrics_idle_time(uv_loop_t* loop)
14+
15+
Retrieve the amount of time the event loop has been idle in the kernel's
16+
event provider (e.g. ``epoll_wait``). The call is thread safe.
17+
18+
The return value is the accumulated time spent idle in the kernel's event
19+
provider starting from when the :c:type:`uv_loop_t` was configured to
20+
collect the idle time.
21+
22+
.. note::
23+
The event loop will not begin accumulating the event provider's idle
24+
time until calling :c:type:`uv_loop_configure` with
25+
:c:type:`UV_METRICS_IDLE_TIME`.

0 commit comments

Comments
 (0)