Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v10.x] update libuv to 1.34.2 #31969

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions deps/uv/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test/fixtures/lorem_ipsum.txt text eol=lf
1 change: 1 addition & 0 deletions deps/uv/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Makefile.in
/test/run-benchmarks
/test/run-benchmarks.exe
/test/run-benchmarks.dSYM
test_file_*

*.sln
*.sln.cache
Expand Down
2 changes: 2 additions & 0 deletions deps/uv/.mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Sam Roberts <[email protected]> <[email protected]>
San-Tai Hsu <[email protected]>
Santiago Gimeno <[email protected]> <[email protected]>
Saúl Ibarra Corretgé <[email protected]>
Saúl Ibarra Corretgé <[email protected]> <[email protected]>
Shigeki Ohtsu <[email protected]> <[email protected]>
Timothy J. Fontaine <[email protected]>
Yasuhiro Matsumoto <[email protected]>
Expand All @@ -46,3 +47,4 @@ Yuki Okumura <[email protected]>
jBarz <[email protected]> <[email protected]>
jBarz <[email protected]> <[email protected]>
ptlomholt <[email protected]>
zlargon <[email protected]>
37 changes: 37 additions & 0 deletions deps/uv/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -376,3 +376,40 @@ Rich Trott <[email protected]>
Milad Farazmand <[email protected]>
zlargon <[email protected]>
Yury Selivanov <[email protected]>
Oscar Waddell <[email protected]>
FX Coudert <[email protected]>
George Zhao <[email protected]>
Kyle Edwards <[email protected]>
ken-cunningham-webuse <[email protected]>
Kelvin Jin <[email protected]>
Leorize <[email protected]>
Vlad A <[email protected]>
Niels Lohmann <[email protected]>
Jenil Christo <[email protected]>
Evgeny Ermakov <[email protected]>
gengjiawen <[email protected]>
Leo Chung <[email protected]>
Javier Blazquez <[email protected]>
Mustafa M <[email protected]>
Zach Bjornson <[email protected]>
Nan Xiao <[email protected]>
Ben Davies <[email protected]>
Nhan Khong <[email protected]>
Crunkle <[email protected]>
Tomas Krizek <[email protected]>
Konstantin Podsvirov <[email protected]>
seny <[email protected]>
Vladimir Karnushin <[email protected]>
MaYuming <[email protected]>
Eneas U de Queiroz <[email protected]>
Daniel Hahler <[email protected]>
Yang Yu <[email protected]>
David Carlier <[email protected]>
Calvin Hill <[email protected]>
Isabella Muerte <[email protected]>
Ouyang Yadong <[email protected]>
ZYSzys <[email protected]>
Carl Lei <[email protected]>
Stefan Bender <[email protected]>
nia <[email protected]>
virtualyw <[email protected]>
68 changes: 52 additions & 16 deletions deps/uv/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
# TODO: determine CMAKE_SYSTEM_NAME on OS/390. Currently assumes "OS/390".
cmake_minimum_required(VERSION 3.0)
project(libuv)
enable_testing()
cmake_minimum_required(VERSION 3.4)
project(libuv LANGUAGES C)

include(CMakePackageConfigHelpers)
include(CMakeDependentOption)
include(GNUInstallDirs)
include(CTest)

cmake_dependent_option(LIBUV_BUILD_TESTS
"Build the unit tests when BUILD_TESTING is enabled and we are the root project" ON
"BUILD_TESTING;CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR" OFF)

