Skip to content
Permalink
Browse files

deps: upgrade to libuv 1.33.1

Notable changes:

- uv_random() has been added.
- More work to read those pesky Windows
  environment variables.
- Several build fixes for Tier 3 platforms (Android,
  NetBSD, OpenBSD, Haiku).
- Stop using fsevents to watch files (using kqueue again).

PR-URL: #29996
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
  • Loading branch information
cjihrig authored and targos committed Oct 19, 2019
1 parent 2ebd1a0 commit 2764567f90ffedb1ea975df33e9de04926a0c4c7
Showing with 1,282 additions and 233 deletions.
  1. +8 −0 deps/uv/AUTHORS
  2. +33 −9 deps/uv/CMakeLists.txt
  3. +80 −0 deps/uv/ChangeLog
  4. +11 −7 deps/uv/Makefile.am
  5. +1 −6 deps/uv/SUPPORTED_PLATFORMS.md
  6. +3 −1 deps/uv/configure.ac
  7. +11 −3 deps/uv/docs/src/fs.rst
  8. +10 −4 deps/uv/docs/src/handle.rst
  9. +45 −0 deps/uv/docs/src/misc.rst
  10. +39 −0 deps/uv/docs/src/tty.rst
  11. +41 −0 deps/uv/include/uv.h
  12. +2 −2 deps/uv/include/uv/version.h
  13. +121 −0 deps/uv/src/random.c
  14. +4 −0 deps/uv/src/threadpool.c
  15. +2 −0 deps/uv/src/unix/android-ifaddrs.c
  16. +2 −0 deps/uv/src/unix/bsd-ifaddrs.c
  17. +4 −2 deps/uv/src/unix/core.c
  18. +63 −76 deps/uv/src/unix/darwin-proctitle.c
  19. +15 −15 deps/uv/src/unix/fs.c
  20. +4 −2 deps/uv/src/unix/fsevents.c
  21. +6 −0 deps/uv/src/unix/internal.h
  22. +26 −18 deps/uv/src/unix/kqueue.c
  23. +45 −8 deps/uv/src/unix/linux-core.c
  24. +25 −0 deps/uv/src/unix/linux-syscalls.c
  25. +1 −0 deps/uv/src/unix/linux-syscalls.h
  26. +1 −1 deps/uv/src/unix/openbsd.c
  27. +1 −1 deps/uv/src/unix/pipe.c
  28. +4 −0 deps/uv/src/unix/proctitle.c
  29. +93 −0 deps/uv/src/unix/random-devurandom.c
  30. +57 −0 deps/uv/src/unix/random-getentropy.c
  31. +88 −0 deps/uv/src/unix/random-getrandom.c
  32. +100 −0 deps/uv/src/unix/random-sysctl.c
  33. +7 −0 deps/uv/src/unix/tty.c
  34. +11 −11 deps/uv/src/unix/udp.c
  35. +3 −0 deps/uv/src/uv-common.c
  36. +3 −14 deps/uv/src/win/fs.c
  37. +2 −0 deps/uv/src/win/internal.h
  38. +1 −1 deps/uv/src/win/tcp.c
  39. +26 −18 deps/uv/src/win/tty.c
  40. +1 −1 deps/uv/src/win/udp.c
  41. +16 −1 deps/uv/src/win/util.c
  42. +11 −0 deps/uv/src/win/winapi.c
  43. +8 −0 deps/uv/src/win/winapi.h
  44. +8 −0 deps/uv/src/win/winsock.h
  45. +7 −1 deps/uv/test/test-env-vars.c
  46. +1 −1 deps/uv/test/test-fs-copyfile.c
  47. +55 −17 deps/uv/test/test-fs-event.c
  48. +1 −1 deps/uv/test/test-fs-readdir.c
  49. +4 −0 deps/uv/test/test-ip4-addr.c
  50. +9 −0 deps/uv/test/test-ip6-addr.c
  51. +8 −0 deps/uv/test/test-list.h
  52. +1 −5 deps/uv/test/test-process-title-threadsafe.c
  53. +94 −0 deps/uv/test/test-random.c
  54. +41 −0 deps/uv/test/test-threadpool-cancel.c
  55. +1 −1 deps/uv/test/test-udp-multicast-join.c
  56. +2 −2 deps/uv/test/test-udp-multicast-join6.c
  57. +2 −2 deps/uv/test/test.gyp
  58. +13 −2 deps/uv/uv.gyp
