Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into sdghjfsjghafjhkfs
Browse files Browse the repository at this point in the history
  • Loading branch information
alexweej committed Nov 18, 2024
2 parents a1009cb + bdaa898 commit c31e7e5
Show file tree
Hide file tree
Showing 595 changed files with 49,612 additions and 24,087 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/commit-queue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,15 @@ jobs:
--base ${{ github.ref_name }} \
--label 'commit-queue' \
--json 'number' \
--search "created:<=$(date --date="2 days ago" +"%Y-%m-%dT%H:%M:%S%z")" \
--search "created:<=$(date --date="2 days ago" +"%Y-%m-%dT%H:%M:%S%z") -label:blocked" \
-t '{{ range . }}{{ .number }} {{ end }}' \
--limit 100)
fast_track_prs=$(gh pr list \
--repo ${{ github.repository }} \
--base ${{ github.ref_name }} \
--label 'commit-queue' \
--label 'fast-track' \
--search "-label:blocked" \
--json 'number' \
-t '{{ range . }}{{ .number }} {{ end }}' \
--limit 100)
Expand Down
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ release.
<th title="LTS Until 2025-04"><a href="doc/changelogs/CHANGELOG_V18.md">18</a> (LTS)</th>
</tr>
<tr>
<b><a href="doc/changelogs/CHANGELOG_V23.md#23.1.0">23.1.0</a></b><br/>
<b><a href="doc/changelogs/CHANGELOG_V23.md#23.2.0">23.2.0</a></b><br/>
<a href="doc/changelogs/CHANGELOG_V23.md#23.1.0">23.1.0</a><br/>
<a href="doc/changelogs/CHANGELOG_V23.md#23.0.0">23.0.0</a><br/>
</td>
<td valign="top">
Expand Down Expand Up @@ -88,7 +89,8 @@ release.
<a href="doc/changelogs/CHANGELOG_V20.md#20.0.0">20.0.0</a><br/>
</td>
<td valign="top">
<b><a href="doc/changelogs/CHANGELOG_V18.md#18.20.4">18.20.4</a></b><br/>
<b><a href="doc/changelogs/CHANGELOG_V18.md#18.20.5">18.20.5</a></b><br/>
<a href="doc/changelogs/CHANGELOG_V18.md#18.20.4">18.20.4</a><br/>
<a href="doc/changelogs/CHANGELOG_V18.md#18.20.3">18.20.3</a><br/>
<a href="doc/changelogs/CHANGELOG_V18.md#18.20.2">18.20.2</a><br/>
<a href="doc/changelogs/CHANGELOG_V18.md#18.20.1">18.20.1</a><br/>
Expand Down
30 changes: 29 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -797,6 +797,34 @@ The externally maintained libraries used by Node.js are:

----------------------------------------------------------------------

JSON parsing library (nlohmann/json)

File: vendor/json/upstream/single_include/nlohmann/json.hpp (only for ICU4C)

MIT License

Copyright (c) 2013-2022 Niels Lohmann

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

----------------------------------------------------------------------

File: aclocal.m4 (only for ICU4C)
Section: pkg.m4 - Macros to locate and utilise pkg-config.

Expand Down Expand Up @@ -834,7 +862,7 @@ The externally maintained libraries used by Node.js are:

This file is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful, but
Expand Down
35 changes: 20 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,7 @@ with-code-cache test-code-cache:
$(warning '$@' target is a noop)

out/Makefile: config.gypi common.gypi node.gyp \
deps/uv/uv.gyp deps/llhttp/llhttp.gyp deps/zlib/zlib.gyp \
deps/simdutf/simdutf.gyp deps/ada/ada.gyp deps/nbytes/nbytes.gyp \
deps/*/*.gyp \
tools/v8_gypfiles/toolchain.gypi \
tools/v8_gypfiles/features.gypi \
tools/v8_gypfiles/inspector.gypi tools/v8_gypfiles/v8.gyp
Expand Down Expand Up @@ -376,11 +375,11 @@ ifeq ($(OSTYPE),os400)
DOCBUILDSTAMP_PREREQS := $(DOCBUILDSTAMP_PREREQS) out/$(BUILDTYPE)/node.exp
endif

node_use_openssl = $(call available-node,"-p" \
"process.versions.openssl != undefined")
node_use_openssl_and_icu = $(call available-node,"-p" \
"process.versions.openssl != undefined && process.versions.icu != undefined")
test/addons/.docbuildstamp: $(DOCBUILDSTAMP_PREREQS) tools/doc/node_modules
@if [ "$(shell $(node_use_openssl))" != "true" ]; then \
echo "Skipping .docbuildstamp (no crypto)"; \
@if [ "$(shell $(node_use_openssl_and_icu))" != "true" ]; then \
echo "Skipping .docbuildstamp (no crypto and/or no ICU)"; \
else \
$(RM) -r test/addons/??_*/; \
[ -x $(NODE) ] && $(NODE) $< || node $< ; \
Expand Down Expand Up @@ -536,7 +535,7 @@ NATIVE_SUITES ?= addons js-native-api node-api
# CI_* variables should be kept synchronized with the ones in vcbuild.bat
CI_NATIVE_SUITES ?= $(NATIVE_SUITES) benchmark
CI_JS_SUITES ?= $(JS_SUITES) pummel
ifeq ($(node_use_openssl), false)
ifeq ($(node_use_openssl_and_icu), false)
CI_DOC := doctool
else
CI_DOC =
Expand Down Expand Up @@ -633,8 +632,8 @@ test-hash-seed: all ## Verifu that the hash seed used by V8 for hashing is rando

