Skip to content

Commit

Permalink
deps: upgrade to libuv 1.46.0
Browse files Browse the repository at this point in the history
Notable changes
- fs: use WTF-8 on Windows: libuv/libuv#2970
- linux: add some more iouring backed fs ops: libuv/libuv#4012

Important bugs fixed
- linux: work around io_uring IORING_OP_CLOSE bug: libuv/libuv#4059
- src: don't run timers if loop is stopped/unref'd: libuv/libuv#4048

PR-URL: #48618
Backport-PR-URL: #49591
Fixes: #48512
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
PR-URL: #48078
  • Loading branch information
santigimeno authored and ruyadorno committed Sep 16, 2023
1 parent fb2b80f commit 88855e0
Show file tree
Hide file tree
Showing 65 changed files with 1,528 additions and 764 deletions.
1 change: 1 addition & 0 deletions deps/uv/.readthedocs.yaml
Expand Up @@ -6,6 +6,7 @@ sphinx:
fail_on_warning: false

build:
os: "ubuntu-22.04"
tools:
python: "3.9"

Expand Down
6 changes: 6 additions & 0 deletions deps/uv/AUTHORS
Expand Up @@ -542,3 +542,9 @@ Lewis Russell <me@lewisr.dev>
sivadeilra <arlie.davis@gmail.com>
cui fliter <imcusg@gmail.com>
Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com>
Stefan Karpinski <stefan@karpinski.org>
liuxiang88 <94350585+liuxiang88@users.noreply.github.com>
Jeffrey H. Johnson <trnsz@pobox.com>
Abdirahim Musse <33973272+abmusse@users.noreply.github.com>
小明 <7737673+caobug@users.noreply.github.com>
61 changes: 60 additions & 1 deletion deps/uv/ChangeLog
@@ -1,4 +1,63 @@
2023.05.19, Version 1.45.0 (Stable)
2023.06.30, Version 1.46.0 (Stable)

Changes since version 1.45.0:

* Add SHA to ChangeLog (Santiago Gimeno)

* misc: update readthedocs config (Jameson Nash)

* test: remove erroneous RETURN_SKIP (Ben Noordhuis)

* android: disable io_uring support (Ben Noordhuis)

* linux: add some more iouring backed fs ops (Santiago Gimeno)

* build: add autoconf option for disable-maintainer-mode (Jameson Nash)

* fs: use WTF-8 on Windows (Stefan Karpinski)

* unix,win: replace QUEUE with struct uv__queue (Ben Noordhuis)

* linux: fs_read to use io_uring if iovcnt > IOV_MAX (Santiago Gimeno)

* ios: fix uv_getrusage() ru_maxrss calculation (Ben Noordhuis)

* include: update outdated code comment (Ben Noordhuis)

* linux: support abstract unix sockets (Ben Noordhuis)

* unix,win: add UV_PIPE_NO_TRUNCATE flag (Ben Noordhuis)

* unix: add loongarch support (liuxiang88)

* doc: add DPS8M to LINKS.md (Jeffrey H. Johnson)

* include: add EUNATCH errno mapping (Abdirahim Musse)

* src: don't run timers if loop is stopped/unref'd (Trevor Norris)

* win: fix -Wpointer-to-int-cast warning (Ben Noordhuis)

* test,win: fix -Wunused-variable warning (Ben Noordhuis)

* test,win: fix -Wformat warning (Ben Noordhuis)

* linux: work around io_uring IORING_OP_CLOSE bug (Ben Noordhuis)

* win: remove unused functions (Ben Noordhuis)

* bench: add bench to check uv_loop_alive (Trevor Norris)

* test: add uv_cancel test for threadpool (Trevor Norris)

* unix: skip prohibited syscalls on tvOS and watchOS (小明)

* unix,fs: make no_pwritev access thread-safe (Santiago Gimeno)

* unix: fix build for lower versions of Android (小明)


2023.05.19, Version 1.45.0 (Stable), 96e05543f53b19d9642b4b0dd73b86ad3cea313e

Changes since version 1.44.2:

Expand Down
3 changes: 2 additions & 1 deletion deps/uv/LINKS.md
Expand Up @@ -6,7 +6,8 @@
* [clearskies_core](https://github.com/larroy/clearskies_core): Clearskies file synchronization program. (C++11)
* [CMake](https://cmake.org) open-source, cross-platform family of tools designed to build, test and package software
* [Cocos-Engine](https://github.com/cocos/cocos-engine): The runtime framework for Cocos Creator editor.
* [Coherence](https://github.com/liesware/coherence/): Cryptographic server for modern web apps.
* [Coherence](https://github.com/liesware/coherence/): Cryptographic server for modern web apps.
* [DPS8M](https://dps8m.gitlab.io): GE ∕ Honeywell ∕ Bull DPS‑8/M and 6180/L68 mainframe simulator.
* [DPS-For-IoT](https://github.com/intel/dps-for-iot/wiki): Fully distributed publish/subscribe protocol.
* [HashLink](https://github.com/HaxeFoundation/hashlink): Haxe run-time with libuv support included.
* [Haywire](https://github.com/kellabyte/Haywire): Asynchronous HTTP server.
Expand Down
3 changes: 2 additions & 1 deletion deps/uv/configure.ac
Expand Up @@ -13,12 +13,13 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

AC_PREREQ(2.57)
AC_INIT([libuv], [1.45.0], [https://github.com/libuv/libuv/issues])
AC_INIT([libuv], [1.46.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])
m4_include([m4/libuv-check-flags.m4])
AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects] UV_EXTRA_AUTOMAKE_FLAGS)
AM_MAINTAINER_MODE([enable]) # pass --disable-maintainer-mode if autotools may be unavailable
AC_CANONICAL_HOST
AC_ENABLE_SHARED
AC_ENABLE_STATIC
Expand Down
3 changes: 3 additions & 0 deletions deps/uv/docs/src/errors.rst
Expand Up @@ -339,6 +339,9 @@ Error constants
socket type not supported

.. c:macro:: UV_EUNATCH
protocol driver not attached

API
---
Expand Down
54 changes: 49 additions & 5 deletions deps/uv/docs/src/pipe.rst
Expand Up @@ -55,17 +55,61 @@ API
Bind the pipe to a file path (Unix) or a name (Windows).
Does not support Linux abstract namespace sockets,
unlike :c:func:`uv_pipe_bind2`.
Alias for ``uv_pipe_bind2(handle, name, strlen(name), 0)``.
.. note::
Paths on Unix get truncated to ``sizeof(sockaddr_un.sun_path)`` bytes,
typically between 92 and 108 bytes.
.. c:function:: int uv_pipe_bind2(uv_pipe_t* handle, const char* name, size_t namelen, unsigned int flags)
Bind the pipe to a file path (Unix) or a name (Windows).
``flags`` must be zero or ``UV_PIPE_NO_TRUNCATE``. Returns ``UV_EINVAL``
for unsupported flags without performing the bind operation.
Supports Linux abstract namespace sockets. ``namelen`` must include
the leading nul byte but not the trailing nul byte.
.. versionadded:: 1.46.0
.. note::
Paths on Unix get truncated to ``sizeof(sockaddr_un.sun_path)`` bytes, typically between
92 and 108 bytes.
Paths on Unix get truncated to ``sizeof(sockaddr_un.sun_path)`` bytes,
typically between 92 and 108 bytes, unless the ``UV_PIPE_NO_TRUNCATE``
flag is specified, in which case an ``UV_EINVAL`` error is returned.
.. c:function:: void uv_pipe_connect(uv_connect_t* req, uv_pipe_t* handle, const char* name, uv_connect_cb cb)
Connect to the Unix domain socket or the named pipe.
Connect to the Unix domain socket or the Windows named pipe.
Does not support Linux abstract namespace sockets,
unlike :c:func:`uv_pipe_connect2`.
Alias for ``uv_pipe_connect2(req, handle, name, strlen(name), 0, cb)``.
.. note::
Paths on Unix get truncated to ``sizeof(sockaddr_un.sun_path)`` bytes,
typically between 92 and 108 bytes.
.. c:function:: void uv_pipe_connect2(uv_connect_t* req, uv_pipe_t* handle, const char* name, size_t namelen, unsigned int flags, uv_connect_cb cb)
Connect to the Unix domain socket or the Windows named pipe.
``flags`` must be zero or ``UV_PIPE_NO_TRUNCATE``. Returns ``UV_EINVAL``
for unsupported flags without performing the connect operation.
Supports Linux abstract namespace sockets. ``namelen`` must include
the leading nul byte but not the trailing nul byte.
.. versionadded:: 1.46.0
.. note::
Paths on Unix get truncated to ``sizeof(sockaddr_un.sun_path)`` bytes, typically between
92 and 108 bytes.
Paths on Unix get truncated to ``sizeof(sockaddr_un.sun_path)`` bytes,
typically between 92 and 108 bytes, unless the ``UV_PIPE_NO_TRUNCATE``
flag is specified, in which case an ``UV_EINVAL`` error is returned.
.. c:function:: int uv_pipe_getsockname(const uv_pipe_t* handle, char* buffer, size_t* size)
Expand Down
29 changes: 25 additions & 4 deletions deps/uv/include/uv.h
Expand Up @@ -59,6 +59,12 @@ extern "C" {
#include <stdio.h>
#include <stdint.h>

/* Internal type, do not use. */
struct uv__queue {
struct uv__queue* next;
struct uv__queue* prev;
};

#if defined(_WIN32)
# include "uv/win.h"
#else
Expand Down Expand Up @@ -150,6 +156,7 @@ extern "C" {
XX(EILSEQ, "illegal byte sequence") \
XX(ESOCKTNOSUPPORT, "socket type not supported") \
XX(ENODATA, "no data available") \
XX(EUNATCH, "protocol driver not attached") \

#define UV_HANDLE_TYPE_MAP(XX) \
XX(ASYNC, async) \
Expand Down Expand Up @@ -283,13 +290,13 @@ UV_EXTERN int uv_loop_init(uv_loop_t* loop);
UV_EXTERN int uv_loop_close(uv_loop_t* loop);
/*
* NOTE:
* This function is DEPRECATED (to be removed after 0.12), users should
* This function is DEPRECATED, users should
* allocate the loop manually and use uv_loop_init instead.
*/
UV_EXTERN uv_loop_t* uv_loop_new(void);
/*
* NOTE:
* This function is DEPRECATED (to be removed after 0.12). Users should use
* This function is DEPRECATED. Users should use
* uv_loop_close and free the memory manually instead.
*/
UV_EXTERN void uv_loop_delete(uv_loop_t*);
Expand Down Expand Up @@ -459,7 +466,7 @@ struct uv_shutdown_s {
uv_handle_type type; \
/* private */ \
uv_close_cb close_cb; \
void* handle_queue[2]; \
struct uv__queue handle_queue; \
union { \
int fd; \
void* reserved[4]; \
Expand Down Expand Up @@ -801,6 +808,10 @@ inline int uv_tty_set_mode(uv_tty_t* handle, int mode) {

UV_EXTERN uv_handle_type uv_guess_handle(uv_file file);

enum {
UV_PIPE_NO_TRUNCATE = 1u << 0
};

/*
* uv_pipe_t is a subclass of uv_stream_t.
*
Expand All @@ -817,10 +828,20 @@ struct uv_pipe_s {
UV_EXTERN int uv_pipe_init(uv_loop_t*, uv_pipe_t* handle, int ipc);
UV_EXTERN int uv_pipe_open(uv_pipe_t*, uv_file file);
UV_EXTERN int uv_pipe_bind(uv_pipe_t* handle, const char* name);
UV_EXTERN int uv_pipe_bind2(uv_pipe_t* handle,
const char* name,
size_t namelen,
unsigned int flags);
UV_EXTERN void uv_pipe_connect(uv_connect_t* req,
uv_pipe_t* handle,
const char* name,
uv_connect_cb cb);
UV_EXTERN int uv_pipe_connect2(uv_connect_t* req,
uv_pipe_t* handle,
const char* name,
size_t namelen,
unsigned int flags,
uv_connect_cb cb);
UV_EXTERN int uv_pipe_getsockname(const uv_pipe_t* handle,
char* buffer,
size_t* size);
Expand Down Expand Up @@ -1849,7 +1870,7 @@ struct uv_loop_s {
void* data;
/* Loop reference counting. */
unsigned int active_handles;
void* handle_queue[2];
struct uv__queue handle_queue;
union {
void* unused;
unsigned int count;
Expand Down
6 changes: 3 additions & 3 deletions deps/uv/include/uv/darwin.h
Expand Up @@ -40,16 +40,16 @@
void* cf_state; \
uv_mutex_t cf_mutex; \
uv_sem_t cf_sem; \
void* cf_signals[2]; \
struct uv__queue cf_signals; \

#define UV_PLATFORM_FS_EVENT_FIELDS \
uv__io_t event_watcher; \
char* realpath; \
int realpath_len; \
int cf_flags; \
uv_async_t* cf_cb; \
void* cf_events[2]; \
void* cf_member[2]; \
struct uv__queue cf_events; \
struct uv__queue cf_member; \
int cf_error; \
uv_mutex_t cf_mutex; \

Expand Down
6 changes: 6 additions & 0 deletions deps/uv/include/uv/errno.h
Expand Up @@ -468,4 +468,10 @@
# define UV__ENODATA (-4024)
#endif

#if defined(EUNATCH) && !defined(_WIN32)
# define UV__EUNATCH UV__ERR(EUNATCH)
#else
# define UV__EUNATCH (-4023)
#endif

#endif /* UV_ERRNO_H_ */
2 changes: 1 addition & 1 deletion deps/uv/include/uv/linux.h
Expand Up @@ -28,7 +28,7 @@
int inotify_fd; \

#define UV_PLATFORM_FS_EVENT_FIELDS \
void* watchers[2]; \
struct uv__queue watchers; \
int wd; \

#endif /* UV_LINUX_H */
2 changes: 1 addition & 1 deletion deps/uv/include/uv/threadpool.h
Expand Up @@ -31,7 +31,7 @@ struct uv__work {
void (*work)(struct uv__work *w);
void (*done)(struct uv__work *w, int status);
struct uv_loop_s* loop;
void* wq[2];
struct uv__queue wq;
};

#endif /* UV_THREADPOOL_H_ */

0 comments on commit 88855e0

Please sign in to comment.