@@ -403,3 +403,11 @@ Vladimir Karnushin <v.karnushin@mail.ru>
MaYuming <maym@appexnetworks.com>
Eneas U de Queiroz <cotequeiroz@gmail.com>
Daniel Hahler <git@thequod.de>
Yang Yu <yang.yu@disigma.org>
David Carlier <devnexen@gmail.com>
Calvin Hill <calvin@hakobaito.co.uk>
Isabella Muerte <63051+slurps-mad-rips@users.noreply.github.com>
Ouyang Yadong <oyydoibh@gmail.com>
ZYSzys <zyszys98@gmail.com>
Carl Lei <xecycle@gmail.com>
Stefan Bender <stefan.bender@ntnu.no>
@@ -1,6 +1,15 @@
# TODO: determine CMAKE_SYSTEM_NAME on OS/390. Currently assumes "OS/390".
cmake_minimum_required(VERSION 2.8.12)
project(libuv)
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)
@@ -14,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
@@ -72,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
@@ -108,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
@@ -236,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
@@ -284,6 +295,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
@@ -300,6 +319,8 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
src/unix/linux-inotify.c
src/unix/linux-syscalls.c
src/unix/procfs-exepath.c
src/unix/random-getrandom.c
src/unix/random-sysctl.c
src/unix/sysinfo-loadavg.c)
endif()

@@ -356,11 +377,7 @@ target_compile_options(uv_a PRIVATE ${uv_cflags})
target_include_directories(uv_a PUBLIC include PRIVATE src)
target_link_libraries(uv_a ${uv_libraries})

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

include(CTest)
if(BUILD_TESTING AND libuv_buildtests)
enable_testing()
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)
@@ -380,7 +397,6 @@ 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)
@@ -402,3 +418,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()
@@ -1,3 +1,83 @@
2019.10.20, Version 1.33.1 (Stable), 07ad32138f4d2285ba2226b5e20462b27b091a59

Changes since version 1.33.0:

* linux: fix arm64 SYS__sysctl build breakage (Ben Noordhuis)


2019.10.17, Version 1.33.0 (Stable), e56e42e9310e4437e1886dbd6771792c14c0a5f3

Changes since version 1.32.0:

* Revert "linux: drop code path for epoll_pwait-less kernels" (Yang Yu)

* build: fix build error with __ANDROID_API__ < 21 (Yang Yu)

* win: fix reading hidden env vars (Anna Henningsen)

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

* win: simplify mkdtemp (Saúl Ibarra Corretgé)

* docs: fix literal-includes in User Guide (Nhan Khong)

* win, tty: fix problem of receiving unexpected SIGWINCH (erw7)

* unix: fix {Net,Open}BSD build (David Carlier)

* win,mingw: Fix undefined MCAST_* constants (Crunkle)

* build: Add link for test/fixtures/lorem_ipsum.txt (Andrew Paprocki)

* fs: use statvfs in uv__fs_statfs() for Haiku (Calvin Hill)

* fsevents: stop using fsevents to watch files (Jameson Nash)

* fsevents: regression in watching / (Jameson Nash)

* build,cmake: don't try to detect a C++ compiler (Isabella Muerte)

* build: fix build warning on cygwin (MaYuming)

* unix: set sin_len and sin6_len (Ouyang Yadong)

* test: fix order of operations in test (cjihrig)

* doc: improve uv_fs_readdir() cleanup docs (cjihrig)

* build: remove duplicated test in build files (ZYSzys)

* android: enable getentropy on Android >= 28 (David Carlier)

* android: fix build (David Carlier)

* darwin: speed up uv_set_process_title() (Ben Noordhuis)

* darwin: assume pthread_setname_np() is available (Ben Noordhuis)

* unix,udp: ensure addr is non-null (Jameson Nash)

* win,tty: add uv_tty_{get,set}_vterm_state (erw7)

* win: fix uv_statfs_t leak in uv_fs_statfs() (Ryan Liptak)

* build: install files on windows via cmake (Carl Lei)

* darwin,test: include AvailabilityMacros.h (Saúl Ibarra Corretgé)

* darwin,test: update loop time after sleeping (Saúl Ibarra Corretgé)

* doc: remove old FreeBSD 9 related note (Saúl Ibarra Corretgé)

* doc: improve uv_{send,recv}_buffer_size() docs (Ryan Liptak)

