diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000..595409cefd --- /dev/null +++ b/.travis.yml @@ -0,0 +1,14 @@ +language: node_js + +before_script: + - "./configure" + - "make" + +script: + - "make test" + +notifications: + email: false + irc: + - "irc.freenode.net#libuv" + diff --git a/ChangeLog b/ChangeLog index 06a9a4ff2c..9a544f0ea1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2011.12.04, Version 0.6.5 (stable) + +* npm workaround Windows antivirus software (isaacs) + +* Upgrade V8 to 3.6.6.11 + + 2011.12.02, Version 0.6.4 (stable), 9170077f13e5e5475b23d1d3c2e7f69bfe139727 * doc improvements (Kyle Young, Tim Oxley, Roman Shtylman, Mathias Bynens) diff --git a/LICENSE b/LICENSE index 204ff4b93d..c655cbaf9c 100644 --- a/LICENSE +++ b/LICENSE @@ -79,8 +79,8 @@ The externally maintained libraries used by Node are: licensed under a permissive free software license. See deps/zlib/LICENSE. - - deps/npm NPM is a package manager program copyright 2009, 2010, 2011 - Isaac Z. Schlueter and licensed under MIT. NPM includes several + - deps/npm npm is a package manager program copyright 2009, 2010, 2011 + Isaac Z. Schlueter and licensed under MIT. npm includes several subpackages MIT or Apache licenses, see deps/npm/LICENSE for more - information. NPM is included in the Node .msi and .pkg distributions + information. npm is included in the Node .msi and .pkg distributions but not in the Node binary itself. diff --git a/README.md b/README.md index d58837ed1a..c167589578 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -Evented I/O for V8 javascript. +Evented I/O for V8 javascript. [![Build Status](https://secure.travis-ci.org/joyent/node.png)](http://travis-ci.org/joyent/node) === ### To build: diff --git a/deps/npm/lib/utils/tar.js b/deps/npm/lib/utils/tar.js index 1fe705377e..2c2b96f9a6 100644 --- a/deps/npm/lib/utils/tar.js +++ b/deps/npm/lib/utils/tar.js @@ -144,7 +144,8 @@ function unpack_ ( tarball, unpackTarget, dMode, fMode, uid, gid, cb ) { rm(unpackTarget, function (er) { if (er) return cb(er) log.verbose(unpackTarget, "rm'ed") - fs.rename(folder, unpackTarget, function (er) { + + moveIntoPlace(folder, unpackTarget, function (er) { if (er) return cb(er) log.verbose([folder, unpackTarget], "renamed") // curse you, nfs! It will lie and tell you that the @@ -161,6 +162,24 @@ function unpack_ ( tarball, unpackTarget, dMode, fMode, uid, gid, cb ) { }) } +// on Windows, A/V software can lock the directory, causing this +// to fail with an EACCES. Try again on failure, for up to 1 second. +// XXX Fix this by not unpacking into a temp directory, instead just +// renaming things on the way out of the tarball. +function moveIntoPlace (folder, unpackTarget, cb) { + var start = Date.now() + fs.rename(folder, unpackTarget, function CB (er) { + if (er + && process.platform === "win32" + && er.code === "EACCES" + && Date.now() - start < 1000) { + return fs.rename(folder, unpackTarget, CB) + } + cb(er) + }) +} + + function gunzTarPerm (tarball, tmp, dMode, fMode, uid, gid, cb) { if (!dMode) dMode = npm.modes.exec if (!fMode) fMode = npm.modes.file diff --git a/deps/uv/src/unix/core.c b/deps/uv/src/unix/core.c index 000f33cd66..78bf490878 100644 --- a/deps/uv/src/unix/core.c +++ b/deps/uv/src/unix/core.c @@ -169,7 +169,15 @@ uv_loop_t* uv_loop_new(void) { void uv_loop_delete(uv_loop_t* loop) { uv_ares_destroy(loop, loop->channel); ev_loop_destroy(loop->ev); - free(loop); + +#ifndef NDEBUG + memset(loop, 0, sizeof *loop); +#endif + + if (loop == default_loop_ptr) + default_loop_ptr = NULL; + else + free(loop); } diff --git a/deps/uv/src/unix/error.c b/deps/uv/src/unix/error.c index 5f43709d75..e904d39033 100644 --- a/deps/uv/src/unix/error.c +++ b/deps/uv/src/unix/error.c @@ -82,6 +82,7 @@ uv_err_code uv_translate_sys_error(int sys_errno) { case EHOSTUNREACH: return UV_EHOSTUNREACH; case EAI_NONAME: return UV_ENOENT; case ESRCH: return UV_ESRCH; + case ETIMEDOUT: return UV_ETIMEDOUT; default: return UV_UNKNOWN; } diff --git a/deps/v8/test/mjsunit/mjsunit.status b/deps/v8/test/mjsunit/mjsunit.status index cdac99b23d..b77ebca66a 100644 --- a/deps/v8/test/mjsunit/mjsunit.status +++ b/deps/v8/test/mjsunit/mjsunit.status @@ -34,6 +34,10 @@ bugs: FAIL # Fails. regress/regress-1119: FAIL +############################################################################# +# Fails due to r10102 which reverts precise stepping on the 3.6 branch. +debug-step-2: FAIL + ############################################################################## # Issue 1845: http://code.google.com/p/v8/issues/detail?id=1845 diff --git a/doc/index.html b/doc/index.html index 384a8bf877..d0829b83a3 100644 --- a/doc/index.html +++ b/doc/index.html @@ -26,7 +26,7 @@
  • Download
  • ChangeLog
  • About
  • -
  • v0.6.4 docs
  • +
  • v0.6.5 docs

  • Wiki
  • Blog
  • @@ -105,14 +105,15 @@ server.listen(1337, "127.0.0.1");

    Download

    -

    2011.12.02 v0.6.4 +

    2011.12.04 v0.6.5

    diff --git a/doc/template.html b/doc/template.html index c367bb48d4..377cae8b3c 100644 --- a/doc/template.html +++ b/doc/template.html @@ -2,7 +2,7 @@ - {{section}}Node.js v0.6.4 Manual & Documentation + {{section}}Node.js v0.6.5 Manual & Documentation @@ -10,7 +10,7 @@
    -

    Node.js v0.6.4 Manual & Documentation

    +

    Node.js v0.6.5 Manual & Documentation

    @@ -21,5 +21,16 @@ + + + diff --git a/doc/v0.4_announcement.html b/doc/v0.4_announcement.html index 8ecda802cc..7d68376bcd 100644 --- a/doc/v0.4_announcement.html +++ b/doc/v0.4_announcement.html @@ -43,7 +43,7 @@
  • With a good amount of experience now, some modifications to the module loading system were made to better support package managers. - In particular, NPM was forced to resort to deep symlinks and "shim" + In particular, npm was forced to resort to deep symlinks and "shim" modules to work around missing features in require(). The main changes are:
      diff --git a/lib/child_process.js b/lib/child_process.js index 1eba363fdc..dcff85ab3e 100644 --- a/lib/child_process.js +++ b/lib/child_process.js @@ -33,7 +33,7 @@ var Pipe; function createPipe(ipc) { // Lazy load if (!Pipe) { - Pipe = new process.binding('pipe_wrap').Pipe; + Pipe = process.binding('pipe_wrap').Pipe; } return new Pipe(ipc); diff --git a/lib/net.js b/lib/net.js index b06a78d255..19858e80df 100644 --- a/lib/net.js +++ b/lib/net.js @@ -101,7 +101,7 @@ function Socket(options) { if (typeof options == 'number') { // Legacy interface. - // Must support legacy interface. NPM depends on it. + // Must support legacy interface. Old versions of npm depend on it. // https://github.com/isaacs/npm/blob/c7824f412f0cb59d6f55cf0bc220253c39e6029f/lib/utils/output.js#L110 var fd = options; @@ -194,13 +194,25 @@ Object.defineProperty(Socket.prototype, 'bufferSize', { Socket.prototype.pause = function() { - this._handle.readStop(); + if (this._handle) { + this._handle.readStop(); + + // this adds an undesireable boundary crossing for pipe streams. + // the .unref() method is omitted on TCP streams, because it is + // unnecessary. + if (this._handle.unref) this._handle.unref(); + } }; Socket.prototype.resume = function() { if (this._handle) { this._handle.readStart(); + + // this adds an undesireable boundary crossing for pipe streams. + // the .ref() method is omitted on TCP streams, because it is + // unnecessary. + if (this._handle.ref) this._handle.ref(); } }; diff --git a/lib/tty.js b/lib/tty.js index 78971dda31..32ba512d52 100644 --- a/lib/tty.js +++ b/lib/tty.js @@ -83,8 +83,19 @@ function ReadStream(fd) { this.on('newListener', onNewListener); } inherits(ReadStream, net.Socket); + exports.ReadStream = ReadStream; +ReadStream.prototype.pause = function() { + this._handle.unref(); + return net.Socket.prototype.pause.call(this); +}; + +ReadStream.prototype.resume = function() { + this._handle.ref(); + return net.Socket.prototype.resume.call(this); +}; + ReadStream.prototype.isTTY = true; diff --git a/src/handle_wrap.cc b/src/handle_wrap.cc index 6e07643893..5b6594a3a9 100644 --- a/src/handle_wrap.cc +++ b/src/handle_wrap.cc @@ -64,8 +64,10 @@ Handle HandleWrap::Unref(const Arguments& args) { UNWRAP - // Calling this function twice should never happen. - assert(wrap->unref == false); + // Calling unnecessarily is a no-op + if (wrap->unref) { + return v8::Undefined(); + } wrap->unref = true; uv_unref(uv_default_loop()); @@ -74,6 +76,24 @@ Handle HandleWrap::Unref(const Arguments& args) { } +// Adds a reference to keep uv alive because of this thing. +Handle HandleWrap::Ref(const Arguments& args) { + HandleScope scope; + + UNWRAP + + // Calling multiple times is a no-op + if (!wrap->unref) { + return v8::Undefined(); + } + + wrap->unref = false; + uv_ref(uv_default_loop()); + + return v8::Undefined(); +} + + Handle HandleWrap::Close(const Arguments& args) { HandleScope scope; @@ -82,10 +102,8 @@ Handle HandleWrap::Close(const Arguments& args) { assert(!wrap->object_.IsEmpty()); uv_close(wrap->handle__, OnClose); - if (wrap->unref) { - uv_ref(uv_default_loop()); - wrap->unref = false; - } + + HandleWrap::Ref(args); wrap->StateChange(); diff --git a/src/handle_wrap.h b/src/handle_wrap.h index fc6d623ac6..b9cf31e8eb 100644 --- a/src/handle_wrap.h +++ b/src/handle_wrap.h @@ -49,6 +49,7 @@ class HandleWrap { static void Initialize(v8::Handle target); static v8::Handle Close(const v8::Arguments& args); static v8::Handle Unref(const v8::Arguments& args); + static v8::Handle Ref(const v8::Arguments& args); protected: HandleWrap(v8::Handle object, uv_handle_t* handle); diff --git a/src/node.cc b/src/node.cc index 5402069aee..d0c540ff96 100644 --- a/src/node.cc +++ b/src/node.cc @@ -2217,8 +2217,12 @@ static void PrintHelp() { " --vars print various compiled-in variables\n" " --max-stack-size=val set max v8 stack size (bytes)\n" "\n" - "Enviromental variables:\n" + "Environment variables:\n" +#ifdef _WIN32 + "NODE_PATH ';'-separated list of directories\n" +#else "NODE_PATH ':'-separated list of directories\n" +#endif " prefixed to the module search path.\n" "NODE_MODULE_CONTEXTS Set to 1 to load modules in their own\n" " global contexts.\n" diff --git a/src/node.js b/src/node.js index 53e0c489c6..5e7ae12061 100644 --- a/src/node.js +++ b/src/node.js @@ -336,8 +336,13 @@ }; startup.processKillAndExit = function() { + var exiting = false; + process.exit = function(code) { - process.emit('exit', code || 0); + if (!exiting) { + exiting = true; + process.emit('exit', code || 0); + } process.reallyExit(code || 0); }; diff --git a/src/pipe_wrap.cc b/src/pipe_wrap.cc index a2a4203a80..1870837bca 100644 --- a/src/pipe_wrap.cc +++ b/src/pipe_wrap.cc @@ -85,6 +85,7 @@ void PipeWrap::Initialize(Handle target) { NODE_SET_PROTOTYPE_METHOD(t, "close", HandleWrap::Close); NODE_SET_PROTOTYPE_METHOD(t, "unref", HandleWrap::Unref); + NODE_SET_PROTOTYPE_METHOD(t, "ref", HandleWrap::Ref); NODE_SET_PROTOTYPE_METHOD(t, "readStart", StreamWrap::ReadStart); NODE_SET_PROTOTYPE_METHOD(t, "readStop", StreamWrap::ReadStop); diff --git a/src/tty_wrap.cc b/src/tty_wrap.cc index b46e6c4e1f..486c2a70b4 100644 --- a/src/tty_wrap.cc +++ b/src/tty_wrap.cc @@ -69,6 +69,7 @@ class TTYWrap : StreamWrap { NODE_SET_PROTOTYPE_METHOD(t, "close", HandleWrap::Close); NODE_SET_PROTOTYPE_METHOD(t, "unref", HandleWrap::Unref); + NODE_SET_PROTOTYPE_METHOD(t, "ref", HandleWrap::Ref); NODE_SET_PROTOTYPE_METHOD(t, "readStart", StreamWrap::ReadStart); NODE_SET_PROTOTYPE_METHOD(t, "readStop", StreamWrap::ReadStop); diff --git a/test/simple/test-fs-long-path.js b/test/simple/test-fs-long-path.js index dfd68802a9..2ae80d0edb 100644 --- a/test/simple/test-fs-long-path.js +++ b/test/simple/test-fs-long-path.js @@ -19,6 +19,7 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. +var common = require('../common'); var fs = require('fs'); var path = require('path'); var assert = require('assert'); @@ -26,9 +27,8 @@ var assert = require('assert'); var successes = 0; // make a path that will be at least 260 chars long. -var cwd = process.cwd(); -var fileNameLen = Math.max(260 - cwd.length - 1, 1); -var fileName = new Array(fileNameLen + 1).join('x'); +var fileNameLen = Math.max(260 - common.tmpDir.length - 1, 1); +var fileName = path.join(common.tmpDir, new Array(fileNameLen + 1).join('x')); var fullPath = path.resolve(fileName); console.log({ filenameLength: fileName.length, diff --git a/test/simple/test-process-exit.js b/test/simple/test-process-exit.js new file mode 100644 index 0000000000..59e9cbd155 --- /dev/null +++ b/test/simple/test-process-exit.js @@ -0,0 +1,32 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +var assert = require('assert'); + +// recursively calling .exit() should not overflow the call stack +var nexits = 0; + +process.on('exit', function() { + assert.equal(nexits++, 0); + process.exit(); +}); + +process.exit(); diff --git a/test/simple/test-setproctitle.js b/test/simple/test-setproctitle.js index 4276d2d366..0bf6fd35c3 100644 --- a/test/simple/test-setproctitle.js +++ b/test/simple/test-setproctitle.js @@ -22,7 +22,7 @@ // Original test written by Jakub Lekstan // FIXME add sunos support -if ('linux darwin freebsd'.indexOf(process.platform) === -1) { +if ('linux freebsd'.indexOf(process.platform) === -1) { console.error("Skipping test, platform not supported."); process.exit(); } diff --git a/test/simple/test-stdin-child-proc.js b/test/simple/test-stdin-child-proc.js new file mode 100644 index 0000000000..6c499995d2 --- /dev/null +++ b/test/simple/test-stdin-child-proc.js @@ -0,0 +1,27 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// This tests that pausing and resuming stdin does not hang and timeout +// when done in a child process. See test/simple/test-stdin-pause-resume.js +var child_process = require('child_process'); +var path = require('path'); +child_process.spawn(process.execPath, + [ path.resolve(__dirname, 'test-stdin-pause-resume.js') ]); diff --git a/test/simple/test-stdin-pause-resume.js b/test/simple/test-stdin-pause-resume.js new file mode 100644 index 0000000000..cfa44bae2c --- /dev/null +++ b/test/simple/test-stdin-pause-resume.js @@ -0,0 +1,37 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +console.error("before opening stdin"); +process.stdin.resume(); +console.error("stdin opened"); +setTimeout(function() { + console.error("pausing stdin"); + process.stdin.pause(); + setTimeout(function() { + console.error("opening again"); + process.stdin.resume(); + setTimeout(function() { + console.error("pausing again"); + process.stdin.pause(); + console.error("should exit now"); + }, 1); + }, 1); +}, 1); diff --git a/tools/osx-pkg.pmdoc/index.xml b/tools/osx-pkg.pmdoc/index.xml index d805747fcf..4ba2725c19 100644 --- a/tools/osx-pkg.pmdoc/index.xml +++ b/tools/osx-pkg.pmdoc/index.xml @@ -12,8 +12,8 @@ \ /usr/local/bin/node\ \ -NPM was installed at\ +npm was installed at\ \ /usr/local/bin/npm\ \ -Make sure that /usr/local/bin is in your $PATH.}]]>01local.xml02npm.xmlproperties.titleproperties.userDomainproperties.anywhereDomainproperties.systemDomain \ No newline at end of file +Make sure that /usr/local/bin is in your $PATH.}]]>01local.xml02npm.xmlproperties.titleproperties.userDomainproperties.anywhereDomainproperties.systemDomain diff --git a/wscript b/wscript index 52c5edceeb..0d922e6632 100644 --- a/wscript +++ b/wscript @@ -980,7 +980,7 @@ def install_npm(bld): start_dir = bld.path.find_dir('deps/npm') # The chmod=-1 is a Node hack. We changed WAF so that when chmod was set to # -1 that the same permission in this tree are used. Necessary to get - # npm-cli.js to be executable without having to list every file in NPM. + # npm-cli.js to be executable without having to list every file in npm. bld.install_files('${LIBDIR}/node_modules/npm', start_dir.ant_glob('**/*'), cwd=start_dir,