Skip to content
Permalink
Browse files

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 <trivikr.dev@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
  • Loading branch information...
cjihrig authored and targos committed Jun 27, 2019
1 parent 82b80e0 commit 43677325e1925c04156f97ebf8a9226f2bae5d79
@@ -0,0 +1 @@
test/fixtures/lorem_ipsum.txt text eol=lf
@@ -382,3 +382,10 @@ George Zhao <zhaozg@gmail.com>
Kyle Edwards <kyle.edwards@kitware.com>
ken-cunningham-webuse <ken.cunningham.webuse@gmail.com>
Kelvin Jin <kelvinjin@google.com>
Leorize <leorize+oss@disroot.org>
Vlad A <vladmore@gmail.com>
Niels Lohmann <mail@nlohmann.me>
Jenil Christo <jenilchristo5@gmail.com>
Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
gengjiawen <technicalcute@gmail.com>
Leo Chung <gewalalb@gmail.com>
@@ -1,7 +1,6 @@
# TODO: determine CMAKE_SYSTEM_NAME on OS/390. Currently assumes "OS/390".
cmake_minimum_required(VERSION 3.0)
project(libuv)
enable_testing()

if(MSVC)
list(APPEND uv_cflags /W4)
@@ -137,6 +136,7 @@ set(uv_test_sources
test/test-tcp-read-stop.c
test/test-tcp-shutdown-after-write.c
test/test-tcp-try-write.c
test/test-tcp-try-write-error.c
test/test-tcp-unexpected-read.c
test/test-tcp-write-after-connect.c
test/test-tcp-write-fail.c
@@ -350,8 +350,11 @@ target_compile_options(uv_a PRIVATE ${uv_cflags})
target_include_directories(uv_a PRIVATE include src)
target_link_libraries(uv_a ${uv_libraries})

if(BUILD_TESTING)
include(CTest)
option(libuv_buildtests "Build the unit tests when BUILD_TESTING is enabled." ON)

include(CTest)
if(BUILD_TESTING AND libuv_buildtests)
enable_testing()
add_executable(uv_run_tests ${uv_test_sources})
target_compile_definitions(uv_run_tests
PRIVATE ${uv_defines} USING_UV_SHARED=1)
@@ -1,3 +1,40 @@
2019.06.28, Version 1.30.0 (Stable), 365b6f2a0eacda1ff52be8e57ab9381cfddc5dbb

Changes since version 1.29.1:

* darwin: fall back to F_BARRIERFSYNC (Ben Noordhuis)

* darwin: add 32 bit close$NOCANCEL implementation (ken-cunningham-webuse)

* build, core, unix: add support for Haiku (Leorize)

* darwin,linux: more conservative minimum stack size (Ben Noordhuis)

* threadpool: increase UV_THREADPOOL_SIZE limit (Vlad A)

* unix: return actual error from `uv_try_write()` (Anna Henningsen)

* darwin: fix build error with macos 10.10 (Ben Noordhuis)

* unix: make uv_cwd() report UV_ENOBUFS (Ben Noordhuis)

* unix: make uv_fs_read() fill all buffers (Ben Noordhuis)

* test: give hrtime test a custom 10s timeout (Ben Noordhuis)

* fs: fix uv_fs_copyfile if same src and dst (Santiago Gimeno)

* build: add cmake option to skip building tests (Niels Lohmann)

* doc: add link to nodejs.org (Jenil Christo)

* unix: fix a comment typo in signal.c (Evgeny Ermakov)

* unix: remove redundant cast in process.c (gengjiawen)

* doc: fix wrong mutex function prototypes (Leo Chung)


2019.05.22, Version 1.29.1 (Stable), d16e6094e1eb3b0b5981ef1dd7e03ec4d466944d

Changes since version 1.29.0:
@@ -117,6 +117,7 @@ endif # WINNT

EXTRA_DIST = test/fixtures/empty_file \
test/fixtures/load_error.node \
test/fixtures/lorem_ipsum.txt \
include \
docs \
img \
@@ -272,6 +273,7 @@ test_run_tests_SOURCES = test/blackhole-server.c \
test/test-tcp-writealot.c \
test/test-tcp-write-fail.c \
test/test-tcp-try-write.c \
test/test-tcp-try-write-error.c \
test/test-tcp-write-queue-order.c \
test/test-thread-equal.c \
test/test-thread.c \
@@ -320,6 +322,10 @@ test_run_tests_CFLAGS += -D_ALL_SOURCE \
-D_LINUX_SOURCE_COMPAT
endif

if HAIKU
test_run_tests_CFLAGS += -D_BSD_SOURCE
endif

if LINUX
test_run_tests_CFLAGS += -D_GNU_SOURCE
endif
@@ -409,6 +415,17 @@ libuv_la_SOURCES += src/unix/bsd-ifaddrs.c \
test_run_tests_LDFLAGS += -lutil
endif

if HAIKU
uvinclude_HEADERS += include/uv/posix.h
libuv_la_CFLAGS += -D_BSD_SOURCE
libuv_la_SOURCES += src/unix/bsd-ifaddrs.c \
src/unix/haiku.c \
src/unix/no-fsevents.c \
src/unix/no-proctitle.c \
src/unix/posix-hrtime.c \
src/unix/posix-poll.c
endif

if HURD
uvinclude_HEADERS += include/uv/posix.h
libuv_la_SOURCES += src/unix/no-fsevents.c \
@@ -13,7 +13,7 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

AC_PREREQ(2.57)
AC_INIT([libuv], [1.29.1], [https://github.com/libuv/libuv/issues])
AC_INIT([libuv], [1.30.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])
@@ -56,6 +56,7 @@ AM_CONDITIONAL([CYGWIN], [AS_CASE([$host_os],[cygwin*], [true], [false])
AM_CONDITIONAL([DARWIN], [AS_CASE([$host_os],[darwin*], [true], [false])])
AM_CONDITIONAL([DRAGONFLY],[AS_CASE([$host_os],[dragonfly*], [true], [false])])
AM_CONDITIONAL([FREEBSD], [AS_CASE([$host_os],[*freebsd*], [true], [false])])
AM_CONDITIONAL([HAIKU], [AS_CASE([$host_os],[haiku], [true], [false])])
AM_CONDITIONAL([HURD], [AS_CASE([$host_os],[gnu*], [true], [false])])
AM_CONDITIONAL([LINUX], [AS_CASE([$host_os],[linux*], [true], [false])])
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])])
AS_CASE([$host_os], [kfreebsd*], [
LIBS="$LIBS -lfreebsd-glue"
])
AS_CASE([$host_os], [haiku], [
LIBS="$LIBS -lnetwork"
])
AC_CHECK_HEADERS([sys/ahafs_evProds.h])
AC_CONFIG_FILES([Makefile libuv.pc])
AC_CONFIG_LINKS([test/fixtures/empty_file:test/fixtures/empty_file])
@@ -4,9 +4,11 @@
Design overview
===============

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

.. _Node.js: https://nodejs.org

The library provides much more than a simple abstraction over different I/O polling mechanisms:
'handles' and 'streams' provide a high level abstraction for sockets and other entities;
cross-platform file I/O and threading functionality is also provided, amongst other things.
@@ -10,7 +10,9 @@ operations, as well as getaddrinfo and getnameinfo requests.

Its default size is 4, but it can be changed at startup time by setting the
``UV_THREADPOOL_SIZE`` environment variable to any value (the absolute maximum
is 128).
is 1024).

