Skip to content

Commit

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

- UV_FS_O_FILEMAP has been added for faster access to memory
  mapped files on Windows.
- uv_fs_mkdir() now returns UV_EINVAL for invalid filenames
  on Windows. It previously returned UV_ENOENT.
- The uv_fs_statfs() API has been added.
- The uv_os_environ() and uv_os_free_environ() APIs have
  been added.

Fixes: #28599
Fixes: #28945
Fixes: #29008
PR-URL: #29070
Backport-PR-URL: #31969
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
  • Loading branch information
cjihrig authored and BethGriggs committed Mar 2, 2020
1 parent ed71f55 commit 794abbc
Show file tree
Hide file tree
Showing 42 changed files with 2,136 additions and 150 deletions.
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
1 change: 1 addition & 0 deletions deps/uv/.mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Sam Roberts <vieuxtech@gmail.com> <sam@strongloop.com>
San-Tai Hsu <vanilla@fatpipi.com>
Santiago Gimeno <santiago.gimeno@quantion.es> <santiago.gimeno@gmail.com>
Saúl Ibarra Corretgé <saghul@gmail.com>
Saúl Ibarra Corretgé <saghul@gmail.com> <s@saghul.net>
Shigeki Ohtsu <ohtsu@iij.ad.jp> <ohtsu@ohtsu.org>
Timothy J. Fontaine <tjfontaine@gmail.com>
Yasuhiro Matsumoto <mattn.jp@gmail.com>
Expand Down
7 changes: 7 additions & 0 deletions deps/uv/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -389,3 +389,10 @@ Jenil Christo <jenilchristo5@gmail.com>
Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
gengjiawen <technicalcute@gmail.com>
Leo Chung <gewalalb@gmail.com>
Javier Blazquez <jblazquez@riotgames.com>
Mustafa M <mus-m@outlook.com>
Zach Bjornson <zbbjornson@gmail.com>
Nan Xiao <nan@chinadtrace.org>
Ben Davies <kaiepi@outlook.com>
Nhan Khong <knhana7@gmail.com>
Crunkle <justcrunkle@hotmail.co.uk>
2 changes: 2 additions & 0 deletions deps/uv/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,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 Down
49 changes: 49 additions & 0 deletions deps/uv/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,52 @@
2019.08.10, Version 1.31.0 (Stable), 0a6771cee4c15184c924bfe9d397bdd0c3b206ba

Changes since version 1.30.1:

* win,fs: don't modify global file translation mode (Javier Blazquez)

* win: fix uv_os_tmpdir when env var is 260 chars (Mustafa M)

* win: prevent tty event explosion machine hang (Javier Blazquez)

* win: add UV_FS_O_FILEMAP (João Reis)

* win, fs: mkdir return UV_EINVAL for invalid names (Bartosz Sosnowski)

* github: add root warning to template (cjihrig)

* win: misc fs cleanup (cjihrig)

* unix,win: add uv_fs_statfs() (cjihrig)

* test: avoid AF_LOCAL (Carlo Marcelo Arenas Belón)

* unix,win: add ability to retrieve all env variables (Saúl Ibarra Corretgé)

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

* doc: add %p to valgrind log-file arg (Zach Bjornson)

* doc: fix typo in basics.rst (Nan Xiao)

* ibmi: support Makefile build for IBM i (Xu Meng)

* OpenBSD: only get active CPU core count (Ben Davies)

* test: fix gcc 8 warnings for tests (Nhan Khong)

* ibmi: use correct header files (Xu Meng)

* unix: clear UV_HANDLE_READING flag before callback (zyxwvu Shi)

* unix: fix unused-function warning on BSD (Nhan Khong)

* test: fix test runner on MinGW (Crunkle)

* win: remove try-except outside MSVC (Crunkle)

* win: fix uv_spawn() ENOMEM on empty env (Ben Noordhuis)


2019.07.03, Version 1.30.1 (Stable), 1551969c84c2f546a429dac169c7fdac3e38115e

