Skip to content

Commit 19dc0c4

Browse files
authored
Merge branch 'nodejs:main' into dev-55864
2 parents 8a08e0c + 03ec900 commit 19dc0c4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+2811
-880
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@
143143
# Actions
144144

145145
/.github/workflows/* @nodejs/actions
146+
/.github/workflows/create-release-proposal.yml @nodejs/releasers
146147
/tools/actions/* @nodejs/actions
147148

148149
# Test runner

.github/workflows/create-release-proposal.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,10 @@ on:
1111
release-line:
1212
required: true
1313
type: number
14-
default: 23
1514
description: 'The release line (without dots or prefix). e.g: 22'
1615
release-date:
1716
required: true
1817
type: string
19-
default: YYYY-MM-DD
2018
description: The release date in YYYY-MM-DD format
2119

2220
concurrency: ${{ github.workflow }}

.github/workflows/tools.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ permissions:
5151

5252
jobs:
5353
tools-deps-update:
54-
if: github.repository == 'nodejs/node'
54+
if: github.repository == 'nodejs/node' || github.event_name == 'workflow_dispatch'
5555
runs-on: ubuntu-latest
5656
strategy:
5757
fail-fast: false # Prevent other jobs from aborting if one fails

deps/sqlite/sqlite3ext.h

Lines changed: 719 additions & 0 deletions
Large diffs are not rendered by default.

deps/zlib/google/zip_writer.cc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "third_party/zlib/google/zip_writer.h"
66

77
#include <algorithm>
8+
#include <tuple>
89

910
#include "base/files/file.h"
1011
#include "base/logging.h"
@@ -193,8 +194,8 @@ bool ZipWriter::AddMixedEntries(Paths paths) {
193194
while (!paths.empty()) {
194195
// Work with chunks of 50 paths at most.
195196
const size_t n = std::min<size_t>(paths.size(), 50);
196-
const Paths relative_paths = paths.subspan(0, n);
197-
paths = paths.subspan(n, paths.size() - n);
197+
Paths relative_paths;
198+
std::tie(relative_paths, paths) = paths.split_at(n);
198199

199200
files.clear();
200201
if (!file_accessor_->Open(relative_paths, &files) || files.size() != n)
@@ -233,8 +234,8 @@ bool ZipWriter::AddFileEntries(Paths paths) {
233234
while (!paths.empty()) {
234235
// Work with chunks of 50 paths at most.
235236
const size_t n = std::min<size_t>(paths.size(), 50);
236-
const Paths relative_paths = paths.subspan(0, n);
237-
paths = paths.subspan(n, paths.size() - n);
237+
Paths relative_paths;
238+
std::tie(relative_paths, paths) = paths.split_at(n);
238239

239240
DCHECK_EQ(relative_paths.size(), n);
240241

doc/api/async_context.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,6 @@ a Worker pool around it could use the following structure:
626626
```mjs
627627
import { AsyncResource } from 'node:async_hooks';
628628
import { EventEmitter } from 'node:events';
629-
import path from 'node:path';
630629
import { Worker } from 'node:worker_threads';
631630

632631
const kTaskInfo = Symbol('kTaskInfo');

doc/api/deprecations.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3737,14 +3737,17 @@ and [`crypto.setEngine()`][] all depend on this functionality from OpenSSL.
37373737

37383738
<!-- YAML
37393739
changes:
3740+
- version: REPLACEME
3741+
pr-url: https://github.com/nodejs/node/pull/55718
3742+
description: Runtime deprecation.
37403743
- version:
37413744
- v22.9.0
37423745
- v20.18.0
37433746
pr-url: https://github.com/nodejs/node/pull/54708
37443747
description: Documentation-only deprecation.
37453748
-->
37463749

3747-
Type: Documentation-only
3750+
Type: Runtime
37483751

37493752
Instantiating classes without the `new` qualifier exported by the `node:zlib` module is deprecated.
37503753
It is recommended to use the `new` qualifier instead. This applies to all Zlib classes, such as `Deflate`,
@@ -3786,7 +3789,7 @@ Type: Documentation-only
37863789
Passing non-supported argument types is deprecated and, instead of returning `false`,
37873790
will throw an error in a future version.
37883791

3789-
### DEP0187: `process.features.ipv6` and `process.features.uv`
3792+
### DEP0188: `process.features.ipv6` and `process.features.uv`
37903793

37913794
<!-- YAML
37923795
changes:
@@ -3799,7 +3802,7 @@ Type: Documentation-only
37993802

38003803
These properties are unconditionally `true`. Any checks based on these properties are redundant.
38013804

3802-
### DEP0188: `process.features.tls_*`
3805+
### DEP0189: `process.features.tls_*`
38033806

38043807
<!-- YAML
38053808
changes:

doc/api/errors.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2436,6 +2436,18 @@ Accessing `Object.prototype.__proto__` has been forbidden using
24362436
[`Object.setPrototypeOf`][] should be used to get and set the prototype of an
24372437
object.
24382438

2439+
<a id="ERR_QUIC_APPLICATION_ERROR"></a>
2440+
2441+
### `ERR_QUIC_APPLICATION_ERROR`
2442+
2443+
<!-- YAML
2444+
added: REPLACEME
2445+
-->
2446+
2447+
> Stability: 1 - Experimental
2448+
2449+
A QUIC application error occurred.
2450+
24392451
<a id="ERR_QUIC_CONNECTION_FAILED"></a>
24402452

24412453
### `ERR_QUIC_CONNECTION_FAILED`
@@ -2478,6 +2490,30 @@ added:
24782490
24792491
Opening a QUIC stream failed.
24802492

2493+
<a id="ERR_QUIC_TRANSPORT_ERROR"></a>
2494+
2495+
### `ERR_QUIC_TRANSPORT_ERROR`
2496+
2497+
<!-- YAML
2498+
added: REPLACEME
2499+
-->
2500+
2501+
> Stability: 1 - Experimental
2502+
2503+
A QUIC transport error occurred.
2504+
2505+
<a id="ERR_QUIC_VERSION_NEGOTIATION_ERROR"></a>
2506+
2507+
### `ERR_QUIC_VERSION_NEGOTIATION_ERROR`
2508+
2509+
<!-- YAML
2510+
added: REPLACEME
2511+
-->
2512+
2513+
> Stability: 1 - Experimental
2514+
2515+
A QUIC session failed because version negotiation is required.
2516+
24812517
<a id="ERR_REQUIRE_ASYNC_MODULE"></a>
24822518

24832519
### `ERR_REQUIRE_ASYNC_MODULE`

doc/api/sqlite.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,10 @@ around [`sqlite3_prepare_v2()`][].
156156

157157
### `database.createSession([options])`
158158

159+
<!-- YAML
160+
added: v23.3.0
161+
-->
162+
159163
* `options` {Object} The configuration options for the session.
160164
* `table` {string} A specific table to track changes for. By default, changes to all tables are tracked.
161165
* `db` {string} Name of the database to track. This is useful when multiple databases have been added using [`ATTACH DATABASE`][]. **Default**: `'main'`.
@@ -165,14 +169,18 @@ Creates and attaches a session to the database. This method is a wrapper around
165169

166170
### `database.applyChangeset(changeset[, options])`
167171

172+
<!-- YAML
173+
added: v23.3.0
174+
-->
175+
168176
* `changeset` {Uint8Array} A binary changeset or patchset.
169177
* `options` {Object} The configuration options for how the changes will be applied.
170178
* `filter` {Function} Skip changes that, when targeted table name is supplied to this function, return a truthy value.
171179
By default, all changes are attempted.
172180
* `onConflict` {number} Determines how conflicts are handled. **Default**: `SQLITE_CHANGESET_ABORT`.
173181
* `SQLITE_CHANGESET_OMIT`: conflicting changes are omitted.
174182
* `SQLITE_CHANGESET_REPLACE`: conflicting changes replace existing values.
175-
* `SQLITE_CHANGESET_ABORT`: abort on conflict and roll back databsase.
183+
* `SQLITE_CHANGESET_ABORT`: abort on conflict and roll back database.
176184
* Returns: {boolean} Whether the changeset was applied succesfully without being aborted.
177185

178186
An exception is thrown if the database is not
@@ -198,15 +206,27 @@ targetDb.applyChangeset(changeset);
198206

199207
## Class: `Session`
200208

209+
<!-- YAML
210+
added: v23.3.0
211+
-->
212+
201213
### `session.changeset()`
202214

215+
<!-- YAML
216+
added: v23.3.0
217+
-->
218+
203219
* Returns: {Uint8Array} Binary changeset that can be applied to other databases.
204220

205221
Retrieves a changeset containing all changes since the changeset was created. Can be called multiple times.
206222
An exception is thrown if the database or the session is not open. This method is a wrapper around [`sqlite3session_changeset()`][].
207223

208224
### `session.patchset()`
209225

226+
<!-- YAML
227+
added: v23.3.0
228+
-->
229+
210230
* Returns: {Uint8Array} Binary patchset that can be applied to other databases.
211231

212232
Similar to the method above, but generates a more compact patchset. See [Changesets and Patchsets][]

doc/api/stream.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3846,8 +3846,6 @@ added: v8.0.0
38463846

38473847
The `_destroy()` method is called by [`writable.destroy()`][writable-destroy].
38483848
It can be overridden by child classes but it **must not** be called directly.
3849-
Furthermore, the `callback` should not be mixed with async/await
3850-
once it is executed when a promise is resolved.
38513849

38523850
#### `writable._final(callback)`
38533851

doc/api/util.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1998,6 +1998,10 @@ The full list of formats can be found in [modifiers][].
19981998
19991999
<!-- YAML
20002000
added: v8.3.0
2001+
changes:
2002+
- version: v11.0.0
2003+
pr-url: https://github.com/nodejs/node/pull/22281
2004+
description: The class is now available on the global object.
20012005
-->
20022006
20032007
An implementation of the [WHATWG Encoding Standard][] `TextDecoder` API.
@@ -2076,14 +2080,6 @@ is not supported.
20762080
20772081
### `new TextDecoder([encoding[, options]])`
20782082
2079-
<!-- YAML
2080-
added: v8.3.0
2081-
changes:
2082-
- version: v11.0.0
2083-
pr-url: https://github.com/nodejs/node/pull/22281
2084-
description: The class is now available on the global object.
2085-
-->
2086-
20872083
* `encoding` {string} Identifies the `encoding` that this `TextDecoder` instance
20882084
supports. **Default:** `'utf-8'`.
20892085
* `options` {Object}
@@ -2166,6 +2162,10 @@ encoded bytes.
21662162
21672163
### `textEncoder.encodeInto(src, dest)`
21682164
2165+
<!-- YAML
2166+
added: v12.11.0
2167+
-->
2168+
21692169
* `src` {string} The text to encode.
21702170
* `dest` {Uint8Array} The array to hold the encode result.
21712171
* Returns: {Object}

doc/contributing/gn-build.md

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -28,27 +28,33 @@ Node.js contains following GN build files:
2828

2929
Unlike GYP, the GN tool does not include any built-in rules for compiling a
3030
project, which means projects building with GN must provide their own build
31-
configurations for things like how to invoke a C++ compiler. Chromium related
32-
projects like V8 and skia choose to reuse Chromium's build configurations, and
33-
V8's Node.js integration testing repository
34-
([node-ci](https://chromium.googlesource.com/v8/node-ci/)) can be reused for
35-
building Node.js.
31+
configurations for things like how to invoke a C++ compiler.
32+
33+
Chromium related projects like V8 and skia choose to reuse Chromium's build
34+
configurations, and V8's Node.js integration testing repository
35+
[`node-ci`][node-ci] can be reused for building Node.js.
3636

3737
### 1. Install `depot_tools`
3838

39-
The `depot_tools` is a set of tools used by Chromium related projects for
40-
checking out code and managing dependencies, and since this guide is reusing the
41-
infra of V8, it needs to be installed and added to `PATH`:
39+
You'll need to install [`depot_tools`][depot-tools] the toolset
40+
used for fetching Chromium and its dependencies.
4241

4342
```bash
4443
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
4544
export PATH=/path/to/depot_tools:$PATH
4645
```
4746

48-
You can also follow the [official tutorial of
49-
`depot_tools`](https://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/depot_tools_tutorial.html).
47+
You can ensure `depot_tools` is correctly added to your PATH by running
48+
`which gn` and confirming that it returns `/path/to/depot_tools/gn`.
49+
50+
**NOTE:** On Windows you'll also need to set the environment variable
51+
`DEPOT_TOOLS_WIN_TOOLCHAIN=0`. To do so, open `Control Panel` → `System and
52+
Security``System``Advanced system settings` and add a system variable
53+
`DEPOT_TOOLS_WIN_TOOLCHAIN` with value `0`. This tells `depot_tools` to use
54+
your locally installed version of Visual Studio (by default, `depot_tools` will
55+
try to download a Google-internal version that only Googlers have access to).
5056

51-
### 2. Check out code of Node.js
57+
### 2. Checkout Node.js Source Code
5258

5359
To check out the latest main branch of Node.js for building, use the `fetch`
5460
tool from `depot_tools`:
@@ -91,9 +97,9 @@ out at `node_gn/node/node`.
9197

9298
### 3. Build
9399

94-
GN only supports [`ninja`](https://ninja-build.org) for building, so to build
95-
Node.js with GN, `ninja` build files should be generated first, and then
96-
`ninja` can be invoked to do the building.
100+
GN only supports [`ninja`](https://ninja-build.org) for building. To build
101+
Node.js with GN you'll first need to generate `ninja` build files and then invoke
102+
`ninja` to perform the build.
97103

98104
The `node-ci` repository provides a script for calling GN:
99105

@@ -103,9 +109,10 @@ cd node # Enter `node_gn/node` which contains a node-ci checkout
103109
```
104110

105111
which writes `ninja` build files into the `out/Release` directory under
106-
`node_gn/node`.
112+
`node_gn/node`. To see all possible configurable options, run
113+
`tools/gn-gen.py --help`.
107114

108-
And then you can execute `ninja`:
115+
When `gn-gen.py` has executed successfully, you can then execute `ninja`:
109116

110117
```bash
111118
ninja -C out/Release node
@@ -116,10 +123,12 @@ After the build is completed, the compiled Node.js executable can be found in
116123

117124
## Status of the GN build
118125

119-
Currently the GN build of Node.js is not fully functioning. It builds for macOS
120-
and Linux, while the Windows build is still a work in progress. And some tests
121-
are still failing with the GN build.
126+
Currently the GN build of Node.js is not fully functioning. Some tests
127+
are still failing with the GN build, and there may be other small pitfall
128+
for certain configuration options.
129+
130+
An effort is currently underway to make GN build work without using `depot_tools`,
131+
which is tracked in [#51689](https://github.com/nodejs/node/issues/51689).
122132

123-
There are also efforts on making GN build work without using `depot_tools`,
124-
which is tracked in the issue
125-
[#51689](https://github.com/nodejs/node/issues/51689).
133+
[depot-tools]: https://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/depot_tools_tutorial.html#_setting_up
134+
[node-ci]: https://chromium.googlesource.com/v8/node-ci

doc/contributing/releases.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1383,6 +1383,42 @@ Infrastructure team is able to perform the switch of the default. An issue
13831383
should be opened on the [Node.js Snap management repository][] requesting this
13841384
take place once a new LTS line has been released.
13851385

1386+
## FAQ
1387+
1388+
Due to how `tools/release.sh` work, it isn't uncommon to face some errors
1389+
during the promotion process as it depends on network communication and machine
1390+
availability. This section aims to guide the releaser through potential
1391+
failures.
1392+
1393+
### Error on dist-indexer while promoting
1394+
1395+
```bash
1396+
node:events:491
1397+
throw er; // Unhandled 'error' event
1398+
^
1399+
1400+
Error: read ECONNRESET
1401+
at TLSWrap.onStreamRead (node:internal/stream_base_commons:217:20)
1402+
Emitted 'error' event on DestroyableTransform instance at:
1403+
at ClientRequest.<anonymous> (/usr/lib/node_modules/nodejs-dist-indexer/node_modules/hyperquest/index.js:14:19)
1404+
at ClientRequest.emit (node:events:513:28)
1405+
at TLSSocket.socketErrorListener (node:_http_client:494:9)
1406+
at TLSSocket.emit (node:events:513:28)
1407+
at emitErrorNT (node:internal/streams/destroy:157:8)
1408+
at emitErrorCloseNT (node:internal/streams/destroy:122:3)
1409+
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
1410+
errno: -104,
1411+
code: 'ECONNRESET',
1412+
syscall: 'read'
1413+
}
1414+
```
1415+
1416+
Typical resolution: sign the release again.
1417+
1418+
```bash
1419+
./tools/release.sh -s vX.Y.Z
1420+
```
1421+
13861422
[Build issue tracker]: https://github.com/nodejs/build/issues/new
13871423
[CI lockdown procedure]: https://github.com/nodejs/build/blob/HEAD/doc/jenkins-guide.md#restricting-access-for-security-releases
13881424
[Node.js Snap management repository]: https://github.com/nodejs/snap

0 commit comments

Comments
 (0)