.. versionchanged:: 1.29.2 the maximum UV_THREADPOOL_SIZE allowed was increased from 128 to 1024.

The threadpool is global and shared across all event loops. When a particular
function makes use of the threadpool (i.e. when using :c:func:`uv_queue_work`)
@@ -66,6 +66,8 @@
defined(__MSYS__) || \
defined(__GNU__)
# include "uv/posix.h"
#elif defined(__HAIKU__)
# include "uv/posix.h"
#endif

#ifndef NI_MAXHOST
@@ -31,8 +31,8 @@
*/

#define UV_VERSION_MAJOR 1
#define UV_VERSION_MINOR 29
#define UV_VERSION_PATCH 1
#define UV_VERSION_MINOR 30
#define UV_VERSION_PATCH 0
#define UV_VERSION_IS_RELEASE 1
#define UV_VERSION_SUFFIX ""

@@ -27,7 +27,7 @@

#include <stdlib.h>

#define MAX_THREADPOOL_SIZE 128
#define MAX_THREADPOOL_SIZE 1024

static uv_once_t once = UV_ONCE_INIT;
static uv_cond_t cond;
@@ -31,6 +31,10 @@
#include <net/if_dl.h>
#endif

#if defined(__HAIKU__)
#define IFF_RUNNING IFF_LINK
#endif