Changes since version 1.30.0:
Expand Down
21 changes: 21 additions & 0 deletions deps/uv/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ test_run_tests_SOURCES = test/blackhole-server.c \
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-fork.c \
test/test-getters-setters.c \
test/test-get-currentexe.c \
Expand Down Expand Up @@ -322,6 +324,12 @@ test_run_tests_CFLAGS += -D_ALL_SOURCE \
-D_LINUX_SOURCE_COMPAT
endif

if OS400
test_run_tests_CFLAGS += -D_ALL_SOURCE \
-D_XOPEN_SOURCE=500 \
-D_LINUX_SOURCE_COMPAT
endif

if HAIKU
test_run_tests_CFLAGS += -D_BSD_SOURCE
endif
Expand Down Expand Up @@ -362,6 +370,19 @@ uvinclude_HEADERS += include/uv/aix.h
libuv_la_SOURCES += src/unix/aix.c src/unix/aix-common.c
endif

if OS400
libuv_la_CFLAGS += -D_ALL_SOURCE \
-D_XOPEN_SOURCE=500 \
-D_LINUX_SOURCE_COMPAT \
-D_THREAD_SAFE
uvinclude_HEADERS += include/uv/posix.h
libuv_la_SOURCES += src/unix/aix-common.c \
src/unix/ibmi.c \
src/unix/posix-poll.c \
src/unix/no-fsevents.c \
src/unix/no-proctitle.c
endif

if ANDROID
uvinclude_HEADERS += include/uv/android-ifaddrs.h
libuv_la_SOURCES += src/unix/android-ifaddrs.c \
Expand Down
2 changes: 1 addition & 1 deletion deps/uv/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ $ gdb --args out/Debug/run-tests TEST_NAME
Use the `--trace-children=yes` parameter:

```bash
$ valgrind --trace-children=yes -v --tool=memcheck --leak-check=full --track-origins=yes --leak-resolution=high --show-reachable=yes --log-file=memcheck.log out/Debug/run-tests TEST_NAME
$ valgrind --trace-children=yes -v --tool=memcheck --leak-check=full --track-origins=yes --leak-resolution=high --show-reachable=yes --log-file=memcheck-%p.log out/Debug/run-tests TEST_NAME
```