.PHONY: test-doc
test-doc: doc-only lint-md ## Build, lint, and verify the docs.
@if [ "$(shell $(node_use_openssl))" != "true" ]; then \
echo "Skipping test-doc (no crypto)"; \
@if [ "$(shell $(node_use_openssl_and_icu))" != "true" ]; then \
echo "Skipping test-doc (no crypto and/or no ICU)"; \
else \
$(PYTHON) tools/test.py $(PARALLEL_ARGS) doctool; \
fi
Expand Down Expand Up @@ -750,17 +749,17 @@ apidocs_json = $(addprefix out/,$(apidoc_sources:.md=.json))
apiassets = $(subst api_assets,api/assets,$(addprefix out/,$(wildcard doc/api_assets/*)))

tools/doc/node_modules: tools/doc/package.json
@if [ "$(shell $(node_use_openssl))" != "true" ]; then \
echo "Skipping tools/doc/node_modules (no crypto)"; \
@if [ "$(shell $(node_use_openssl_and_icu))" != "true" ]; then \
echo "Skipping tools/doc/node_modules (no crypto and/or no ICU)"; \
else \
cd tools/doc && $(call available-node,$(run-npm-ci)) \
fi

.PHONY: doc-only
doc-only: tools/doc/node_modules \
$(apidoc_dirs) $(apiassets) ## Build the docs with the local or the global Node.js binary.
@if [ "$(shell $(node_use_openssl))" != "true" ]; then \
echo "Skipping doc-only (no crypto)"; \
@if [ "$(shell $(node_use_openssl_and_icu))" != "true" ]; then \
echo "Skipping doc-only (no crypto and/or no ICU)"; \
else \
$(MAKE) out/doc/api/all.html out/doc/api/all.json out/doc/api/stability; \
fi
Expand Down Expand Up @@ -1383,8 +1382,8 @@ lint-js-fix: tools/eslint/node_modules/eslint/bin/eslint.js ## Lint and fix the
# Note that on the CI `lint-js-ci` is run instead.
lint-js-doc: LINT_JS_TARGETS=doc
lint-js lint-js-doc: tools/eslint/node_modules/eslint/bin/eslint.js ## Lint the JavaScript code with eslint./eslint/bin/eslint.js
@if [ "$(shell $(node_use_openssl))" != "true" ]; then \
echo "Skipping $@ (no crypto)"; \
@if [ "$(shell $(node_use_openssl_and_icu))" != "true" ]; then \
echo "Skipping $@ (no crypto and/or no ICU)"; \
else \
echo "Running JS linter..."; \
$(call available-node,$(run-lint-js)) \
Expand Down Expand Up @@ -1414,6 +1413,11 @@ LINT_CPP_EXCLUDE += $(LINT_CPP_ADDON_DOC_FILES)
# These files were copied more or less verbatim from V8.
LINT_CPP_EXCLUDE += src/tracing/trace_event.h src/tracing/trace_event_common.h

# deps/ncrypto is included in this list, as it is maintained in
# this repository, and should be linted. Eventually it should move
# to its own repo, at which point we should remove it from this list.
LINT_CPP_DEPS = deps/ncrypto/*.cc deps/ncrypto/*.h

LINT_CPP_FILES = $(filter-out $(LINT_CPP_EXCLUDE), $(wildcard \
benchmark/napi/*/*.cc \
src/*.c \
Expand All @@ -1438,6 +1442,7 @@ LINT_CPP_FILES = $(filter-out $(LINT_CPP_EXCLUDE), $(wildcard \
tools/code_cache/*.h \
tools/snapshot/*.cc \
tools/snapshot/*.h \
$(LINT_CPP_DEPS) \
))

FORMAT_CPP_FILES ?=
Expand Down
11 changes: 11 additions & 0 deletions benchmark/fixtures/basic-test-runner.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const { test } = require('node:test');

test('should pass', () => {});
test('should fail', () => { throw new Error('fail'); });
test('should skip', { skip: true }, () => {});
test('parent', (t) => {
t.test('should fail', () => { throw new Error('fail'); });
t.test('should pass but parent fail', (t, done) => {
setImmediate(done);
});
});
2 changes: 1 addition & 1 deletion benchmark/fs/bench-opendirSync.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ tmpdir.refresh();

const testFiles = fs.readdirSync('test', { withFileTypes: true })
.filter((f) => f.isDirectory())
.map((f) => path.join(f.path, f.name));
.map((f) => path.join(f.parentPath, f.name));
const bench = common.createBenchmark(main, {
type: ['existing', 'non-existing'],
n: [1e3],
Expand Down
48 changes: 48 additions & 0 deletions benchmark/test_runner/mock-fn.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
'use strict';

const common = require('../common');
const assert = require('node:assert');
const { test } = require('node:test');

const bench = common.createBenchmark(main, {
n: [1e6],
mode: ['define', 'execute'],
}, {
// We don't want to test the reporter here
flags: ['--test-reporter=./benchmark/fixtures/empty-test-reporter.js'],
});

const noop = () => {};

function benchmarkDefine(n) {
let noDead;
test((t) => {
bench.start();
for (let i = 0; i < n; i++) {
noDead = t.mock.fn(noop);
}
bench.end(n);
assert.ok(noDead);
});
}

function benchmarkExecute(n) {
let noDead;
test((t) => {
const mocked = t.mock.fn(noop);
bench.start();
for (let i = 0; i < n; i++) {
noDead = mocked();
}
bench.end(n);
assert.strictEqual(noDead, noop());
});
}

function main({ n, mode }) {
if (mode === 'define') {
benchmarkDefine(n);
} else if (mode === 'execute') {
benchmarkExecute(n);
}
}
41 changes: 41 additions & 0 deletions benchmark/test_runner/test-reporters.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
'use strict';

const common = require('../common');
const { run } = require('node:test');
const reporters = require('node:test/reporters');
const { Readable } = require('node:stream');
const assert = require('node:assert');

const bench = common.createBenchmark(main, {
n: [1e4],
reporter: Object.keys(reporters),
});

// No need to run this for every benchmark,
// it should always be the same data.
const stream = run({
files: ['../fixtures/basic-test-runner.js'],
});
let testResults;

async function main({ n, reporter: r }) {
testResults ??= await stream.toArray();

// Create readable streams for each iteration
const readables = Array.from({ length: n }, () => Readable.from(testResults));

// Get the selected reporter
const reporter = reporters[r];

bench.start();

let noDead;
for (const readable of readables) {
// Process each readable stream through the reporter
noDead = await readable.compose(reporter).toArray();
}

bench.end(n);

assert.ok(noDead);
}
6 changes: 3 additions & 3 deletions deps/cares/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ INCLUDE (CheckCSourceCompiles)
INCLUDE (CheckStructHasMember)
INCLUDE (CheckLibraryExists)

PROJECT (c-ares LANGUAGES C VERSION "1.34.2" )
PROJECT (c-ares LANGUAGES C VERSION "1.34.3" )

# Set this version before release
SET (CARES_VERSION "${PROJECT_VERSION}")
Expand All @@ -30,7 +30,7 @@ INCLUDE (GNUInstallDirs) # include this *AFTER* PROJECT(), otherwise paths are w
# For example, a version of 4:0:2 would generate output such as:
# libname.so -> libname.so.2
# libname.so.2 -> libname.so.2.2.0
SET (CARES_LIB_VERSIONINFO "21:1:19")
SET (CARES_LIB_VERSIONINFO "21:2:19")


OPTION (CARES_STATIC "Build as a static library" OFF)
Expand Down Expand Up @@ -263,7 +263,7 @@ ENDIF ()
# Set system-specific compiler flags
IF (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
LIST (APPEND SYSFLAGS -D_DARWIN_C_SOURCE)
ELSEIF (CMAKE_SYSTEM_NAME STREQUAL "Linux")
ELSEIF (CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Android")
LIST (APPEND SYSFLAGS -D_GNU_SOURCE -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700)
ELSEIF (CMAKE_SYSTEM_NAME STREQUAL "SunOS")
LIST (APPEND SYSFLAGS -D__EXTENSIONS__ -D_REENTRANT -D_XOPEN_SOURCE=600)
Expand Down
Loading

0 comments on commit c31e7e5

Please sign in to comment.