Skip to content

Commit a500382

Browse files
deps: update libuv to 1.50.0
PR-URL: nodejs#56616 Reviewed-By: Rafael Gonzaga <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Juan José Arboleda <[email protected]> Reviewed-By: Santiago Gimeno <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Ulises Gascón <[email protected]> Reviewed-By: Richard Lau <[email protected]>
1 parent 2e45656 commit a500382

Some content is hidden

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

58 files changed

+1582
-567
lines changed

deps/uv/.mailmap

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ San-Tai Hsu <[email protected]>
5252
5353
Saúl Ibarra Corretgé <[email protected]>
5454
Saúl Ibarra Corretgé <[email protected]> <[email protected]>
55+
Saúl Ibarra Corretgé <[email protected]> <[email protected]>
5556
5657
Shuowang (Wayne) Zhang <[email protected]>
5758

deps/uv/AUTHORS

+3-1
Original file line numberDiff line numberDiff line change
@@ -588,5 +588,7 @@ Raihaan Shouhell <[email protected]>
588588
589589
590590
Poul T Lomholt <[email protected]>
591-
dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
592591
Thad House <[email protected]>
592+
Julian A Avar C <[email protected]>
593+
amcgoogan <[email protected]>
594+
Rafael Gonzaga <[email protected]>

deps/uv/CMakeLists.txt

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.9)
1+
cmake_minimum_required(VERSION 3.10)
22

33
if(POLICY CMP0091)
44
cmake_policy(SET CMP0091 NEW) # Enable MSVC_RUNTIME_LIBRARY setting
@@ -186,7 +186,7 @@ set(uv_sources
186186
src/version.c)
187187

