Skip to content

Commit 4367732

Browse files
cjihrigtargos
authored andcommitted
deps: upgrade to libuv 1.30.0
Notable changes: - Support for the Haiku platform has been added. - The maximum UV_THREADPOOL_SIZE has been increased from 128 to 1024. - uv_fs_copyfile() now works properly when the source and destination files are the same. PR-URL: #28449 Fixes: #27746 Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Jiawen Geng <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
1 parent 82b80e0 commit 4367732

28 files changed

+644
-63
lines changed

deps/uv/.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
test/fixtures/lorem_ipsum.txt text eol=lf

deps/uv/AUTHORS

+7
Original file line numberDiff line numberDiff line change
@@ -382,3 +382,10 @@ George Zhao <[email protected]>
382382
Kyle Edwards <[email protected]>
383383
ken-cunningham-webuse <[email protected]>
384384
Kelvin Jin <[email protected]>
385+
386+
387+
Niels Lohmann <[email protected]>
388+
Jenil Christo <[email protected]>
389+
Evgeny Ermakov <[email protected]>
390+
gengjiawen <[email protected]>
391+
Leo Chung <[email protected]>

deps/uv/CMakeLists.txt

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# TODO: determine CMAKE_SYSTEM_NAME on OS/390. Currently assumes "OS/390".
22
cmake_minimum_required(VERSION 3.0)
33
project(libuv)
4-
enable_testing()
54

