Skip to content

Commit

Permalink
deps: upgrade to libuv 1.38.0
Browse files Browse the repository at this point in the history
Notable changes:

- `uv_library_shutdown()` has been added.
- `uv_udp_init_ex()` now accepts `UV_UDP_RECVMMSG`, although it
  is a no-op.
- Obsolete `MAX_PATH` restrictions have been removed on Windows,
  and Windows is now long path aware.
- Windows environment variables longer than 32,767 characters are
  now supported.
- Linux `cpu_times` are now reported as milliseconds to match
  other platforms.
- A memory leak resulting from `uv_loop_init()` failures has
  been fixed.

PR-URL: #33446
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
  • Loading branch information
cjihrig authored and codebytere committed Jun 9, 2020
1 parent a48aeb3 commit 402aa1b
Show file tree
Hide file tree
Showing 60 changed files with 1,068 additions and 416 deletions.
1 change: 1 addition & 0 deletions deps/uv/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ ipch

# Clion / IntelliJ project files
/.idea/
cmake-build-debug/

*.xcodeproj
*.xcworkspace
Expand Down
7 changes: 7 additions & 0 deletions deps/uv/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -425,3 +425,10 @@ Sk Sajidul Kadir <sheikh.sajid522@gmail.com>
twosee <twose@qq.com>
Rikard Falkeborn <rikard.falkeborn@gmail.com>
Yash Ladha <yashladhapankajladha123@gmail.com>
James Ross <git@james-ross.co.uk>
Colin Finck <colin@reactos.org>
Shohei YOSHIDA <syohex@gmail.com>
Philip Chimento <philip.chimento@gmail.com>
Michal Artazov <michal@artazov.cz>
Jeroen Roovers <jer@gentoo.org>
MasterDuke17 <MasterDuke17@users.noreply.github.com>
79 changes: 59 additions & 20 deletions deps/uv/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,53 @@ cmake_dependent_option(LIBUV_BUILD_BENCH
"Build the benchmarks when building unit tests and we are the root project" ON
"LIBUV_BUILD_TESTS" OFF)

# Qemu Build
option(QEMU "build for qemu" OFF)
if(QEMU)
add_definitions(-D__QEMU__=1)
endif()

# Compiler check
string(CONCAT is-msvc $<OR:
$<C_COMPILER_ID:MSVC>,
$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},MSVC>
>)

check_c_compiler_flag(/W4 UV_LINT_W4)
check_c_compiler_flag(/wd4100 UV_LINT_NO_UNUSED_PARAMETER_MSVC)
check_c_compiler_flag(/wd4127 UV_LINT_NO_CONDITIONAL_CONSTANT_MSVC)
check_c_compiler_flag(/wd4201 UV_LINT_NO_NONSTANDARD_MSVC)
check_c_compiler_flag(/wd4206 UV_LINT_NO_NONSTANDARD_EMPTY_TU_MSVC)
check_c_compiler_flag(/wd4210 UV_LINT_NO_NONSTANDARD_FILE_SCOPE_MSVC)
check_c_compiler_flag(/wd4232 UV_LINT_NO_NONSTANDARD_NONSTATIC_DLIMPORT_MSVC)
check_c_compiler_flag(/wd4456 UV_LINT_NO_HIDES_LOCAL)
check_c_compiler_flag(/wd4457 UV_LINT_NO_HIDES_PARAM)
check_c_compiler_flag(/wd4459 UV_LINT_NO_HIDES_GLOBAL)
check_c_compiler_flag(/wd4706 UV_LINT_NO_CONDITIONAL_ASSIGNMENT_MSVC)
check_c_compiler_flag(/wd4996 UV_LINT_NO_UNSAFE_MSVC)

check_c_compiler_flag(-Wall UV_LINT_WALL) # DO NOT use this under MSVC

# TODO: Place these into its own function
check_c_compiler_flag(-Wno-unused-parameter UV_LINT_NO_UNUSED_PARAMETER)
check_c_compiler_flag(-Wstrict-prototypes UV_LINT_STRICT_PROTOTYPES)
check_c_compiler_flag(-Wextra UV_LINT_EXTRA)