static int uv__ifaddr_exclude(struct ifaddrs *ent, int exclude_type) {
if (!((ent->ifa_flags & IFF_UP) && (ent->ifa_flags & IFF_RUNNING)))
return 1;
@@ -45,7 +49,8 @@ static int uv__ifaddr_exclude(struct ifaddrs *ent, int exclude_type) {
if (exclude_type == UV__EXCLUDE_IFPHYS)
return (ent->ifa_addr->sa_family != AF_LINK);
#endif
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__DragonFly__)
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__DragonFly__) || \
defined(__HAIKU__)
/*
* On BSD getifaddrs returns information related to the raw underlying
* devices. We're not interested in this information.
@@ -526,8 +526,13 @@ int uv__close_nocancel(int fd) {
#if defined(__APPLE__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdollar-in-identifier-extension"
#if defined(__LP64__)
extern int close$NOCANCEL(int);
return close$NOCANCEL(fd);
#else
extern int close$NOCANCEL$UNIX2003(int);
return close$NOCANCEL$UNIX2003(fd);
#endif
#pragma GCC diagnostic pop
#elif defined(__linux__)
return syscall(SYS_close, fd);
@@ -579,7 +584,7 @@ int uv__nonblock_ioctl(int fd, int set) {
}


#if !defined(__CYGWIN__) && !defined(__MSYS__)
#if !defined(__CYGWIN__) && !defined(__MSYS__) && !defined(__HAIKU__)
int uv__cloexec_ioctl(int fd, int set) {
int r;

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


int uv_cwd(char* buffer, size_t* size) {
char scratch[1 + UV__PATH_MAX];

if (buffer == NULL || size == NULL)
return UV_EINVAL;

if (getcwd(buffer, *size) == NULL)
/* Try to read directly into the user's buffer first... */
if (getcwd(buffer, *size) != NULL)
goto fixup;

if (errno != ERANGE)
return UV__ERR(errno);

/* ...or into scratch space if the user's buffer is too small
* so we can report how much space to provide on the next try.
*/
if (getcwd(scratch, sizeof(scratch)) == NULL)
return UV__ERR(errno);

buffer = scratch;

fixup:

*size = strlen(buffer);

if (*size > 1 && buffer[*size - 1] == '/') {
buffer[*size-1] = '\0';
(*size)--;
*size -= 1;
buffer[*size] = '\0';
}

if (buffer == scratch) {
*size += 1;
return UV_ENOBUFS;
}

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

#if !defined(__MVS__)
#if !defined(__MVS__) && !defined(__HAIKU__)
rusage->ru_maxrss = usage.ru_maxrss;
rusage->ru_ixrss = usage.ru_ixrss;
rusage->ru_idrss = usage.ru_idrss;

0 comments on commit 4367732

Please sign in to comment.
You can’t perform that action at this time.