### Running benchmarks
Expand Down
3 changes: 2 additions & 1 deletion 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.30.1], [https://github.com/libuv/libuv/issues])
AC_INIT([libuv], [1.31.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 Down Expand Up @@ -63,6 +63,7 @@ AM_CONDITIONAL([MSYS], [AS_CASE([$host_os],[msys*], [true], [false])
AM_CONDITIONAL([NETBSD], [AS_CASE([$host_os],[netbsd*], [true], [false])])
AM_CONDITIONAL([OPENBSD], [AS_CASE([$host_os],[openbsd*], [true], [false])])
AM_CONDITIONAL([OS390], [AS_CASE([$host_os],[openedition*], [true], [false])])
AM_CONDITIONAL([OS400], [AS_CASE([$host_os],[os400], [true], [false])])
AM_CONDITIONAL([SUNOS], [AS_CASE([$host_os],[solaris*], [true], [false])])
AM_CONDITIONAL([WINNT], [AS_CASE([$host_os],[mingw*], [true], [false])])
AS_CASE([$host_os],[mingw*], [
Expand Down
47 changes: 47 additions & 0 deletions deps/uv/docs/src/fs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,24 @@ Data types
UV_FS_CLOSEDIR
} uv_fs_type;

.. c:type:: uv_statfs_t
Reduced cross platform equivalent of ``struct statfs``.
Used in :c:func:`uv_fs_statfs`.

::

typedef struct uv_statfs_s {
uint64_t f_type;
uint64_t f_bsize;
uint64_t f_blocks;
uint64_t f_bfree;
uint64_t f_bavail;
uint64_t f_files;
uint64_t f_ffree;
uint64_t f_spare[4];
} uv_statfs_t;

.. c:type:: uv_dirent_t
Cross platform (reduced) equivalent of ``struct dirent``.
Expand Down Expand Up @@ -200,6 +218,11 @@ API
Equivalent to :man:`preadv(2)`.
.. warning::
On Windows, under non-MSVC environments (e.g. when GCC or Clang is used
to build libuv), files opened using ``UV_FS_O_FILEMAP`` may cause a fatal
crash if the memory mapped read operation fails.
.. c:function:: int uv_fs_unlink(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_cb cb)
Equivalent to :man:`unlink(2)`.
Expand All @@ -208,6 +231,11 @@ API
Equivalent to :man:`pwritev(2)`.
.. warning::
On Windows, under non-MSVC environments (e.g. when GCC or Clang is used
to build libuv), files opened using ``UV_FS_O_FILEMAP`` may cause a fatal
crash if the memory mapped write operation fails.
.. c:function:: int uv_fs_mkdir(uv_loop_t* loop, uv_fs_t* req, const char* path, int mode, uv_fs_cb cb)
Equivalent to :man:`mkdir(2)`.
Expand Down Expand Up @@ -290,6 +318,17 @@ API
Equivalent to :man:`stat(2)`, :man:`fstat(2)` and :man:`lstat(2)` respectively.
.. c:function:: int uv_fs_statfs(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_cb cb)
Equivalent to :man:`statfs(2)`. On success, a `uv_statfs_t` is allocated
and returned via `req->ptr`. This memory is freed by `uv_fs_req_cleanup()`.
.. note::
Any fields in the resulting `uv_statfs_t` that are not supported by the
underlying operating system are set to zero.
.. versionadded:: 1.31.0
.. c:function:: int uv_fs_rename(uv_loop_t* loop, uv_fs_t* req, const char* path, const char* new_path, uv_fs_cb cb)
Equivalent to :man:`rename(2)`.
Expand Down Expand Up @@ -534,6 +573,14 @@ File open constants
.. versionchanged:: 1.17.0 support is added for Windows.
.. c:macro:: UV_FS_O_FILEMAP
Use a memory file mapping to access the file. When using this flag, the
file cannot be open multiple times concurrently.
.. note::
`UV_FS_O_FILEMAP` is only supported on Windows.
.. c:macro:: UV_FS_O_NOATIME
Do not update the file access time when the file is read.
Expand Down
28 changes: 28 additions & 0 deletions deps/uv/docs/src/misc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,17 @@ Data types
char machine[256];
} uv_utsname_t;

.. c:type:: uv_env_item_t
Data type for environment variable storage.

::

typedef struct uv_env_item_s {
char* name;
char* value;
} uv_env_item_t;


API
---
Expand Down Expand Up @@ -523,6 +534,23 @@ API
.. versionadded:: 1.8.0
.. c:function:: int uv_os_environ(uv_env_item_t** envitems, int* count)
Retrieves all environment variables. This function will allocate memory
which must be freed by calling :c:func:`uv_os_free_environ`.
.. warning::
This function is not thread safe.
.. versionadded:: 1.31.0
.. c:function:: void uv_os_free_environ(uv_env_item_t* envitems, int count);
Frees the memory allocated for the environment variables by
:c:func:`uv_os_environ`.

.. versionadded:: 1.31.0

.. c:function:: int uv_os_getenv(const char* name, char* buffer, size_t* size)
Retrieves the environment variable specified by `name`, copies its value
Expand Down
27 changes: 26 additions & 1 deletion deps/uv/include/uv.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,13 @@ typedef struct uv_fs_s uv_fs_t;
typedef struct uv_work_s uv_work_t;

/* None of the above. */
typedef struct uv_env_item_s uv_env_item_t;
typedef struct uv_cpu_info_s uv_cpu_info_t;
typedef struct uv_interface_address_s uv_interface_address_t;
typedef struct uv_dirent_s uv_dirent_t;
typedef struct uv_passwd_s uv_passwd_t;
typedef struct uv_utsname_s uv_utsname_t;
typedef struct uv_statfs_s uv_statfs_t;

typedef enum {
UV_LOOP_BLOCK_SIGNAL
Expand Down Expand Up @@ -1070,6 +1072,17 @@ struct uv_utsname_s {
to as meaningless in the docs. */
};

struct uv_statfs_s {
uint64_t f_type;
uint64_t f_bsize;
uint64_t f_blocks;
uint64_t f_bfree;
uint64_t f_bavail;
uint64_t f_files;
uint64_t f_ffree;
uint64_t f_spare[4];
};

typedef enum {
UV_DIRENT_UNKNOWN,
UV_DIRENT_FILE,
Expand Down Expand Up @@ -1150,6 +1163,13 @@ UV_EXTERN int uv_interface_addresses(uv_interface_address_t** addresses,
UV_EXTERN void uv_free_interface_addresses(uv_interface_address_t* addresses,
int count);

struct uv_env_item_s {
char* name;
char* value;
};

UV_EXTERN int uv_os_environ(uv_env_item_t** envitems, int* count);
UV_EXTERN void uv_os_free_environ(uv_env_item_t* envitems, int count);
UV_EXTERN int uv_os_getenv(const char* name, char* buffer, size_t* size);
UV_EXTERN int uv_os_setenv(const char* name, const char* value);
UV_EXTERN int uv_os_unsetenv(const char* name);
Expand Down Expand Up @@ -1205,7 +1225,8 @@ typedef enum {
UV_FS_LCHOWN,
UV_FS_OPENDIR,
UV_FS_READDIR,
UV_FS_CLOSEDIR
UV_FS_CLOSEDIR,
UV_FS_STATFS
} uv_fs_type;

struct uv_dir_s {
Expand Down Expand Up @@ -1433,6 +1454,10 @@ UV_EXTERN int uv_fs_lchown(uv_loop_t* loop,
uv_uid_t uid,
uv_gid_t gid,
uv_fs_cb cb);
UV_EXTERN int uv_fs_statfs(uv_loop_t* loop,
uv_fs_t* req,
const char* path,
uv_fs_cb cb);


enum uv_fs_event {
Expand Down
6 changes: 4 additions & 2 deletions deps/uv/include/uv/unix.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
# include "uv/linux.h"
#elif defined (__MVS__)
# include "uv/os390.h"
#elif defined(__PASE__) /* __PASE__ and _AIX are both defined on IBM i */
# include "uv/posix.h" /* IBM i needs uv/posix.h, not uv/aix.h */
#elif defined(_AIX)
# include "uv/aix.h"
#elif defined(__sun)
Expand All @@ -61,8 +63,7 @@
defined(__OpenBSD__) || \
defined(__NetBSD__)
# include "uv/bsd.h"
#elif defined(__PASE__) || \
defined(__CYGWIN__) || \
#elif defined(__CYGWIN__) || \
defined(__MSYS__) || \
defined(__GNU__)
# include "uv/posix.h"
Expand Down Expand Up @@ -481,6 +482,7 @@ typedef struct {
#endif

/* fs open() flags supported on other platforms: */
#define UV_FS_O_FILEMAP 0
#define UV_FS_O_RANDOM 0
#define UV_FS_O_SHORT_LIVED 0
#define UV_FS_O_SEQUENTIAL 0
Expand Down
4 changes: 2 additions & 2 deletions deps/uv/include/uv/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
*/

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

Expand Down
1 change: 1 addition & 0 deletions deps/uv/include/uv/win.h
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,7 @@ typedef struct {
#define UV_FS_O_APPEND _O_APPEND
#define UV_FS_O_CREAT _O_CREAT
#define UV_FS_O_EXCL _O_EXCL
#define UV_FS_O_FILEMAP 0x20000000
#define UV_FS_O_RANDOM _O_RANDOM
#define UV_FS_O_RDONLY _O_RDONLY
#define UV_FS_O_RDWR _O_RDWR
Expand Down
Loading

0 comments on commit 794abbc

Please sign in to comment.