Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
deps: update libuv to 1.0.0
Browse files Browse the repository at this point in the history
PR-URL: #8762
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
  • Loading branch information
saghul authored and trevnorris committed Nov 26, 2014
1 parent 2d17193 commit 9d9ed61
Show file tree
Hide file tree
Showing 26 changed files with 269 additions and 222 deletions.
5 changes: 5 additions & 0 deletions deps/uv/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,8 @@ Jeff Widman <jeff@jeffwidman.com>
cjihrig <cjihrig@gmail.com>
Tomasz Kołodziejski <tkolodziejski@mozilla.com>
Unknown W. Brackets <checkins@unknownbrackets.org>
Emmanuel Odeke <odeke@ualberta.ca>
Mikhail Mukovnikov <yndi@me.com>
Thorsten Lorenz <thlorenz@gmx.de>
Yuri D'Elia <yuri.delia@eurac.edu>
Manos Nikolaidis <manos@shadowrobot.com>
32 changes: 32 additions & 0 deletions deps/uv/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,35 @@
2014.11.21, Version 1.0.0 (Stable)

Changes since version 1.0.0-rc2:

* doc: fix git/svn url for gyp repo in README (Emmanuel Odeke)

* windows: fix fs_read with nbufs > 1 and offset (Unknown W. Brackets)

* win: add missing IP_ADAPTER_UNICAST_ADDRESS_LH definition for MinGW
(huxingyi)

* doc: mention homebrew in README (Mikhail Mukovnikov)

* doc: add learnuv workshop to README (Thorsten Lorenz)

* doc: fix parameter name in uv_fs_access (Saúl Ibarra Corretgé)