* build: move -Wno-long-long check to configure time (Ben Noordhuis)

* unix: update uv_fs_copyfile() fallback logic (Stefan Bender)

* win: cast setsockopt struct to const char* (Shelley Vohr)


2019.09.10, Version 1.32.0 (Stable), 697bea87b3a0b0e9b4e5ff86b39d1dedb70ee46d

Changes since version 1.31.0:
@@ -35,6 +35,7 @@ libuv_la_SOURCES = src/fs-poll.c \
src/idna.h \
src/inet.c \
src/queue.h \
src/random.c \
src/strscpy.c \
src/strscpy.h \
src/threadpool.c \
@@ -105,6 +106,7 @@ libuv_la_SOURCES += src/unix/async.c \
src/unix/pipe.c \
src/unix/poll.c \
src/unix/process.c \
src/unix/random-devurandom.c \
src/unix/signal.c \
src/unix/spinlock.h \
src/unix/stream.c \
@@ -138,11 +140,7 @@ EXTRA_DIST = test/fixtures/empty_file \

TESTS = test/run-tests
check_PROGRAMS = test/run-tests
if OS390
test_run_tests_CFLAGS =
else
test_run_tests_CFLAGS = -Wno-long-long
endif

if SUNOS
# Can't be turned into a CC_CHECK_CFLAGS in configure.ac, it makes compilers
@@ -240,6 +238,7 @@ test_run_tests_SOURCES = test/blackhole-server.c \
test/test-process-title.c \
test/test-process-title-threadsafe.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 \
@@ -414,7 +413,8 @@ libuv_la_SOURCES += src/unix/bsd-ifaddrs.c \
src/unix/darwin-proctitle.c \
src/unix/fsevents.c \
src/unix/kqueue.c \
src/unix/proctitle.c
src/unix/proctitle.c \
src/unix/random-getentropy.c
test_run_tests_LDFLAGS += -lutil
endif

@@ -434,7 +434,8 @@ libuv_la_SOURCES += src/unix/bsd-ifaddrs.c \
src/unix/bsd-proctitle.c \
src/unix/freebsd.c \
src/unix/kqueue.c \
src/unix/posix-hrtime.c
src/unix/posix-hrtime.c \
src/unix/random-getrandom.c
test_run_tests_LDFLAGS += -lutil
endif

@@ -465,6 +466,8 @@ libuv_la_SOURCES += src/unix/linux-core.c \
src/unix/linux-syscalls.h \
src/unix/procfs-exepath.c \
src/unix/proctitle.c \
src/unix/random-getrandom.c \
src/unix/random-sysctl.c \
src/unix/sysinfo-loadavg.c
test_run_tests_LDFLAGS += -lutil
endif
@@ -498,7 +501,8 @@ libuv_la_SOURCES += src/unix/bsd-ifaddrs.c \
src/unix/bsd-proctitle.c \
src/unix/kqueue.c \
src/unix/openbsd.c \
src/unix/posix-hrtime.c
src/unix/posix-hrtime.c \
src/unix/random-getentropy.c
test_run_tests_LDFLAGS += -lutil
endif

@@ -5,7 +5,7 @@
| GNU/Linux | Tier 1 | Linux >= 2.6.32 with glibc >= 2.12 | |
| macOS | Tier 1 | macOS >= 10.7 | |
| Windows | Tier 1 | >= Windows 7 | MSVC 2008 and later are supported |
| FreeBSD | Tier 1 | >= 9 (see note) | |
| FreeBSD | Tier 1 | >= 10 | |
| AIX | Tier 2 | >= 6 | Maintainers: @libuv/aix |
| z/OS | Tier 2 | >= V2R2 | Maintainers: @libuv/zos |
| Linux with musl | Tier 2 | musl >= 1.0 | |
@@ -16,11 +16,6 @@
| SunOS | Tier 3 | Solaris 121 and later | |
| Other | Tier 3 | N/A | |

#### Note on FreeBSD 9

While FreeBSD is supported as Tier 1, FreeBSD 9 will get Tier 2 support until
it reaches end of life, in December 2016.

## Support types

* **Tier 1**: Officially supported and tested with CI. Any contributed patch
@@ -13,7 +13,7 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