set(lint-no-unused-parameter $<$<BOOL:${UV_LINT_NO_UNUSED_PARAMETER}>:-Wno-unused-parameter>)
set(lint-no-unused-parameter $<$<BOOL:${UV_LINT_NO_UNUSED_PARAMETER}>:-Wno-unused-parameter>)
set(lint-strict-prototypes $<$<BOOL:${UV_LINT_STRICT_PROTOTYPES}>:-Wstrict-prototypes>)
set(lint-extra $<$<BOOL:${UV_LINT_EXTRA}>:-Wextra>)
set(lint-w4 $<$<BOOL:${UV_LINT_W4}>:/W4>)
set(lint-no-unused-parameter-msvc $<$<BOOL:${UV_LINT_NO_UNUSED_PARAMETER_MSVC}>:/wd4100>)
set(lint-no-conditional-constant-msvc $<$<BOOL:${UV_LINT_NO_CONDITIONAL_CONSTANT_MSVC}>:/wd4127>)
set(lint-no-nonstandard-msvc $<$<BOOL:${UV_LINT_NO_NONSTANDARD_MSVC}>:/wd4201>)
set(lint-no-nonstandard-empty-tu-msvc $<$<BOOL:${UV_LINT_NO_NONSTANDARD_EMPTY_TU_MSVC}>:/wd4206>)
set(lint-no-nonstandard-file-scope-msvc $<$<BOOL:${UV_LINT_NO_NONSTANDARD_FILE_SCOPE_MSVC}>:/wd4210>)
set(lint-no-nonstandard-nonstatic-dlimport-msvc $<$<BOOL:${UV_LINT_NO_NONSTANDARD_NONSTATIC_DLIMPORT_MSVC}>:/wd4232>)
set(lint-no-hides-local-msvc $<$<BOOL:${UV_LINT_NO_HIDES_LOCAL}>:/wd4456>)
set(lint-no-hides-param-msvc $<$<BOOL:${UV_LINT_NO_HIDES_PARAM}>:/wd4457>)
set(lint-no-hides-global-msvc $<$<BOOL:${UV_LINT_NO_HIDES_GLOBAL}>:/wd4459>)
set(lint-no-conditional-assignment-msvc $<$<BOOL:${UV_LINT_NO_CONDITIONAL_ASSIGNMENT_MSVC}>:/wd4706>)
set(lint-no-unsafe-msvc $<$<BOOL:${UV_LINT_NO_UNSAFE_MSVC}>:/wd4996>)
# Unfortunately, this one is complicated because MSVC and clang-cl support -Wall
# but using it is like calling -Weverything
string(CONCAT lint-default $<
Expand All @@ -50,6 +79,17 @@ string(CONCAT lint-default $<

list(APPEND uv_cflags ${lint-strict-prototypes} ${lint-extra} ${lint-default} ${lint-w4})
list(APPEND uv_cflags ${lint-no-unused-parameter})
list(APPEND uv_cflags ${lint-no-unused-parameter-msvc})
list(APPEND uv_cflags ${lint-no-conditional-constant-msvc})
list(APPEND uv_cflags ${lint-no-nonstandard-msvc})
list(APPEND uv_cflags ${lint-no-nonstandard-empty-tu-msvc})
list(APPEND uv_cflags ${lint-no-nonstandard-file-scope-msvc})
list(APPEND uv_cflags ${lint-no-nonstandard-nonstatic-dlimport-msvc})
list(APPEND uv_cflags ${lint-no-hides-local-msvc})
list(APPEND uv_cflags ${lint-no-hides-param-msvc})
list(APPEND uv_cflags ${lint-no-hides-global-msvc})
list(APPEND uv_cflags ${lint-no-conditional-assignment-msvc})
list(APPEND uv_cflags ${lint-no-unsafe-msvc})

set(uv_sources
src/fs-poll.c
Expand All @@ -64,22 +104,9 @@ set(uv_sources
src/version.c)

if(WIN32)
if (CMAKE_SYSTEM_VERSION VERSION_GREATER 10) # Windows 10
set(windows-version 0x0A00)
elseif (CMAKE_SYSTEM_VERSION VERSION_GREATER 6.3) # Windows 8.1
set(windows-version 0x0603)
elseif (CMAKE_SYSTEM_VERSION VERSION_GREATER 6.2) # Windows 8
set(windows-version 0x0602)
elseif (CMAKE_SYSTEM_VERSION VERSION_GREATER 6.1) # Windows 7
set(windows-version 0x0601)
elseif (CMAKE_SYSTEM_VERSION VERSION_GREATER 6.0) # Windows Vista
set(windows-version 0x0600)
else()
message(FATAL_ERROR "Windows Vista is the minimum version supported")
endif()
list(APPEND uv_defines WIN32_LEAN_AND_MEAN _WIN32_WINNT=${windows-version})
list(APPEND uv_defines WIN32_LEAN_AND_MEAN _WIN32_WINNT=0x0600)
list(APPEND uv_libraries
$<$<STREQUAL:${windows-version},0x0600>:psapi>
psapi
iphlpapi
userenv
ws2_32)
Expand Down Expand Up @@ -155,7 +182,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "AIX")
endif()

if(CMAKE_SYSTEM_NAME STREQUAL "Android")
list(APPEND uv_libs dl)
list(APPEND uv_libraries dl)
list(APPEND uv_sources
src/unix/android-ifaddrs.c
src/unix/linux-core.c
Expand Down Expand Up @@ -489,7 +516,7 @@ if(LIBUV_BUILD_TESTS)
test/test-walk-handles.c
test/test-watcher-cross-stop.c)

add_executable(uv_run_tests ${uv_test_sources})
add_executable(uv_run_tests ${uv_test_sources} uv_win_longpath.manifest)
target_compile_definitions(uv_run_tests
PRIVATE ${uv_defines} USING_UV_SHARED=1)
target_compile_options(uv_run_tests PRIVATE ${uv_cflags})
Expand All @@ -501,10 +528,14 @@ if(LIBUV_BUILD_TESTS)
set_tests_properties(uv_test PROPERTIES ENVIRONMENT
"LIBPATH=${CMAKE_BINARY_DIR}:$ENV{LIBPATH}")
endif()
add_executable(uv_run_tests_a ${uv_test_sources})
add_executable(uv_run_tests_a ${uv_test_sources} uv_win_longpath.manifest)
target_compile_definitions(uv_run_tests_a PRIVATE ${uv_defines})
target_compile_options(uv_run_tests_a PRIVATE ${uv_cflags})
target_link_libraries(uv_run_tests_a uv_a ${uv_test_libraries})
if(QEMU)
target_link_libraries(uv_run_tests_a uv_a ${uv_test_libraries} -static)
else()
target_link_libraries(uv_run_tests_a uv_a ${uv_test_libraries})
endif()
add_test(NAME uv_test_a
COMMAND uv_run_tests_a
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
Expand Down Expand Up @@ -544,3 +575,11 @@ if(WIN32)
RUNTIME DESTINATION lib/$<CONFIG>
ARCHIVE DESTINATION lib/$<CONFIG>)
endif()

message(STATUS "summary of build options:
Install prefix: ${CMAKE_INSTALL_PREFIX}
Target system: ${CMAKE_SYSTEM_NAME}
Compiler:
C compiler: ${CMAKE_C_COMPILER}
CFLAGS: ${CMAKE_C_FLAGS_${_build_type}} ${CMAKE_C_FLAGS}
")
73 changes: 73 additions & 0 deletions deps/uv/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,76 @@
2020.05.18, Version 1.38.0 (Stable), 1ab9ea3790378f9f25c4e78e9e2b511c75f9c9ed

Changes since version 1.37.0:

* test: skip poll_duplex and poll_unidirectional on PASE (Xu Meng)

* linux: make cpu_times consistently be milliseconds (James Ross)

* win: DRY uv_poll_start() and uv_poll_stop() (Ben Noordhuis)

* win: DRY uv_poll_close() (Ben Noordhuis)

* unix,win: add uv_library_shutdown() (Ben Noordhuis)

* unix: yield cpu when spinlocking on async handle (Ben Noordhuis)

* win: remove dep on GetQueuedCompletionStatusEx (Colin Finck)

* doc: correct source lines (Shohei YOSHIDA)

* build,android: fix typo (twosee)

* doc: uv_cancel() handles uv_random_t requests (Philip Chimento)

* doc: fix unescaped character (Philip Chimento)

* build,cmake: fix compilation on old MinGW (erw7)

* build: remove unnessesary MSVC warnings (Bartosz Sosnowski)

* win: make uv_udp_init_ex() accept UV_UDP_RECVMMSG (Ben Noordhuis)

* unix: simplify uv__udp_init_ex() (Ben Noordhuis)

* win: remove MAX_PATH limitations (Bartosz Sosnowski)

* build, win: add long path aware manifest (Bartosz Sosnowski)

* doc: check/idle/prepare functions always succeed (Ben Noordhuis)

* darwin: fix build with non-apple compilers (Ben Noordhuis)

* win: support environment variables > 32767 chars (Ben Noordhuis)

* unix: fully initialize struct msghdr (Ben Noordhuis)

* doc: add uv_replace_allocator thread safety warning (twosee)

* unix: fix int overflow when copying large files (Michal Artazov)

* fs: report original error (Bartosz Sosnowski)

* win, fs: add IO_REPARSE_TAG_APPEXECLINK support (Bartosz Sosnowski)

* doc: fix formatting (Ben Noordhuis)

* unix: fix memory leak when uv_loop_init() fails (Anna Henningsen)

* unix: shrink uv_udp_set_source_membership() stack (Ben Noordhuis)

* unix,win: fix wrong sizeof argument to memcpy() (Ben Noordhuis)

* build: check for libraries not provided by libc (Jeroen Roovers)

* doc: fix the order of arguments to calloc() (MasterDuke17)

* unix: don't abort when getrlimit() fails (Ben Noordhuis)

* test: support common user profile on IBMi (Xu Meng)

* build: test on more platforms via QEMU in CI (gengjiawen)


2020.04.20, Version 1.37.0 (Stable), 02a9e1be252b623ee032a3137c0b0c94afbe6809

Changes since version 1.36.0:
Expand Down
3 changes: 2 additions & 1 deletion deps/uv/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,9 @@ uvinclude_HEADERS += include/uv/darwin.h
libuv_la_CFLAGS += -D_DARWIN_USE_64_BIT_INODE=1
libuv_la_CFLAGS += -D_DARWIN_UNLIMITED_SELECT=1
libuv_la_SOURCES += src/unix/bsd-ifaddrs.c \
src/unix/darwin.c \
src/unix/darwin-proctitle.c \
src/unix/darwin-stub.h \
src/unix/darwin.c \
src/unix/fsevents.c \
src/unix/kqueue.c \
src/unix/proctitle.c \
Expand Down
20 changes: 11 additions & 9 deletions deps/uv/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

AC_PREREQ(2.57)
AC_INIT([libuv], [1.37.0], [https://github.com/libuv/libuv/issues])
AC_INIT([libuv], [1.38.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])
Expand All @@ -38,15 +38,17 @@ m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
AC_PROG_LIBTOOL
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
LT_INIT
# TODO(bnoordhuis) Check for -pthread vs. -pthreads
AX_PTHREAD([
LIBS="$LIBS $PTHREAD_LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
])
AC_CHECK_LIB([dl], [dlopen])
AC_CHECK_LIB([kstat], [kstat_lookup])
AC_CHECK_LIB([nsl], [gethostbyname])
AC_CHECK_LIB([perfstat], [perfstat_cpu])
AC_CHECK_LIB([pthread], [pthread_mutex_init])
AC_CHECK_LIB([rt], [clock_gettime])
AC_CHECK_LIB([sendfile], [sendfile])
AC_CHECK_LIB([socket], [socket])
AC_SEARCH_LIBS([kstat_lookup], [kstat])
AC_SEARCH_LIBS([gethostbyname], [nsl])
AC_SEARCH_LIBS([perfstat_cpu], [perfstat])
AC_SEARCH_LIBS([clock_gettime], [rt])
AC_SEARCH_LIBS([sendfile], [sendfile])
AC_SEARCH_LIBS([socket], [socket])
AC_SYS_LARGEFILE
AM_CONDITIONAL([AIX], [AS_CASE([$host_os],[aix*], [true], [false])])
AM_CONDITIONAL([ANDROID], [AS_CASE([$host_os],[linux-android*],[true], [false])])
Expand Down
12 changes: 10 additions & 2 deletions deps/uv/docs/src/check.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,22 @@ API

.. c:function:: int uv_check_init(uv_loop_t* loop, uv_check_t* check)
Initialize the handle.
Initialize the handle. This function always succeeds.
:returns: 0
.. c:function:: int uv_check_start(uv_check_t* check, uv_check_cb cb)
Start the handle with the given callback.
Start the handle with the given callback. This function always succeeds,
except when `cb` is `NULL`.
:returns: 0 on success, or `UV_EINVAL` when `cb == NULL`.
.. c:function:: int uv_check_stop(uv_check_t* check)
Stop the handle, the callback will no longer be called.
This function always succeeds.
:returns: 0
.. seealso:: The :c:type:`uv_handle_t` API functions also apply.
7 changes: 7 additions & 0 deletions deps/uv/docs/src/fs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,13 @@ API
.. versionadded:: 1.19.0
.. c:function:: int uv_fs_get_system_error(const uv_fs_t* req)
Returns the platform specific error code - `GetLastError()` value on Windows
and `-(req->result)` on other platforms.
.. versionadded:: 1.38.0
.. c:function:: void* uv_fs_get_ptr(const uv_fs_t* req)
Returns `req->ptr`.
Expand Down
12 changes: 10 additions & 2 deletions deps/uv/docs/src/idle.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,22 @@ API

.. c:function:: int uv_idle_init(uv_loop_t* loop, uv_idle_t* idle)
Initialize the handle.
Initialize the handle. This function always succeeds.
:returns: 0
.. c:function:: int uv_idle_start(uv_idle_t* idle, uv_idle_cb cb)
Start the handle with the given callback.
Start the handle with the given callback. This function always succeeds,
except when `cb` is `NULL`.
:returns: 0 on success, or `UV_EINVAL` when `cb == NULL`.
.. c:function:: int uv_idle_stop(uv_idle_t* idle)
Stop the handle, the callback will no longer be called.
This function always succeeds.
:returns: 0
.. seealso:: The :c:type:`uv_handle_t` API functions also apply.
Loading

0 comments on commit 402aa1b

Please sign in to comment.