Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'upstream/v10.x' into v10.x
Browse files Browse the repository at this point in the history
  • Loading branch information
kfarnung committed Apr 18, 2018
2 parents 42fe0fe + efda6fb commit 9bd9834
Show file tree
Hide file tree
Showing 1,555 changed files with 70,514 additions and 52,732 deletions.
8 changes: 6 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,13 @@ module.exports = {
selector: "CallExpression[callee.object.name='assert'][callee.property.name='doesNotThrow']",
message: "Please replace `assert.doesNotThrow()` and add a comment next to the code instead."
},
{
selector: `CallExpression[callee.object.name='assert'][callee.property.name='rejects'][arguments.length<2]`,
message: 'assert.rejects() must be invoked with at least two arguments.',
},
{
selector: `CallExpression[callee.object.name='assert'][callee.property.name='throws'][arguments.1.type='Literal']:not([arguments.1.regex])`,
message: 'use a regular expression for second argument of assert.throws()',
message: 'Use an object as second argument of assert.throws()',
},
{
selector: `CallExpression[callee.object.name='assert'][callee.property.name='throws'][arguments.length<2]`,
Expand Down Expand Up @@ -185,7 +189,7 @@ module.exports = {
'no-this-before-super': 'error',
'no-throw-literal': 'error',
'no-trailing-spaces': 'error',
'no-undef': 'error',
'no-undef': ['error', { typeof: true }],
'no-undef-init': 'error',
'no-unexpected-multiline': 'error',
'no-unreachable': 'error',
Expand Down
20 changes: 11 additions & 9 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ platforms in production.
| GNU/Linux | Tier 1 | kernel >= 2.6.32, glibc >= 2.12 | x64, arm | |
| GNU/Linux | Tier 1 | kernel >= 3.10, glibc >= 2.17 | arm64 | |
| macOS | Tier 1 | >= 10.10 | x64 | |
| Windows | Tier 1 | >= Windows 7/2008 R2 | x86, x64 | vs2017 |
| Windows | Tier 1 | >= Windows 7/2008 R2/2012 R2 | x86, x64 | vs2017 |
| SmartOS | Tier 2 | >= 15 < 16.4 | x86, x64 | see note1 |
| FreeBSD | Tier 2 | >= 10 | x64 | |
| GNU/Linux | Tier 2 | kernel >= 3.13.0, glibc >= 2.19 | ppc64le >=power8 | |
Expand Down Expand Up @@ -124,18 +124,20 @@ On macOS, you will need to install the `Xcode Command Line Tools` by running
installed, you can find them under the menu `Xcode -> Open Developer Tool ->
More Developer Tools...`. This step will install `clang`, `clang++`, and
`make`.
* After building, you may want to setup [firewall rules](tools/macosx-firewall.sh)
to avoid popups asking to accept incoming network connections when running
tests:

If the path to your build directory contains a space, the build will likely
fail.

After building, setting up [firewall rules](tools/macosx-firewall.sh) can avoid
popups asking to accept incoming network connections when running tests.

Running the following script on macOS will add the firewall rules for the
executable `node` in the `out` directory and the symbolic `node` link in the
project's root directory.

```console
$ sudo ./tools/macosx-firewall.sh
```
Running this script will add rules for the executable `node` in the `out`
directory and the symbolic `node` link in the project's root directory.

On FreeBSD and OpenBSD, you may also need:
* libexecinfo
Expand Down Expand Up @@ -258,9 +260,9 @@ Prerequisites:
* Basic Unix tools required for some tests,
[Git for Windows](http://git-scm.com/download/win) includes Git Bash
and tools which can be included in the global `PATH`.
* **Optional** (for OpenSSL assembler modules): the [NetWide Assembler](http://www.nasm.us/),
if not installed in the default location it needs to be manually added
to `PATH`.
* The [NetWide Assembler](http://www.nasm.us/), for OpenSSL assembler modules.
If not installed in the default location, it needs to be manually added
to `PATH`. Build with `openssl-no-asm` option does not require this.
* **Optional** (to build the MSI): the [WiX Toolset v3.11](http://wixtoolset.org/releases/)
and the [Wix Toolset Visual Studio 2017 Extension](https://marketplace.visualstudio.com/items?itemName=RobMensching.WixToolsetVisualStudio2017Extension).

Expand Down
37 changes: 11 additions & 26 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,12 @@ ifdef JOBS
PARALLEL_ARGS = -j $(JOBS)
endif

ifdef QUICKCHECK
QUICKCHECK_ARG := --quickcheck
endif

ifdef ENABLE_V8_TAP
TAP_V8 := --junitout $(PWD)/v8-tap.xml
TAP_V8_INTL := --junitout $(PWD)/v8-intl-tap.xml
TAP_V8_BENCHMARKS := --junitout $(PWD)/v8-benchmarks-tap.xml
endif

V8_BUILD_OPTIONS += GYPFLAGS="-Dclang=0"
V8_TEST_OPTIONS = $(V8_EXTRA_TEST_OPTIONS)
ifdef DISABLE_V8_I18N
V8_BUILD_OPTIONS += i18nsupport=off
Expand Down Expand Up @@ -96,7 +91,7 @@ $(NODE_G_EXE): config.gypi out/Makefile

out/Makefile: common.gypi deps/uv/uv.gyp deps/http_parser/http_parser.gyp \
deps/zlib/zlib.gyp deps/v8/gypfiles/toolchain.gypi \
deps/v8/gypfiles/features.gypi deps/v8/src/v8.gyp node.gyp \
deps/v8/gypfiles/features.gypi deps/v8/gypfiles/v8.gyp node.gyp \
config.gypi
$(PYTHON) tools/gyp_node.py -f make

Expand Down Expand Up @@ -233,8 +228,7 @@ endif
# Rebuilds deps/v8 as a git tree, pulls its third-party dependencies, and
# builds it.
v8:
tools/make-v8.sh
$(MAKE) -C deps/v8 $(V8_ARCH).$(BUILDTYPE_LOWER) $(V8_BUILD_OPTIONS)
tools/make-v8.sh $(V8_ARCH).$(BUILDTYPE_LOWER) $(V8_BUILD_OPTIONS)

.PHONY: jstest
jstest: build-addons build-addons-napi ## Runs addon tests and JS tests
Expand Down Expand Up @@ -569,31 +563,22 @@ test-with-async-hooks:
ifneq ("","$(wildcard deps/v8/tools/run-tests.py)")
# Related CI job: node-test-commit-v8-linux
test-v8: v8 ## Runs the V8 test suite on deps/v8.
# Performs a full test unless QUICKCHECK is specified.
# Note that we cannot run the tests in deps/v8 directly without rebuilding a
# git tree and using gclient to pull the third-party dependencies, which is
# done by the `v8` target.
deps/v8/tools/run-tests.py --arch=$(V8_ARCH) \
--mode=$(BUILDTYPE_LOWER) $(V8_TEST_OPTIONS) $(QUICKCHECK_ARG) \
--no-presubmit \
--shell-dir=$(PWD)/deps/v8/out/$(V8_ARCH).$(BUILDTYPE_LOWER) \
$(TAP_V8)
git clean -fdxq -- deps/v8
deps/v8/tools/run-tests.py --gn --arch=$(V8_ARCH) \
--mode=$(BUILDTYPE_LOWER) $(V8_TEST_OPTIONS) \
mjsunit cctest debugger inspector message preparser \
$(TAP_V8)
@echo Testing hash seed
$(MAKE) test-hash-seed

test-v8-intl: v8
# Performs a full test unless QUICKCHECK is specified.
deps/v8/tools/run-tests.py --arch=$(V8_ARCH) \
--mode=$(BUILDTYPE_LOWER) --no-presubmit $(QUICKCHECK_ARG) \
--shell-dir=deps/v8/out/$(V8_ARCH).$(BUILDTYPE_LOWER) intl \
deps/v8/tools/run-tests.py --gn --arch=$(V8_ARCH) \
--mode=$(BUILDTYPE_LOWER) intl \
$(TAP_V8_INTL)

test-v8-benchmarks: v8
deps/v8/tools/run-tests.py --arch=$(V8_ARCH) --mode=$(BUILDTYPE_LOWER) \
--download-data $(QUICKCHECK_ARG) --no-presubmit \
--shell-dir=deps/v8/out/$(V8_ARCH).$(BUILDTYPE_LOWER) benchmarks \
$(TAP_V8_BENCHMARKS)
deps/v8/tools/run-tests.py --gn --arch=$(V8_ARCH) --mode=$(BUILDTYPE_LOWER) \
benchmarks \
$(TAP_V8_BENCHMARKS)

test-v8-all: test-v8 test-v8-intl test-v8-benchmarks
# runs all v8 tests
Expand Down
31 changes: 23 additions & 8 deletions common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

# Reset this number to 0 on major V8 upgrades.
# Increment by one for each non-official patch applied to deps/v8.
'v8_embedder_string': '-node.6',
'v8_embedder_string': '-node.4',

# Enable disassembler for `--print-code` v8 options
'v8_enable_disassembler': 1,
Expand All @@ -51,12 +51,18 @@
'conditions': [
['GENERATOR=="ninja"', {
'obj_dir': '<(PRODUCT_DIR)/obj',
'v8_base': '<(PRODUCT_DIR)/obj/deps/v8/src/libv8_base.a',
'chakrashim_base': '<(PRODUCT_DIR)/obj/deps/chakrashim/libchakrashim.a',
}, {
'obj_dir%': '<(PRODUCT_DIR)/obj.target',
'v8_base%': '<(PRODUCT_DIR)/obj.target/deps/v8/src/libv8_base.a',
'chakrashim_base': '<(PRODUCT_DIR)/obj.target/deps/chakrashim/libchakrashim.a',
'conditions': [
[ 'build_v8_with_gn=="true"', {
'v8_base': '<(PRODUCT_DIR)/obj/deps/v8/gypfiles/v8_monolith.gen/gn/obj/libv8_monolith.a',
}, {
'v8_base': '<(PRODUCT_DIR)/obj/deps/v8/gypfiles/libv8_base.a',
}],
]
}, {
'obj_dir%': '<(PRODUCT_DIR)/obj.target',
'chakrashim_base': '<(PRODUCT_DIR)/obj.target/deps/chakrashim/libchakrashim.a',
'v8_base': '<(PRODUCT_DIR)/obj.target/deps/v8/gypfiles/libv8_base.a',
}],
['OS == "win"', {
'os_posix': 0,
Expand All @@ -67,11 +73,20 @@
'os_posix': 1,
'v8_postmortem_support%': 'true',
}],
['OS== "mac"', {
'chakrashim_base': '<(PRODUCT_DIR)/libchakrashim.a',
['OS == "mac"', {
'obj_dir%': '<(PRODUCT_DIR)/obj.target',
'chakrashim_base': '<(PRODUCT_DIR)/libchakrashim.a',
'v8_base': '<(PRODUCT_DIR)/libv8_base.a',
}],
['build_v8_with_gn == "true"', {
'conditions': [
['GENERATOR == "ninja"', {
'v8_base': '<(PRODUCT_DIR)/obj/deps/v8/gypfiles/v8_monolith.gen/gn/obj/libv8_monolith.a',
}, {
'v8_base': '<(PRODUCT_DIR)/obji.target/v8_monolith/geni/gn/obj/libv8_monolith.a',
}],
],
}],
['openssl_fips != ""', {
'openssl_product': '<(STATIC_LIB_PREFIX)crypto<(STATIC_LIB_SUFFIX)',
}, {
Expand Down
21 changes: 20 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ sys.path.insert(0, 'tools')
import getmoduleversion
from gyp_node import run_gyp

# imports in deps/v8/tools/node
sys.path.insert(0, os.path.join('deps', 'v8', 'tools', 'node'))
from fetch_deps import FetchDeps

# parse our options
parser = optparse.OptionParser()

Expand Down Expand Up @@ -573,6 +577,12 @@ parser.add_option('--without-bundled-v8',
help='do not use V8 includes from the bundled deps folder. ' +
'(This mode is not officially supported for regular applications)')

parser.add_option('--build-v8-with-gn',
action='store_true',
dest='build_v8_with_gn',
default=False,
help='build V8 using GN instead of gyp')

# Create compile_commands.json in out/Debug and out/Release.
parser.add_option('-C',
action='store_true',
Expand Down Expand Up @@ -1090,6 +1100,14 @@ def configure_v8(o):
o['variables']['test_isolation_mode'] = 'noop' # Needed by d8.gyp.
if options.without_bundled_v8 and options.enable_d8:
raise Exception('--enable-d8 is incompatible with --without-bundled-v8.')
if options.without_bundled_v8 and options.build_v8_with_gn:
raise Exception(
'--build-v8-with-gn is incompatible with --without-bundled-v8.')
if options.build_v8_with_gn:
v8_path = os.path.join('deps', 'v8')
print('Fetching dependencies to build V8 with GN')
options.build_v8_with_gn = FetchDeps(v8_path)
o['variables']['build_v8_with_gn'] = b(options.build_v8_with_gn)


def configure_openssl(o):
Expand All @@ -1113,7 +1131,8 @@ def configure_openssl(o):
('llvm_version' in variables and variables['llvm_version'] >= '3.3') or \
('nasm_version' in variables and variables['nasm_version'] >= '2.10')

if not openssl110_asm_supported and variables['openssl_no_asm'] == 0:
if not options.without_ssl and not openssl110_asm_supported and \
variables['openssl_no_asm'] == 0:
warn('''openssl_no_asm is enabled due to missed or old assembler.
Please refer BUILDING.md''')
variables['openssl_no_asm'] = 1
Expand Down
1 change: 1 addition & 0 deletions deps/cares/cares.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
'include/ares_rules.h',
'include/ares_version.h',
'include/nameser.h',
'src/ares_android.c',
'src/ares_cancel.c',
'src/ares__close_sockets.c',
'src/ares_create_query.c',
Expand Down
10 changes: 10 additions & 0 deletions deps/cares/include/ares.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@
# include <netinet/in.h>
#endif

#if defined(ANDROID) || defined(__ANDROID__)
#include <jni.h>
#endif

#ifdef __cplusplus
extern "C" {
#endif
Expand Down Expand Up @@ -307,6 +311,12 @@ CARES_EXTERN int ares_library_init_mem(int flags,
void (*afree)(void *ptr),
void *(*arealloc)(void *ptr, size_t size));

#if defined(ANDROID) || defined(__ANDROID__)
CARES_EXTERN void ares_library_init_jvm(JavaVM *jvm);
CARES_EXTERN int ares_library_init_android(jobject connectivity_manager);
CARES_EXTERN int ares_library_android_initialized(void);
#endif

CARES_EXTERN int ares_library_initialized(void);

CARES_EXTERN void ares_library_cleanup(void);
Expand Down
6 changes: 3 additions & 3 deletions deps/cares/include/ares_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
#define ARES__VERSION_H

/* This is the global package copyright */
#define ARES_COPYRIGHT "2004 - 2016 Daniel Stenberg, <daniel@haxx.se>."
#define ARES_COPYRIGHT "2004 - 2017 Daniel Stenberg, <daniel@haxx.se>."

#define ARES_VERSION_MAJOR 1
#define ARES_VERSION_MINOR 13
#define ARES_VERSION_MINOR 14
#define ARES_VERSION_PATCH 0
#define ARES_VERSION ((ARES_VERSION_MAJOR<<16)|\
(ARES_VERSION_MINOR<<8)|\
(ARES_VERSION_PATCH))
#define ARES_VERSION_STR "1.13.0"
#define ARES_VERSION_STR "1.14.0"

#if (ARES_VERSION >= 0x010700)
# define CARES_HAVE_ARES_LIBRARY_INIT 1
Expand Down
2 changes: 2 additions & 0 deletions deps/cares/src/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Frederic Germain
Geert Uytterhoeven
George Neill
Gisle Vanem
Google LLC
Gregor Jasny
Guenter Knauf
Guilherme Balena Versiani
Expand All @@ -45,6 +46,7 @@ Henrik Stoerner
Jakub Hrozek
James Bursa
Jérémy Lal
John Schember
Keith Shaw
Lei Shi
Marko Kreen
Expand Down
1 change: 1 addition & 0 deletions deps/cares/src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ c-ares
[![Windows Build Status](https://ci.appveyor.com/api/projects/status/03i7151772eq3wn3/branch/master?svg=true)](https://ci.appveyor.com/project/c-ares/c-ares)
[![Coverage Status](https://coveralls.io/repos/c-ares/c-ares/badge.svg?branch=master&service=github)](https://coveralls.io/github/c-ares/c-ares?branch=master)
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/291/badge)](https://bestpractices.coreinfrastructure.org/projects/291)
[![Releases](https://coderelease.io/badge/c-ares/c-ares)](https://coderelease.io/github/repository/c-ares/c-ares)

This is c-ares, an asynchronous resolver library. It is intended for
applications which need to perform DNS queries without blocking, or need to
Expand Down
Loading

0 comments on commit 9bd9834

Please sign in to comment.