65
if(MSVC)
76
list(APPEND uv_cflags /W4)
@@ -137,6 +136,7 @@ set(uv_test_sources
137136
test/test-tcp-read-stop.c
138137
test/test-tcp-shutdown-after-write.c
139138
test/test-tcp-try-write.c
139+
test/test-tcp-try-write-error.c
140140
test/test-tcp-unexpected-read.c
141141
test/test-tcp-write-after-connect.c
142142
test/test-tcp-write-fail.c
@@ -350,8 +350,11 @@ target_compile_options(uv_a PRIVATE ${uv_cflags})
350350
target_include_directories(uv_a PRIVATE include src)
351351
target_link_libraries(uv_a ${uv_libraries})
352352

353-
if(BUILD_TESTING)
354-
include(CTest)
353+
option(libuv_buildtests "Build the unit tests when BUILD_TESTING is enabled." ON)
354+
355+
include(CTest)
356+
if(BUILD_TESTING AND libuv_buildtests)
357+
enable_testing()
355358
add_executable(uv_run_tests ${uv_test_sources})
356359
target_compile_definitions(uv_run_tests
357360
PRIVATE ${uv_defines} USING_UV_SHARED=1)

deps/uv/ChangeLog

+37
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,40 @@
1+
2019.06.28, Version 1.30.0 (Stable), 365b6f2a0eacda1ff52be8e57ab9381cfddc5dbb
2+
3+
Changes since version 1.29.1:
4+
5+
* darwin: fall back to F_BARRIERFSYNC (Ben Noordhuis)
6+
7+
* darwin: add 32 bit close$NOCANCEL implementation (ken-cunningham-webuse)
8+
9+
* build, core, unix: add support for Haiku (Leorize)
10+
11+
* darwin,linux: more conservative minimum stack size (Ben Noordhuis)
12+
13+
* threadpool: increase UV_THREADPOOL_SIZE limit (Vlad A)
14+
15+
* unix: return actual error from `uv_try_write()` (Anna Henningsen)
16+
17+
* darwin: fix build error with macos 10.10 (Ben Noordhuis)
18+
19+
* unix: make uv_cwd() report UV_ENOBUFS (Ben Noordhuis)
20+
21+
* unix: make uv_fs_read() fill all buffers (Ben Noordhuis)
22+
23+
* test: give hrtime test a custom 10s timeout (Ben Noordhuis)
24+
25+
* fs: fix uv_fs_copyfile if same src and dst (Santiago Gimeno)
26+
27+
* build: add cmake option to skip building tests (Niels Lohmann)
28+
29+
* doc: add link to nodejs.org (Jenil Christo)
30+
31+
* unix: fix a comment typo in signal.c (Evgeny Ermakov)
32+
33+
* unix: remove redundant cast in process.c (gengjiawen)
34+
35+
* doc: fix wrong mutex function prototypes (Leo Chung)
36+
37+
138
2019.05.22, Version 1.29.1 (Stable), d16e6094e1eb3b0b5981ef1dd7e03ec4d466944d
239

340
Changes since version 1.29.0:

deps/uv/Makefile.am

+17
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ endif # WINNT
117117

118118
EXTRA_DIST = test/fixtures/empty_file \
119119
test/fixtures/load_error.node \
120+
test/fixtures/lorem_ipsum.txt \
120121
include \
121122
docs \
122123
img \
@@ -272,6 +273,7 @@ test_run_tests_SOURCES = test/blackhole-server.c \
272273
test/test-tcp-writealot.c \
273274
test/test-tcp-write-fail.c \
274275
test/test-tcp-try-write.c \
276+
test/test-tcp-try-write-error.c \
275277
test/test-tcp-write-queue-order.c \
276278
test/test-thread-equal.c \
277279
test/test-thread.c \
@@ -320,6 +322,10 @@ test_run_tests_CFLAGS += -D_ALL_SOURCE \
320322
-D_LINUX_SOURCE_COMPAT
321323
endif
322324

325+
if HAIKU
326+
test_run_tests_CFLAGS += -D_BSD_SOURCE
327+
endif
328+
323329
if LINUX
324330
test_run_tests_CFLAGS += -D_GNU_SOURCE
325331
endif
@@ -409,6 +415,17 @@ libuv_la_SOURCES += src/unix/bsd-ifaddrs.c \
409415
test_run_tests_LDFLAGS += -lutil
410416
endif
411417

418+
if HAIKU
419+
uvinclude_HEADERS += include/uv/posix.h
420+
libuv_la_CFLAGS += -D_BSD_SOURCE
421+
libuv_la_SOURCES += src/unix/bsd-ifaddrs.c \
422+
src/unix/haiku.c \
423+
src/unix/no-fsevents.c \
424+
src/unix/no-proctitle.c \
425+
src/unix/posix-hrtime.c \
426+
src/unix/posix-poll.c
427+
endif
428+
412429
if HURD
413430
uvinclude_HEADERS += include/uv/posix.h
414431
libuv_la_SOURCES += src/unix/no-fsevents.c \

deps/uv/configure.ac

+5-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.29.1], [https://github.com/libuv/libuv/issues])
16+
AC_INIT([libuv], [1.30.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])
@@ -56,6 +56,7 @@ AM_CONDITIONAL([CYGWIN], [AS_CASE([$host_os],[cygwin*], [true], [false])
5656
AM_CONDITIONAL([DARWIN], [AS_CASE([$host_os],[darwin*], [true], [false])])
5757
AM_CONDITIONAL([DRAGONFLY],[AS_CASE([$host_os],[dragonfly*], [true], [false])])
5858
AM_CONDITIONAL([FREEBSD], [AS_CASE([$host_os],[*freebsd*], [true], [false])])
59+
AM_CONDITIONAL([HAIKU], [AS_CASE([$host_os],[haiku], [true], [false])])
5960
AM_CONDITIONAL([HURD], [AS_CASE([$host_os],[gnu*], [true], [false])])
6061
AM_CONDITIONAL([LINUX], [AS_CASE([$host_os],[linux*], [true], [false])])
6162
AM_CONDITIONAL([MSYS], [AS_CASE([$host_os],[msys*], [true], [false])])
@@ -71,6 +72,9 @@ AS_CASE([$host_os], [netbsd*], [AC_CHECK_LIB([kvm], [kvm_open])])
7172
AS_CASE([$host_os], [kfreebsd*], [
7273
LIBS="$LIBS -lfreebsd-glue"
7374
])
75+
AS_CASE([$host_os], [haiku], [
76+
LIBS="$LIBS -lnetwork"
77+
])
7478
AC_CHECK_HEADERS([sys/ahafs_evProds.h])
7579
AC_CONFIG_FILES([Makefile libuv.pc])
7680
AC_CONFIG_LINKS([test/fixtures/empty_file:test/fixtures/empty_file])

deps/uv/docs/src/design.rst

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44
Design overview
55
===============
66

7-
libuv is cross-platform support library which was originally written for NodeJS. It's designed
7+
libuv is cross-platform support library which was originally written for `Node.js`_. It's designed
88
around the event-driven asynchronous I/O model.
99

10+
.. _Node.js: https://nodejs.org
11+
1012
The library provides much more than a simple abstraction over different I/O polling mechanisms:
1113
'handles' and 'streams' provide a high level abstraction for sockets and other entities;
1214
cross-platform file I/O and threading functionality is also provided, amongst other things.

deps/uv/docs/src/threadpool.rst

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ operations, as well as getaddrinfo and getnameinfo requests.
1010

1111
Its default size is 4, but it can be changed at startup time by setting the
1212
``UV_THREADPOOL_SIZE`` environment variable to any value (the absolute maximum
13-
is 128).
13+
is 1024).
14+
15+
.. versionchanged:: 1.29.2 the maximum UV_THREADPOOL_SIZE allowed was increased from 128 to 1024.
1416

1517
The threadpool is global and shared across all event loops. When a particular
1618
function makes use of the threadpool (i.e. when using :c:func:`uv_queue_work`)

deps/uv/include/uv/unix.h

+2
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@
6666
defined(__MSYS__) || \
6767
defined(__GNU__)
6868
# include "uv/posix.h"
69+
#elif defined(__HAIKU__)
70+
# include "uv/posix.h"
6971
#endif
7072

7173
#ifndef NI_MAXHOST

deps/uv/include/uv/version.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
*/
3232

3333
#define UV_VERSION_MAJOR 1
34-
#define UV_VERSION_MINOR 29
35-
#define UV_VERSION_PATCH 1
34+
#define UV_VERSION_MINOR 30
35+
#define UV_VERSION_PATCH 0
3636
#define UV_VERSION_IS_RELEASE 1
3737
#define UV_VERSION_SUFFIX ""
3838

deps/uv/src/threadpool.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
#include <stdlib.h>
2929

30-
#define MAX_THREADPOOL_SIZE 128
30+
#define MAX_THREADPOOL_SIZE 1024
3131

3232
static uv_once_t once = UV_ONCE_INIT;
3333
static uv_cond_t cond;

deps/uv/src/unix/bsd-ifaddrs.c

+6-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@
3131
#include <net/if_dl.h>
3232
#endif
3333

34+
#if defined(__HAIKU__)
35+
#define IFF_RUNNING IFF_LINK
36+
#endif
37+
3438
static int uv__ifaddr_exclude(struct ifaddrs *ent, int exclude_type) {
3539
if (!((ent->ifa_flags & IFF_UP) && (ent->ifa_flags & IFF_RUNNING)))
3640
return 1;
@@ -45,7 +49,8 @@ static int uv__ifaddr_exclude(struct ifaddrs *ent, int exclude_type) {
4549
if (exclude_type == UV__EXCLUDE_IFPHYS)
4650
return (ent->ifa_addr->sa_family != AF_LINK);
4751
#endif
48-
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__DragonFly__)
52+
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__DragonFly__) || \
53+
defined(__HAIKU__)
4954
/*
5055
* On BSD getifaddrs returns information related to the raw underlying
5156
* devices. We're not interested in this information.

deps/uv/src/unix/core.c

+32-5
Original file line numberDiff line numberDiff line change
@@ -526,8 +526,13 @@ int uv__close_nocancel(int fd) {
526526
#if defined(__APPLE__)
527527
#pragma GCC diagnostic push
528528
#pragma GCC diagnostic ignored "-Wdollar-in-identifier-extension"
529+
#if defined(__LP64__)
529530
extern int close$NOCANCEL(int);
530531
return close$NOCANCEL(fd);
532+
#else
533+
extern int close$NOCANCEL$UNIX2003(int);
534+
return close$NOCANCEL$UNIX2003(fd);
535+
#endif
531536
#pragma GCC diagnostic pop
532537
#elif defined(__linux__)
533538
return syscall(SYS_close, fd);
@@ -579,7 +584,7 @@ int uv__nonblock_ioctl(int fd, int set) {
579584
}
580585

581586

582-
#if !defined(__CYGWIN__) && !defined(__MSYS__)
587+
#if !defined(__CYGWIN__) && !defined(__MSYS__) && !defined(__HAIKU__)
583588
int uv__cloexec_ioctl(int fd, int set) {
584589
int r;
585590

@@ -696,16 +701,38 @@ ssize_t uv__recvmsg(int fd, struct msghdr* msg, int flags) {
696701

697702

698703
int uv_cwd(char* buffer, size_t* size) {
704+
char scratch[1 + UV__PATH_MAX];
705+
699706
if (buffer == NULL || size == NULL)
700707
return UV_EINVAL;
701708

702-
if (getcwd(buffer, *size) == NULL)
709+
/* Try to read directly into the user's buffer first... */
710+
if (getcwd(buffer, *size) != NULL)
711+
goto fixup;
712+
713+
if (errno != ERANGE)
714+
return UV__ERR(errno);
715+
716+
/* ...or into scratch space if the user's buffer is too small
717+
* so we can report how much space to provide on the next try.
718+
*/
719+
if (getcwd(scratch, sizeof(scratch)) == NULL)
703720
return UV__ERR(errno);
704721

722+
buffer = scratch;
723+
724+
fixup:
725+
705726
*size = strlen(buffer);
727+
706728
if (*size > 1 && buffer[*size - 1] == '/') {
707-
buffer[*size-1] = '\0';
708-
(*size)--;
729+
*size -= 1;
730+
buffer[*size] = '\0';
731+
}
732+
733+
if (buffer == scratch) {
734+
*size += 1;
735+
return UV_ENOBUFS;
709736
}
710737

711738
return 0;
@@ -947,7 +974,7 @@ int uv_getrusage(uv_rusage_t* rusage) {
947974
rusage->ru_stime.tv_sec = usage.ru_stime.tv_sec;
948975
rusage->ru_stime.tv_usec = usage.ru_stime.tv_usec;
949976

950-
#if !defined(__MVS__)
977+
#if !defined(__MVS__) && !defined(__HAIKU__)
951978
rusage->ru_maxrss = usage.ru_maxrss;
952979
rusage->ru_ixrss = usage.ru_ixrss;
953980
rusage->ru_idrss = usage.ru_idrss;

0 commit comments

Comments
 (0)