* unix: use cfmakeraw() for setting raw TTY mode (Yuri D'Elia)

* win: fix uv_thread_self() (Alexis Campailla)

* build: add x32 support to gyp build (Ben Noordhuis)

* build: remove dtrace probes (Ben Noordhuis)

* doc: fix link in misc.rst (Manos Nikolaidis)

* mailmap: remove duplicated entries (Saúl Ibarra Corretgé)

* gyp: fix comment regarding version info location (Saúl Ibarra Corretgé)


2014.10.21, Version 1.0.0-rc2 (Pre-release)

Changes since version 1.0.0-rc1:
Expand Down
40 changes: 1 addition & 39 deletions deps/uv/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ test_run_tests_SOURCES = test/blackhole-server.c \
test/test-tcp-writealot.c \
test/test-tcp-try-write.c \
test/test-tcp-write-queue-order.c \
test/test-thread-equal.c \
test/test-thread.c \
test/test-threadpool-cancel.c \
test/test-threadpool.c \
Expand Down Expand Up @@ -306,46 +307,7 @@ libuv_la_CFLAGS += -D__EXTENSIONS__ -D_XOPEN_SOURCE=500
libuv_la_SOURCES += src/unix/sunos.c
endif

if HAVE_DTRACE
BUILT_SOURCES = include/uv-dtrace.h
CLEANFILES += include/uv-dtrace.h
if FREEBSD
libuv_la_LDFLAGS += -lelf
endif
endif

if DTRACE_NEEDS_OBJECTS
libuv_la_SOURCES += src/unix/uv-dtrace.d
libuv_la_DEPENDENCIES = src/unix/uv-dtrace.o
libuv_la_LIBADD = uv-dtrace.lo
CLEANFILES += src/unix/uv-dtrace.o src/unix/uv-dtrace.lo
endif

if HAVE_PKG_CONFIG
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = @PACKAGE_NAME@.pc
endif

if HAVE_DTRACE
include/uv-dtrace.h: src/unix/uv-dtrace.d
$(AM_V_GEN)$(DTRACE) $(DTRACEFLAGS) -h -xnolibs -s $< -o $(top_srcdir)/$@
endif

if DTRACE_NEEDS_OBJECTS
SUFFIXES = .d

src/unix/uv-dtrace.o: src/unix/uv-dtrace.d ${libuv_la_OBJECTS}

# It's ok to specify the output here, because we have 1 .d file, and we process
# every created .o, most projects don't need to include more than one .d
.d.o:
$(AM_V_GEN)$(DTRACE) $(DTRACEFLAGS) -G -o $(top_builddir)/uv-dtrace.o -s $< \
`find ${top_builddir}/src -name "*.o"`
$(AM_V_GEN)printf %s\\n \
'# ${top_builddir}/uv-dtrace.lo - a libtool object file' \
'# Generated by libtool (GNU libtool) 2.4' \
'# libtool wants a .lo not a .o' \
"pic_object='uv-dtrace.o'" \
"non_pic_object='uv-dtrace.o'" \
> ${top_builddir}/uv-dtrace.lo
endif
16 changes: 12 additions & 4 deletions deps/uv/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

libuv is a multi-platform support library with a focus on asynchronous I/O. It
was primarily developed for use by [Node.js](http://nodejs.org), but it's also
used by Mozilla's [Rust language](http://www.rust-lang.org/),
[Luvit](http://luvit.io/), [Julia](http://julialang.org/),
used by [Luvit](http://luvit.io/), [Julia](http://julialang.org/),
[pyuv](https://github.com/saghul/pyuv), and [others](https://github.com/joyent/libuv/wiki/Projects-that-use-libuv).

## Feature highlights
Expand Down Expand Up @@ -82,6 +81,8 @@ Documentation can be browsed online [here](http://docs.libuv.org).
&mdash; API specification and usage examples.
* [libuv-dox](https://github.com/thlorenz/libuv-dox)
&mdash; Documenting types and methods of libuv, mostly by reading uv.h.
* [learnuv](https://github.com/thlorenz/learnuv)
&mdash; Learn uv for fun and profit, a self guided workshop to libuv.

## Build Instructions

Expand Down Expand Up @@ -110,8 +111,9 @@ generate uv.sln as well as related project files.
To have GYP generate build script for another system, checkout GYP into the
project tree manually:

$ mkdir -p build
$ git clone https://git.chromium.org/external/gyp.git build/gyp
$ git clone https://chromium.googlesource.com/external/gyp.git build/gyp
OR
$ svn co http://gyp.googlecode.com/svn/trunk build/gyp

### Unix

Expand All @@ -120,6 +122,8 @@ Run:
$ ./gyp_uv.py -f make
$ make -C out

Run `./gyp_uv.py -f make -Dtarget_arch=x32` to build [x32][] binaries.

### OS X

Run:
Expand All @@ -128,6 +132,10 @@ Run:
$ xcodebuild -ARCHS="x86_64" -project uv.xcodeproj \
-configuration Release -target All

Using Homebrew:

$ brew install --HEAD libuv

Note to OS X users:

Make sure that you specify the architecture you wish to build for in the
Expand Down
4 changes: 4 additions & 0 deletions deps/uv/common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@
'cflags': [ '-m32' ],
'ldflags': [ '-m32' ],
}],
[ 'target_arch=="x32"', {
'cflags': [ '-mx32' ],
'ldflags': [ '-mx32' ],
}],
[ 'OS=="linux"', {
'cflags': [ '-ansi' ],
}],
Expand Down
3 changes: 1 addition & 2 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.0.0-rc2], [https://github.com/joyent/libuv/issues])
AC_INIT([libuv], [1.0.0], [https://github.com/joyent/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 @@ -50,7 +50,6 @@ AM_CONDITIONAL([NETBSD], [AS_CASE([$host_os],[netbsd*], [true], [false])
AM_CONDITIONAL([OPENBSD], [AS_CASE([$host_os],[openbsd*], [true], [false])])
AM_CONDITIONAL([SUNOS], [AS_CASE([$host_os],[solaris*], [true], [false])])
AM_CONDITIONAL([WINNT], [AS_CASE([$host_os],[mingw*], [true], [false])])
PANDORA_ENABLE_DTRACE
AC_CHECK_PROG(PKG_CONFIG, pkg-config, yes)
AM_CONDITIONAL([HAVE_PKG_CONFIG], [test "x$PKG_CONFIG" != "x"])
AS_IF([test "x$PKG_CONFIG" != "x"], [
Expand Down
2 changes: 1 addition & 1 deletion deps/uv/docs/src/fs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ API
Limited equivalent to ``sendfile(2)``.
.. c:function:: int uv_fs_access(uv_loop_t* loop, uv_fs_t* req, const char* path, int flags, uv_fs_cb cb)
.. c:function:: int uv_fs_access(uv_loop_t* loop, uv_fs_t* req, const char* path, int mode, uv_fs_cb cb)
Equivalent to ``access(2)`` on Unix. Windows uses ``GetFileAttributesW()``.
Expand Down
5 changes: 2 additions & 3 deletions deps/uv/docs/src/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@ Overview
--------

libuv is a multi-platform support library with a focus on asynchronous I/O. It
was primarily developed for use by `Node.js`_, but it's also used by Mozilla's
`Rust language`_, `Luvit`_, `Julia`_, `pyuv`_, and `others`_.
was primarily developed for use by `Node.js`_, but it's also used by `Luvit`_,
`Julia`_, `pyuv`_, and `others`_.

.. note::
In case you find errors in this documentation you can help by sending
`pull requests <https://github.com/joyent/libuv>`_!

.. _Node.js: http://nodejs.org
.. _Rust language: http://www.rust-lang.org
.. _Luvit: http://luvit.io
.. _Julia: http://julialang.org
.. _pyuv: https://github.com/saghul/pyuv
Expand Down
2 changes: 1 addition & 1 deletion deps/uv/docs/src/misc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ API
.. c:function:: void uv_loadavg(double avg[3])
Gets the load average. See: http://en.wikipedia.org/wiki/Load_(computing)
Gets the load average. See: `<http://en.wikipedia.org/wiki/Load_(computing)>`_
.. note::
Returns [0,0,0] on Windows (i.e., it's not implemented).
Expand Down
3 changes: 2 additions & 1 deletion deps/uv/docs/src/threading.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ Threads
^^^^^^^

.. c:function:: int uv_thread_create(uv_thread_t* tid, uv_thread_cb entry, void* arg)
.. c:function:: unsigned long uv_thread_self(void)
.. c:function:: uv_thread_t uv_thread_self(void)
.. c:function:: int uv_thread_join(uv_thread_t *tid)
.. c:function:: int uv_thread_equal(const uv_thread_t* t1, const uv_thread_t* t2)
Thread-local storage
^^^^^^^^^^^^^^^^^^^^
Expand Down
2 changes: 1 addition & 1 deletion deps/uv/include/uv-version.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@
#define UV_VERSION_MINOR 0
#define UV_VERSION_PATCH 0
#define UV_VERSION_IS_RELEASE 1
#define UV_VERSION_SUFFIX "rc2"
#define UV_VERSION_SUFFIX ""

#endif /* UV_VERSION_H */
5 changes: 3 additions & 2 deletions deps/uv/include/uv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1138,7 +1138,7 @@ UV_EXTERN int uv_fs_sendfile(uv_loop_t* loop,
UV_EXTERN int uv_fs_access(uv_loop_t* loop,
uv_fs_t* req,
const char* path,
int flags,
int mode,
uv_fs_cb cb);
UV_EXTERN int uv_fs_chmod(uv_loop_t* loop,
uv_fs_t* req,
Expand Down Expand Up @@ -1369,8 +1369,9 @@ UV_EXTERN void uv_key_set(uv_key_t* key, void* value);
typedef void (*uv_thread_cb)(void* arg);

UV_EXTERN int uv_thread_create(uv_thread_t* tid, uv_thread_cb entry, void* arg);
UV_EXTERN unsigned long uv_thread_self(void);
UV_EXTERN uv_thread_t uv_thread_self(void);
UV_EXTERN int uv_thread_join(uv_thread_t *tid);
UV_EXTERN int uv_thread_equal(const uv_thread_t* t1, const uv_thread_t* t2);

/* The presence of these unions force similar struct layout. */
#define XX(_, name) uv_ ## name ## _t name;
Expand Down
3 changes: 1 addition & 2 deletions deps/uv/m4/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Ignore libtoolize-generated files.
*.m4
!as_case.m4
!dtrace.m4
!libuv-check-flags.m4
!libuv-check-flags.m4
3 changes: 0 additions & 3 deletions deps/uv/src/unix/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,6 @@ int uv_run(uv_loop_t* loop, uv_run_mode mode) {
uv__update_time(loop);

while (r != 0 && loop->stop_flag == 0) {
UV_TICK_START(loop, mode);

uv__update_time(loop);
uv__run_timers(loop);
uv__run_pending(loop);
Expand Down Expand Up @@ -340,7 +338,6 @@ int uv_run(uv_loop_t* loop, uv_run_mode mode) {
}

r = uv__loop_alive(loop);
UV_TICK_STOP(loop, mode);

if (mode & (UV_RUN_ONCE | UV_RUN_NOWAIT))
break;
Expand Down
8 changes: 0 additions & 8 deletions deps/uv/src/unix/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -306,12 +306,4 @@ UV_UNUSED(static char* uv__basename_r(const char* path)) {
return s + 1;
}


#ifdef HAVE_DTRACE
#include "uv-dtrace.h"
#else
#define UV_TICK_START(arg0, arg1)
#define UV_TICK_STOP(arg0, arg1)
#endif

#endif /* UV_UNIX_INTERNAL_H_ */
50 changes: 50 additions & 0 deletions deps/uv/src/unix/thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,61 @@
#undef NANOSEC
#define NANOSEC ((uint64_t) 1e9)


struct thread_ctx {
void (*entry)(void* arg);
void* arg;
};


static void* uv__thread_start(void *arg)
{
struct thread_ctx *ctx_p;
struct thread_ctx ctx;

ctx_p = arg;
ctx = *ctx_p;
free(ctx_p);
ctx.entry(ctx.arg);

return 0;
}


int uv_thread_create(uv_thread_t *tid, void (*entry)(void *arg), void *arg) {
struct thread_ctx* ctx;
int err;

ctx = malloc(sizeof(*ctx));
if (ctx == NULL)
return UV_ENOMEM;

ctx->entry = entry;
ctx->arg = arg;

err = pthread_create(tid, NULL, uv__thread_start, ctx);

if (err)
free(ctx);

return err ? -1 : 0;
}


uv_thread_t uv_thread_self(void) {
return pthread_self();
}

int uv_thread_join(uv_thread_t *tid) {
return -pthread_join(*tid, NULL);
}


int uv_thread_equal(const uv_thread_t* t1, const uv_thread_t* t2) {
return pthread_equal(*t1, *t2);
}


int uv_mutex_init(uv_mutex_t* mutex) {
#if defined(NDEBUG) || !defined(PTHREAD_MUTEX_ERRORCHECK)
return -pthread_mutex_init(mutex, NULL);
Expand Down
7 changes: 1 addition & 6 deletions deps/uv/src/unix/tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,7 @@ int uv_tty_set_mode(uv_tty_t* tty, int mode) {
uv_spinlock_unlock(&termios_spinlock);

raw = tty->orig_termios;
raw.c_iflag &= ~(BRKINT | ICRNL | INPCK | ISTRIP | IXON);
raw.c_oflag |= (ONLCR);
raw.c_cflag |= (CS8);
raw.c_lflag &= ~(ECHO | ICANON | IEXTEN | ISIG);
raw.c_cc[VMIN] = 1;
raw.c_cc[VTIME] = 0;
cfmakeraw(&raw);

This comment has been minimized.

Copy link
@trevnorris

trevnorris Dec 4, 2014

@saghul This change has borked Node's REPL indentation. Each line is further indented than the last.

/cc @indutny @tjfontaine

This comment has been minimized.

Copy link
@saghul

saghul via email Dec 5, 2014

Author Member

This comment has been minimized.

Copy link
@saghul

saghul Dec 5, 2014

Author Member

@trevnorris I can confirm that with libuv/libuv@484a3a9 the REPL works again. We can make a libuv 1.0.2 release if it's needed for node 0.12, no problem.

This comment has been minimized.

Copy link
@saghul

saghul Dec 5, 2014

Author Member

On a related note, I wonder if this could have been detected with a test. The entire Node test suite passed for me :-/

This comment has been minimized.

Copy link
@trevnorris

trevnorris Dec 9, 2014

@saghul A proper test does seem appropriate. I'll take a look at adding one.


/* Put terminal in raw mode after draining */
if (tcsetattr(fd, TCSADRAIN, &raw))
Expand Down
Loading

0 comments on commit 9d9ed61

Please sign in to comment.