Skip to content

Commit

Permalink
Merge branch 'main' into fix_problem_with_size_base64
Browse files Browse the repository at this point in the history
  • Loading branch information
lemire committed Sep 17, 2024
2 parents 5f44e48 + 7014e50 commit 3ad4996
Show file tree
Hide file tree
Showing 313 changed files with 5,772 additions and 5,254 deletions.
4 changes: 2 additions & 2 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ AlignEscapedNewlines: Right
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: true
AllowShortLoopsOnASingleLine: true
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-v8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
cat temp-output
tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true
rm temp-output
- uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c # v6.1.0
- uses: peter-evans/create-pull-request@8867c4aba1b742c39f8d0ba35429c2dfa4b6cb20 # v7.0.1
# Creates a PR or update the Action's existing PR, or
# no-op if the base branch is already up-to-date.
with:
Expand Down
25 changes: 14 additions & 11 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,7 @@ For use of AVX2,
* llvm version 3.3 or higher
* nasm version 2.10 or higher in Windows

Please refer to
<https://www.openssl.org/docs/man1.1.1/man3/OPENSSL_ia32cap.html> for details.
Please refer to <https://docs.openssl.org/1.1.1/man3/OPENSSL_ia32cap/> for details.

If compiling without one of the above, use `configure` with the
`--openssl-no-asm` flag. Otherwise, `configure` will fail.
Expand Down Expand Up @@ -525,7 +524,7 @@ $ gdb /opt/node-debug/node core.node.8.1535359906
[ASan](https://github.com/google/sanitizers) can help detect various memory
related bugs. ASan builds are currently only supported on linux.
If you want to check it on Windows or macOS or you want a consistent toolchain
on Linux, you can try [Docker](https://www.docker.com/products/docker-desktop)
on Linux, you can try [Docker](https://www.docker.com/products/docker-desktop/)
(using an image like `gengjiawen/node-build:2020-02-14`).

The `--debug` is not necessary and will slow down build and testing, but it can
Expand Down Expand Up @@ -618,7 +617,11 @@ vcpkg owns zlib1.dll
vcpkg integrate remove
```

Refs: #24448, <https://github.com/microsoft/vcpkg/issues/37518>, [vcpkg](https://github.com/microsoft/vcpkg/)
Refs:

1. <https://github.com/nodejs/node/issues/24448>
2. <https://github.com/microsoft/vcpkg/issues/37518> / <https://github.com/microsoft/vcpkg/discussions/37546>
3. [vcpkg](https://github.com/microsoft/vcpkg/)

#### Windows Prerequisites

Expand Down Expand Up @@ -677,9 +680,9 @@ packages:
* [NetWide Assembler](https://chocolatey.org/packages/nasm)

To install Node.js prerequisites using
[Boxstarter WebLauncher](https://boxstarter.org/weblauncher), open
[Boxstarter WebLauncher](https://boxstarter.org/weblauncher), visit
<https://boxstarter.org/package/nr/url?https://raw.githubusercontent.com/nodejs/node/HEAD/tools/bootstrap/windows_boxstarter>
with Edge browser on the target machine.
with a supported browser.

Alternatively, you can use PowerShell. Run those commands from
an elevated (Administrator) PowerShell terminal:
Expand Down Expand Up @@ -754,7 +757,7 @@ architecture supports \[arm, arm64/aarch64, x86, x86\_64].

## `Intl` (ECMA-402) support

[Intl](https://github.com/nodejs/node/blob/HEAD/doc/api/intl.md) support is
[Intl](doc/api/intl.md) support is
enabled by default.

### Build with full ICU support (all locales supported by ICU)
Expand Down Expand Up @@ -820,7 +823,7 @@ that works for both your host and target environments.
### Build with a specific ICU

You can find other ICU releases at
[the ICU homepage](http://site.icu-project.org/download).
[the ICU homepage](https://icu.unicode.org/download).
Download the file named something like `icu4c-**##.#**-src.tgz` (or
`.zip`).

Expand Down Expand Up @@ -851,7 +854,7 @@ From a tarball URL:
#### Windows

First unpack latest ICU to `deps/icu`
[icu4c-**##.#**-src.tgz](http://site.icu-project.org/download) (or `.zip`)
[icu4c-**##.#**-src.tgz](https://icu.unicode.org/download) (or `.zip`)
as `deps/icu` (You'll have: `deps/icu/source/...`)

```powershell
Expand All @@ -874,10 +877,10 @@ configure option:
## Building Node.js with FIPS-compliant OpenSSL

Node.js supports FIPS when statically or dynamically linked with OpenSSL 3 via
[OpenSSL's provider model](https://www.openssl.org/docs/man3.0/man7/crypto.html#OPENSSL-PROVIDERS).
[OpenSSL's provider model](https://docs.openssl.org/3.0/man7/crypto/#OPENSSL-PROVIDERS).
It is not necessary to rebuild Node.js to enable support for FIPS.

See [FIPS mode](./doc/api/crypto.md#fips-mode) for more information on how to
See [FIPS mode](doc/api/crypto.md#fips-mode) for more information on how to
enable FIPS support in Node.js.

## Building Node.js with external core modules
Expand Down
20 changes: 10 additions & 10 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,16 @@ The externally maintained libraries used by Node.js are:

- cjs-module-lexer, located at deps/cjs-module-lexer, is licensed as follows:
"""
MIT License
-----------

Copyright (C) 2018-2020 Guy Bedford

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.
MIT License
-----------
Copyright (C) 2018-2020 Guy Bedford
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.
"""

- ittapi, located at deps/v8/third_party/ittapi, is licensed as follows:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ For information about the governance of the Node.js project, see
* [addaleax](https://github.com/addaleax) -
**Anna Henningsen** <<[email protected]>> (she/her)
* [aduh95](https://github.com/aduh95) -
**Antoine du Hamel** <<[email protected]>> (he/him)
**Antoine du Hamel** <<[email protected]>> (he/him) - [Support me](https://github.com/sponsors/aduh95)
* [anonrig](https://github.com/anonrig) -
**Yagiz Nizipli** <<[email protected]>> (he/him) - [Support me](https://github.com/sponsors/anonrig)
* [apapirovski](https://github.com/apapirovski) -
Expand Down
2 changes: 1 addition & 1 deletion benchmark/module/module-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const bench = common.createBenchmark(main, {
files: [5e2],
n: [1, 1e3],
cache: ['true', 'false'],
});
}, { flags: '--no-warnings' });

function main({ n, name, cache, files, dir }) {
tmpdir.refresh();
Expand Down
1 change: 1 addition & 0 deletions benchmark/napi/buffer/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build/
85 changes: 85 additions & 0 deletions benchmark/napi/buffer/binding.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
#include <node_api.h>
#include <stdio.h>
#include <stdlib.h>

#define NODE_API_CALL(call) \
do { \
napi_status status = call; \
if (status != napi_ok) { \
fprintf(stderr, #call " failed: %d\n", status); \
abort(); \
} \
} while (0)

#define ABORT_IF_FALSE(condition) \
if (!(condition)) { \
fprintf(stderr, #condition " failed\n"); \
abort(); \
}

static void Finalize(node_api_basic_env env, void* data, void* hint) {
delete[] static_cast<uint8_t*>(data);
}

static napi_value CreateExternalBuffer(napi_env env, napi_callback_info info) {
napi_value argv[2], undefined, start, end;
size_t argc = 2;
int32_t n = 0;
napi_valuetype val_type = napi_undefined;

// Validate params and retrieve start and end function.
NODE_API_CALL(napi_get_cb_info(env, info, &argc, argv, nullptr, nullptr));
ABORT_IF_FALSE(argc == 2);
NODE_API_CALL(napi_typeof(env, argv[0], &val_type));
ABORT_IF_FALSE(val_type == napi_object);
NODE_API_CALL(napi_typeof(env, argv[1], &val_type));
ABORT_IF_FALSE(val_type == napi_number);
NODE_API_CALL(napi_get_named_property(env, argv[0], "start", &start));
NODE_API_CALL(napi_typeof(env, start, &val_type));
ABORT_IF_FALSE(val_type == napi_function);
NODE_API_CALL(napi_get_named_property(env, argv[0], "end", &end));
NODE_API_CALL(napi_typeof(env, end, &val_type));
ABORT_IF_FALSE(val_type == napi_function);
NODE_API_CALL(napi_get_value_int32(env, argv[1], &n));

NODE_API_CALL(napi_get_undefined(env, &undefined));

constexpr uint32_t kBufferLen = 32;

// Start the benchmark.
napi_call_function(env, argv[0], start, 0, nullptr, nullptr);

for (int32_t idx = 0; idx < n; idx++) {
napi_handle_scope scope;
uint8_t* buffer = new uint8_t[kBufferLen];
napi_value jsbuffer;
NODE_API_CALL(napi_open_handle_scope(env, &scope));
NODE_API_CALL(napi_create_external_buffer(
env, kBufferLen, buffer, Finalize, nullptr, &jsbuffer));
NODE_API_CALL(napi_close_handle_scope(env, scope));
}

// Conclude the benchmark.
napi_value end_argv[] = {argv[1]};
NODE_API_CALL(napi_call_function(env, argv[0], end, 1, end_argv, nullptr));

return undefined;
}

NAPI_MODULE_INIT() {
napi_property_descriptor props[] = {
{"createExternalBuffer",
nullptr,
CreateExternalBuffer,
nullptr,
nullptr,
nullptr,
static_cast<napi_property_attributes>(napi_writable | napi_configurable |
napi_enumerable),
nullptr},
};

NODE_API_CALL(napi_define_properties(
env, exports, sizeof(props) / sizeof(*props), props));
return exports;
}
18 changes: 18 additions & 0 deletions benchmark/napi/buffer/binding.gyp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
'targets': [
{
'target_name': 'binding',
'sources': [ 'binding.cc' ],
'defines': [
'NAPI_EXPERIMENTAL'
]
},
{
'target_name': 'binding_node_api_v8',
'sources': [ 'binding.cc' ],
'defines': [
'NAPI_VERSION=8'
]
}
]
}
14 changes: 14 additions & 0 deletions benchmark/napi/buffer/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
'use strict';

const common = require('../../common.js');

const bench = common.createBenchmark(main, {
n: [5e6],
addon: ['binding', 'binding_node_api_v8'],
implem: ['createExternalBuffer'],
});

function main({ n, implem, addon }) {
const binding = require(`./build/${common.buildType}/${addon}`);
binding[implem](bench, n);
}
31 changes: 31 additions & 0 deletions benchmark/os/tmpdir.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
'use strict';

const common = require('../common.js');
const { tmpdir } = require('os');
const assert = require('assert');

const bench = common.createBenchmark(main, {
n: [1e6],
});

function main({ n }) {
// Warm up.
const length = 1024;
const array = [];
for (let i = 0; i < length; ++i) {
array.push(tmpdir());
}

bench.start();
for (let i = 0; i < n; ++i) {
const index = i % length;
array[index] = tmpdir();
}
bench.end(n);

// Verify the entries to prevent dead code elimination from making
// the benchmark invalid.
for (let i = 0; i < length; ++i) {
assert.strictEqual(typeof array[i], 'string');
}
}
2 changes: 1 addition & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

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

##### V8 defaults for Node.js #####

Expand Down
2 changes: 1 addition & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -1671,7 +1671,7 @@ def configure_v8(o, configs):
o['variables']['v8_enable_short_builtin_calls'] = 1
if options.v8_enable_snapshot_compression:
o['variables']['v8_enable_snapshot_compression'] = 1
if options.v8_enable_object_print and options.v8_disable_object_print:
if all(opt in sys.argv for opt in ['--v8-enable-object-print', '--v8-disable-object-print']):
raise Exception(
'Only one of the --v8-enable-object-print or --v8-disable-object-print options '
'can be specified at a time.')
Expand Down
2 changes: 1 addition & 1 deletion deps/cjs-module-lexer/dist/lexer.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions deps/cjs-module-lexer/dist/lexer.mjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion deps/cjs-module-lexer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cjs-module-lexer",
"version": "1.4.0",
"version": "1.4.1",
"description": "Lexes CommonJS modules, returning their named exports metadata",
"main": "lexer.js",
"exports": {
Expand Down
7 changes: 7 additions & 0 deletions deps/corepack/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [0.29.4](https://github.com/nodejs/corepack/compare/v0.29.3...v0.29.4) (2024-09-07)


### Features

* update package manager versions ([#543](https://github.com/nodejs/corepack/issues/543)) ([b819e40](https://github.com/nodejs/corepack/commit/b819e404dbb23c4ae3d5dbe55e21de74d714ee9c))

## [0.29.3](https://github.com/nodejs/corepack/compare/v0.29.2...v0.29.3) (2024-07-21)


Expand Down
8 changes: 4 additions & 4 deletions deps/corepack/dist/lib/corepack.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -21260,7 +21260,7 @@ function String2(descriptor, ...args) {
}

// package.json
var version = "0.29.3";
var version = "0.29.4";

// sources/Engine.ts
var import_fs9 = __toESM(require("fs"));
Expand All @@ -21274,7 +21274,7 @@ var import_valid3 = __toESM(require_valid2());
var config_default = {
definitions: {
npm: {
default: "10.8.2+sha1.3c123c7f14409dc0395478e7269fdbc32ae179d8",
default: "10.8.3+sha1.e6085b2864fcfd9b1aad7b602601b5a2fc116699",
fetchLatestFrom: {
type: "npm",
package: "npm"
Expand Down Expand Up @@ -21311,7 +21311,7 @@ var config_default = {
}
},
pnpm: {
default: "9.5.0+sha1.8c155dc114e1689d18937974f6571e0ceee66f1d",
default: "9.9.0+sha1.3edbe440f4e570aa8f049adbd06b9483d55cc2d2",
fetchLatestFrom: {
type: "npm",
package: "pnpm"
Expand Down Expand Up @@ -21375,7 +21375,7 @@ var config_default = {
package: "yarn"
},
transparent: {
default: "4.3.1+sha224.934d21773e22af4b69a7032a2d3b4cb38c1f7c019624777cc9916b23",
default: "4.4.1+sha224.fd21d9eb5fba020083811af1d4953acc21eeb9f6ff97efd1b3f9d4de",
commands: [
[
"yarn",
Expand Down
2 changes: 1 addition & 1 deletion deps/corepack/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "corepack",
"version": "0.29.3",
"version": "0.29.4",
"homepage": "https://github.com/nodejs/corepack#readme",
"bugs": {
"url": "https://github.com/nodejs/corepack/issues"
Expand Down
Loading

0 comments on commit 3ad4996

Please sign in to comment.