AC_PREREQ(2.57)
AC_INIT([libuv], [1.32.0], [https://github.com/libuv/libuv/issues])
AC_INIT([libuv], [1.33.1], [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])
@@ -32,6 +32,7 @@ CC_CHECK_CFLAGS_APPEND([-g])
CC_CHECK_CFLAGS_APPEND([-std=gnu89])
CC_CHECK_CFLAGS_APPEND([-Wall])
CC_CHECK_CFLAGS_APPEND([-Wextra])
CC_CHECK_CFLAGS_APPEND([-Wno-long-long])
CC_CHECK_CFLAGS_APPEND([-Wno-unused-parameter])
CC_CHECK_CFLAGS_APPEND([-Wstrict-prototypes])
# AM_PROG_AR is not available in automake v0.11 but it's essential in v0.12.
@@ -80,4 +81,5 @@ AC_CHECK_HEADERS([sys/ahafs_evProds.h])
AC_CONFIG_FILES([Makefile libuv.pc])
AC_CONFIG_LINKS([test/fixtures/empty_file:test/fixtures/empty_file])
AC_CONFIG_LINKS([test/fixtures/load_error.node:test/fixtures/load_error.node])
AC_CONFIG_LINKS([test/fixtures/lorem_ipsum.txt:test/fixtures/lorem_ipsum.txt])
AC_OUTPUT
@@ -295,7 +295,8 @@ API
.. note::
On success this function allocates memory that must be freed using
`uv_fs_req_cleanup()`.
`uv_fs_req_cleanup()`. `uv_fs_req_cleanup()` must be called before
closing the directory with `uv_fs_closedir()`.
.. c:function:: int uv_fs_scandir(uv_loop_t* loop, uv_fs_t* req, const char* path, int flags, uv_fs_cb cb)
.. c:function:: int uv_fs_scandir_next(uv_fs_t* req, uv_dirent_t* ent)
@@ -358,10 +359,13 @@ API
is to overwrite the destination if it exists.
- `UV_FS_COPYFILE_FICLONE`: If present, `uv_fs_copyfile()` will attempt to
create a copy-on-write reflink. If the underlying platform does not
support copy-on-write, then a fallback copy mechanism is used.
support copy-on-write, or an error occurs while attempting to use
copy-on-write, a fallback copy mechanism based on
:c:func:`uv_fs_sendfile()` is used.
- `UV_FS_COPYFILE_FICLONE_FORCE`: If present, `uv_fs_copyfile()` will
attempt to create a copy-on-write reflink. If the underlying platform does
not support copy-on-write, then an error is returned.
not support copy-on-write, or an error occurs while attempting to use
copy-on-write, then an error is returned.
.. warning::
If the destination path is created, but an error occurs while copying
@@ -374,6 +378,10 @@ API
.. versionchanged:: 1.20.0 `UV_FS_COPYFILE_FICLONE` and
`UV_FS_COPYFILE_FICLONE_FORCE` are supported.
.. versionchanged:: 1.33.0 If an error occurs while using
`UV_FS_COPYFILE_FICLONE_FORCE`, that error is returned. Previously,
all errors were mapped to `UV_ENOTSUP`.
.. c:function:: int uv_fs_sendfile(uv_loop_t* loop, uv_fs_t* req, uv_file out_fd, uv_file in_fd, int64_t in_offset, size_t length, uv_fs_cb cb)
Limited equivalent to :man:`sendfile(2)`.
@@ -190,8 +190,11 @@ just for some handle types.
Gets or sets the size of the send buffer that the operating
system uses for the socket.
If `*value` == 0, it will return the current send buffer size,
otherwise it will use `*value` to set the new send buffer size.
If `*value` == 0, then it will set `*value` to the current send buffer size.
If `*value` > 0 then it will use `*value` to set the new send buffer size.
On success, zero is returned. On error, a negative result is
returned.
This function works for TCP, pipe and UDP handles on Unix and for TCP and
UDP handles on Windows.
@@ -204,8 +207,11 @@ just for some handle types.
Gets or sets the size of the receive buffer that the operating
system uses for the socket.
If `*value` == 0, it will return the current receive buffer size,
otherwise it will use `*value` to set the new receive buffer size.
If `*value` == 0, then it will set `*value` to the current receive buffer size.
If `*value` > 0 then it will use `*value` to set the new receive buffer size.
On success, zero is returned. On error, a negative result is
returned.
This function works for TCP, pipe and UDP handles on Unix and for TCP and
UDP handles on Windows.

0 comments on commit 2764567

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