Skip to content

Commit

Permalink
Build with upstream node
Browse files Browse the repository at this point in the history
  • Loading branch information
zcbenz committed Dec 1, 2023
1 parent d2ef329 commit 1c65629
Show file tree
Hide file tree
Showing 83 changed files with 741 additions and 3,541 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,16 @@ jobs:
if: matrix.arch == 'x64' && (matrix.targetOs == 'linux' || matrix.targetOs == 'mac')
run: |
PATH=$PATH:$(pwd)/depot_tools
autoninja -C node-ci/out/Release node_cctest node_embedtest overlapped_checker
autoninja -C node-ci/out/Release tests
cd node-ci/node
../out/Release/node_cctest
# TODO(zcbenz): https://github.com/nodejs/node/pull/50276
# ../out/Release/node test/embedding/test-embedding.js
# TODO(zcbenz): Fix the tests.
./tools/test.py --shell ../out/Release/node --flaky-tests=dontcare --skip-tests=parallel/test-code-cache,parallel/test-crypto-no-algorithm,parallel/test-v8-stats
# TODO(zcbenz): Fix the skipped tests.
./tools/test.py --shell ../out/Release/node --skip-tests=request-interrupt,cppgc-object,openssl-providers,zlib-binding addons
./tools/test.py --shell ../out/Release/node --skip-tests=test_init_order node-api
./tools/test.py --shell ../out/Release/node js-native-api
./tools/test.py --shell ../out/Release/node --flaky-tests=dontcare --skip-tests=parallel/test-crypto-no-algorithm,parallel/test-v8-stats
vs-toolchain:
runs-on: windows-2022
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Dependencies
/base
/build
/buildtools/
/buildtools
/node
/third_party
/tools/clang
Expand All @@ -11,4 +11,4 @@
/out

# Generated
/node_files.json
*.swp
84 changes: 42 additions & 42 deletions .gn
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -28,7 +23,43 @@ 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",
"//node_tests/BUILD.gn",
]

# The python interpreter to use by default.
Expand All @@ -37,56 +68,25 @@ 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
treat_warnings_as_errors = false

# 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 = []
}
38 changes: 0 additions & 38 deletions .vpython

This file was deleted.

14 changes: 14 additions & 0 deletions BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
group("default") {
deps = [ "//node" ]
}

group("tests") {
testonly = true

deps = [
"//node:node_cctest",
"//node:node_embedtest",
"//node:overlapped_checker",
"//node_tests",
]
}
78 changes: 55 additions & 23 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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',

Expand All @@ -64,8 +59,8 @@ vars = {
'markupsafe_revision': '006709ba3ed87660a17bd4548c45663628f5ed85',
'markupsafe_url': 'https://chromium.googlesource.com/chromium/src/third_party/markupsafe.git',

'node_revision': '72cd9e5248e50cd1eaba6f2f91ab2d9db5d99295',
'node_url': 'https://chromium.googlesource.com/external/github.com/v8/node.git',
'node_revision': '608c04d66d670850b40f70d2d4c63be149ba4d3d',
'node_url': 'https://github.com/zcbenz/node',

'trace_common_revision' : '29ac73db520575590c3aceb0a6f1f58dda8934f6',
'trace_common_url': 'https://chromium.googlesource.com/chromium/src/base/trace_event/common.git',
Expand Down Expand Up @@ -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'),
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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',
Expand Down
14 changes: 3 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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

Loading

0 comments on commit 1c65629

Please sign in to comment.