188188
if(WIN32)
189-
list(APPEND uv_defines WIN32_LEAN_AND_MEAN _WIN32_WINNT=0x0602 _CRT_DECLARE_NONSTDC_NAMES=0)
189+
list(APPEND uv_defines WIN32_LEAN_AND_MEAN _WIN32_WINNT=0x0A00 _CRT_DECLARE_NONSTDC_NAMES=0)
190190
list(APPEND uv_libraries
191191
psapi
192192
user32
@@ -667,6 +667,7 @@ if(LIBUV_BUILD_TESTS)
667667
test/test-thread-affinity.c
668668
test/test-thread-equal.c
669669
test/test-thread.c
670+
test/test-thread-name.c
670671
test/test-thread-priority.c
671672
test/test-threadpool-cancel.c
672673
test/test-threadpool.c

deps/uv/ChangeLog

+82-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,85 @@
1-
2024.10.18, Version 1.49.2 (Stable)
1+
2025.01.15, Version 1.50.0 (Stable)
2+
3+
Changes since version 1.49.2:
4+
5+
* ci: run macOS and iOS tests also on macOS 14 (Saúl Ibarra Corretgé)
6+
7+
* unix,win: map ENOEXEC errno (Saúl Ibarra Corretgé)
8+
9+
* test: skip multicast join test on ENOEXEC (Saúl Ibarra Corretgé)
10+
11+
* ci: make sure the macOS firewall is disabled (Saúl Ibarra Corretgé)
12+
13+
* darwin,test: squelch EBUSY error on multicast join (Saúl Ibarra Corretgé)
14+
15+
* build: update minimum cmake to 3.10 (Ben Noordhuis)
16+
17+
* kqueue: use EVFILT_USER for async if available (Jameson Nash)
18+
19+
* unix,win: fix off-by-one in uv_wtf8_to_utf16() (Ben Noordhuis)
20+
21+
* doc: add scala-native-loop to LINKS.md (Julian A Avar C)
22+
23+
* unix: fix build breakage on haiku, openbsd, etc (Jeffrey H. Johnson)
24+
25+
* kqueue: lower overhead in uv__io_check_fd (Andy Pan)
26+
27+
* doc: move cjihrig back to active maintainers (cjihrig)
28+
29+
* build(deps): bump actions/checkout from 3 to 4 (dependabot[bot])
30+
31+
* unix,pipe: fix handling null buffer in uv_pipe_get{sock,peer}name (Saúl
32+
Ibarra Corretgé)
33+
34+
* unix,win: harmonize buffer checking (Saúl Ibarra Corretgé)
35+
36+
* unix,win: add support for detached threads (Juan José Arboleda)
37+
38+
* src: add uv_thread_set/getname() methods (Santiago Gimeno)
39+
40+
* build: fix qemu builds (Ben Noordhuis)
41+
42+
* win: drop support for windows 8 (Ben Noordhuis)
43+
44+
* linux: fix uv_cpu_info() arm cpu model detection (Ben Noordhuis)
45+
46+
* linux: always use io_uring for epoll batching (Ben Noordhuis)
47+
48+
* doc: clarify repeating timer behavior more (Ben Noordhuis)
49+
50+
* unix,win: handle nbufs=0 in uv_udp_try_send (Ben Noordhuis)
51+
52+
* win: use GetQueuedCompletionStatusEx directly (Saúl Ibarra Corretgé)
53+
54+
* win: enable uv_thread_{get,set}name on MinGW (Saúl Ibarra Corretgé)
55+
56+
* win: drop support for the legacy MinGW (Saúl Ibarra Corretgé)
57+
58+
* win,fs: get (most) fstat when no permission (Jameson Nash)
59+
60+
* win: plug uv_fs_event_start memory leak (amcgoogan)
61+
62+
* test: address FreeBSD kernel bug causing NULL path in fsevents (Juan José
63+
Arboleda)
64+
65+
* unix: refactor udp sendmsg code (Ben Noordhuis)
66+
67+
* unix,win: add uv_udp_try_send2 (Ben Noordhuis)
68+
69+
* test: fix flaky flaky udp_mmsg test (Juan José Arboleda)
70+
71+
* build: enable fdsan in Android (Juan José Arboleda)
72+
73+
* test: fix udp-multicast-join for FreeBSD (Juan José Arboleda)
74+
75+
* win: fix leak processing fs event (Saúl Ibarra Corretgé)
76+
77+
* src: set a default thread name for workers (Rafael Gonzaga)
78+
79+
* misc: implement uv_getrusage_thread (Juan José Arboleda)
80+
81+
82+
2024.10.18, Version 1.49.2 (Stable), e1095c7a4373ce00cd8874d8e820de5afb25776e
283

384
Changes since version 1.49.1:
485

deps/uv/LINKS.md

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
* [Pixie-io](https://github.com/pixie-io/pixie): Open-source observability tool for Kubernetes applications.
3838
* [potion](https://github.com/perl11/potion)/[p2](https://github.com/perl11/p2): runtime
3939
* [racer](https://libraries.io/rubygems/racer): Ruby web server written as an C extension
40+
* [scala-native-loop](https://github.com/scala-native/scala-native-loop): Extensible event loop and async-oriented IO for Scala Native; powered by libuv
4041
* [Socket Runtime](https://sockets.sh): A runtime for creating native cross-platform software on mobile and desktop using HTML, CSS, and JavaScript
4142
* [spider-gazelle](https://github.com/cotag/spider-gazelle): Ruby web server using libuv bindings
4243
* [Suave](http://suave.io/): A simple web development F# library providing a lightweight web server and a set of combinators to manipulate route flow and task composition

deps/uv/MAINTAINERS.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ libuv is currently managed by the following individuals:
44

55
* **Ben Noordhuis** ([@bnoordhuis](https://github.com/bnoordhuis))
66
- GPG key: D77B 1E34 243F BAF0 5F8E 9CC3 4F55 C8C8 46AB 89B9 (pubkey-bnoordhuis)
7+
* **Colin Ihrig** ([@cjihrig](https://github.com/cjihrig))
8+
- GPG key: 94AE 3667 5C46 4D64 BAFA 68DD 7434 390B DBE9 B9C5 (pubkey-cjihrig)
9+
- GPG key: 5735 3E0D BDAA A7E8 39B6 6A1A FF47 D5E4 AD8B 4FDC (pubkey-cjihrig-kb)
710
* **Jameson Nash** ([@vtjnash](https://github.com/vtjnash))
811
- GPG key: AEAD 0A4B 6867 6775 1A0E 4AEF 34A2 5FB1 2824 6514 (pubkey-vtjnash)
912
- GPG key: CFBB 9CA9 A5BE AFD7 0E2B 3C5A 79A6 7C55 A367 9C8B (pubkey2022-vtjnash)
@@ -24,9 +27,6 @@ libuv is currently managed by the following individuals:
2427
* **Anna Henningsen** ([@addaleax](https://github.com/addaleax))
2528
* **Bartosz Sosnowski** ([@bzoz](https://github.com/bzoz))
2629
* **Bert Belder** ([@piscisaureus](https://github.com/piscisaureus))
27-
* **Colin Ihrig** ([@cjihrig](https://github.com/cjihrig))
28-
- GPG key: 94AE 3667 5C46 4D64 BAFA 68DD 7434 390B DBE9 B9C5 (pubkey-cjihrig)
29-
- GPG key: 5735 3E0D BDAA A7E8 39B6 6A1A FF47 D5E4 AD8B 4FDC (pubkey-cjihrig-kb)
3030
* **Fedor Indutny** ([@indutny](https://github.com/indutny))
3131
- GPG key: AF2E EA41 EC34 47BF DD86 FED9 D706 3CCE 19B7 E890 (pubkey-indutny)
3232
* **Imran Iqbal** ([@imran-iq](https://github.com/imran-iq))

deps/uv/Makefile.am

+2-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ if WINNT
5959
uvinclude_HEADERS += include/uv/win.h include/uv/tree.h
6060
AM_CPPFLAGS += -I$(top_srcdir)/src/win \
6161
-DWIN32_LEAN_AND_MEAN \
62-
-D_WIN32_WINNT=0x0602
62+
-D_WIN32_WINNT=0x0A00
6363
libuv_la_SOURCES += src/win/async.c \
6464
src/win/atomicops-inl.h \
6565
src/win/core.c \
@@ -294,6 +294,7 @@ test_run_tests_SOURCES = test/blackhole-server.c \
294294
test/test-thread-equal.c \
295295
test/test-thread.c \
296296
test/test-thread-affinity.c \
297+
test/test-thread-name.c \
297298
test/test-thread-priority.c \
298299
test/test-threadpool-cancel.c \
299300
test/test-threadpool.c \

deps/uv/SUPPORTED_PLATFORMS.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
|---|---|---|---|
55
| GNU/Linux | Tier 1 | Linux >= 3.10 with glibc >= 2.17 | |
66
| macOS | Tier 1 | macOS >= 11 | Currently supported macOS releases |
7-
| Windows | Tier 1 | >= Windows 8 | VS 2015 and later are supported |
7+
| Windows | Tier 1 | >= Windows 10 | VS 2015 and later are supported |
88
| FreeBSD | Tier 2 | >= 12 | |
99
| AIX | Tier 2 | >= 6 | Maintainers: @libuv/aix |
1010
| IBM i | Tier 2 | >= IBM i 7.2 | Maintainers: @libuv/ibmi |
1111
| z/OS | Tier 2 | >= V2R2 | Maintainers: @libuv/zos |
1212
| Linux with musl | Tier 2 | musl >= 1.0 | |
1313
| Android | Tier 3 | NDK >= r15b | Android 7.0, `-DANDROID_PLATFORM=android-24` |
14-
| MinGW | Tier 3 | MinGW32 and MinGW-w64 | |
14+
| MinGW | Tier 3 | MinGW-w64 | |
1515
| SunOS | Tier 3 | Solaris 121 and later | |
1616
| Other | Tier 3 | N/A | |
1717

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.49.2], [https://github.com/libuv/libuv/issues])
16+
AC_INIT([libuv], [1.50.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/fs_event.rst

+5
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ Data types
4747

4848
The `events` parameter is an ORed mask of :c:enum:`uv_fs_event` elements.
4949

50+
.. note::
51+
For FreeBSD path could sometimes be `NULL` due to a kernel bug.
52+
53+
.. _Reference: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=197695
54+
5055
.. c:enum:: uv_fs_event
5156
5257
Event types that :c:type:`uv_fs_event_t` handles monitor.

deps/uv/docs/src/misc.rst

+11
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,17 @@ API
360360
On Windows not all fields are set, the unsupported fields are filled with zeroes.
361361
See :c:type:`uv_rusage_t` for more details.
362362
363+
.. c:function:: int uv_getrusage_thread(uv_rusage_t* rusage)
364+
365+
Gets the resource usage measures for the calling thread.
366+
367+
.. versionadded:: 1.50.0
368+
369+
.. note::
370+
Not supported on all platforms. May return `UV_ENOTSUP`.
371+
On macOS and Windows not all fields are set, the unsupported fields are filled with zeroes.
372+
See :c:type:`uv_rusage_t` for more details.
373+
363374
.. c:function:: uv_pid_t uv_os_getpid(void)
364375
365376
Returns the current process ID.

deps/uv/docs/src/threading.rst

+25
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,14 @@ Threads
7878
7979
.. versionchanged:: 1.4.1 returns a UV_E* error code on failure
8080
81+
.. c:function:: int uv_thread_detach(uv_thread_t* tid)
82+
83+
Detaches a thread. Detached threads automatically release their
84+
resources upon termination, eliminating the need for the application to
85+
call `uv_thread_join`.
86+
87+
.. versionadded:: 1.50.0
88+
8189
.. c:function:: int uv_thread_create_ex(uv_thread_t* tid, const uv_thread_options_t* params, uv_thread_cb entry, void* arg)
8290
8391
Like :c:func:`uv_thread_create`, but additionally specifies options for creating a new thread.
@@ -132,6 +140,23 @@ Threads
132140
.. c:function:: int uv_thread_join(uv_thread_t *tid)
133141
.. c:function:: int uv_thread_equal(const uv_thread_t* t1, const uv_thread_t* t2)
134142
143+
.. c:function:: int uv_thread_setname(const char* name)
144+
145+
Sets the name of the current thread. Different platforms define different limits on the max number of characters
146+
a thread name can be: Linux, IBM i (16), macOS (64), Windows (32767), and NetBSD (32), etc. `uv_thread_setname()`
147+
will truncate it in case `name` is larger than the limit of the platform.
148+
149+
.. versionadded:: 1.50.0
150+
151+
.. c:function:: int uv_thread_getname(uv_thread_t* tid, char* name, size_t* size)
152+
153+
Gets the name of the thread specified by `tid`. The thread name is copied, with the trailing NUL, into the buffer
154+
pointed to by `name`. The `size` parameter specifies the size of the buffer pointed to by `name`.
155+
The buffer should be large enough to hold the name of the thread plus the trailing NUL, or it will be truncated to fit
156+
with the trailing NUL.
157+
158+
.. versionadded:: 1.50.0
159+
135160
.. c:function:: int uv_thread_setpriority(uv_thread_t tid, int priority)
136161
If the function succeeds, the return value is 0.
137162
If the function fails, the return value is less than zero.

deps/uv/docs/src/threadpool.rst

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ is 1024).
1717
.. versionchanged:: 1.45.0 threads now have an 8 MB stack instead of the
1818
(sometimes too low) platform default.
1919

20+
.. versionchanged:: 1.50.0 threads now have a default name of libuv-worker.
21+
2022
The threadpool is global and shared across all event loops. When a particular
2123
function makes use of the threadpool (i.e. when using :c:func:`uv_queue_work`)
2224
libuv preallocates and initializes the maximum number of threads allowed by

deps/uv/docs/src/timer.rst

+9-5
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@
66

77
Timer handles are used to schedule callbacks to be called in the future.
88

9+
Timers are either single-shot or repeating. Repeating timers do not adjust
10+
for overhead but are rearmed relative to the event loop's idea of "now".
11+
12+
Libuv updates its idea of "now" right before executing timer callbacks, and
13+
right after waking up from waiting for I/O. See also :c:func:`uv_update_time`.
14+
15+
Example: a repeating timer with a 50 ms interval whose callback takes 17 ms
16+
to complete, runs again 33 ms later. If other tasks take longer than 33 ms,
17+
the timer callback runs as soon as possible.
918

1019
Data types
1120
----------
@@ -64,11 +73,6 @@ API
6473
duration, and will follow normal timer semantics in the case of a
6574
time-slice overrun.
6675
67-
For example, if a 50ms repeating timer first runs for 17ms, it will be
68-
scheduled to run again 33ms later. If other tasks consume more than the
69-
33ms following the first timer callback, then the callback will run as soon
70-
as possible.
71-
7276
.. note::
7377
If the repeat value is set from a timer callback it does not immediately take effect.
7478
If the timer was non-repeating before, it will have been stopped. If it was repeating,

deps/uv/docs/src/udp.rst

+14
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,20 @@ API
426426
427427
.. versionchanged:: 1.27.0 added support for connected sockets
428428
429+
.. c:function:: int uv_udp_try_send2(uv_udp_t* handle, unsigned int count, uv_buf_t* bufs[/*count*/], unsigned int nbufs[/*count*/], struct sockaddr* addrs[/*count*/], unsigned int flags)
430+
431+
Like :c:func:`uv_udp_try_send`, but can send multiple datagrams.
432+
Lightweight abstraction around :man:`sendmmsg(2)`, with a :man:`sendmsg(2)`
433+
fallback loop for platforms that do not support the former. The handle must
434+
be fully initialized; call c:func:`uv_udp_bind` first.
435+
436+
:returns: >= 0: number of datagrams sent. Zero only if `count` was zero.
437+
< 0: negative error code. Only if sending the first datagram fails,
438+
otherwise returns a positive send count. ``UV_EAGAIN`` when datagrams
439+
cannot be sent right now; fall back to :c:func:`uv_udp_send`.
440+
441+
.. versionadded:: 1.50.0
442+
429443
.. c:function:: int uv_udp_recv_start(uv_udp_t* handle, uv_alloc_cb alloc_cb, uv_udp_recv_cb recv_cb)
430444
431445
Prepare for receiving data. If the socket has not previously been bound

deps/uv/include/uv.h

+12
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ struct uv__queue {
157157
XX(ESOCKTNOSUPPORT, "socket type not supported") \
158158
XX(ENODATA, "no data available") \
159159
XX(EUNATCH, "protocol driver not attached") \
160+
XX(ENOEXEC, "exec format error") \
160161

161162
#define UV_HANDLE_TYPE_MAP(XX) \
162163
XX(ASYNC, async) \
@@ -775,6 +776,12 @@ UV_EXTERN int uv_udp_try_send(uv_udp_t* handle,
775776
const uv_buf_t bufs[],
776777
unsigned int nbufs,
777778
const struct sockaddr* addr);
779+
UV_EXTERN int uv_udp_try_send2(uv_udp_t* handle,
780+
unsigned int count,
781+
uv_buf_t* bufs[/*count*/],
782+
unsigned int nbufs[/*count*/],
783+
struct sockaddr* addrs[/*count*/],
784+
unsigned int flags);
778785
UV_EXTERN int uv_udp_recv_start(uv_udp_t* handle,
779786
uv_alloc_cb alloc_cb,
780787
uv_udp_recv_cb recv_cb);
@@ -1288,6 +1295,7 @@ typedef struct {
12881295
} uv_rusage_t;
12891296

12901297
UV_EXTERN int uv_getrusage(uv_rusage_t* rusage);
1298+
UV_EXTERN int uv_getrusage_thread(uv_rusage_t* rusage);
12911299

12921300
UV_EXTERN int uv_os_homedir(char* buffer, size_t* size);
12931301
UV_EXTERN int uv_os_tmpdir(char* buffer, size_t* size);
@@ -1869,6 +1877,7 @@ UV_EXTERN int uv_gettimeofday(uv_timeval64_t* tv);
18691877
typedef void (*uv_thread_cb)(void* arg);
18701878

18711879
UV_EXTERN int uv_thread_create(uv_thread_t* tid, uv_thread_cb entry, void* arg);
1880+
UV_EXTERN int uv_thread_detach(uv_thread_t* tid);
18721881

18731882
typedef enum {
18741883
UV_THREAD_NO_FLAGS = 0x00,
@@ -1898,6 +1907,9 @@ UV_EXTERN int uv_thread_getcpu(void);
18981907
UV_EXTERN uv_thread_t uv_thread_self(void);
18991908
UV_EXTERN int uv_thread_join(uv_thread_t *tid);
19001909
UV_EXTERN int uv_thread_equal(const uv_thread_t* t1, const uv_thread_t* t2);
1910+
UV_EXTERN int uv_thread_setname(const char* name);
1911+
UV_EXTERN int uv_thread_getname(uv_thread_t* tid, char* name, size_t size);
1912+
19011913

19021914
/* The presence of these unions force similar struct layout. */
19031915
#define XX(_, name) uv_ ## name ## _t name;

deps/uv/include/uv/errno.h

+6
Original file line numberDiff line numberDiff line change
@@ -474,4 +474,10 @@
474474
# define UV__EUNATCH (-4023)
475475
#endif
476476

477+
#if defined(ENOEXEC) && !defined(_WIN32)
478+
# define UV__ENOEXEC UV__ERR(ENOEXEC)
479+
#else
480+
# define UV__ENOEXEC (-4022)
481+
#endif
482+
477483
#endif /* UV_ERRNO_H_ */

deps/uv/include/uv/unix.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,10 @@ typedef struct {
271271

272272
#define UV_UDP_SEND_PRIVATE_FIELDS \
273273
struct uv__queue queue; \
274-
struct sockaddr_storage addr; \
274+
union { \
275+
struct sockaddr addr; \
276+
struct sockaddr_storage storage; \
277+
} u; \
275278
unsigned int nbufs; \
276279
uv_buf_t* bufs; \
277280
ssize_t status; \

0 commit comments

Comments
 (0)