if(MSVC)
list(APPEND uv_cflags /W4)
Expand All @@ -15,6 +23,7 @@ set(uv_sources
src/fs-poll.c
src/idna.c
src/inet.c
src/random.c
src/strscpy.c
src/threadpool.c
src/timer.c
Expand Down Expand Up @@ -54,6 +63,8 @@ set(uv_test_sources
test/test-fs-poll.c
test/test-fs.c
test/test-fs-readdir.c
test/test-fs-fd-hash.c
test/test-fs-open-flags.c
test/test-get-currentexe.c
test/test-get-loadavg.c
test/test-get-memory.c
Expand All @@ -71,7 +82,6 @@ set(uv_test_sources
test/test-idna.c
test/test-ip4-addr.c
test/test-ip6-addr.c
test/test-ip6-addr.c
test/test-ipc-heavy-traffic-deadlock-bug.c
test/test-ipc-send-recv.c
test/test-ipc.c
Expand Down Expand Up @@ -107,6 +117,7 @@ set(uv_test_sources
test/test-process-title-threadsafe.c
test/test-process-title.c
test/test-queue-foreach-delete.c
test/test-random.c
test/test-ref.c
test/test-run-nowait.c
test/test-run-once.c
Expand All @@ -115,6 +126,7 @@ set(uv_test_sources
test/test-shutdown-eof.c
test/test-shutdown-twice.c
test/test-signal-multiple-loops.c
test/test-signal-pending-on-close.c
test/test-signal.c
test/test-socket-buffer-size.c
test/test-spawn.c
Expand All @@ -126,6 +138,7 @@ set(uv_test_sources
test/test-tcp-close-accept.c
test/test-tcp-close-while-connecting.c
test/test-tcp-close.c
test/test-tcp-close-reset.c
test/test-tcp-connect-error-after-write.c
test/test-tcp-connect-error.c
test/test-tcp-connect-timeout.c
Expand All @@ -137,6 +150,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
Expand Down Expand Up @@ -232,6 +246,7 @@ else()
src/unix/pipe.c
src/unix/poll.c
src/unix/process.c
src/unix/random-devurandom.c
src/unix/signal.c
src/unix/stream.c
src/unix/tcp.c
Expand Down Expand Up @@ -260,8 +275,9 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Android")
src/unix/linux-syscalls.c
src/unix/procfs-exepath.c
src/unix/pthread-fixes.c
src/unix/sysinfo-loadavg.c
src/unix/sysinfo-memory.c)
src/unix/random-getrandom.c
src/unix/random-sysctl-linux.c
src/unix/sysinfo-loadavg.c)
endif()

if(APPLE OR CMAKE_SYSTEM_NAME MATCHES "Android|Linux|OS/390")
Expand All @@ -281,6 +297,14 @@ if(APPLE OR CMAKE_SYSTEM_NAME MATCHES "DragonFly|FreeBSD|NetBSD|OpenBSD")
list(APPEND uv_sources src/unix/bsd-ifaddrs.c src/unix/kqueue.c)
endif()

if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
list(APPEND uv_sources src/unix/random-getrandom.c)
endif()

if(APPLE OR CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
list(APPEND uv_sources src/unix/random-getentropy.c)
endif()

if(APPLE)
list(APPEND uv_defines _DARWIN_UNLIMITED_SELECT=1 _DARWIN_USE_64_BIT_INODE=1)
list(APPEND uv_sources
Expand All @@ -297,8 +321,9 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
src/unix/linux-inotify.c
src/unix/linux-syscalls.c
src/unix/procfs-exepath.c
src/unix/sysinfo-loadavg.c
src/unix/sysinfo-memory.c)
src/unix/random-getrandom.c
src/unix/random-sysctl-linux.c
src/unix/sysinfo-loadavg.c)
endif()

if(CMAKE_SYSTEM_NAME STREQUAL "NetBSD")
Expand All @@ -317,6 +342,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "OS/390")
list(APPEND uv_defines _OPEN_MSGQ_EXT)
list(APPEND uv_defines _OPEN_SYS_FILE_EXT)
list(APPEND uv_defines _OPEN_SYS_IF_EXT)
list(APPEND uv_defines _OPEN_SYS_SOCK_EXT3)
list(APPEND uv_defines _OPEN_SYS_SOCK_IPV6)
list(APPEND uv_defines _UNIX03_SOURCE)
list(APPEND uv_defines _UNIX03_THREADS)
Expand All @@ -340,32 +366,31 @@ if(APPLE OR CMAKE_SYSTEM_NAME MATCHES "DragonFly|FreeBSD|Linux|NetBSD|OpenBSD")
endif()

add_library(uv SHARED ${uv_sources})
target_compile_definitions(uv PRIVATE ${uv_defines} BUILDING_UV_SHARED=1)
target_compile_definitions(uv
INTERFACE USING_UV_SHARED=1
PRIVATE ${uv_defines} BUILDING_UV_SHARED=1)
target_compile_options(uv PRIVATE ${uv_cflags})
target_include_directories(uv PRIVATE include src)
target_include_directories(uv PUBLIC include PRIVATE src)
target_link_libraries(uv ${uv_libraries})

add_library(uv_a STATIC ${uv_sources})
target_compile_definitions(uv_a PRIVATE ${uv_defines})
target_compile_options(uv_a PRIVATE ${uv_cflags})
target_include_directories(uv_a PRIVATE include src)
target_include_directories(uv_a PUBLIC include PRIVATE src)
target_link_libraries(uv_a ${uv_libraries})

if(BUILD_TESTING)
include(CTest)
if(LIBUV_BUILD_TESTS)
add_executable(uv_run_tests ${uv_test_sources})
target_compile_definitions(uv_run_tests
PRIVATE ${uv_defines} USING_UV_SHARED=1)
target_compile_options(uv_run_tests PRIVATE ${uv_cflags})
target_include_directories(uv_run_tests PRIVATE include)
target_link_libraries(uv_run_tests uv ${uv_test_libraries})
add_test(NAME uv_test
COMMAND uv_run_tests
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
add_executable(uv_run_tests_a ${uv_test_sources})
target_compile_definitions(uv_run_tests_a PRIVATE ${uv_defines})
target_compile_options(uv_run_tests_a PRIVATE ${uv_cflags})
target_include_directories(uv_run_tests_a PRIVATE include)
target_link_libraries(uv_run_tests_a uv_a ${uv_test_libraries})
add_test(NAME uv_test_a
COMMAND uv_run_tests_a
Expand All @@ -374,12 +399,15 @@ endif()

if(UNIX)
# Now for some gibbering horrors from beyond the stars...
include(GNUInstallDirs)
foreach(x ${uv_libraries})
set(LIBS "${LIBS} -l${x}")
endforeach(x)
file(STRINGS configure.ac configure_ac REGEX ^AC_INIT)
string(REGEX MATCH [0-9]+[.][0-9]+[.][0-9]+ PACKAGE_VERSION "${configure_ac}")
string(REGEX MATCH ^[0-9]+ UV_VERSION_MAJOR "${PACKAGE_VERSION}")
# The version in the filename is mirroring the behaviour of autotools.
set_target_properties(uv PROPERTIES VERSION ${UV_VERSION_MAJOR}.0.0
SOVERSION ${UV_VERSION_MAJOR})
set(includedir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR})
set(libdir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
set(prefix ${CMAKE_INSTALL_PREFIX})
Expand All @@ -392,3 +420,11 @@ if(UNIX)
install(TARGETS uv LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(TARGETS uv_a ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()

if(WIN32)
install(DIRECTORY include/ DESTINATION include)
install(FILES LICENSE DESTINATION .)
install(TARGETS uv uv_a
RUNTIME DESTINATION lib/$<CONFIG>
ARCHIVE DESTINATION lib/$<CONFIG>)
endif()
Loading