diff --git a/.gitignore b/.gitignore index b34f180..3b4429a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ # Dependencies /base /build -/buildtools/ +/buildtools /node /third_party /tools/clang @@ -11,4 +11,4 @@ /out # Generated -/node_files.json +*.swp diff --git a/.gn b/.gn index 21cf0cf..4daf0a0 100644 --- a/.gn +++ b/.gn @@ -11,11 +11,6 @@ import("//build/dotfile_settings.gni") # The location of the build configuration file. buildconfig = "//build/config/BUILDCONFIG.gn" -# The secondary source root is a parallel directory tree where -# GN build files are placed when they can not be placed directly -# in the source tree, e.g. for third party source trees. -secondary_source = "//gn/" - # These are the targets to check headers for by default. The files in targets # matching these patterns (see "gn help label_pattern" for format) will have # their includes checked for proper dependencies when you run either @@ -28,7 +23,42 @@ check_targets = ["*"] exec_script_whitelist = build_dotfile_settings.exec_script_whitelist + [ "//v8/build_overrides/build.gni", - "//node/node_component.gni", + "//node/BUILD.gn", + "//node/node.gni", + "//node/unofficial.gni", + "//node/tools/inspector_protocol/BUILD.gn", + "//node/deps/ada/BUILD.gn", + "//node/deps/ada/unofficial.gni", + "//node/deps/llhttp/BUILD.gn", + "//node/deps/llhttp/unofficial.gni", + "//node/deps/nghttp2/BUILD.gn", + "//node/deps/nghttp2/unofficial.gni", + "//node/deps/simdjson/BUILD.gn", + "//node/deps/simdjson/unofficial.gni", + "//node/deps/simdutf/BUILD.gn", + "//node/deps/simdutf/unofficial.gni", + "//node/deps/postject/BUILD.gn", + "//node/deps/postject/unofficial.gni", + "//node/deps/brotli/BUILD.gn", + "//node/deps/brotli/unofficial.gni", + "//node/deps/base64/BUILD.gn", + "//node/deps/base64/unofficial.gni", + "//node/deps/ngtcp2/BUILD.gn", + "//node/deps/ngtcp2/unofficial.gni", + "//node/deps/uv/BUILD.gn", + "//node/deps/uv/unofficial.gni", + "//node/deps/uvwasi/BUILD.gn", + "//node/deps/uvwasi/unofficial.gni", + "//node/deps/cares/BUILD.gn", + "//node/deps/cares/unofficial.gni", + "//node/deps/googletest/BUILD.gn", + "//node/deps/googletest/unofficial.gni", + "//node/deps/openssl/BUILD.gn", + "//node/deps/openssl/unofficial.gni", + "//node/deps/histogram/BUILD.gn", + "//node/deps/histogram/unofficial.gni", + "//node/src/inspector/BUILD.gn", + "//node/src/inspector/unofficial.gni", ] # The python interpreter to use by default. @@ -37,56 +67,24 @@ script_executable = "vpython3" default_args = { ######################################################### # Changeable defaults - # General build options - use_sysroot = false - is_component_build = false - # Node.js defaults. - node_report = true - is_debug = false - node_use_custom_libcxx = false + node_v8_path = "//v8" # V8 options. v8_embedder_string = "-node.0" - v8_enable_i18n_support = true - - # V8 debug options. - v8_enable_disassembler = true - v8_deprecation_warnings = false - v8_imminent_deprecation_warnings = false - v8_enable_handle_zapping = false - v8_enable_pointer_compression = false - v8_optimized_debug = false - v8_enable_fast_mksnapshot = false - v8_enable_snapshot_compression = false ######################################################### # Alternative configuration not supported. Do not change. # General build options. clang_use_chrome_plugins = false - icu_use_data_file = false - symbol_level = 0 - - # Node.js options. Do not change. - node_use_v8_platform = true # V8 options catering towards Node.js use case. - v8_postmortem_support = true + v8_expose_symbols=true v8_promise_internal_field_count = 1 v8_use_external_startup_data = false - v8_untrusted_code_mitigations = false - v8_enable_pointer_compression = false - v8_enable_31bit_smis_on_64bit_arch = false - v8_disable_arguments_adaptor = false - v8_use_siphash = true - v8_expose_symbols = true - v8_enable_lazy_source_positions = false - v8_allow_javascript_in_promise_hooks = true v8_enable_javascript_promise_hooks = true + v8_enable_sandbox = false + v8_enable_maglev = false # TODO(cbruni, v8:12302): Remove once API is migrated v8_scriptormodule_legacy_lifetime = true - - # V8 options. - v8_experimental_extra_library_files = [] - v8_extra_library_files = [] } diff --git a/.vpython b/.vpython deleted file mode 100644 index 34da61d..0000000 --- a/.vpython +++ /dev/null @@ -1,38 +0,0 @@ -# This is a vpython "spec" file. -# -# It describes patterns for python wheel dependencies of the python scripts in -# the V8 repo, particularly for dependencies that have compiled components -# (since pure-python dependencies can be easily vendored into third_party). -# -# When vpython is invoked, it finds this file and builds a python VirtualEnv, -# containing all of the dependencies described in this file, fetching them from -# CIPD (the "Chrome Infrastructure Package Deployer" service). Unlike `pip`, -# this never requires the end-user machine to have a working python extension -# compilation environment. All of these packages are built using: -# https://chromium.googlesource.com/infra/infra/+/main/infra/tools/dockerbuild/ -# -# All python scripts in the repo share this same spec, to avoid dependency -# fragmentation. -# -# If you have depot_tools installed in your $PATH, you can invoke python scripts -# in this repo by running them as you normally would run them, except -# substituting `vpython` instead of `python` on the command line, e.g.: -# vpython path/to/script.py some --arguments -# -# Read more about `vpython` and how to modify this file here: -# https://chromium.googlesource.com/infra/infra/+/main/doc/users/vpython.md - -python_version: "2.7" - -# Used by: -# build/toolchain/win -wheel: < - name: "infra/python/wheels/pypiwin32/${vpython_platform}" - version: "version:219" - match_tag: < - platform: "win32" - > - match_tag: < - platform: "win_amd64" - > -> diff --git a/BUILD.gn b/BUILD.gn new file mode 100644 index 0000000..687392b --- /dev/null +++ b/BUILD.gn @@ -0,0 +1,3 @@ +group("default") { + deps = [ "//node" ] +} diff --git a/DEPS b/DEPS index f215519..2f4b618 100644 --- a/DEPS +++ b/DEPS @@ -5,12 +5,10 @@ gclient_gn_args_file = 'node-ci/build/config/gclient_args.gni' gclient_gn_args = [ 'checkout_google_benchmark', - 'checkout_fuchsia_for_arm64_host' ] vars = { 'checkout_google_benchmark' : False, - 'checkout_fuchsia_for_arm64_host' : False, 'abseil_revision': '84ccde02f2ad7c440aa8b5d99f73b77c5e6484ad', 'abseil_url': 'https://chromium.googlesource.com/chromium/src/third_party/abseil-cpp.git', @@ -42,9 +40,6 @@ vars = { # Fetch configuration files required for the 'use_remoteexec' gn arg 'download_remoteexec_cfg': False, - 'fuchsia_sdk_revision': 'f8df9ff79b878d1998970cc04a197061069e48ce', - 'fuchsia_sdk_url': 'https://chromium.googlesource.com/chromium/src/third_party/fuchsia-sdk.git', - # GN CIPD package version. 'gn_version': 'git_revision:e9e83d9095d3234adf68f3e2866f25daf766d5c7', @@ -64,8 +59,8 @@ vars = { 'markupsafe_revision': '006709ba3ed87660a17bd4548c45663628f5ed85', 'markupsafe_url': 'https://chromium.googlesource.com/chromium/src/third_party/markupsafe.git', - 'node_revision': '648158dea3384a57edfc96881b7cc78a0a142dbb', - 'node_url': 'https://chromium.googlesource.com/external/github.com/v8/node.git', + 'node_revision': 'f11b2061eac181c69de522fc4a14a9410222bcf9', + 'node_url': 'https://github.com/nodejs/node', 'trace_common_revision' : '29ac73db520575590c3aceb0a6f1f58dda8934f6', 'trace_common_url': 'https://chromium.googlesource.com/chromium/src/base/trace_event/common.git', @@ -97,10 +92,6 @@ deps = { 'node-ci/node': Var('node_url') + '@' + Var('node_revision'), 'node-ci/third_party/abseil-cpp': Var('abseil_url') + '@' + Var('abseil_revision'), 'node-ci/third_party/depot_tools': Var('depot_tools_url') + '@' + Var('depot_tools_revision'), - 'node-ci/third_party/fuchsia-sdk': { - 'url': Var('fuchsia_sdk_url') + '@' + Var('fuchsia_sdk_revision'), - 'condition': 'checkout_fuchsia', - }, 'node-ci/third_party/googletest/src': Var('googletest_url') + '@' + Var('googletest_revision'), 'node-ci/third_party/icu': Var('icu_url') + '@' + Var('icu_revision'), 'node-ci/third_party/jinja2': Var('jinja2_url') + '@' + Var('jinja2_revision'), @@ -161,9 +152,59 @@ deps = { hooks = [ { - 'name': 'generate_node_filelist', - 'pattern': 'node-ci/node', - 'action': ['python3', 'node-ci/tools/generate_node_files_json.py'], + 'name': 'sysroot_arm', + 'pattern': '.', + 'condition': 'checkout_linux and checkout_arm', + 'action': ['python3', 'node-ci/build/linux/sysroot_scripts/install-sysroot.py', + '--arch=arm'], + }, + { + 'name': 'sysroot_arm64', + 'pattern': '.', + 'condition': 'checkout_linux and checkout_arm64', + 'action': ['python3', 'node-ci/build/linux/sysroot_scripts/install-sysroot.py', + '--arch=arm64'], + }, + { + 'name': 'sysroot_x86', + 'pattern': '.', + 'condition': 'checkout_linux and (checkout_x86 or checkout_x64)', + 'action': ['python3', 'node-ci/build/linux/sysroot_scripts/install-sysroot.py', + '--arch=x86'], + }, + { + 'name': 'sysroot_mips', + 'pattern': '.', + 'condition': 'checkout_linux and checkout_mips', + 'action': ['python3', 'node-ci/build/linux/sysroot_scripts/install-sysroot.py', + '--arch=mips'], + }, + { + 'name': 'sysroot_mips64', + 'pattern': '.', + 'condition': 'checkout_linux and checkout_mips64', + 'action': ['python3', 'node-ci/build/linux/sysroot_scripts/install-sysroot.py', + '--arch=mips64el'], + }, + { + 'name': 'sysroot_x64', + 'pattern': '.', + 'condition': 'checkout_linux and checkout_x64', + 'action': ['python3', 'node-ci/build/linux/sysroot_scripts/install-sysroot.py', + '--arch=x64'], + }, + { + # Case-insensitivity for the Win SDK. Must run before win_toolchain below. + 'name': 'ciopfs_linux', + 'pattern': '.', + 'condition': 'checkout_win and host_os == "linux"', + 'action': [ 'python3', + 'node-ci/third_party/depot_tools/download_from_google_storage.py', + '--no_resume', + '--no_auth', + '--bucket', 'chromium-browser-clang/ciopfs', + '-s', 'node-ci/build/ciopfs.sha1', + ] }, { # Update the Windows toolchain if necessary. @@ -199,15 +240,6 @@ hooks = [ 'node-ci/build/linux/sysroot_scripts/install-sysroot.py', '--arch=x64'], }, - { - 'name': 'fuchsia_sdk', - 'pattern': '.', - 'condition': 'checkout_fuchsia', - 'action': [ - 'python3', - 'node-ci/build/fuchsia/update_sdk.py', - ], - }, # Configure remote exec cfg files { 'name': 'configure_reclient_cfgs', diff --git a/Makefile b/Makefile index f63f67c..4b418be 100644 --- a/Makefile +++ b/Makefile @@ -6,13 +6,9 @@ ifdef JOBS PARALLEL_ARGS = -j $(JOBS) endif -BUILDDEPS_FLAGS = --no-nacl --no-chromeos-fonts --no-arm --lib32 - -# Gclient sync and check build deps +# Gclient sync deps: gclient sync - build/install-build-deps.sh --quick-check $(BUILDDEPS_FLAGS) ||\ - build/install-build-deps.sh $(BUILDDEPS_FLAGS) # Generate GN configs out/Release: @@ -21,17 +17,14 @@ out/Release: out/Debug: tools/gn-gen.py out/Debug --debug -out/fuchsia: - tools/gn-gen.py out/fuchsia --target_os="fuchsia" --no-cache - # Build .PHONY: build.Release build.Release: out/Release - autoninja -C $< test_all + autoninja -C $< node .PHONY: build.Debug: out/Debug - autoninja -C $< test_all + autoninja -C $< node .PHONY: build.fuchsia build.fuchsia: out/fuchsia @@ -112,4 +105,3 @@ test-addons.Release: build.Release test-addons.Debug: build.Debug tools/test.py --test-root out/Debug/gen/node/test\ $(PARALLEL_ARGS) -m debug addons - diff --git a/README.md b/README.md index 2f2fef9..a250a57 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ Electron, having both Chromium and Node.js as its dependencies, adopted GN. Many Some reading material: * [GN build system](https://www.chromium.org/developers/gn-build-configuration) +* [Discussion on adding GN files to upstream Node.js](https://github.com/nodejs/TSC/issues/1353) * [Discussion on building Node.js with GN](https://github.com/nodejs/node/issues/21410) * [Discussion on building Node.js with cmake](https://github.com/nodejs/TSC/issues/648) * [Discussion on building Node.js with Bazel](https://github.com/nodejs/TSC/issues/464) @@ -31,8 +32,8 @@ Alternatively, you can ```bash mkdir node-ci cd node-ci -git clone https://chromium.googlesource.com/v8/node-ci -gclient config https://chromium.googlesource.com/v8/node-ci --unmanaged +git clone https://github.com/photoionization/node-ci +gclient config https://github.com/photoionization/node-ci --unmanaged ``` ### Build @@ -76,10 +77,6 @@ git checkout local-v8/ * Stay as up-to-date as possible. The point of this is to be able to build with newest versions of dependencies, including Node.js, V8, and ICU. * Simplicity. It should be easy to get up and running. -## Not yet implemented -* Support building on Windows. The current configurations have been tested for Linux and Mac. -* Platform-specific OpenSSL build configurations. The current build only supports the slowest platform-independent configuration. - ## Explicit non-goals * To translate every configuration from the GYP build. * To support platforms not supported by Chromium. diff --git a/examples/BUILD.gn b/examples/BUILD.gn deleted file mode 100644 index a4dba91..0000000 --- a/examples/BUILD.gn +++ /dev/null @@ -1,12 +0,0 @@ -# Copyright 2020 the V8 project authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -group("examples") { - deps = [ - "express", - "lodash", - "simple_server", - "tsc", - ] -} \ No newline at end of file diff --git a/examples/express/BUILD.gn b/examples/express/BUILD.gn deleted file mode 100644 index 92b8435..0000000 --- a/examples/express/BUILD.gn +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 2020 the V8 project authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import("//node/node_component.gni") - -node_component("express_cmx") { - manifest = "express.cmx" - node_modules = [ "express" ] - sources = [ "express.js" ] -} - -fuchsia_package("express") { - deps = [ ":express_cmx" ] -} \ No newline at end of file diff --git a/examples/express/express.cmx b/examples/express/express.cmx deleted file mode 100644 index ad820fa..0000000 --- a/examples/express/express.cmx +++ /dev/null @@ -1,20 +0,0 @@ -{ - "program": { - "binary": "node", - "args": [ "/pkg/express.js" ] - }, - "sandbox": { - "dev": [ - "null", - "zero" - ], - "features": [ - "isolated-temp", - "deprecated-ambient-replace-as-executable" - ], - "services": [ - "fuchsia.process.Launcher", - "fuchsia.posix.socket.Provider" - ] - } -} \ No newline at end of file diff --git a/examples/express/express.js b/examples/express/express.js deleted file mode 100644 index 5f33000..0000000 --- a/examples/express/express.js +++ /dev/null @@ -1,9 +0,0 @@ -const express = require('express') -const app = express() - -app.get('/', function (req, res) { - res.send('Hello World') -}) - -console.log("Listening to localhost:3000") -app.listen(3000) \ No newline at end of file diff --git a/examples/lodash/BUILD.gn b/examples/lodash/BUILD.gn deleted file mode 100644 index 07b4f85..0000000 --- a/examples/lodash/BUILD.gn +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 2020 the V8 project authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import("//node/node_component.gni") - -node_component("lodash_cmx") { - manifest = "lodash.cmx" - node_modules = [ "lodash" ] - sources = [ "lodash.js" ] -} - -fuchsia_package("lodash") { - deps = [ ":lodash_cmx" ] -} \ No newline at end of file diff --git a/examples/lodash/lodash.cmx b/examples/lodash/lodash.cmx deleted file mode 100644 index e997287..0000000 --- a/examples/lodash/lodash.cmx +++ /dev/null @@ -1,11 +0,0 @@ -{ - "program": { - "binary": "node", - "args": [ "/pkg/lodash.js" ] - }, - "sandbox": { - "features": [ - "deprecated-ambient-replace-as-executable" - ] - } -} \ No newline at end of file diff --git a/examples/lodash/lodash.js b/examples/lodash/lodash.js deleted file mode 100644 index 3c6d1e1..0000000 --- a/examples/lodash/lodash.js +++ /dev/null @@ -1,10 +0,0 @@ -const _ = require("lodash") - -let words = ['sky', 'wood', 'forest', 'falcon', - 'pear', 'ocean', 'universe']; - -let fel = _.first(words); -let lel = _.last(words); - -console.log(`First element: ${fel}`); -console.log(`Last element: ${lel}`); \ No newline at end of file diff --git a/examples/simple_server/BUILD.gn b/examples/simple_server/BUILD.gn deleted file mode 100644 index bd6ef79..0000000 --- a/examples/simple_server/BUILD.gn +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 2020 the V8 project authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import("//node/node_component.gni") - -node_component("simple_server_cmx") { - manifest = "simple_server.cmx" - sources = [ "simple_server.js" ] -} - -fuchsia_package("simple_server") { - package_name = "simple_server" - deps = [ ":simple_server_cmx" ] -} \ No newline at end of file diff --git a/examples/simple_server/simple_server.cmx b/examples/simple_server/simple_server.cmx deleted file mode 100644 index 88b2c60..0000000 --- a/examples/simple_server/simple_server.cmx +++ /dev/null @@ -1,20 +0,0 @@ -{ - "program": { - "binary": "node", - "args": [ "/pkg/simple_server.js" ] - }, - "sandbox": { - "dev": [ - "null", - "zero" - ], - "features": [ - "isolated-temp", - "deprecated-ambient-replace-as-executable" - ], - "services": [ - "fuchsia.process.Launcher", - "fuchsia.posix.socket.Provider" - ] - } -} \ No newline at end of file diff --git a/examples/simple_server/simple_server.js b/examples/simple_server/simple_server.js deleted file mode 100644 index 5cd0832..0000000 --- a/examples/simple_server/simple_server.js +++ /dev/null @@ -1,14 +0,0 @@ -const http = require('http'); - -const hostname = '::0'; // IPv6 localhost -const port = 1234; - -const server = http.createServer((req, res) => { - res.statusCode = 200; - res.setHeader('Content-Type', 'text/plain'); - res.end('Hello World'); -}); - -server.listen(port, hostname, () => { - console.log(`Server running at http://${hostname}:${port}/`); -}); \ No newline at end of file diff --git a/examples/tsc/BUILD.gn b/examples/tsc/BUILD.gn deleted file mode 100644 index 7b0f1e0..0000000 --- a/examples/tsc/BUILD.gn +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 2020 the V8 project authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import("//node/node_component.gni") - -node_component("tsc_cmx") { - manifest = "tsc.cmx" - node_modules = [ "typescript" ] - sources = [ "greeter.ts" ] -} - -fuchsia_package("tsc") { - deps = [ ":tsc_cmx" ] -} \ No newline at end of file diff --git a/examples/tsc/greeter.ts b/examples/tsc/greeter.ts deleted file mode 100644 index 20b37c1..0000000 --- a/examples/tsc/greeter.ts +++ /dev/null @@ -1,19 +0,0 @@ -class Student { - fullName: string; - constructor(public firstName: string, public middleInitial: string, public lastName: string) { - this.fullName = firstName + " " + middleInitial + " " + lastName; - } -} - -interface Person { - firstName: string; - lastName: string; -} - -function greeter(person: Person) { - return "Hello, " + person.firstName + " " + person.lastName; -} - -let user = new Student("Jane", "M.", "User"); - -console.log(greeter(user)) \ No newline at end of file diff --git a/examples/tsc/tsc.cmx b/examples/tsc/tsc.cmx deleted file mode 100644 index c75564d..0000000 --- a/examples/tsc/tsc.cmx +++ /dev/null @@ -1,12 +0,0 @@ -{ - "program": { - "binary": "node", - "args": [ "/pkg/node_modules/typescript/lib/tsc.js" ] - }, - "sandbox": { - "features": [ - "deprecated-ambient-replace-as-executable", - "isolated-cache-storage" - ] - } -} \ No newline at end of file diff --git a/gn/BUILD.gn b/gn/BUILD.gn deleted file mode 100644 index 1130af1..0000000 --- a/gn/BUILD.gn +++ /dev/null @@ -1,63 +0,0 @@ -# Copyright 2019 the V8 project authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -if (is_fuchsia) { - import("//third_party/fuchsia-sdk/sdk/build/component.gni") - import("//third_party/fuchsia-sdk/sdk/build/package.gni") - - fuchsia_component("node_cmx") { - manifest = "//gn/node/meta/node.cmx" - data_deps = [ - "//node:node", - ] - } - - fuchsia_component("node_cctest_cmx") { - testonly = true - manifest = "//gn/node/meta/node_cctest.cmx" - data_deps = [ - "//node:node_cctest", - ] - } - - fuchsia_package("node_package") { - deps = [ - ":node_cmx", - ] - } - - fuchsia_package("node_cctest_package") { - testonly = true - deps = [ - ":node_cctest_cmx", - ] - } - - group("examples") { - deps = [ - "//examples" - ] - } -} - -group("test_all") { - testonly = true - - deps = [ - "//node:node", - ] - - # TODO(v8:11554): These targets currently do not build on Mac. - if (is_linux || is_fuchsia) { - deps += [ "//node:node_cctest" ] - } - - if (is_linux) { - deps += [ - "//node/test/addons:build", - "//node/test/node-api:build", - "//node/test/js-native-api:build", - ] - } -} diff --git a/gn/node/BUILD.gn b/gn/node/BUILD.gn deleted file mode 100644 index ccb0b7c..0000000 --- a/gn/node/BUILD.gn +++ /dev/null @@ -1,351 +0,0 @@ -# Copyright (c) 2013-2019 GitHub Inc. -# Copyright 2019 the V8 project authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import("//node/node_files.gni") -import("//v8/gni/snapshot_toolchain.gni") -import("//v8/gni/v8.gni") - -declare_args() { - # Enable the V8 inspector protocol for use with node. - node_enable_inspector = !is_fuchsia - - # Build node with SSL support. - # The variable is called "openssl" for parity with node's GYP build. - node_use_openssl = true - - # Use the specified path to system CA (PEM format) in addition to - # the BoringSSL supplied CA store or compiled-in Mozilla CA copy. - node_openssl_system_ca_path = "" - - # Initialize v8 platform during node.js startup. - node_use_v8_platform = true - - # Build with DTrace support. - node_use_dtrace = false - - # Build with ETW support. - node_use_etw = false - - # Build JavaScript in lib/ with DCHECK macros. - node_debug_lib = false - - # Custom build tag. - node_tag = "" - - # V8 options to pass, see `node --v8-options` for examples. - node_v8_options = "" - - # Provide a custom URL prefix for the `process.release` properties - # `sourceUrl` and `headersUrl`. When compiling a release build, this will - # default to https://nodejs.org/download/release/'). - node_release_urlbase = "" - - # Use code cache to speed up startup. - node_use_code_cache = is_linux - - # Use snapshot to speed up startup. - node_use_snapshot = !is_win && !is_fuchsia -} - -assert(!node_use_dtrace, "node_use_dtrace not supported in GN") -assert(!node_use_etw, "node_use_etw not supported in GN") - -assert(!node_enable_inspector || node_use_openssl, - "node_enable_inspector requires node_use_openssl") - -executable("node_js2c") { - sources = [ "tools/js2c.cc" ] - public_deps = [ - "deps/simdutf", - "deps/uv" - ] -} - -copy("node_js2c_inputs") { - sources = node_files.node_library_files - outputs = [ - "$target_gen_dir/js2c_inputs/{{source_target_relative}}", - ] -} - -action("generate_config_gypi") { - script = "//tools/generate_config_gypi.py" - outputs = [ - "$target_gen_dir/js2c_inputs/config.gypi", - ] - depfile = "$target_gen_dir/$target_name.d" - - if (is_mac) { - gn = "//buildtools/mac/gn" - } else if (is_win) { - gn = "//buildtools/win/gn.exe" - } else { - gn = "//buildtools/linux64/gn" - } - script_args = [ - gn, - "$root_build_dir", - ] - script_args += outputs - script_args += [ depfile ] - args = rebase_path(script_args, root_build_dir) -} - -action("run_node_js2c") { - deps = [ - ":generate_config_gypi", - ":node_js2c", - ":node_js2c_inputs" - ] - - script = "//tools/run_executable_in_dir.py" - cwd = rebase_path("$target_gen_dir/js2c_inputs") - exe = rebase_path("$root_build_dir/node_js2c") - stamp = "${exe}.stamp" - js2c_inputs = [ "deps", "lib", "config.gypi" ] - outputs = [ - "$target_gen_dir/node_javascript.cc", - ] - - args = [ cwd, stamp, exe ] + rebase_path(outputs) - args += ["--root", cwd] - args += js2c_inputs -} - -config("node_base_external") { - include_dirs = [ "src" ] - defines = [ "NODE_WANT_INTERNALS=1" ] - configs = [ "//v8:external_config" ] - cflags_cc = [ "-std=c++17" ] -} - -config("node_base_internal") { - visibility = [ - ":*", - "src/inspector:*", - ] - configs = [ ":node_base_external" ] - cflags = [ "-Wno-microsoft-include" ] - libs = [] - cflags_cc = [ - "-Wno-deprecated-declarations", - "-Wno-implicit-fallthrough", - "-Wno-return-type", - "-Wno-sometimes-uninitialized", - "-Wno-unused-label", - "-Wno-unused-private-field", - "-Wno-unused-variable", - "-Wno-string-plus-int", - "-Wno-string-conversion", - "-Wno-unused-function", - "-Wno-extra-semi", # Temporarily until resolved upstream. - "-Wno-unreachable-code", # node_crypto.cc has unreachable code. - "-Wno-unreachable-code-break", - "-Wno-unreachable-code-return", - "-Wno-shadow", - ] - - if (target_cpu == "x86") { - node_arch = "ia32" - } else { - node_arch = target_cpu - } - if (target_os == "win") { - node_platform = "win32" - } else if (target_os == "mac") { - node_platform = "darwin" - } else { - node_platform = target_os - } - defines = [ - "NODE_ARCH=\"$node_arch\"", - "NODE_PLATFORM=\"$node_platform\"", - "NODE_REPORT" - ] - - if (is_win) { - defines += [ - "NOMINMAX", - "_UNICODE=1", - ] - libs += [ "psapi.lib" ] - } else { - defines += [ "__POSIX__" ] - } - if (is_mac) { - frameworks = [ "CoreFoundation.framework" ] - } - if (node_tag != "") { - defines += [ "NODE_TAG=\"$node_tag\"" ] - } - if (node_v8_options != "") { - defines += [ "NODE_V8_OPTIONS=\"$node_v8_options\"" ] - } - if (node_release_urlbase != "") { - defines += [ "NODE_RELEASE_URLBASE=\"$node_release_urlbase\"" ] - } - if (node_use_openssl) { - defines += [ - "NODE_OPENSSL_SYSTEM_CERT_PATH=\"$node_openssl_system_ca_path\"", - "HAVE_OPENSSL=1", - ] - } else { - defines += [ "HAVE_OPENSSL=0" ] - } - if (node_use_v8_platform) { - defines += [ "NODE_USE_V8_PLATFORM=1" ] - } else { - defines += [ "NODE_USE_V8_PLATFORM=0" ] - } - if (node_enable_inspector) { - defines += [ "HAVE_INSPECTOR=1" ] - } else { - defines += [ "HAVE_INSPECTOR=0" ] - } - if (v8_enable_i18n_support) { - defines += [ "NODE_HAVE_I18N_SUPPORT=1" ] - } else { - defines += [ "NODE_HAVE_I18N_SUPPORT=0" ] - } - if (node_use_code_cache) { - defines += [ "NODE_USE_NODE_CODE_CACHE=1"] - } -} - -source_set("node_base") { - deps = [ - ":run_node_js2c", - "deps/ada", - "deps/base64", - "deps/brotli/c:brotli", - "deps/cares", - "deps/histogram", - "deps/llhttp", - "deps/nghttp2", - "deps/ngtcp2", - "deps/postject", - "deps/simdutf", - "deps/uvwasi", - "//third_party/zlib", - "//v8:v8_libplatform", - ] - public_deps = [ - "deps/uv", - "deps/base64", - "//v8", - ] - public_configs = [ - ":node_base_external", - "//build/config/compiler:no_chromium_code", - "deps/googletest:gtest_config", - ] - if (is_posix || is_mac || is_fuchsia) { - public_configs += [ "//build/config/gcc:symbol_visibility_default" ] - configs -= [ "//build/config/gcc:symbol_visibility_hidden" ] - } - configs += [ ":node_base_internal" ] - configs -= [ "//build/config/clang:find_bad_constructs" ] - - sources = node_files.node_sources - sources += [ "$target_gen_dir/node_javascript.cc" ] - - if (v8_enable_i18n_support) { - deps += [ "//third_party/icu" ] - } - - if (node_enable_inspector) { - deps += [ "src/inspector" ] - } - - if (node_use_openssl) { - deps += [ "deps/openssl" ] - sources += node_files.crypto_sources - } -} - -if (node_use_snapshot) { - if (current_toolchain == v8_snapshot_toolchain) { - executable("node_mksnapshot") { - sources = [ - "src/node_snapshot_stub.cc", - "tools/snapshot/node_mksnapshot.cc", - ] - configs += [ ":node_base_internal" ] - deps = [ - ":node_base", - ] - } - } - - action("run_node_mksnapshot") { - script = "//tools/run_executable_in_dir.py" - base = target_gen_dir - stamp = "$target_gen_dir/run_node_mksnapshot.stamp" - exe = get_label_info(":node_mksnapshot($v8_snapshot_toolchain)", - "root_out_dir") + "/node_mksnapshot" - output_cc = "$target_gen_dir/node_snapshot.cc" - outputs = [ - stamp, - output_cc, - ] - args = [ - rebase_path(base, root_build_dir), - rebase_path(stamp, root_build_dir), - rebase_path(exe, base), - rebase_path(output_cc, base), - ] - deps = [ - ":node_mksnapshot($v8_snapshot_toolchain)", - ] - } -} - -component("node_lib") { - cflags_cc = [ - "-Wno-shadow", - ] - sources = [ - "src/node_main.cc", - ] - public_deps = [ - ":node_base", - ] - deps = [] - if (node_use_snapshot) { - sources += [ "$target_gen_dir/node_snapshot.cc" ] - deps += [ ":run_node_mksnapshot" ] - } else { - sources += [ "src/node_snapshot_stub.cc" ] - } - output_name = "node" -} - -executable("node") { - sources = [ - "src/node_main.cc", - ] - deps = [ - ":node_lib", - ] -} - -if (is_linux) { - executable("node_cctest") { - testonly = true - deps = [ - ":node_base", - "deps/googletest", - "deps/simdutf", - ] - configs += [ ":node_base_internal" ] - sources = node_files.cctest_sources - if (node_enable_inspector) { - sources += [ - "test/cctest/test_inspector_socket.cc", - "test/cctest/test_inspector_socket_server.cc", - ] - } - } -} diff --git a/gn/node/deps/ada/BUILD.gn b/gn/node/deps/ada/BUILD.gn deleted file mode 100644 index 65a902f..0000000 --- a/gn/node/deps/ada/BUILD.gn +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright 2023 the V8 project authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import("//node/node.gni") -import("//v8/gni/v8.gni") - -config("ada_config") { - if (!v8_enable_i18n_support) { - defines = [ "ADA_HAS_ICU=0" ] - } - include_dirs = [ "." ] -} - -node_dep("ada") { - public_configs = [ ":ada_config" ] - sources = [ "ada.cpp", "ada.h" ] - if (v8_enable_i18n_support) { - deps = [ "//third_party/icu" ] - } -} diff --git a/gn/node/deps/base64/BUILD.gn b/gn/node/deps/base64/BUILD.gn deleted file mode 100644 index bac528d..0000000 --- a/gn/node/deps/base64/BUILD.gn +++ /dev/null @@ -1,134 +0,0 @@ -# Copyright (c) 2013-2022 GitHub Inc. -# Copyright 2022 the V8 project authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import("//node/node_files.gni") -import("//node/node.gni") - -config("base64_config") { - defines = [ "BASE64_STATIC_DEFINE" ] - include_dirs = [ "base64/include", "base64/lib" ] -} - -node_dep("base64") { - public_configs = [ ":base64_config" ] - defines = [ - "BASE64_STATIC_DEFINE", - # Default for x86 architectures. - "HAVE_SSSE3=1", - "HAVE_SSE41=1", - "HAVE_SSE42=1", - "HAVE_AVX=1", - "HAVE_AVX2=1" - ] - include_dirs = [ "base64/include", "base64/lib" ] - sources = node_files.base64_sources - deps = [ - ":base64_ssse3", - ":base64_sse41", - ":base64_sse42", - ":base64_avx", - ":base64_avx2", - ":base64_neon32", - ":base64_neon64" - ] -} - -source_set("base64_ssse3") { - include_dirs = [ "base64/include", "base64/lib" ] - defines = [ "BASE64_STATIC_DEFINE" ] - if (target_cpu == "x86" || target_cpu == "x64") { - defines += [ "HAVE_SSSE3=1" ] - } - sources = [ "base64/lib/arch/ssse3/codec.c" ] - if (!is_win) { - cflags_c = [ - "-Wno-implicit-fallthrough", - "-mssse3" - ] - } -} - -source_set("base64_sse41") { - include_dirs = [ "base64/include", "base64/lib" ] - defines = [ "BASE64_STATIC_DEFINE" ] - if (target_cpu == "x86" || target_cpu == "x64") { - defines += [ "HAVE_SSE41=1" ] - } - sources = [ "base64/lib/arch/sse41/codec.c" ] - if (!is_win) { - cflags_c = [ - "-Wno-implicit-fallthrough", - "-msse4.1" - ] - } -} - -source_set("base64_sse42") { - include_dirs = [ "base64/include", "base64/lib" ] - defines = [ "BASE64_STATIC_DEFINE" ] - if (target_cpu == "x86" || target_cpu == "x64") { - defines += [ "HAVE_SSE42=1" ] - } - sources = [ "base64/lib/arch/sse42/codec.c" ] - if (!is_win) { - cflags_c = [ - "-Wno-implicit-fallthrough", - "-msse4.2" - ] - } -} - -source_set("base64_avx") { - include_dirs = [ "base64/include", "base64/lib" ] - defines = [ "BASE64_STATIC_DEFINE" ] - if (target_cpu == "x86" || target_cpu == "x64") { - defines += [ "HAVE_AVX=1" ] - } - sources = [ "base64/lib/arch/avx/codec.c" ] - if (!is_win) { - cflags_c = [ - "-Wno-implicit-fallthrough", - "-mavx" - ] - } -} -source_set("base64_avx2") { - include_dirs = [ "base64/include", "base64/lib" ] - defines = [ "BASE64_STATIC_DEFINE" ] - if (target_cpu == "x86" || target_cpu == "x64") { - defines += [ "HAVE_AVX2=1" ] - } - sources = [ "base64/lib/arch/avx2/codec.c" ] - if (!is_win) { - cflags_c = [ - "-Wno-implicit-fallthrough", - "-mavx2" - ] - } -} - -source_set("base64_neon32") { - include_dirs = [ "base64/include", "base64/lib" ] - defines = [ "BASE64_STATIC_DEFINE" ] - if (target_cpu == "arm") { - defines += [ "HAVE_NEON32=1" ] - } - sources = [ "base64/lib/arch/neon32/codec.c" ] - if (target_cpu == "arm" && !is_win) { - cflags_c = [ - "-Wno-implicit-fallthrough", - "-mfpu=neon" - ] - } -} - -source_set("base64_neon64") { - include_dirs = [ "base64/include", "base64/lib" ] - defines = [ "BASE64_STATIC_DEFINE" ] - if (target_cpu == "arm64") { - defines += [ "HAVE_NEON64=1" ] - } - sources = [ "base64/lib/arch/neon64/codec.c" ] -} diff --git a/gn/node/deps/brotli/c/BUILD.gn b/gn/node/deps/brotli/c/BUILD.gn deleted file mode 100644 index e5ed294..0000000 --- a/gn/node/deps/brotli/c/BUILD.gn +++ /dev/null @@ -1,138 +0,0 @@ -# Copyright 2014 The Chromium Authors. All rights reserved. -# Copyright 2019 the V8 project authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import("//node/node.gni") - -if (is_win) { - import("//build/config/win/visual_studio_version.gni") -} - -config("includes") { - include_dirs = [ "include" ] -} - -source_set("headers") { - sources = [ - "include/brotli/decode.h", - "include/brotli/encode.h", - "include/brotli/port.h", - "include/brotli/types.h", - ] -} - -common_sources = [ - "common/constants.c", - "common/constants.h", - "common/context.c", - "common/context.h", - "common/dictionary.c", - "common/dictionary.h", - "common/platform.c", - "common/platform.h", - "common/transform.c", - "common/transform.h", - "common/version.h", -] - -source_set("common") { - sources = common_sources - public_configs = [ ":includes" ] - deps = [ - ":headers", - ] -} - -source_set("common_no_dictionary_data") { - sources = common_sources - public_configs = [ ":includes" ] - deps = [ - ":headers", - ] - defines = [ "BROTLI_EXTERNAL_DICTIONARY_DATA" ] -} - -dec_sources = [ - "dec/bit_reader.c", - "dec/bit_reader.h", - "dec/decode.c", - "dec/huffman.c", - "dec/huffman.h", - "dec/prefix.h", - "dec/state.c", - "dec/state.h", -] - -enc_sources = [ - "enc/backward_references.c", - "enc/backward_references.h", - "enc/backward_references_hq.c", - "enc/backward_references_hq.h", - "enc/backward_references_inc.h", - "enc/bit_cost.c", - "enc/bit_cost.h", - "enc/bit_cost_inc.h", - "enc/block_encoder_inc.h", - "enc/block_splitter.c", - "enc/block_splitter.h", - "enc/block_splitter_inc.h", - "enc/brotli_bit_stream.c", - "enc/brotli_bit_stream.h", - "enc/cluster.c", - "enc/cluster.h", - "enc/cluster_inc.h", - "enc/command.c", - "enc/command.h", - "enc/compress_fragment.c", - "enc/compress_fragment.h", - "enc/compress_fragment_two_pass.c", - "enc/compress_fragment_two_pass.h", - "enc/dictionary_hash.c", - "enc/dictionary_hash.h", - "enc/encode.c", - "enc/encoder_dict.c", - "enc/encoder_dict.h", - "enc/entropy_encode.c", - "enc/entropy_encode.h", - "enc/entropy_encode_static.h", - "enc/fast_log.c", - "enc/fast_log.h", - "enc/find_match_length.h", - "enc/hash.h", - "enc/hash_composite_inc.h", - "enc/hash_forgetful_chain_inc.h", - "enc/hash_longest_match64_inc.h", - "enc/hash_longest_match_inc.h", - "enc/hash_longest_match_quickly_inc.h", - "enc/hash_rolling_inc.h", - "enc/hash_to_binary_tree_inc.h", - "enc/histogram.c", - "enc/histogram.h", - "enc/histogram_inc.h", - "enc/literal_cost.c", - "enc/literal_cost.h", - "enc/memory.c", - "enc/memory.h", - "enc/metablock.c", - "enc/metablock.h", - "enc/metablock_inc.h", - "enc/params.h", - "enc/prefix.h", - "enc/quality.h", - "enc/ringbuffer.h", - "enc/static_dict.c", - "enc/static_dict.h", - "enc/static_dict_lut.h", - "enc/utf8_util.c", - "enc/utf8_util.h", - "enc/write_bits.h", -] - -node_dep("brotli") { - sources = enc_sources + dec_sources - public_configs = [ ":includes" ] - - public_deps = [ ":headers" ] - deps = [ ":common" ] -} diff --git a/gn/node/deps/cares/BUILD.gn b/gn/node/deps/cares/BUILD.gn deleted file mode 100644 index 2dbd4d6..0000000 --- a/gn/node/deps/cares/BUILD.gn +++ /dev/null @@ -1,70 +0,0 @@ -# Copyright (c) 2013-2019 GitHub Inc. -# Copyright 2019 the V8 project authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import("//node/node_files.gni") -import("//node/node.gni") - -config("cares_config") { - include_dirs = [ "include", "src/lib" ] -} - -node_dep("cares") { - defines = [ "CARES_STATICLIB" ] - include_dirs = [ - "include", - "src/lib", - ] - public_configs = [ ":cares_config" ] - - libs = [] - cflags_c = [ - "-Wno-logical-not-parentheses", - "-Wno-sign-compare", - ] - - sources = node_files.cares_sources - - if (!is_win) { - defines += [ - "_DARWIN_USE_64_BIT_INODE=1", - "_LARGEFILE_SOURCE", - "_FILE_OFFSET_BITS=64", - "_GNU_SOURCE", - ] - } - - if (is_win) { - defines += [ "CARES_PULL_WS2TCPIP_H=1" ] - include_dirs += [ "config/win32" ] - sources += [ - "src/lib/ares_getenv.c", - "src/lib/ares_iphlpapi.h", - "src/lib/ares_platform.c", - "src/lib/config-win32.h", - "src/lib/windows_port.c", - ] - libs += [ - "ws2_32.lib", - "iphlpapi.lib", - ] - } else { - defines += [ "HAVE_CONFIG_H" ] - } - - if (is_linux) { - include_dirs += [ "config/linux" ] - sources += [ "config/linux/ares_config.h" ] - } - - if (is_fuchsia) { - include_dirs += [ "//gn/node/deps/cares/config/fuchsia" ] - sources += [ "//gn/node/deps/cares/config/fuchsia/ares_config.h" ] - } - - if (is_mac) { - include_dirs += [ "config/darwin" ] - sources += [ "config/darwin/ares_config.h" ] - } -} diff --git a/gn/node/deps/cares/config/fuchsia/ares_config.h b/gn/node/deps/cares/config/fuchsia/ares_config.h deleted file mode 100644 index 9fcfb35..0000000 --- a/gn/node/deps/cares/config/fuchsia/ares_config.h +++ /dev/null @@ -1,502 +0,0 @@ -/* ares_config.h. Generated from ares_config.h.in by configure. */ -/* ares_config.h.in. Generated from configure.ac by autoheader. */ - -/* Define if building universal (internal helper macro) */ -/* #undef AC_APPLE_UNIVERSAL_BUILD */ - -/* define this if ares is built for a big endian system */ -/* #undef ARES_BIG_ENDIAN */ - -/* when building as static part of libcurl */ -/* #undef BUILDING_LIBCURL */ - -/* Defined for build that exposes internal static functions for testing. */ -/* #undef CARES_EXPOSE_STATICS */ - -/* Defined for build with symbol hiding. */ -#define CARES_SYMBOL_HIDING 1 - -/* Definition to make a library symbol externally visible. */ -#define CARES_SYMBOL_SCOPE_EXTERN __attribute__ ((__visibility__ ("default"))) - -/* the signed version of size_t */ -#define CARES_TYPEOF_ARES_SSIZE_T ssize_t - -/* Use resolver library to configure cares */ -/* #undef CARES_USE_LIBRESOLV */ - -/* if a /etc/inet dir is being used */ -/* #undef ETC_INET */ - -/* Define to the type of arg 2 for gethostname. */ -#define GETHOSTNAME_TYPE_ARG2 size_t - -/* Define to the type qualifier of arg 1 for getnameinfo. */ -#define GETNAMEINFO_QUAL_ARG1 const - -/* Define to the type of arg 1 for getnameinfo. */ -#define GETNAMEINFO_TYPE_ARG1 struct sockaddr * - -/* Define to the type of arg 2 for getnameinfo. */ -#define GETNAMEINFO_TYPE_ARG2 socklen_t - -/* Define to the type of args 4 and 6 for getnameinfo. */ -#define GETNAMEINFO_TYPE_ARG46 socklen_t - -/* Define to the type of arg 7 for getnameinfo. */ -#define GETNAMEINFO_TYPE_ARG7 int - -/* Specifies the number of arguments to getservbyport_r */ -#define GETSERVBYPORT_R_ARGS 6 - -/* Specifies the size of the buffer to pass to getservbyport_r */ -#define GETSERVBYPORT_R_BUFSIZE 4096 - -/* Define to 1 if you have AF_INET6. */ -#define HAVE_AF_INET6 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_ARPA_INET_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_ARPA_NAMESER_COMPAT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_ARPA_NAMESER_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_ASSERT_H 1 - -/* Define to 1 if you have the `bitncmp' function. */ -/* #undef HAVE_BITNCMP */ - -/* Define to 1 if bool is an available type. */ -#define HAVE_BOOL_T 1 - -/* Define to 1 if you have the clock_gettime function and monotonic timer. */ -#define HAVE_CLOCK_GETTIME_MONOTONIC 1 - -/* Define to 1 if you have the closesocket function. */ -/* #undef HAVE_CLOSESOCKET */ - -/* Define to 1 if you have the CloseSocket camel case function. */ -/* #undef HAVE_CLOSESOCKET_CAMEL */ - -/* Define to 1 if you have the connect function. */ -#define HAVE_CONNECT 1 - -/* define if the compiler supports basic C++11 syntax */ -#define HAVE_CXX11 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_DLFCN_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_ERRNO_H 1 - -/* Define to 1 if you have the fcntl function. */ -#define HAVE_FCNTL 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_FCNTL_H 1 - -/* Define to 1 if you have a working fcntl O_NONBLOCK function. */ -#define HAVE_FCNTL_O_NONBLOCK 1 - -/* Define to 1 if you have the freeaddrinfo function. */ -#define HAVE_FREEADDRINFO 1 - -/* Define to 1 if you have a working getaddrinfo function. */ -#define HAVE_GETADDRINFO 1 - -/* Define to 1 if the getaddrinfo function is threadsafe. */ -#define HAVE_GETADDRINFO_THREADSAFE 1 - -/* Define to 1 if you have the getenv function. */ -#define HAVE_GETENV 1 - -/* Define to 1 if you have the gethostbyaddr function. */ -#define HAVE_GETHOSTBYADDR 1 - -/* Define to 1 if you have the gethostbyname function. */ -#define HAVE_GETHOSTBYNAME 1 - -/* Define to 1 if you have the gethostname function. */ -#define HAVE_GETHOSTNAME 1 - -/* Define to 1 if you have the getnameinfo function. */ -#define HAVE_GETNAMEINFO 1 - -/* Define to 1 if you have the getservbyport_r function. */ -#define HAVE_GETSERVBYPORT_R 1 - -/* Define to 1 if you have the `gettimeofday' function. */ -#define HAVE_GETTIMEOFDAY 1 - -/* Define to 1 if you have the `if_indextoname' function. */ -#define HAVE_IF_INDEXTONAME 1 - -/* Define to 1 if you have a IPv6 capable working inet_net_pton function. */ -/* #undef HAVE_INET_NET_PTON */ - -/* Define to 1 if you have a IPv6 capable working inet_ntop function. */ -#define HAVE_INET_NTOP 1 - -/* Define to 1 if you have a IPv6 capable working inet_pton function. */ -#define HAVE_INET_PTON 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_INTTYPES_H 1 - -/* Define to 1 if you have the ioctl function. */ -#define HAVE_IOCTL 1 - -/* Define to 1 if you have the ioctlsocket function. */ -/* #undef HAVE_IOCTLSOCKET */ - -/* Define to 1 if you have the IoctlSocket camel case function. */ -/* #undef HAVE_IOCTLSOCKET_CAMEL */ - -/* Define to 1 if you have a working IoctlSocket camel case FIONBIO function. - */ -/* #undef HAVE_IOCTLSOCKET_CAMEL_FIONBIO */ - -/* Define to 1 if you have a working ioctlsocket FIONBIO function. */ -/* #undef HAVE_IOCTLSOCKET_FIONBIO */ - -/* Define to 1 if you have a working ioctl FIONBIO function. */ -#define HAVE_IOCTL_FIONBIO 1 - -/* Define to 1 if you have a working ioctl SIOCGIFADDR function. */ -#define HAVE_IOCTL_SIOCGIFADDR 1 - -/* Define to 1 if you have the `resolve' library (-lresolve). */ -/* #undef HAVE_LIBRESOLVE */ - -/* Define to 1 if you have the header file. */ -#define HAVE_LIMITS_H 1 - -/* if your compiler supports LL */ -#define HAVE_LL 1 - -/* Define to 1 if the compiler supports the 'long long' data type. */ -#define HAVE_LONGLONG 1 - -/* Define to 1 if you have the malloc.h header file. */ -#define HAVE_MALLOC_H 1 - -/* Define to 1 if you have the memory.h header file. */ -#define HAVE_MEMORY_H 1 - -/* Define to 1 if you have the MSG_NOSIGNAL flag. */ -//#define HAVE_MSG_NOSIGNAL 0 - -/* Define to 1 if you have the header file. */ -#define HAVE_NETDB_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_NETINET_IN_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_NETINET_TCP_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_NET_IF_H 1 - -/* Define to 1 if you have PF_INET6. */ -#define HAVE_PF_INET6 1 - -/* Define to 1 if you have the recv function. */ -#define HAVE_RECV 1 - -/* Define to 1 if you have the recvfrom function. */ -#define HAVE_RECVFROM 1 - -/* Define to 1 if you have the send function. */ -#define HAVE_SEND 1 - -/* Define to 1 if you have the setsockopt function. */ -#define HAVE_SETSOCKOPT 1 - -/* Define to 1 if you have a working setsockopt SO_NONBLOCK function. */ -/* #undef HAVE_SETSOCKOPT_SO_NONBLOCK */ - -/* Define to 1 if you have the header file. */ -#define HAVE_SIGNAL_H 1 - -/* Define to 1 if sig_atomic_t is an available typedef. */ -#define HAVE_SIG_ATOMIC_T 1 - -/* Define to 1 if sig_atomic_t is already defined as volatile. */ -/* #undef HAVE_SIG_ATOMIC_T_VOLATILE */ - -/* Define to 1 if your struct sockaddr_in6 has sin6_scope_id. */ -#define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1 - -/* Define to 1 if you have the socket function. */ -#define HAVE_SOCKET 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_SOCKET_H */ - -/* Define to 1 if you have the header file. */ -#define HAVE_STDBOOL_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDINT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDLIB_H 1 - -/* Define to 1 if you have the strcasecmp function. */ -#define HAVE_STRCASECMP 1 - -/* Define to 1 if you have the strcmpi function. */ -/* #undef HAVE_STRCMPI */ - -/* Define to 1 if you have the strdup function. */ -#define HAVE_STRDUP 1 - -/* Define to 1 if you have the stricmp function. */ -/* #undef HAVE_STRICMP */ - -/* Define to 1 if you have the header file. */ -#define HAVE_STRINGS_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRING_H 1 - -/* Define to 1 if you have the strncasecmp function. */ -#define HAVE_STRNCASECMP 1 - -/* Define to 1 if you have the strncmpi function. */ -/* #undef HAVE_STRNCMPI */ - -/* Define to 1 if you have the strnicmp function. */ -/* #undef HAVE_STRNICMP */ - -/* Define to 1 if you have the header file. */ -#define HAVE_STROPTS_H 1 - -/* Define to 1 if you have struct addrinfo. */ -#define HAVE_STRUCT_ADDRINFO 1 - -/* Define to 1 if you have struct in6_addr. */ -#define HAVE_STRUCT_IN6_ADDR 1 - -/* Define to 1 if you have struct sockaddr_in6. */ -#define HAVE_STRUCT_SOCKADDR_IN6 1 - -/* if struct sockaddr_storage is defined */ -#define HAVE_STRUCT_SOCKADDR_STORAGE 1 - -/* Define to 1 if you have the timeval struct. */ -#define HAVE_STRUCT_TIMEVAL 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_IOCTL_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_PARAM_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_SELECT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_SOCKET_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_STAT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TIME_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_UIO_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_TIME_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_UNISTD_H 1 - -/* Define to 1 if you have the windows.h header file. */ -/* #undef HAVE_WINDOWS_H */ - -/* Define to 1 if you have the winsock2.h header file. */ -/* #undef HAVE_WINSOCK2_H */ - -/* Define to 1 if you have the winsock.h header file. */ -/* #undef HAVE_WINSOCK_H */ - -/* Define to 1 if you have the writev function. */ -#define HAVE_WRITEV 1 - -/* Define to 1 if you have the ws2tcpip.h header file. */ -/* #undef HAVE_WS2TCPIP_H */ - -/* Define to the sub-directory where libtool stores uninstalled libraries. */ -#define LT_OBJDIR ".libs/" - -/* Define to 1 if you need the malloc.h header file even with stdlib.h */ -/* #undef NEED_MALLOC_H */ - -/* Define to 1 if you need the memory.h header file even with stdlib.h */ -/* #undef NEED_MEMORY_H */ - -/* Define to 1 if _REENTRANT preprocessor symbol must be defined. */ -/* #undef NEED_REENTRANT */ - -/* Define to 1 if _THREAD_SAFE preprocessor symbol must be defined. */ -/* #undef NEED_THREAD_SAFE */ - -/* cpu-machine-OS */ -#define OS "x86_64-pc-linux-gnu" - -/* Name of package */ -#define PACKAGE "c-ares" - -/* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "c-ares mailing list: http://cool.haxx.se/mailman/listinfo/c-ares" - -/* Define to the full name of this package. */ -#define PACKAGE_NAME "c-ares" - -/* Define to the full name and version of this package. */ -#define PACKAGE_STRING "c-ares 1.13.0" - -/* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "c-ares" - -/* Define to the home page for this package. */ -#define PACKAGE_URL "" - -/* Define to the version of this package. */ -#define PACKAGE_VERSION "1.13.0" - -/* a suitable file/device to read random data from */ -#define RANDOM_FILE "/dev/urandom" - -/* Define to the type qualifier pointed by arg 5 for recvfrom. */ -#define RECVFROM_QUAL_ARG5 - -/* Define to the type of arg 1 for recvfrom. */ -#define RECVFROM_TYPE_ARG1 int - -/* Define to the type pointed by arg 2 for recvfrom. */ -#define RECVFROM_TYPE_ARG2 void - -/* Define to 1 if the type pointed by arg 2 for recvfrom is void. */ -#define RECVFROM_TYPE_ARG2_IS_VOID 1 - -/* Define to the type of arg 3 for recvfrom. */ -#define RECVFROM_TYPE_ARG3 size_t - -/* Define to the type of arg 4 for recvfrom. */ -#define RECVFROM_TYPE_ARG4 int - -/* Define to the type pointed by arg 5 for recvfrom. */ -#define RECVFROM_TYPE_ARG5 struct sockaddr - -/* Define to 1 if the type pointed by arg 5 for recvfrom is void. */ -/* #undef RECVFROM_TYPE_ARG5_IS_VOID */ - -/* Define to the type pointed by arg 6 for recvfrom. */ -#define RECVFROM_TYPE_ARG6 socklen_t - -/* Define to 1 if the type pointed by arg 6 for recvfrom is void. */ -/* #undef RECVFROM_TYPE_ARG6_IS_VOID */ - -/* Define to the function return type for recvfrom. */ -#define RECVFROM_TYPE_RETV ssize_t - -/* Define to the type of arg 1 for recv. */ -#define RECV_TYPE_ARG1 int - -/* Define to the type of arg 2 for recv. */ -#define RECV_TYPE_ARG2 void * - -/* Define to the type of arg 3 for recv. */ -#define RECV_TYPE_ARG3 size_t - -/* Define to the type of arg 4 for recv. */ -#define RECV_TYPE_ARG4 int - -/* Define to the function return type for recv. */ -#define RECV_TYPE_RETV ssize_t - -/* Define as the return type of signal handlers (`int' or `void'). */ -#define RETSIGTYPE void - -/* Define to the type qualifier of arg 2 for send. */ -#define SEND_QUAL_ARG2 const - -/* Define to the type of arg 1 for send. */ -#define SEND_TYPE_ARG1 int - -/* Define to the type of arg 2 for send. */ -#define SEND_TYPE_ARG2 void * - -/* Define to the type of arg 3 for send. */ -#define SEND_TYPE_ARG3 size_t - -/* Define to the type of arg 4 for send. */ -#define SEND_TYPE_ARG4 int - -/* Define to the function return type for send. */ -#define SEND_TYPE_RETV ssize_t - -/* Define to 1 if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* Define to 1 if you can safely include both and . */ -#define TIME_WITH_SYS_TIME 1 - -/* Define to disable non-blocking sockets. */ -/* #undef USE_BLOCKING_SOCKETS */ - -/* Version number of package */ -#define VERSION "1.13.0" - -/* Define to avoid automatic inclusion of winsock.h */ -/* #undef WIN32_LEAN_AND_MEAN */ - -/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most - significant byte first (like Motorola and SPARC, unlike Intel). */ -#if defined AC_APPLE_UNIVERSAL_BUILD -# if defined __BIG_ENDIAN__ -# define WORDS_BIGENDIAN 1 -# endif -#else -# ifndef WORDS_BIGENDIAN -/* # undef WORDS_BIGENDIAN */ -# endif -#endif - -/* Define to 1 if OS is AIX. */ -#ifndef _ALL_SOURCE -/* # undef _ALL_SOURCE */ -#endif - -/* Enable large inode numbers on Mac OS X 10.5. */ -#ifndef _DARWIN_USE_64_BIT_INODE -# define _DARWIN_USE_64_BIT_INODE 1 -#endif - -/* Number of bits in a file offset, on hosts where this is settable. */ -/* #undef _FILE_OFFSET_BITS */ - -/* Define for large files, on AIX-style hosts. */ -/* #undef _LARGE_FILES */ - -/* Define to empty if `const' does not conform to ANSI C. */ -/* #undef const */ - -/* Type to use in place of in_addr_t when system does not provide it. */ -/* #undef in_addr_t */ - -/* Define to `unsigned int' if does not define. */ -/* #undef size_t */ diff --git a/gn/node/deps/googletest/BUILD.gn b/gn/node/deps/googletest/BUILD.gn deleted file mode 100644 index 1a7e767..0000000 --- a/gn/node/deps/googletest/BUILD.gn +++ /dev/null @@ -1,56 +0,0 @@ -# Copyright 2021 the V8 project authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import("//node/node.gni") - -config("gtest_config") { - include_dirs = [ "include" ] -} - -node_dep("googletest") { - testonly = true - include_dirs = [ - "include", - ".", - ] - defines = [ - "GTEST_HAS_POSIX_RE=0", - "GTEST_LANG_CXX11=1", - "GTEST_HAS_CLONE=0", - ] - sources = [ - "include/gtest/gtest_pred_impl.h", - "include/gtest/gtest-death-test.h", - "include/gtest/gtest-matchers.h", - "include/gtest/gtest-message.h", - "include/gtest/gtest-param-test.h", - "include/gtest/gtest-printers.h", - "include/gtest/gtest-spi.h", - "include/gtest/gtest-test-part.h", - "include/gtest/gtest-typed-test.h", - "include/gtest/gtest.h", - "include/gtest/internal/gtest-death-test-internal.h", - "include/gtest/internal/gtest-filepath.h", - "include/gtest/internal/gtest-internal.h", - "include/gtest/internal/gtest-param-util.h", - "include/gtest/internal/gtest-port-arch.h", - "include/gtest/internal/gtest-port.h", - "include/gtest/internal/gtest-string.h", - "include/gtest/internal/gtest-type-util.h", - "include/gtest/internal/custom/gtest-port.h", - "include/gtest/internal/custom/gtest-printers.h", - "include/gtest/internal/custom/gtest.h", - "src/gtest-all.cc", - "src/gtest-death-test.cc", - "src/gtest-filepath.cc", - "src/gtest-internal-inl.h", - "src/gtest-matchers.cc", - "src/gtest-port.cc", - "src/gtest-printers.cc", - "src/gtest-test-part.cc", - "src/gtest-typed-test.cc", - "src/gtest.cc", - "src/gtest_main.cc", - ] -} diff --git a/gn/node/deps/histogram/BUILD.gn b/gn/node/deps/histogram/BUILD.gn deleted file mode 100644 index 0731f4e..0000000 --- a/gn/node/deps/histogram/BUILD.gn +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright (c) 2013-2019 GitHub Inc. -# Copyright 2019 the V8 project authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import("//node/node.gni") - -config("external_config") { - defines = [ "HTTP_PARSER_STRICT=0" ] - include_dirs = [ "include" ] -} - -config("internal_config") { - cflags_c = [ - "-Wno-implicit-function-declaration", - "-Wno-incompatible-pointer-types", - ] -} - -node_dep("histogram") { - public_configs = [ ":external_config" ] - configs = [ ":internal_config" ] - sources = [ "src/hdr_histogram.c" ] -} diff --git a/gn/node/deps/llhttp/BUILD.gn b/gn/node/deps/llhttp/BUILD.gn deleted file mode 100644 index 0beb381..0000000 --- a/gn/node/deps/llhttp/BUILD.gn +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright (c) 2013-2019 GitHub Inc. -# Copyright 2019 the V8 project authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import("//node/node.gni") - -config("llhttp_config") { - include_dirs = [ "include" ] -} - -node_dep("llhttp") { - include_dirs = [ "include" ] - public_configs = [ ":llhttp_config" ] - sources = [ - "src/api.c", - "src/http.c", - "src/llhttp.c", - ] -} diff --git a/gn/node/deps/nghttp2/BUILD.gn b/gn/node/deps/nghttp2/BUILD.gn deleted file mode 100644 index 948b1f4..0000000 --- a/gn/node/deps/nghttp2/BUILD.gn +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright (c) 2013-2019 GitHub Inc. -# Copyright 2019 the V8 project authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import("//node/node_files.gni") -import("//node/node.gni") - -config("nghttp2_config") { - defines = [ "NGHTTP2_STATICLIB" ] - include_dirs = [ "lib/includes" ] -} - -node_dep("nghttp2") { - public_configs = [ ":nghttp2_config" ] - defines = [ - "_U_", - "BUILDING_NGHTTP2", - "NGHTTP2_STATICLIB", - "HAVE_CONFIG_H" - ] - include_dirs = [ "lib/includes" ] - cflags_c = [ - "-Wno-implicit-function-declaration", - "-Wno-string-plus-int" - ] - sources = node_files.nghttp2_sources -} diff --git a/gn/node/deps/ngtcp2/BUILD.gn b/gn/node/deps/ngtcp2/BUILD.gn deleted file mode 100644 index 78619e1..0000000 --- a/gn/node/deps/ngtcp2/BUILD.gn +++ /dev/null @@ -1,114 +0,0 @@ -# Copyright (c) 2013-2021 GitHub Inc. -# Copyright 2021 the V8 project authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import("//node/node.gni") - -config("ngtcp2_config") { - defines = [ "NGTCP2_STATICLIB" ] - include_dirs = [ - "ngtcp2/lib/includes/", - "ngtcp2/crypto/includes/", - "nghttp3/lib/includes/", - "nghttp3/lib/" - ] -} - -node_dep("ngtcp2") { - public_configs = [ ":ngtcp2_config" ] - defines = [ - "_U_", - "BUILDING_NGTCP2", - "NGTCP2_STATICLIB", - "NGHTTP3_STATICLIB", - ] - - include_dirs = [ - "ngtcp2/lib/includes/", - "ngtcp2/crypto/includes/", - "ngtcp2/lib/", - "ngtcp2/crypto/", - "nghttp3/lib/includes/", - "nghttp3/lib/" - ] - - if (is_win) { - defines += [ - "WIN32", - "_WINDOWS", - "HAVE_CONFIG_H", - ] - } - - if (is_linux) { - defines += [ - "HAVE_ARPA_INET_H", - "HAVE_NETINET_IN_H", - ] - } - - cflags_c = [ - "-Wno-implicit-function-declaration", - "-Wno-string-plus-int", - "-Wno-sometimes-uninitialized", - "-Wno-return-type" - ] - - sources = [ - "nghttp3/lib/nghttp3_buf.c", - "nghttp3/lib/nghttp3_conn.c", - "nghttp3/lib/nghttp3_conv.c", - "nghttp3/lib/nghttp3_debug.c", - "nghttp3/lib/nghttp3_err.c", - "nghttp3/lib/nghttp3_frame.c", - "nghttp3/lib/nghttp3_gaptr.c", - "nghttp3/lib/nghttp3_http.c", - "nghttp3/lib/nghttp3_idtr.c", - "nghttp3/lib/nghttp3_ksl.c", - "nghttp3/lib/nghttp3_map.c", - "nghttp3/lib/nghttp3_mem.c", - "nghttp3/lib/nghttp3_pq.c", - "nghttp3/lib/nghttp3_qpack.c", - "nghttp3/lib/nghttp3_qpack_huffman.c", - "nghttp3/lib/nghttp3_qpack_huffman_data.c", - "nghttp3/lib/nghttp3_range.c", - "nghttp3/lib/nghttp3_rcbuf.c", - "nghttp3/lib/nghttp3_ringbuf.c", - "nghttp3/lib/nghttp3_str.c", - "nghttp3/lib/nghttp3_stream.c", - "nghttp3/lib/nghttp3_tnode.c", - "nghttp3/lib/nghttp3_vec.c", - "nghttp3/lib/nghttp3_version.c", - "ngtcp2/lib/ngtcp2_acktr.c", - "ngtcp2/lib/ngtcp2_addr.c", - "ngtcp2/lib/ngtcp2_buf.c", - "ngtcp2/lib/ngtcp2_cc.c", - "ngtcp2/lib/ngtcp2_cid.c", - "ngtcp2/lib/ngtcp2_conn.c", - "ngtcp2/lib/ngtcp2_conv.c", - "ngtcp2/lib/ngtcp2_crypto.c", - "ngtcp2/lib/ngtcp2_err.c", - "ngtcp2/lib/ngtcp2_gaptr.c", - "ngtcp2/lib/ngtcp2_idtr.c", - "ngtcp2/lib/ngtcp2_ksl.c", - "ngtcp2/lib/ngtcp2_log.c", - "ngtcp2/lib/ngtcp2_map.c", - "ngtcp2/lib/ngtcp2_mem.c", - "ngtcp2/lib/ngtcp2_path.c", - "ngtcp2/lib/ngtcp2_pkt.c", - "ngtcp2/lib/ngtcp2_ppe.c", - "ngtcp2/lib/ngtcp2_pq.c", - "ngtcp2/lib/ngtcp2_pv.c", - "ngtcp2/lib/ngtcp2_qlog.c", - "ngtcp2/lib/ngtcp2_range.c", - "ngtcp2/lib/ngtcp2_ringbuf.c", - "ngtcp2/lib/ngtcp2_rob.c", - "ngtcp2/lib/ngtcp2_rst.c", - "ngtcp2/lib/ngtcp2_rtb.c", - "ngtcp2/lib/ngtcp2_str.c", - "ngtcp2/lib/ngtcp2_strm.c", - "ngtcp2/lib/ngtcp2_vec.c", - "ngtcp2/lib/ngtcp2_version.c", - ] -} diff --git a/gn/node/deps/openssl/BUILD.gn b/gn/node/deps/openssl/BUILD.gn deleted file mode 100644 index 2963171..0000000 --- a/gn/node/deps/openssl/BUILD.gn +++ /dev/null @@ -1,88 +0,0 @@ -# Copyright 2019 the V8 project authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import("//node/node_files.gni") -import("//node/node.gni") - -declare_args() { - # Defaults for OpenSSL config path. - if (is_linux) { - openssl_dir = "/etc/ssl/" - } else if (is_mac) { - openssl_dir = "/System/Library/OpenSSL/" - } else { - openssl_dir = "" - } - - # Security level as described in - # https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_set_security_level.html - openssl_seclevel = 1 -} - -config("external_config") { - include_dirs = [ "openssl/include" ] -} - -config("internal_config") { - cflags_c = [ - "-Wno-implicit-function-declaration", - "-Wno-constant-conversion", - "-Wno-incompatible-pointer-types", - "-Wno-constant-conversion", - ] - if (is_posix || is_fuchsia) { - asmflags = [ "-fPIC" ] - cflags = [ "-fPIC" ] - ldflags = [ "-fPIC" ] - } - cflags_cc = [ "-Wno-sign-compare" ] - include_dirs = [ - "openssl", - "openssl/crypto/", - "openssl/crypto/include/", - "openssl/crypto/include/internal", - "openssl/crypto/modes/", - "openssl/crypto/ec/curve448", - "openssl/crypto/ec/curve448/arch_32", - "openssl/providers/common/include/", - "openssl/providers/implementations/include", - "config/archs/linux-x86_64/no-asm/crypto", - "config/archs/linux-x86_64/no-asm/providers/common/include", - "config", - ] - if (is_win) { - libs = [ "crypt32.lib" ] - } -} - -openssl_defines = [ - "NDEBUG", - "OPENSSL_USE_NODELETE", - "L_ENDIAN", - "OPENSSL_PIC", - "OPENSSL_NO_ASM", - "OPENSSL_NO_HW", - "OPENSSLDIR=\"$openssl_dir\"", - "ENGINESDIR=\"/dev/null\"", - "OPENSSL_TLS_SECURITY_LEVEL=$openssl_seclevel", - "MODULESDIR=\"deps/openssl/lib/openssl-modules\"", -] - -source_set("openssl_crypto_o_str") { - # This is a hack to undef _GNU_SOURCE only for openssl/crypto/o_str.c - visibility = [ ":openssl" ] - sources = [ "openssl/crypto/o_str.c" ] - defines = openssl_defines - configs += [ ":internal_config", ":external_config" ] - cflags = [ "-U_GNU_SOURCE" ] -} - -node_dep("openssl") { - sources = node_files.openssl_sources - sources -= [ "openssl/crypto/o_str.c" ] - defines = openssl_defines - public_configs = [ ":external_config" ] - configs = [ ":internal_config" ] - deps = [ ":openssl_crypto_o_str" ] -} diff --git a/gn/node/deps/postject/BUILD.gn b/gn/node/deps/postject/BUILD.gn deleted file mode 100644 index bbf67fc..0000000 --- a/gn/node/deps/postject/BUILD.gn +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright (c) 2013-2019 GitHub Inc. -# Copyright 2019 the V8 project authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import("//node/node.gni") - -config("postject_config") { - include_dirs = [ "." ] -} - -node_dep("postject") { - public_configs = [ ":postject_config" ] - sources = [ "postject-api.h" ] -} diff --git a/gn/node/deps/simdutf/BUILD.gn b/gn/node/deps/simdutf/BUILD.gn deleted file mode 100644 index d3f956d..0000000 --- a/gn/node/deps/simdutf/BUILD.gn +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright (c) 2013-2019 GitHub Inc. -# Copyright 2019 the V8 project authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import("//node/node.gni") - -config("simdutf_config") { - include_dirs = [ "." ] - cflags_cc = [ - "-Wno-unused-function", - "-Wno-ambiguous-reversed-operator", - ] -} - -node_dep("simdutf") { - public_configs = [ ":simdutf_config" ] - sources = [ "simdutf.cpp", "simdutf.h" ] -} diff --git a/gn/node/deps/uv/BUILD.gn b/gn/node/deps/uv/BUILD.gn deleted file mode 100644 index 34e39e1..0000000 --- a/gn/node/deps/uv/BUILD.gn +++ /dev/null @@ -1,461 +0,0 @@ -# Copyright (c) 2013-2019 GitHub Inc. -# Copyright 2019 the V8 project authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import("//node/node.gni") - -if (is_fuchsia) { - import("//third_party/fuchsia-sdk/sdk/build/component.gni") - import("//third_party/fuchsia-sdk/sdk/build/package.gni") -} - -config("libuv_config") { - include_dirs = [ - "include", - "src", - ] - - defines = [] - - if (is_linux) { - defines += [ - "_POSIX_C_SOURCE=200112", - "_GNU_SOURCE", - ] - } - if (!is_win) { - defines += [ - "_LARGEFILE_SOURCE", - "_FILE_OFFSET_BITS=64", - - # This only has an effect on Windows, where it will cause libuv's - # symbols to be exported in node.lib - "BUILDING_UV_SHARED=1", - ] - } - if (is_mac) { - defines += [ - "_DARWIN_USE_64_BIT_INODE=1", - "_DARWIN_UNLIMITED_SELECT=1", - ] - } -} - -node_dep("uv") { - # This happens everywhere in libuv code when compiling in debug mode. - cflags_c = [ - "-Wno-string-conversion", - "-Wno-shadow" - ] - public_configs = [ ":libuv_config" ] - libs = [] - ldflags = [] - - sources = [ - "include/uv.h", - "include/uv/tree.h", - "include/uv/errno.h", - "include/uv/threadpool.h", - "include/uv/version.h", - "src/fs-poll.c", - "src/heap-inl.h", - "src/idna.c", - "src/idna.h", - "src/inet.c", - "src/queue.h", - "src/random.c", - "src/strscpy.c", - "src/strscpy.h", - "src/strtok.c", - "src/strtok.h", - "src/thread-common.c", - "src/threadpool.c", - "src/timer.c", - "src/uv-data-getter-setters.c", - "src/uv-common.c", - "src/uv-common.h", - "src/version.c", - ] - - if (is_win) { - sources += [ - "include/uv/win.h", - "src/win/async.c", - "src/win/atomicops-inl.h", - "src/win/core.c", - "src/win/detect-wakeup.c", - "src/win/dl.c", - "src/win/error.c", - "src/win/fs.c", - "src/win/fs-event.c", - "src/win/getaddrinfo.c", - "src/win/getnameinfo.c", - "src/win/handle.c", - "src/win/handle-inl.h", - "src/win/internal.h", - "src/win/loop-watcher.c", - "src/win/pipe.c", - "src/win/thread.c", - "src/win/poll.c", - "src/win/process.c", - "src/win/process-stdio.c", - "src/win/req-inl.h", - "src/win/signal.c", - "src/win/snprintf.c", - "src/win/stream.c", - "src/win/stream-inl.h", - "src/win/tcp.c", - "src/win/tty.c", - "src/win/udp.c", - "src/win/util.c", - "src/win/winapi.c", - "src/win/winapi.h", - "src/win/winsock.c", - "src/win/winsock.h", - ] - libs += [ - "advapi32.lib", - "iphlpapi.lib", - "psapi.lib", - "shell32.lib", - "user32.lib", - "userenv.lib", - "ws2_32.lib", - ] - } else { - sources += [ - "include/uv/unix.h", - "include/uv/linux.h", - "include/uv/sunos.h", - "include/uv/darwin.h", - "include/uv/bsd.h", - "include/uv/aix.h", - "src/unix/async.c", - "src/unix/core.c", - "src/unix/dl.c", - "src/unix/fs.c", - "src/unix/getaddrinfo.c", - "src/unix/getnameinfo.c", - "src/unix/internal.h", - "src/unix/loop.c", - "src/unix/loop-watcher.c", - "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", - "src/unix/thread.c", - "src/unix/tty.c", - "src/unix/udp.c", - ] - libs += [ "m" ] - ldflags += [ "-pthread" ] - } - if (is_mac || is_linux) { - sources += [ "src/unix/proctitle.c" ] - } - if (is_mac) { - sources += [ - "src/unix/darwin-proctitle.c", - "src/unix/darwin.c", - "src/unix/fsevents.c", - "src/unix/random-getentropy.c", - ] - } - if (is_linux) { - sources += [ - "src/unix/linux.c", - "src/unix/procfs-exepath.c", - "src/unix/random-getrandom.c", - "src/unix/random-sysctl-linux.c", - ] - libs += [ - "dl", - "rt", - ] - } - if (is_mac) { # is_bsd - sources += [ - "src/unix/bsd-ifaddrs.c", - "src/unix/kqueue.c", - ] - } - if (is_fuchsia) { - sources += [ - "src/unix/fuchsia.c", - "src/unix/no-fsevents.c", - "src/unix/no-proctitle.c", - "src/unix/posix-hrtime.c", - "src/unix/posix-poll.c", - ] - deps = [ - "//third_party/fuchsia-sdk/sdk/pkg/fdio", - ] - } -} - -source_set("test-close-fd") { - cflags_c = [ - "-Wno-string-conversion", - "-Wno-shadow" - ] - sources = [ - "test/test-close-fd.c", - ] - deps = [ - ":uv", - ] -} - -source_set("test-tty") { - cflags_c = [ - "-Wno-string-conversion", - "-Wno-shadow" - ] - sources = [ - "test/test-tty-duplicate-key.c", - "test/test-tty-escape-sequence-processing.c", - "test/test-tty.c", - ] - deps = [ - ":uv", - ] -} - -source_set("runner_unix") { - cflags_c = [ - "-Wno-incompatible-pointer-types-discards-qualifiers", - "-Wno-shadow" - ] - sources = [ - "test/runner-unix.h", - "test/runner-unix.c", - ] - deps = [ - ":uv" - ] - if (is_fuchsia) { - deps += [ "//third_party/fuchsia-sdk/sdk/pkg/fdio" ] - } -} - -# TODO(v8:11554): This target currently do not build on Mac. -if (is_linux || is_fuchsia) { - executable("uv_tests") { - cflags_c = [ - "-Wno-implicit-fallthrough", - "-Wno-shadow", - "-Wno-unused-but-set-variable", - ] - - sources = [ - "test/blackhole-server.c", - "test/echo-server.c", - "test/run-tests.c", - "test/runner.c", - "test/test-active.c", - "test/test-async-null-cb.c", - "test/test-async.c", - "test/test-barrier.c", - "test/test-callback-stack.c", - "test/test-close-order.c", - "test/test-condvar.c", - "test/test-connect-unspecified.c", - "test/test-connection-fail.c", - "test/test-cwd-and-chdir.c", - "test/test-default-loop-close.c", - "test/test-delayed-accept.c", - "test/test-dlerror.c", - "test/test-eintr-handling.c", - "test/test-embed.c", - "test/test-env-vars.c", - "test/test-error.c", - "test/test-fail-always.c", - "test/test-fork.c", - "test/test-fs-copyfile.c", - "test/test-fs-event.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-get-currentexe.c", - "test/test-get-loadavg.c", - "test/test-get-memory.c", - "test/test-get-passwd.c", - "test/test-getaddrinfo.c", - "test/test-gethostname.c", - "test/test-getnameinfo.c", - "test/test-getsockname.c", - "test/test-getters-setters.c", - "test/test-gettimeofday.c", - "test/test-handle-fileno.c", - "test/test-homedir.c", - "test/test-hrtime.c", - "test/test-idle.c", - "test/test-ip4-addr.c", - "test/test-ip6-addr.c", - "test/test-ip-name.c", - "test/test-ipc-heavy-traffic-deadlock-bug.c", - "test/test-ipc-send-recv.c", - "test/test-ipc.c", - "test/test-loop-alive.c", - "test/test-loop-close.c", - "test/test-loop-configure.c", - "test/test-loop-handles.c", - "test/test-loop-stop.c", - "test/test-loop-time.c", - "test/test-metrics.c", - "test/test-multiple-listen.c", - "test/test-mutexes.c", - "test/test-not-readable-nor-writable-on-read-error.c", - "test/test-not-writable-after-shutdown.c", - "test/test-osx-select.c", - "test/test-pass-always.c", - "test/test-ping-pong.c", - "test/test-pipe-bind-error.c", - "test/test-pipe-close-stdout-read-stdin.c", - "test/test-pipe-connect-error.c", - "test/test-pipe-connect-multiple.c", - "test/test-pipe-connect-prepare.c", - "test/test-pipe-getsockname.c", - "test/test-pipe-pending-instances.c", - "test/test-pipe-sendmsg.c", - "test/test-pipe-server-close.c", - "test/test-pipe-set-fchmod.c", - "test/test-pipe-set-non-blocking.c", - "test/test-platform-output.c", - "test/test-poll-close-doesnt-corrupt-stack.c", - "test/test-poll-close.c", - "test/test-poll-closesocket.c", - "test/test-poll-multiple-handles.c", - "test/test-poll-oob.c", - "test/test-poll.c", - "test/test-process-title-threadsafe.c", - "test/test-process-title.c", - "test/test-queue-foreach-delete.c", - "test/test-random.c", - "test/test-readable-on-eof.c", - "test/test-ref.c", - "test/test-run-nowait.c", - "test/test-run-once.c", - "test/test-semaphore.c", - "test/test-shutdown-close.c", - "test/test-shutdown-eof.c", - "test/test-shutdown-simultaneous.c", - "test/test-shutdown-twice.c", - "test/test-signal-multiple-loops.c", - "test/test-signal-pending-on-close.c", - "test/test-signal.c", - "test/test-socket-buffer-size.c", - "test/test-spawn.c", - "test/test-stdio-over-pipes.c", - "test/test-strtok.c", - "test/test-tcp-alloc-cb-fail.c", - "test/test-tcp-bind-error.c", - "test/test-tcp-bind6-error.c", - "test/test-tcp-close-accept.c", - "test/test-tcp-close-after-read-timeout.c", - "test/test-tcp-close-while-connecting.c", - "test/test-tcp-close.c", - "test/test-tcp-close-reset.c", - "test/test-tcp-connect-error-after-write.c", - "test/test-tcp-connect-error.c", - "test/test-tcp-connect-timeout.c", - "test/test-tcp-connect6-error.c", - "test/test-tcp-create-socket-early.c", - "test/test-tcp-flags.c", - "test/test-tcp-oob.c", - "test/test-tcp-open.c", - "test/test-tcp-read-stop.c", - "test/test-tcp-read-stop-start.c", - "test/test-tcp-rst.c", - "test/test-tcp-shutdown-after-write.c", - "test/test-tcp-try-write.c", - "test/test-tcp-write-in-a-row.c", - "test/test-tcp-try-write-error.c", - "test/test-tcp-unexpected-read.c", - "test/test-tcp-write-after-connect.c", - "test/test-tcp-write-fail.c", - "test/test-tcp-write-queue-order.c", - "test/test-tcp-write-to-half-open-connection.c", - "test/test-tcp-writealot.c", - "test/test-test-macros.c", - "test/test-thread-affinity.c", - "test/test-thread-equal.c", - "test/test-thread.c", - "test/test-threadpool-cancel.c", - "test/test-threadpool.c", - "test/test-timer-again.c", - "test/test-timer-from-check.c", - "test/test-timer.c", - "test/test-tmpdir.c", - "test/test-udp-alloc-cb-fail.c", - "test/test-udp-bind.c", - "test/test-udp-connect.c", - "test/test-udp-connect6.c", - "test/test-udp-create-socket-early.c", - "test/test-udp-dgram-too-big.c", - "test/test-udp-ipv6.c", - "test/test-udp-mmsg.c", - "test/test-udp-multicast-interface.c", - "test/test-udp-multicast-interface6.c", - "test/test-udp-multicast-join.c", - "test/test-udp-multicast-join6.c", - "test/test-udp-multicast-ttl.c", - "test/test-udp-open.c", - "test/test-udp-options.c", - "test/test-udp-send-and-recv.c", - "test/test-udp-send-hang-loop.c", - "test/test-udp-send-immediate.c", - "test/test-udp-sendmmsg-error.c", - "test/test-udp-send-unreachable.c", - "test/test-udp-try-send.c", - "test/test-udp-recv-in-a-row.c", - "test/test-uname.c", - "test/test-walk-handles.c", - ] - - deps = [ - ":uv", - ":runner_unix", - ":test-tty", - ":test-close-fd", - ] - - if (is_fuchsia) { - deps += [ "//third_party/fuchsia-sdk/sdk/pkg/fdio" ] - } - - if (is_linux) { - sources += [ - "test/test-emfile.c", - "test/test-idna.c", - "test/test-strscpy.c", - "test/test-watcher-cross-stop.c", - "test/test-process-priority.c", - ] - - libs = [ "util" ] - } - } - - if (is_fuchsia) { - fuchsia_component("uv_tests_cmx") { - manifest = "//gn/node/deps/uv/meta/uv_tests.cmx" - data_deps = [ - ":uv_tests", - ] - } - - fuchsia_package("uv_tests_package") { - package_name = "uv_tests" - deps = [ - ":uv_tests_cmx", - ] - } - } -} diff --git a/gn/node/deps/uv/meta/uv_tests.cmx b/gn/node/deps/uv/meta/uv_tests.cmx deleted file mode 100644 index 828618a..0000000 --- a/gn/node/deps/uv/meta/uv_tests.cmx +++ /dev/null @@ -1,18 +0,0 @@ -{ - "program": { - "binary": "uv_tests" - }, - "sandbox": { - "dev": [ - "null", - "zero" - ], - "features": [ - "isolated-temp" - ], - "services": [ - "fuchsia.process.Launcher", - "fuchsia.posix.socket.Provider" - ] - } -} \ No newline at end of file diff --git a/gn/node/deps/uvwasi/BUILD.gn b/gn/node/deps/uvwasi/BUILD.gn deleted file mode 100644 index 5341aec..0000000 --- a/gn/node/deps/uvwasi/BUILD.gn +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2013-2019 GitHub Inc. -# Copyright 2019 the V8 project authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import("//node/node.gni") - -config("includes") { - include_dirs = [ - "include", - "src", - ] -} - -node_dep("uvwasi") { - sources = [ - "src/clocks.c", - "src/clocks.h", - "src/debug.h", - "src/fd_table.c", - "src/path_resolver.c", - "src/path_resolver.h", - "src/poll_oneoff.c", - "src/poll_oneoff.h", - "src/sync_helpers.c", - "src/sync_helpers.h", - "src/uv_mapping.c", - "src/uv_mapping.h", - "src/uvwasi_alloc.h", - "src/uvwasi.c", - "src/wasi_rights.c", - "src/wasi_rights.h", - "src/wasi_serdes.c", - "include/fd_table.h", - "include/uv_wasi.h", - "include/wasi_types.h", - ] - - public_configs = [ - ":includes" - ] - - deps = [ - "//node/deps/uv" - ] -} diff --git a/gn/node/meta/node.cmx b/gn/node/meta/node.cmx deleted file mode 100644 index ddf7e30..0000000 --- a/gn/node/meta/node.cmx +++ /dev/null @@ -1,19 +0,0 @@ -{ - "program": { - "binary": "node" - }, - "sandbox": { - "dev": [ - "null", - "zero" - ], - "features": [ - "isolated-temp", - "deprecated-ambient-replace-as-executable" - ], - "services": [ - "fuchsia.process.Launcher", - "fuchsia.posix.socket.Provider" - ] - } -} \ No newline at end of file diff --git a/gn/node/meta/node_cctest.cmx b/gn/node/meta/node_cctest.cmx deleted file mode 100644 index 01e7e2e..0000000 --- a/gn/node/meta/node_cctest.cmx +++ /dev/null @@ -1,5 +0,0 @@ -{ - "program": { - "binary": "node_cctest" - } -} \ No newline at end of file diff --git a/gn/node/node.gni b/gn/node/node.gni deleted file mode 100644 index 3650557..0000000 --- a/gn/node/node.gni +++ /dev/null @@ -1,105 +0,0 @@ -# Copyright 2019 the V8 project authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import("//v8/gni/snapshot_toolchain.gni") - -declare_args() { - # Compile node modules with custom libc++ - node_use_custom_libcxx = false -} - -if (is_win) { - node_exe = "node.exe" -} else { - node_exe = "node" -} - -template("node_dep") { - static_library(target_name) { - forward_variables_from(invoker, "*", ["configs", "remove_configs"]) - if (defined(invoker.configs)) { - configs += invoker.configs - } - if (is_posix || is_mac || is_fuchsia) { - configs -= [ "//build/config/gcc:symbol_visibility_hidden" ] - configs += [ "//build/config/gcc:symbol_visibility_default" ] - } - configs += [ "//build/config/compiler:no_chromium_code" ] - configs -= [ "//build/config/compiler:chromium_code" ] - if (defined(invoker.remove_configs)) { - configs -= invoker.remove_configs - } - } -} - -template("call_node") { - action(target_name) { - deps = invoker.deps + [ "//node:node($v8_snapshot_toolchain)" ] - script = "//tools/run_executable_in_dir.py" - inputs = invoker.inputs - stamp = "$target_gen_dir/$target_name.stamp" - outputs = [ stamp ] - exe = get_label_info("//node:node($v8_snapshot_toolchain)", - "root_out_dir") + "/" + node_exe - base = invoker.base - env = [] - if (defined(invoker.env)) { - env = invoker.env - } - args = [ - rebase_path(base, root_build_dir), - rebase_path(stamp, root_build_dir), - ] + env + [ - rebase_path(exe, base), - ] + invoker.args - } -} - -# TODO: add correct list of outputs. -template("build_addons") { - call_node(target_name) { - deps = invoker.deps - build_scripts = [ - "//node/tools/build-addons.mjs", - "//node/deps/npm/node_modules/node-gyp/bin/node-gyp.js", - ] - inputs = invoker.inputs + build_scripts - base = root_gen_dir - - env = [ - "--env", "npm_config_loglevel", "silent", - "--env", "npm_config_python", "python", - "--env", "npm_config_nodedir", - rebase_path("$root_gen_dir/node", root_build_dir), - # Force native modules to be compile with clang - "--env", "CXX", - rebase_path("//third_party/llvm-build/Release+Asserts/bin/clang++"), - - ] - if (node_use_custom_libcxx) { - libcpp_path = rebase_path("//buildtools/third_party/libc++") - libcppabi_path = rebase_path("//buildtools/third_party/libc++abi/trunk/include") - env += [ "--env", "CFLAGS", "-nostdinc++ -isystem $libcpp_path -isystem $libcpp_path/trunk/include -isystem $libcppabi_path" ] - } - args = rebase_path(build_scripts, base) + - [ rebase_path(target_gen_dir, base) ] - } -} - -template("sync_files") { - copy("$target_name.copy") { - sources = invoker.sources - outputs = [ "$target_gen_dir/{{source_target_relative}}" ] - } - action(target_name) { - script = "//tools/mirror_removal.py" - inputs = [ "//node_files.json" ] - outputs = [ "$target_gen_dir/$target_name.stamp" ] - args = rebase_path([ - ".", - target_gen_dir, - ] + outputs, root_build_dir) - public_deps = [":$target_name.copy"] - } -} diff --git a/gn/node/node_component.gni b/gn/node/node_component.gni deleted file mode 100644 index fd94356..0000000 --- a/gn/node/node_component.gni +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright 2020 the V8 project authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import("//third_party/fuchsia-sdk/sdk/build/package.gni") -import("//third_party/fuchsia-sdk/sdk/build/component.gni") - -# Define a Fuchsia Node Component -# Parameters -# -# manifest: -# Required: The source manifest file for this component. This can be -# either a v1 (.cmx) or v2 (.cml) manifest. v2 manifests must have -# the file extension ".cml". -# -# node_modules: -# Optional: Node modules dependencies. -# -# sources: -# Optional: JS files to be included in the package. -# -template("node_component") { - assert(defined(invoker.manifest), "manifest file required for this component") - - if (!defined(invoker.node_modules)) { - node_modules = [] - } else { - node_modules = invoker.node_modules - } - - # Write the npm dependencies as runtime deps - data = exec_script("//tools/npm.py", node_modules, "value") - - copy("$target_name.sources") { - sources = invoker.sources - outputs = [ "$root_gen_dir/{{source_target_relative}}" ] - } - - fuchsia_component("$target_name") { - manifest = invoker.manifest - data_deps = [ "//node:node" ] - if (defined(invoker.sources)) { - data_deps += [ ":$target_name.sources" ] - } - } -} \ No newline at end of file diff --git a/gn/node/node_files.gni b/gn/node/node_files.gni deleted file mode 100644 index fb2b89f..0000000 --- a/gn/node/node_files.gni +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright 2019 the V8 project authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -node_files = read_file("//node_files.json", "json") - -npm_cli = "//node/deps/npm/bin/npm-cli.js" - -node_headers = [ - "//node/deps/uv/include", - "//node/deps/openssl/openssl/include", - "//node/deps/openssl/config", - "//node/src/node.h", - "//node/src/node_buffer.h", - "//node/src/node_object_wrap.h", - "//node/src/node_version.h", - "//node/src/util-inl.h", - "//node/common.gypi", -] - -node_api_headers = [ - "//node/src/node_api.h", - "//node/src/node_api_types.h", - "//node/src/js_native_api.h", - "//node/src/js_native_api_types.h", - "//node/src/js_native_api_v8.h", - "//node/src/js_native_api_v8_internals.h", -] diff --git a/gn/node/src/inspector/BUILD.gn b/gn/node/src/inspector/BUILD.gn deleted file mode 100644 index b2834f8..0000000 --- a/gn/node/src/inspector/BUILD.gn +++ /dev/null @@ -1,201 +0,0 @@ -# Copyright (c) 2013-2019 GitHub Inc. -# Copyright 2019 the V8 project authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import("//node/node.gni") -import("//node/node_files.gni") -import("//v8/gni/v8.gni") - -inspector_protocol_dir = "../../tools/inspector_protocol" - -config("inspector_config") { - include_dirs = [ - "$target_gen_dir", - "$target_gen_dir/src", - ] -} - -_protocol_generated = [ - "protocol/Forward.h", - "protocol/Protocol.cpp", - "protocol/Protocol.h", - "protocol/NodeWorker.cpp", - "protocol/NodeWorker.h", - "protocol/NodeTracing.cpp", - "protocol/NodeTracing.h", - "protocol/NodeRuntime.cpp", - "protocol/NodeRuntime.h", -] - -# These are from node_protocol_config.json -# These convoluted path hacks are to work around the fact that node.js is very -# confused about what paths are in its includes, without changing node at all. -# Hopefully, keying everything in this file off the paths that are in -# node_protocol_config.json will mean that the paths stay in sync. -inspector_protocol_package = "src/node/inspector/protocol" -inspector_protocol_output = "node/inspector/protocol" - -node_dep("inspector") { - sources = node_files.inspector_sources - sources += rebase_path(_protocol_generated, - ".", - "$target_gen_dir/$inspector_protocol_package/..") - include_dirs = [ - "$target_gen_dir", - "$target_gen_dir/src", - "//v8/include", - "..", - ] - deps = [ - ":protocol_generated_sources", - ":v8_inspector_compress_protocol_json", - "../../deps/ada", - "../../deps/llhttp", - "../../deps/openssl", - "../../deps/uv", - "../../deps/base64", - "../../deps/simdutf", - "//third_party/icu:icuuc", - "//third_party/zlib", - ] - public_configs = [ ":inspector_config" ] - configs = [ "//node:node_base_internal" ] -} - -# This based on the template from //v8/../inspector_protocol.gni -action("protocol_generated_sources") { - # This is to ensure that the output directory exists--the code generator - # doesn't create it. - write_file("$target_gen_dir/$inspector_protocol_package/.dummy", "") - script = "$inspector_protocol_dir/code_generator.py" - - inputs = [ - "$target_gen_dir/node_protocol_config.json", - "$target_gen_dir/src/node_protocol.json", - "$inspector_protocol_dir/lib/Allocator_h.template", - "$inspector_protocol_dir/lib/Array_h.template", - "$inspector_protocol_dir/lib/base_string_adapter_cc.template", - "$inspector_protocol_dir/lib/base_string_adapter_h.template", - "$inspector_protocol_dir/lib/DispatcherBase_cpp.template", - "$inspector_protocol_dir/lib/DispatcherBase_h.template", - "$inspector_protocol_dir/lib/encoding_cpp.template", - "$inspector_protocol_dir/lib/encoding_h.template", - "$inspector_protocol_dir/lib/ErrorSupport_cpp.template", - "$inspector_protocol_dir/lib/ErrorSupport_h.template", - "$inspector_protocol_dir/lib/Forward_h.template", - "$inspector_protocol_dir/lib/FrontendChannel_h.template", - "$inspector_protocol_dir/lib/Maybe_h.template", - "$inspector_protocol_dir/lib/Object_cpp.template", - "$inspector_protocol_dir/lib/Object_h.template", - "$inspector_protocol_dir/lib/Parser_cpp.template", - "$inspector_protocol_dir/lib/Parser_h.template", - "$inspector_protocol_dir/lib/Protocol_cpp.template", - "$inspector_protocol_dir/lib/ValueConversions_h.template", - "$inspector_protocol_dir/lib/Values_cpp.template", - "$inspector_protocol_dir/lib/Values_h.template", - "$inspector_protocol_dir/templates/Exported_h.template", - "$inspector_protocol_dir/templates/Imported_h.template", - "$inspector_protocol_dir/templates/TypeBuilder_cpp.template", - "$inspector_protocol_dir/templates/TypeBuilder_h.template", - ] - - deps = [ - ":node_protocol_config", - ":node_protocol_json", - ] - - args = [ - "--jinja_dir", - rebase_path("//third_party/", root_build_dir), # jinja is in chromium's third_party - "--output_base", - rebase_path("$target_gen_dir/src", root_build_dir), - "--config", - rebase_path("$target_gen_dir/node_protocol_config.json", root_build_dir), - ] - - outputs = - get_path_info(rebase_path(rebase_path(_protocol_generated, - ".", - "$inspector_protocol_output/.."), - ".", - "$target_gen_dir/src"), - "abspath") -} - -template("generate_protocol_json") { - copy_target_name = target_name + "_copy" - copy(copy_target_name) { - sources = invoker.sources - outputs = [ - "$target_gen_dir/{{source_file_part}}", - ] - } - copied_pdl = get_target_outputs(":$copy_target_name") - action(target_name) { - deps = [ - ":$copy_target_name", - ] - sources = copied_pdl - outputs = invoker.outputs - script = "//v8/third_party/inspector_protocol/convert_protocol_to_json.py" - args = rebase_path(sources + outputs, root_build_dir) - } -} - -copy("node_protocol_config") { - sources = [ - "node_protocol_config.json", - ] - outputs = [ - "$target_gen_dir/{{source_file_part}}", - ] -} - -generate_protocol_json("node_protocol_json") { - sources = [ - "node_protocol.pdl", - ] - outputs = [ - "$target_gen_dir/src/node_protocol.json", - ] -} - -generate_protocol_json("v8_protocol_json") { - sources = [ - v8_inspector_js_protocol, - ] - outputs = [ - "$target_gen_dir/src/js_protocol.json", - ] -} - -action("concatenate_protocols") { - deps = [ - ":node_protocol_json", - ":v8_protocol_json", - ] - inputs = [ - "$target_gen_dir/src/js_protocol.json", - "$target_gen_dir/src/node_protocol.json", - ] - outputs = [ - "$target_gen_dir/concatenated_protocol.json", - ] - script = "$inspector_protocol_dir/concatenate_protocols.py" - args = rebase_path(inputs + outputs, root_build_dir) -} - -action("v8_inspector_compress_protocol_json") { - deps = [ - ":concatenate_protocols", - ] - inputs = [ - "$target_gen_dir/concatenated_protocol.json", - ] - outputs = [ - "$target_gen_dir/v8_inspector_protocol_json.h", - ] - script = "../../tools/compress_json.py" - args = rebase_path(inputs + outputs, root_build_dir) -} diff --git a/gn/node/test/BUILD.gn b/gn/node/test/BUILD.gn deleted file mode 100644 index 025b45d..0000000 --- a/gn/node/test/BUILD.gn +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright 2019 the V8 project authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import("//node/node_files.gni") - -copy("copy_node_headers") { - sources = node_headers - outputs = [ "$root_gen_dir/{{source}}" ] -} - -copy("copy_v8_headers") { - sources = node_files.v8_headers - outputs = [ "$root_gen_dir/node/deps/{{source}}" ] -} - -copy("copy_node_api_headers") { - sources = node_api_headers - outputs = [ "$root_gen_dir/{{source}}" ] -} - -copy("copy_test_files") { - sources = [ - "//node/test/common", - "//node/test/testpy", - ] - outputs = [ "$root_gen_dir/{{source}}" ] -} diff --git a/gn/node/test/addons/BUILD.gn b/gn/node/test/addons/BUILD.gn deleted file mode 100644 index bab24ed..0000000 --- a/gn/node/test/addons/BUILD.gn +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright 2019 the V8 project authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import("//node/node_files.gni") -import("//node/node.gni") - -sync_files("sync_files") { - sources = node_files.test_addons_files -} - -build_addons("build") { - deps = [ - ":sync_files", - "..:copy_node_headers", - "..:copy_v8_headers", - "..:copy_test_files", - # "//node/tools/doc:generate_addons", TODO(v8:11042): temporarily disabling this compilation step. - ] - inputs = node_files.test_addons_files + - node_files.v8_headers + - node_headers -} diff --git a/gn/node/test/js-native-api/BUILD.gn b/gn/node/test/js-native-api/BUILD.gn deleted file mode 100644 index 669d385..0000000 --- a/gn/node/test/js-native-api/BUILD.gn +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright 2019 the V8 project authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import("//node/node_files.gni") -import("//node/node.gni") - -sync_files("sync_files") { - sources = node_files.test_js_native_api_files -} - -build_addons("build") { - deps = [ - ":sync_files", - "..:copy_node_api_headers", - "..:copy_test_files", - ] - inputs = node_files.test_js_native_api_files + - node_api_headers -} diff --git a/gn/node/test/node-api/BUILD.gn b/gn/node/test/node-api/BUILD.gn deleted file mode 100644 index 22294f0..0000000 --- a/gn/node/test/node-api/BUILD.gn +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright 2019 the V8 project authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import("//node/node_files.gni") -import("//node/node.gni") - -sync_files("sync_files") { - sources = node_files.test_node_api_files -} - -build_addons("build") { - deps = [ - ":sync_files", - "..:copy_node_api_headers", - "..:copy_test_files", - "../js-native-api:sync_files", - ] - inputs = node_api_headers + - node_files.test_js_native_api_files + - node_files.test_node_api_files -} diff --git a/gn/node/tools/doc/BUILD.gn b/gn/node/tools/doc/BUILD.gn deleted file mode 100644 index d494c24..0000000 --- a/gn/node/tools/doc/BUILD.gn +++ /dev/null @@ -1,51 +0,0 @@ -# Copyright 2019 the V8 project authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import("//node/node_files.gni") -import("//node/node.gni") - -sync_files("sync_files") { - sources = node_files.tools_doc_files -} - -copy("copy_addons_md") { - sources = [ "//node/doc/api/addons.md" ] - outputs = [ "$root_gen_dir/node/doc/api/addons.md" ] -} - -call_node("npm_install_dependencies") { - deps = [ ":sync_files" ] - inputs = [ - npm_cli, - "$target_gen_dir/package.json" - ] - base = target_gen_dir - args = [ - rebase_path(npm_cli, base), - "ci", - ] -} - -action("generate_addons") { - deps = [ - ":npm_install_dependencies", - ":sync_files", - ":copy_addons_md", - "//node/test/addons:sync_files", - "//node:node", - ] - script = "//tools/run_executable_in_dir.py" - inputs = [ - "$target_gen_dir/addon-verify.js", - "//node/doc/api/addons.md", - ] - stamp = "$target_gen_dir/generate_addons.stamp" - outputs = [ stamp ] - base = root_gen_dir - args = [ - rebase_path(base, root_build_dir), - rebase_path(stamp, root_build_dir), - rebase_path(node_exe, base), - ] + rebase_path(inputs, base) -} diff --git a/gn/testing/gmock/BUILD.gn b/gn/testing/gmock/BUILD.gn deleted file mode 100644 index 22d8eab..0000000 --- a/gn/testing/gmock/BUILD.gn +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright 2019 the V8 project authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -group("gmock") { - testonly = true - public_deps = [ "//v8/testing/gmock" ] -} diff --git a/gn/testing/gtest/BUILD.gn b/gn/testing/gtest/BUILD.gn deleted file mode 100644 index 9c70bf4..0000000 --- a/gn/testing/gtest/BUILD.gn +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright 2019 the V8 project authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -group("gtest") { - testonly = true - public_deps = [ "//v8/testing/gtest" ] -} diff --git a/testing/OWNERS b/testing/OWNERS new file mode 100644 index 0000000..cb04fa0 --- /dev/null +++ b/testing/OWNERS @@ -0,0 +1 @@ +file:../INFRA_OWNERS diff --git a/testing/gmock-support.h b/testing/gmock-support.h new file mode 100644 index 0000000..8473304 --- /dev/null +++ b/testing/gmock-support.h @@ -0,0 +1,116 @@ +// Copyright 2014 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef V8_TESTING_GMOCK_SUPPORT_H_ +#define V8_TESTING_GMOCK_SUPPORT_H_ + +#include +#include +#include + +#include "include/v8-isolate.h" +#include "testing/gmock/include/gmock/gmock.h" + +namespace testing { + +template +class Capture { + public: + Capture() : value_(), has_value_(false) {} + + const T& value() const { return value_; } + bool has_value() const { return has_value_; } + + void SetValue(const T& value) { + DCHECK(!has_value()); + value_ = value; + has_value_ = true; + } + + private: + T value_; + bool has_value_; +}; + + +namespace internal { + +template +class CaptureEqMatcher : public MatcherInterface { + public: + explicit CaptureEqMatcher(Capture* capture) : capture_(capture) {} + + virtual void DescribeTo(std::ostream* os) const { + *os << "captured by " << static_cast(capture_); + if (capture_->has_value()) *os << " which has value " << capture_->value(); + } + + virtual bool MatchAndExplain(T value, MatchResultListener* listener) const { + if (!capture_->has_value()) { + capture_->SetValue(value); + return true; + } + if (value != capture_->value()) { + *listener << "which is not equal to " << capture_->value(); + return false; + } + return true; + } + + private: + Capture* capture_; +}; + +} // namespace internal + + +// Creates a polymorphic matcher that matches anything whose bit representation +// is equal to that of {x}. +MATCHER_P(BitEq, x, std::string(negation ? "isn't" : "is") + + " bitwise equal to " + PrintToString(x)) { + static_assert(sizeof(x) == sizeof(arg), "Size mismatch"); + return std::memcmp(&arg, &x, sizeof(x)) == 0; +} + +// Creates a polymorphic matcher that matches JSValue to Int32. +MATCHER_P(IsInt32, expected, + std::string(negation ? "isn't" : "is") + " Int32 " + + PrintToString(expected)) { + return arg->IsInt32() && + arg->Int32Value(v8::Isolate::GetCurrent()->GetCurrentContext()) + .FromJust() == expected; +} + +// Creates a polymorphic matcher that matches JSValue to String. +MATCHER_P(IsString, expected, + std::string(negation ? "isn't" : "is") + " String " + + PrintToString(expected)) { + if (!arg->IsString()) { + return false; + } + v8::String::Utf8Value utf8(v8::Isolate::GetCurrent(), arg); + return strcmp(expected, *utf8) == 0; +} + +// Creates a polymorphic matcher that matches JSValue to Undefined. +MATCHER(IsUndefined, std::string(negation ? "isn't" : "is") + " Undefined") { + return arg->IsUndefined(); +} + +// CaptureEq(capture) captures the value passed in during matching as long as it +// is unset, and once set, compares the value for equality with the argument. +template +inline Matcher CaptureEq(Capture* capture) { + return MakeMatcher(new internal::CaptureEqMatcher(capture)); +} + + +// Creates a polymorphic matcher that matches any floating point NaN value. +MATCHER(IsNaN, std::string(negation ? "isn't" : "is") + " not a number") { + return std::isnan(arg); +} + +} // namespace testing + +#endif // V8_TESTING_GMOCK_SUPPORT_H_ diff --git a/testing/gmock/BUILD.gn b/testing/gmock/BUILD.gn new file mode 100644 index 0000000..c20d335 --- /dev/null +++ b/testing/gmock/BUILD.gn @@ -0,0 +1,27 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# The file/directory layout of Google Test is not yet considered stable. Until +# it stabilizes, Chromium code MUST use this target instead of reaching directly +# into //third_party/googletest. + +import("//build_overrides/build.gni") + +source_set("gmock") { + testonly = true + sources = [ + "include/gmock/gmock-actions.h", + "include/gmock/gmock-matchers.h", + "include/gmock/gmock.h", + ] + public_deps = [ "//third_party/googletest:gmock" ] +} + +# The file/directory layout of Google Test is not yet considered stable. Until +# it stabilizes, Chromium code MUST use this target instead of reaching directly +# into //third_party/googletest. +source_set("gmock_main") { + testonly = true + deps = [ "//third_party/googletest:gmock_main" ] +} diff --git a/testing/gmock/OWNERS b/testing/gmock/OWNERS new file mode 100644 index 0000000..d5fa70c --- /dev/null +++ b/testing/gmock/OWNERS @@ -0,0 +1,2 @@ +thakis@chromium.org +pwnall@chromium.org diff --git a/testing/gmock/include/DEPS b/testing/gmock/include/DEPS new file mode 100644 index 0000000..c817a84 --- /dev/null +++ b/testing/gmock/include/DEPS @@ -0,0 +1,3 @@ +include_rules = [ + '+third_party/googletest/src/googlemock/include/gmock', +] diff --git a/testing/gmock/include/gmock/gmock-actions.h b/testing/gmock/include/gmock/gmock-actions.h new file mode 100644 index 0000000..e4ae2fe --- /dev/null +++ b/testing/gmock/include/gmock/gmock-actions.h @@ -0,0 +1,10 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// The file/directory layout of Google Test is not yet considered stable. Until +// it stabilizes, Chromium code will use forwarding headers in testing/gtest +// and testing/gmock, instead of directly including files in +// third_party/googletest. + +#include "third_party/googletest/src/googlemock/include/gmock/gmock-actions.h" diff --git a/testing/gmock/include/gmock/gmock-matchers.h b/testing/gmock/include/gmock/gmock-matchers.h new file mode 100644 index 0000000..8cfc699 --- /dev/null +++ b/testing/gmock/include/gmock/gmock-matchers.h @@ -0,0 +1,10 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// The file/directory layout of Google Test is not yet considered stable. Until +// it stabilizes, Chromium code will use forwarding headers in testing/gtest +// and testing/gmock, instead of directly including files in +// third_party/googletest. + +#include "third_party/googletest/src/googlemock/include/gmock/gmock-matchers.h" diff --git a/testing/gmock/include/gmock/gmock.h b/testing/gmock/include/gmock/gmock.h new file mode 100644 index 0000000..c39a9f6 --- /dev/null +++ b/testing/gmock/include/gmock/gmock.h @@ -0,0 +1,10 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// The file/directory layout of Google Test is not yet considered stable. Until +// it stabilizes, Chromium code will use forwarding headers in testing/gtest +// and testing/gmock, instead of directly including files in +// third_party/googletest. + +#include "third_party/googletest/src/googlemock/include/gmock/gmock.h" diff --git a/testing/gtest-support.h b/testing/gtest-support.h new file mode 100644 index 0000000..21c8ebf --- /dev/null +++ b/testing/gtest-support.h @@ -0,0 +1,57 @@ +// Copyright 2014 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef V8_TESTING_GTEST_SUPPORT_H_ +#define V8_TESTING_GTEST_SUPPORT_H_ + +#include "testing/gtest/include/gtest/gtest.h" + +namespace testing { +namespace internal { + +#define GET_TYPE_NAME(type) \ + template <> \ + inline std::string GetTypeName() { \ + return #type; \ + } +GET_TYPE_NAME(bool) +GET_TYPE_NAME(signed char) +GET_TYPE_NAME(unsigned char) +GET_TYPE_NAME(short) +GET_TYPE_NAME(unsigned short) +GET_TYPE_NAME(int) +GET_TYPE_NAME(unsigned int) +GET_TYPE_NAME(long) +GET_TYPE_NAME(unsigned long) +GET_TYPE_NAME(long long) +GET_TYPE_NAME(unsigned long long) +GET_TYPE_NAME(float) +GET_TYPE_NAME(double) +#undef GET_TYPE_NAME + + +// TRACED_FOREACH(type, var, container) expands to a loop that assigns |var| +// every item in the |container| and adds a SCOPED_TRACE() message for the +// |var| while inside the loop body. +#define TRACED_FOREACH(_type, _var, _container) \ + for (_type const _var : _container) \ + for (bool _var##_done = false; !_var##_done;) \ + for (SCOPED_TRACE(::testing::Message() << #_var << " = " << _var); \ + !_var##_done; _var##_done = true) + +// TRACED_FORRANGE(type, var, low, high) expands to a loop that assigns |var| +// every value in the range |low| to (including) |high| and adds a +// SCOPED_TRACE() message for the |var| while inside the loop body. +// TODO(bmeurer): Migrate to C++11 once we're ready. +#define TRACED_FORRANGE(_type, _var, _low, _high) \ + for (_type _var##_i = _low; _var##_i <= _high; ++_var##_i) \ + for (bool _var##_done = false; !_var##_done;) \ + for (_type const _var = _var##_i; !_var##_done;) \ + for (SCOPED_TRACE(::testing::Message() << #_var << " = " << _var); \ + !_var##_done; _var##_done = true) + +} // namespace internal +} // namespace testing + +#endif // V8_TESTING_GTEST_SUPPORT_H_ diff --git a/testing/gtest/BUILD.gn b/testing/gtest/BUILD.gn new file mode 100644 index 0000000..6636b2d --- /dev/null +++ b/testing/gtest/BUILD.gn @@ -0,0 +1,90 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build_overrides/gtest.gni") +if (is_ios) { + import("//build/buildflag_header.gni") + import("//build/config/coverage/coverage.gni") + import("//build/config/ios/ios_sdk.gni") +} + +config("gtest_direct_config") { + visibility = [ ":*" ] + defines = [ "UNIT_TEST" ] +} + +# The file/directory layout of Google Test is not yet considered stable. Until +# it stabilizes, Chromium code MUST use this target instead of reaching directly +# into //third_party/googletest. +static_library("gtest") { + testonly = true + + sources = [ + "include/gtest/gtest-death-test.h", + "include/gtest/gtest-message.h", + "include/gtest/gtest-param-test.h", + "include/gtest/gtest-spi.h", + "include/gtest/gtest.h", + "include/gtest/gtest_prod.h", + + # This is a workaround for the issues below. + # + # 1) This target needs to be a static_library (not a source set) on Mac to + # avoid the build errors in + # https://codereview.chromium.org/2779193002#msg82. + # 2) A static_library must have at least one source file, to avoid build + # errors on Mac and Windows. https://crbug.com/710334 + # 3) A static_library with complete_static_lib = true, which would not + # require adding the empty file, will result in duplicate symbols on + # Android. https://codereview.chromium.org/2852613002/#ps20001 + "empty.cc", + ] + public_deps = [ "//third_party/googletest:gtest" ] + + public_configs = [ ":gtest_direct_config" ] + + if (gtest_include_multiprocess) { + sources += [ + "../multiprocess_func_list.cc", + "../multiprocess_func_list.h", + ] + } + + if (gtest_include_platform_test) { + sources += [ "../platform_test.h" ] + } + + if ((is_mac || is_ios) && gtest_include_objc_support) { + sources += [ + "../gtest_mac.h", + "../gtest_mac.mm", + ] + if (gtest_include_platform_test) { + sources += [ "../platform_test_mac.mm" ] + } + } + + if (is_ios && gtest_include_ios_coverage) { + sources += [ + "../coverage_util_ios.h", + "../coverage_util_ios.mm", + ] + deps = [ ":ios_enable_coverage" ] + } +} + +# The file/directory layout of Google Test is not yet considered stable. Until +# it stabilizes, Chromium code MUST use this target instead of reaching directly +# into //third_party/googletest. +source_set("gtest_main") { + testonly = true + deps = [ "//third_party/googletest:gtest_main" ] +} + +if (is_ios) { + buildflag_header("ios_enable_coverage") { + header = "ios_enable_coverage.h" + flags = [ "IOS_ENABLE_COVERAGE=$use_clang_coverage" ] + } +} diff --git a/testing/gtest/OWNERS b/testing/gtest/OWNERS new file mode 100644 index 0000000..d5fa70c --- /dev/null +++ b/testing/gtest/OWNERS @@ -0,0 +1,2 @@ +thakis@chromium.org +pwnall@chromium.org diff --git a/testing/gtest/empty.cc b/testing/gtest/empty.cc new file mode 100644 index 0000000..7487e66 --- /dev/null +++ b/testing/gtest/empty.cc @@ -0,0 +1,3 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. diff --git a/testing/gtest/include/DEPS b/testing/gtest/include/DEPS new file mode 100644 index 0000000..e67416c --- /dev/null +++ b/testing/gtest/include/DEPS @@ -0,0 +1,3 @@ +include_rules = [ + '+third_party/googletest/src/googletest/include/gtest', +] diff --git a/testing/gtest/include/gtest/gtest-death-test.h b/testing/gtest/include/gtest/gtest-death-test.h new file mode 100644 index 0000000..d2fead0 --- /dev/null +++ b/testing/gtest/include/gtest/gtest-death-test.h @@ -0,0 +1,10 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// The file/directory layout of Google Test is not yet considered stable. Until +// it stabilizes, Chromium code will use forwarding headers in testing/gtest +// and testing/gmock, instead of directly including files in +// third_party/googletest. + +#include "third_party/googletest/src/googletest/include/gtest/gtest-death-test.h" diff --git a/testing/gtest/include/gtest/gtest-message.h b/testing/gtest/include/gtest/gtest-message.h new file mode 100644 index 0000000..4ec1e0e --- /dev/null +++ b/testing/gtest/include/gtest/gtest-message.h @@ -0,0 +1,10 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// The file/directory layout of Google Test is not yet considered stable. Until +// it stabilizes, Chromium code will use forwarding headers in testing/gtest +// and testing/gmock, instead of directly including files in +// third_party/googletest. + +#include "third_party/googletest/src/googletest/include/gtest/gtest-message.h" diff --git a/testing/gtest/include/gtest/gtest-param-test.h b/testing/gtest/include/gtest/gtest-param-test.h new file mode 100644 index 0000000..e85c2f3 --- /dev/null +++ b/testing/gtest/include/gtest/gtest-param-test.h @@ -0,0 +1,10 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// The file/directory layout of Google Test is not yet considered stable. Until +// it stabilizes, Chromium code will use forwarding headers in testing/gtest +// and testing/gmock, instead of directly including files in +// third_party/googletest. + +#include "third_party/googletest/src/googletest/include/gtest/gtest-param-test.h" diff --git a/testing/gtest/include/gtest/gtest-spi.h b/testing/gtest/include/gtest/gtest-spi.h new file mode 100644 index 0000000..87af65c --- /dev/null +++ b/testing/gtest/include/gtest/gtest-spi.h @@ -0,0 +1,10 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// The file/directory layout of Google Test is not yet considered stable. Until +// it stabilizes, Chromium code will use forwarding headers in testing/gtest +// and testing/gmock, instead of directly including files in +// third_party/googletest. + +#include "third_party/googletest/src/googletest/include/gtest/gtest-spi.h" diff --git a/testing/gtest/include/gtest/gtest.h b/testing/gtest/include/gtest/gtest.h new file mode 100644 index 0000000..b026e3a --- /dev/null +++ b/testing/gtest/include/gtest/gtest.h @@ -0,0 +1,10 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// The file/directory layout of Google Test is not yet considered stable. Until +// it stabilizes, Chromium code will use forwarding headers in testing/gtest +// and testing/gmock, instead of directly including files in +// third_party/googletest. + +#include "third_party/googletest/src/googletest/include/gtest/gtest.h" diff --git a/testing/gtest/include/gtest/gtest_prod.h b/testing/gtest/include/gtest/gtest_prod.h new file mode 100644 index 0000000..218e676 --- /dev/null +++ b/testing/gtest/include/gtest/gtest_prod.h @@ -0,0 +1,12 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// The file/directory layout of Google Test is not yet considered stable. Until +// it stabilizes, Chromium code will use forwarding headers in testing/gtest +// and testing/gmock, instead of directly including files in +// third_party/googletest. + +#if !defined(GOOGLE3) +#include "third_party/googletest/src/googletest/include/gtest/gtest_prod.h" +#endif \ No newline at end of file diff --git a/gn/third_party/googletest/BUILD.gn b/third_party/googletest/BUILD.gn similarity index 81% rename from gn/third_party/googletest/BUILD.gn rename to third_party/googletest/BUILD.gn index 4b87c05..c741262 100644 --- a/gn/third_party/googletest/BUILD.gn +++ b/third_party/googletest/BUILD.gn @@ -1,8 +1,9 @@ # Copyright 2014 The Chromium Authors. All rights reserved. -# Copyright 2019 the V8 project authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("../../v8/gni/v8.gni") + config("gtest_config") { visibility = [ ":*" ] # gmock also shares this config. @@ -50,8 +51,6 @@ config("gmock_config") { source_set("gtest") { testonly = true sources = [ - # TODO(crbug.com/829773): Remove this after transitioning off . - "custom/gmock/internal/custom/gmock-port.h", "src/googletest/include/gtest/gtest-assertion-result.h", "src/googletest/include/gtest/gtest-death-test.h", "src/googletest/include/gtest/gtest-matchers.h", @@ -66,12 +65,9 @@ source_set("gtest") { "src/googletest/include/gtest/internal/gtest-death-test-internal.h", "src/googletest/include/gtest/internal/gtest-filepath.h", "src/googletest/include/gtest/internal/gtest-internal.h", - "src/googletest/include/gtest/internal/gtest-linked_ptr.h", - "src/googletest/include/gtest/internal/gtest-param-util-generated.h", "src/googletest/include/gtest/internal/gtest-param-util.h", "src/googletest/include/gtest/internal/gtest-port.h", "src/googletest/include/gtest/internal/gtest-string.h", - "src/googletest/include/gtest/internal/gtest-tuple.h", "src/googletest/include/gtest/internal/gtest-type-util.h", #"src/googletest/src/gtest-all.cc", # Not needed by our build. @@ -95,6 +91,15 @@ source_set("gtest") { configs -= [ "//build/config/compiler:chromium_code" ] configs += [ "//build/config/compiler:no_chromium_code" ] + # V8-only workaround for http://crbug.com/chromium/1191946. Ensures that + # googletest is compiled with the same visibility such as the rest of V8, see + # https://source.chromium.org/chromium/chromium/src/+/master:v8/gni/v8.gni + if ((is_posix || is_fuchsia) && + (v8_enable_backtrace || v8_monolithic || v8_expose_symbols)) { + configs -= [ "//build/config/gcc:symbol_visibility_hidden" ] + configs += [ "//build/config/gcc:symbol_visibility_default" ] + } + deps = [] if (is_fuchsia) { @@ -109,12 +114,8 @@ source_set("gtest") { # See README.chromium for details. source_set("gtest_main") { testonly = true - sources = [ - "src/googletest/src/gtest_main.cc", - ] - deps = [ - ":gtest", - ] + sources = [ "src/googletest/src/gtest_main.cc" ] + deps = [ ":gtest" ] } # Do NOT depend on this directly. Use //testing/gmock:gmock_main instead. @@ -125,24 +126,16 @@ source_set("gmock") { "src/googlemock/include/gmock/gmock-actions.h", "src/googlemock/include/gmock/gmock-cardinalities.h", "src/googlemock/include/gmock/gmock-function-mocker.h", - "src/googlemock/include/gmock/gmock-generated-actions.h", - "src/googlemock/include/gmock/gmock-generated-function-mockers.h", - "src/googlemock/include/gmock/gmock-generated-matchers.h", - "src/googlemock/include/gmock/gmock-generated-nice-strict.h", "src/googlemock/include/gmock/gmock-matchers.h", "src/googlemock/include/gmock/gmock-more-actions.h", "src/googlemock/include/gmock/gmock-more-matchers.h", "src/googlemock/include/gmock/gmock-nice-strict.h", "src/googlemock/include/gmock/gmock-spec-builders.h", "src/googlemock/include/gmock/gmock.h", - "src/googlemock/include/gmock/internal/gmock-generated-internal-utils.h", "src/googlemock/include/gmock/internal/gmock-internal-utils.h", "src/googlemock/include/gmock/internal/gmock-port.h", "src/googlemock/include/gmock/internal/gmock-pp.h", - # gmock helpers. - "custom/gmock/internal/custom/gmock-port.h", - #"src/googlemock/src/gmock-all.cc", # Not needed by our build. "src/googlemock/src/gmock-cardinalities.cc", "src/googlemock/src/gmock-internal-utils.cc", @@ -151,20 +144,30 @@ source_set("gmock") { "src/googlemock/src/gmock.cc", ] + # V8-only workaround for http://crbug.com/chromium/1191946. Ensures that + # googletest is compiled with the same visibility such as the rest of V8, see + # https://source.chromium.org/chromium/chromium/src/+/master:v8/gni/v8.gni + if ((is_posix || is_fuchsia) && + (v8_enable_backtrace || v8_monolithic || v8_expose_symbols)) { + configs -= [ "//build/config/gcc:symbol_visibility_hidden" ] + configs += [ "//build/config/gcc:symbol_visibility_default" ] + } + public_configs = [ ":gmock_config", ":gtest_config", ] + + deps = [ ":gtest" ] } # Do NOT depend on this directly. Use //testing/gmock:gmock_main instead. # See README.chromium for details. static_library("gmock_main") { testonly = true - sources = [ - "src/googlemock/src/gmock_main.cc", - ] + sources = [ "src/googlemock/src/gmock_main.cc" ] deps = [ ":gmock", + ":gtest", ] } diff --git a/tools/generate_config_gypi.py b/tools/generate_config_gypi.py deleted file mode 100644 index fdb8660..0000000 --- a/tools/generate_config_gypi.py +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/env python3 -# Copyright (c) 2013-2019 GitHub Inc. -# Copyright 2019 the V8 project authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import re -import os -import subprocess -import sys - -root_dir = os.path.dirname(os.path.dirname(__file__)) -sys.path.append(os.path.join(root_dir, 'node', 'tools')) -import getmoduleversion - -GN_RE = re.compile(r'(\w+)\s+=\s+(.*?)$', re.MULTILINE) - -def bool_string_to_number(v): - return 1 if v == 'true' else 0 - -def string_to_number(v): - return int(v) - -def translate_config(config): - if sys.platform == 'darwin': - shlib_suffix = 'dylib' - else: - shlib_suffix = 'so' - - return { - 'target_defaults': { - 'default_configuration': - 'Debug' if config['is_debug'] == 'true' else 'Release', - }, - 'variables': { - 'asan': bool_string_to_number(config['is_asan']), - 'llvm_version': 13, - 'node_module_version': string_to_number(config['node_module_version']), - 'node_shared': bool_string_to_number(config['is_component_build']), - 'node_code_cache': 'yes' if config['node_use_code_cache'] else 'no', - 'napi_build_version': '8', - 'shlib_suffix': shlib_suffix, - # v8_enable_inspector is actually a misnomer, and only affects node. - 'v8_enable_inspector': - bool_string_to_number(config['node_enable_inspector']), - 'v8_enable_i18n_support': - bool_string_to_number(config['v8_enable_i18n_support']), - 'v8_enable_pointer_compression': 0, - 'v8_enable_31bit_smis_on_64bit_arch': 0, - # introduced for building addons. - 'node_use_openssl': config['node_use_openssl'], - 'node_use_node_code_cache': 'true', - 'build_v8_with_gn': 'false', - 'enable_lto': 'false', - 'openssl_fips': '', - } - } - -def main(gn_exe, gn_out_dir, output_file, depfile): - # Get GN config and parse into a dictionary. - gnconfig = subprocess.check_output( - [gn_exe, 'args', '--list', '--short', '-C', gn_out_dir]) - config = dict(re.findall(GN_RE, gnconfig.decode('utf-8'))) - config['node_module_version'] = getmoduleversion.get_version() - - # Write output. - with open(output_file, 'w') as f: - f.write(repr(translate_config(config))) - - # Write depfile. Force regenerating config.gypi when GN configs change. - with open(depfile, 'w') as f: - dot_gn = os.path.abspath(os.path.join(root_dir, '.gn')) - args_gn = os.path.abspath(os.path.join(gn_out_dir, 'args.gn')) - if not os.path.exists(args_gn): - with open(args_gn, 'w') as args_file: - args_file.write('# Dummy args.gn file') - f.write('%s: %s %s' %(output_file, dot_gn, args_gn)) - -if __name__ == '__main__': - main(sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4]) diff --git a/tools/generate_node_files_json.py b/tools/generate_node_files_json.py deleted file mode 100644 index 71e0d43..0000000 --- a/tools/generate_node_files_json.py +++ /dev/null @@ -1,215 +0,0 @@ -#!/usr/bin/env python3 -# Copyright (c) 2013-2019 GitHub Inc. -# Copyright 2019 the V8 project authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import json -import os -import subprocess -import sys - -basedir = os.path.dirname(__file__) -sys.path.append(os.path.join(basedir, os.pardir, 'node', 'tools')) -import install - -def LoadPythonDictionary(path): - file_string = open(path).read() - try: - file_data = eval(file_string, {'__builtins__': None}, None) - except SyntaxError as e: - e.filename = path - raise - except Exception as e: - raise Exception('Unexpected error while reading %s: %s' % (path, str(e))) - - assert isinstance(file_data, dict), '%s does not eval to a dictionary' % path - - return file_data - -def ReplaceVariable(dictionary, var, ignore_list): - if var in ignore_list: - return [] - if var.startswith('<@('): - var_name = var[3:-1] - assert var_name in dictionary['variables'], \ - 'Variable %s not found defined in gyp file' % var_name - return ReplaceVariables(dictionary, - dictionary['variables'][var_name], - ignore_list) - else: - return [var] - -def ReplaceVariables(dictionary, sources, ignore_list = []): - return [replacement for source in sources - for replacement in ReplaceVariable(dictionary, source, ignore_list)] - -FILENAMES_JSON_HEADER = ''' -// This file is automatically generated by generate_gn_filenames_json.py -// DO NOT EDIT -'''.lstrip() - -def dedup(a_list): - return list(set(a_list)) - -def RedirectV8(list): - return [f.replace('deps/v8/', '../v8/', 1) for f in list] - -def GitLsFiles(path, prefix): - output = subprocess.check_output(['git', 'ls-files'], cwd=path).decode() - return [prefix + x for x in output.splitlines()] - -def SearchNodeLibraryFiles(node_dir, entry): - assert(entry == '<@(node_library_files)') - files = [] - prefix_size = len(node_dir) + 1 - for (dir, _, fs) in os.walk(os.path.join(node_dir,'lib')): - for f in fs: - if f.endswith(".js"): - files.append(os.path.join(dir, f)[prefix_size:]) - return files - -def GypExpandList(node_dir, list): - entries = [] - for entry in list: - if entry == '<@(node_library_files)': - entries = entries + SearchNodeLibraryFiles(node_dir, entry) - else: - entries.append(entry) - return entries - -if __name__ == '__main__': - # Set up paths. - root_dir = os.path.dirname(os.path.dirname(__file__)) - node_dir = os.path.join(root_dir, 'node') - node_gyp_file = os.path.join(node_dir, 'node.gyp') - out_file = os.path.join(root_dir, 'node_files.json') - inspector_gyp_file = os.path.join(node_dir, - 'src', 'inspector', 'node_inspector.gypi') - openssl_gyp_file = os.path.join(node_dir, - 'deps', 'openssl', 'config', 'archs', - 'linux-x86_64', 'no-asm', 'openssl.gypi') - nghttp2_gyp_file = os.path.join(node_dir, - 'deps', 'nghttp2', 'nghttp2.gyp') - cares_gyp_file = os.path.join(node_dir, - 'deps', 'cares', 'cares.gyp') - base64_gyp_file = os.path.join(node_dir, - 'deps', 'base64', 'base64.gyp') - out = {} - # Load file lists from gyp files. - node_gyp = LoadPythonDictionary(node_gyp_file) - inspector_gyp = LoadPythonDictionary(inspector_gyp_file) - openssl_gyp = LoadPythonDictionary(openssl_gyp_file) - nghttp2_gyp = LoadPythonDictionary(nghttp2_gyp_file) - cares_gyp = LoadPythonDictionary(cares_gyp_file) - base64_gyp = LoadPythonDictionary(base64_gyp_file) - - # Find JS lib file and single out files from V8. - library_files = GypExpandList(node_dir, node_gyp['variables']['library_files']) - deps_files = node_gyp['variables']['deps_files'] - library_files += deps_files - - # Remove '<@(node_builtin_shareable_builtins)'. - # We do not support externally shared js builtins. - # See: https://github.com/nodejs/node/pull/44376 - # TODO(victorgomes): We need a way to get these externally shareable builtins - # from configure.py. I have a feeling this is still in flux in the NodeJS side, - # so let's delay this a bit. - library_files.remove('<@(node_builtin_shareable_builtins)') - library_files.remove('<@(linked_module_files)') - library_files.append('deps/cjs-module-lexer/lexer.js') - library_files.append('deps/cjs-module-lexer/dist/lexer.js') - library_files.append('deps/undici/undici.js') - - out['node_library_files'] = [ - f for f in library_files if not f.startswith('deps/v8')] - out['all_library_files'] = library_files - - # Find C++ source files. - node_lib_target = next( - t for t in node_gyp['targets'] - if t['target_name'] == '<(node_lib_target_name)') - node_source_blacklist = { - '<@(library_files)', - '<@(deps_files)', - 'common.gypi', - '<(SHARED_INTERMEDIATE_DIR)/node_javascript.cc', - '<@(node_library_files)', - '<@(node_builtin-shareable_builtins)', - } - node_sources = [ - f for f in ReplaceVariables(node_gyp, - node_lib_target['sources'], - node_source_blacklist) - if f not in node_source_blacklist] - out['node_sources'] = [ - f.replace('deps/v8/', '../v8/', 1) for f in node_sources] - - # Find C++ sources when building with crypto. - node_use_openssl = next( - t for t in node_lib_target['conditions'] - if t[0] == 'node_use_openssl=="true"') - out['crypto_sources'] = dedup(ReplaceVariables(node_gyp, - node_use_openssl[1]['sources']) - ) - - # Find cctest files. Omit included gtest. - cctest_target = next( - t for t in node_gyp['targets'] - if t['target_name'] == 'cctest') - out['cctest_sources'] = [ - f for f in ReplaceVariables(node_gyp, cctest_target['sources']) if not f.startswith('test/cctest/gtest')] - - # Find inspector sources. - inspector_sources = list(map(lambda s: '../../' + s, - ReplaceVariables(inspector_gyp, - inspector_gyp['sources']) - )) - out['inspector_sources'] = inspector_sources - - # Find OpenSSL sources. - # OpenSSL sources countain duplicate sources, so we remove duplicates by applying list(set()) - openssl_sources = set(openssl_gyp['variables']['openssl_sources']) - openssl_sources = openssl_sources.union(set(openssl_gyp['variables']['openssl_sources_linux-x86_64'])) - # HACK: Remove libraries from sources - openssl_sources = {source for source in openssl_sources if not source.endswith('.ld')} - out['openssl_sources'] = list(openssl_sources) - - # Find nghttp2 sources. - nghttp2_sources = ReplaceVariables(nghttp2_gyp, nghttp2_gyp['targets'][0]['sources']) - out['nghttp2_sources'] = nghttp2_sources - - # Find cares sources. - cares_sources = ReplaceVariables(cares_gyp, cares_gyp['targets'][0]['sources']) - out['cares_sources'] = cares_sources - - # Find base64 sources. - base64_sources = ReplaceVariables(base64_gyp, base64_gyp['targets'][0]['sources']) - out['base64_sources'] = base64_sources - - # Find node/tools/doc content. - tools_doc_dir = os.path.join(node_dir, 'tools', 'doc') - out['tools_doc_files'] = GitLsFiles(tools_doc_dir, '//node/tools/doc/') - - # Find node/test/addons content. - test_addons_dir = os.path.join(node_dir, 'test', 'addons') - out['test_addons_files'] = GitLsFiles(test_addons_dir, '//node/test/addons/') - - # Find node/test/node-api content. - test_node_api_dir = os.path.join(node_dir, 'test', 'node-api') - out['test_node_api_files'] = GitLsFiles(test_node_api_dir, - '//node/test/node-api/') - # Find node/test/js-native-api content. - test_js_native_api_dir = os.path.join(node_dir, 'test', 'js-native-api') - out['test_js_native_api_files'] = GitLsFiles(test_js_native_api_dir, - '//node/test/js-native-api/') - - # Find v8/include content. - v8_include_dir = os.path.join(root_dir, 'v8', 'include') - out['v8_headers'] = GitLsFiles(v8_include_dir, '//v8/include/') - - # Write file list as JSON. - with open(out_file, 'w') as f: - f.write(FILENAMES_JSON_HEADER) - f.write(json.dumps(out, sort_keys=True, indent=2, separators=(',', ': '))) - f.write('\n') diff --git a/tools/gn-gen.py b/tools/gn-gen.py index b55b7a3..0c87f80 100755 --- a/tools/gn-gen.py +++ b/tools/gn-gen.py @@ -25,7 +25,6 @@ def GenerateBuildFiles(options): if options.sysroot: gn_args.append('use_sysroot=true') gn_args.append('use_custom_libcxx=true') - gn_args.append('node_use_custom_libcxx=true') if options.target_os: gn_args.append('target_os="' + options.target_os + '"') @@ -48,17 +47,16 @@ def GenerateBuildFiles(options): gn_args.append('is_ubsan_vptr=true') gn_args.append('is_ubsan_no_recover=true') + # Should be set to false after this is merged: + # https://chromium-review.googlesource.com/c/chromium/deps/icu/+/5004573 + if options.target_os == 'win' and options.target_cpu.endswith('64'): + gn_args.append('icu_use_data_file=true') + else: + gn_args.append('icu_use_data_file=false') + gn_args.append('is_debug=%s' % ToBool(options.debug)) gn_args.append('symbol_level=%s' % (1 if options.debug else 0)) - gn_args.append('use_goma=%s' % ToBool(options.goma)) gn_args.append('is_component_build=%s' % ToBool(options.shared)) - gn_args.append('node_use_code_cache=%s' % ToBool(not options.no_cache)) - gn_args.append('v8_enable_snapshot_compression=false') - # Override system's OpenSSL configs for tests. - gn_args.append('openssl_dir=""') - gn_args.append('openssl_seclevel=1') - gn_args.append('v8_enable_javascript_promise_hooks=true') - gn_args.append('v8_scriptormodule_legacy_lifetime=true') flattened_args = ' '.join(gn_args) args = ['gn', 'gen', options.out_dir, '-q', '--args=' + flattened_args] @@ -69,10 +67,6 @@ def ParseOptions(args): parser = argparse.ArgumentParser( description='Generate GN build configurations') parser.add_argument('out_dir', help='build directory') - parser.add_argument('--goma', help='use goma to speed up compile', - action='store_true') - parser.add_argument('--jumbo', help='use jumbo to speed up compile', - action='store_true') parser.add_argument('--asan', help='build with address sanitizer', action='store_true', default=False) parser.add_argument('--tsan', help='build with thread sanitizer', @@ -88,8 +82,6 @@ def ParseOptions(args): action='store_true', default=False) parser.add_argument('--debug', help='debug build', action='store_true', default=False) - parser.add_argument('--no-cache', help='do not use Node.js code cache', - action='store_true', default=False) parser.add_argument('--target_os', help='set target OS', default='') parser.add_argument('--target_cpu', help='set target CPU', default='') return parser.parse_args(args) diff --git a/tools/mirror_removal.py b/tools/mirror_removal.py deleted file mode 100644 index a220c4f..0000000 --- a/tools/mirror_removal.py +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env python3 -# Copyright 2019 the V8 project authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -# This script recursively removes files from to_dir that do not exist -# in from_dir. This is to remove outdated artifacts in incremental builds. - -import os -import shutil -import sys - -def mirror_removal(from_dir, to_dir, dirpath, list, remove): - for file in list: - if not os.path.exists(os.path.join(from_dir, dirpath, file)): - delete_file = os.path.join(to_dir, dirpath, file) - if os.path.exists(delete_file): - remove(delete_file) - -def main(from_dir, to_dir, stamp): - os.chdir(to_dir) - for dirpath, dirs, files in os.walk(".", topdown=False): - mirror_removal(from_dir, to_dir, dirpath, files, lambda x: os.unlink(x)) - mirror_removal(from_dir, to_dir, dirpath, dirs, lambda x: shutil.rmtree(x)) - - with open(stamp, 'w') as file: - file.write('stamp') - -if __name__ == '__main__': - main(os.path.abspath(sys.argv[1]), - os.path.abspath(sys.argv[2]), - os.path.abspath(sys.argv[3])) diff --git a/tools/npm.py b/tools/npm.py deleted file mode 100644 index 4bfffad..0000000 --- a/tools/npm.py +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/env python3 -# Copyright 2020 the V8 project authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Prints the path of every file in the NPM modules and its dependencies. - - The script should be run with the module names: - > python ./tools/npm.py mod1 mod2 mod3 .... - - It checks if the module is available locally in the 'node_modules' - directory, otherwise it runs 'npm install'. - - It prints to the stdout the path of every file in the module directory. - - It fails if 'npm' is not available in PATH. -""" - -import os -import subprocess -import sys -import json - -def print_mod_contents(mod): - """Walk the module directory and prints to stdout the path of each file.""" - cwd = os.getcwd() - for root, _, files in os.walk(os.path.join("node_modules", mod)): - for f in files: - print(f'"{os.path.join(cwd, os.path.join(root, f))}",') - -def check_npm(): - """Checks if NPM is available in PATH.""" - for path in os.environ["PATH"].split(os.pathsep): - npm = os.path.join(path, "npm") - if os.path.isfile(npm) and os.access(npm, os.X_OK): - return - print("Error: NPM not found in PATH.") - print("Please install NPM.") - exit(1) - -def pkg_file_path(mod): - """Returns the path of 'package.json' for a module.""" - return os.path.join("node_modules", os.path.join(mod, "package.json")) - -def mod_is_installed(mod): - """Checks if a 'package.json' exists for a module.""" - return os.path.isfile(pkg_file_path(mod)) - -def install_mod(mod): - """Runs 'npm install' for a module.""" - devnull = open(os.devnull, 'wb') - subprocess.check_call(["npm", "install", mod], stdout=devnull) - -def get_mod_deps(mod): - """Reads the list of dependencies of a module from its 'package.json'.""" - try: - pkg = json.load(open(pkg_file_path(mod))) - return map(lambda mod : mod.split("@")[0], pkg['dependencies'].keys()) - except KeyError: # No 'depenencies' key, so no dependency. - return [] - -def print_modules(modules): - """Prints to stdout the files of the modules and its dependencies.""" - done = [] - print("[") - for mod in modules: - if mod in done: - continue - if not mod_is_installed(mod): - install_mod(mod) - modules.extend(get_mod_deps(mod)) - done.append(mod) - print_mod_contents(mod) - print("]") - -if __name__ == '__main__': - check_npm() - print_modules(sys.argv[1:]) diff --git a/tools/run_executable_in_dir.py b/tools/run_executable_in_dir.py deleted file mode 100644 index 312c0c9..0000000 --- a/tools/run_executable_in_dir.py +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env python3 -# Copyright 2019 the V8 project authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import os -import subprocess -import sys - -def main(argv): - stamp = argv[2] - arg_start = 3 - - # Parse env variables provided in the form `--env name value`. - # Convert paths to absolute paths. - env = os.environ.copy() - while argv[arg_start] == '--env': - value = argv[arg_start + 2] - if os.path.exists(value): - value = os.path.abspath(value) - env[argv[arg_start + 1]] = value - arg_start = arg_start + 3 - - try: - subprocess.check_output(argv[arg_start:], cwd=argv[1], env=env, - stderr=subprocess.STDOUT) - except subprocess.CalledProcessError as exc: - print(exc.output) - raise - - with open(stamp, 'w') as file: - file.write('stamp') - -if __name__ == '__main__': - main(sys.argv) diff --git a/tools/run_in_dir.py b/tools/run_in_dir.py deleted file mode 100644 index a6dd68b..0000000 --- a/tools/run_in_dir.py +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env python3 -# Copyright (c) 2013-2019 GitHub Inc. -# Copyright 2019 the V8 project authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import os -import subprocess -import sys - -def main(argv): - cwd = argv[1] - os.chdir(cwd) - os.execv(sys.executable, [sys.executable] + argv[2:]) - -if __name__ == '__main__': - main(sys.argv) diff --git a/tools/whitespace.txt b/tools/whitespace.txt deleted file mode 100644 index a255a20..0000000 --- a/tools/whitespace.txt +++ /dev/null @@ -1,2 +0,0 @@ -......... -Today's answer to life the universe and everything is 3084!