Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v16.20.0 proposal #47272

Merged
merged 23 commits into from Mar 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
908c4df
test: mark test-crypto-key-objects flaky on Linux
richardlau Feb 16, 2023
1913b67
deps: update corepack to 0.15.2
nodejs-github-bot Nov 27, 2022
a467782
deps: update corepack to 0.15.3
nodejs-github-bot Jan 2, 2023
748bc96
deps: update corepack to 0.16.0
nodejs-github-bot Feb 18, 2023
962a747
deps: update corepack to 0.17.0
nodejs-github-bot Feb 26, 2023
6a01d39
src: add support for externally shared js builtins
mhdawson Aug 24, 2022
7af9bdb
deps: upgrade npm to 8.19.4
npm-cli-bot Feb 15, 2023
088e9cd
test: add WPTRunner support for variants and generating WPT reports
panva Feb 3, 2023
0d1485b
test: fix default WPT titles
panva Feb 22, 2023
cf76d07
test: fix WPT title when no META title is present
panva Feb 25, 2023
fc47d58
test: remove cjs loader from stack traces
GeoffreyBooth Aug 14, 2022
56cbc7f
deps: V8: cherry-pick c2792e58035f
gengjiawen Oct 14, 2022
768e562
tools: make `utils.SearchFiles` deterministic
brjsp Oct 4, 2022
efe1be4
test: skip test depending on `overlapped-checker` when not available
aduh95 Oct 15, 2022
809371a
module: require.resolve.paths returns null with node schema
fossamagna Nov 20, 2022
4617512
crypto: ensure auth tag set for chacha20-poly1305
bnoordhuis Jan 14, 2023
de6dd67
crypto: avoid hang when no algorithm available
richardlau Jan 19, 2023
b4ebe6d
deps: update c-ares to 1.19.0
targos Feb 1, 2023
85f88c6
deps: V8: cherry-pick 90be99fab31c
targos Feb 20, 2023
2497216
deps: update undici to 5.20.0
nodejs-github-bot Feb 18, 2023
086bb2f
Revert "src: let http2 streams end after session close"
Trott Feb 21, 2023
d081032
test: fix test-net-connect-reset-until-connected
batrla Feb 25, 2023
6fd13be
2023-03-29, Version 16.20.0 'Gallium' (LTS)
BethGriggs Mar 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
38 changes: 38 additions & 0 deletions BUILDING.md
Expand Up @@ -1062,6 +1062,44 @@ To make `./myModule.js` available via `require('myModule')` and
> .\vcbuild link-module './myModule.js' link-module './myModule2.js'
```

## Building to use shared dependencies at runtime

By default Node.js is built so that all dependencies are bundled into
the Node.js binary itself. This provides a single binary that includes
the correct versions of all dependencies on which it depends.

Some Node.js distributions, however, prefer to manage dependencies.
A number of `configure` options are provided to support this use case.

* For dependencies with native code, the first set of options allow
Node.js to be built so that it uses a shared library
at runtime instead of building and including the dependency
in the Node.js binary itself. These options are in the
`Shared libraries` section of the `configure` help
(run `./configure --help` to get the complete list).
They provide the ability to enable the use of a shared library,
to set the name of the shared library, and to set the paths that
contain the include and shared library files.

* For dependencies with JavaScript code (including WASM), the second
set of options allow the Node.js binary to be built so that it loads
the JavaScript for dependencies at runtime instead of being built into
the Node.js binary itself. These options are in the `Shared builtins`
section of the `configure` help
(run `./configure --help` to get the complete list). They
provide the ability to set the path to an external JavaScript file
for the dependency to be used at runtime.

It is the responsibility of any distribution
shipping with these options to:

* ensure that the shared dependencies available at runtime
match what is expected by the Node.js binary. A
mismatch may result in crashes or unexpected behavior.
* fully test that Node.js operates as expected with the
external dependencies. There may be little or no test coverage
within the Node.js project CI for these non-default options.

## Note for downstream distributors of Node.js

The Node.js ecosystem is reliant on ABI compatibility within a major release.
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Expand Up @@ -32,7 +32,8 @@ release.
</tr>
<tr>
<td valign="top">
<b><a href="doc/changelogs/CHANGELOG_V16.md#16.19.1">16.19.1</a></b><br/>
<b><a href="doc/changelogs/CHANGELOG_V16.md#16.20.0">16.20.0</a></b><br/>
<a href="doc/changelogs/CHANGELOG_V16.md#16.19.1">16.19.1</a><br/>
<a href="doc/changelogs/CHANGELOG_V16.md#16.19.0">16.19.0</a><br/>
<a href="doc/changelogs/CHANGELOG_V16.md#16.18.1">16.18.1</a><br/>
<a href="doc/changelogs/CHANGELOG_V16.md#16.18.0">16.18.0</a><br/>
Expand Down
6 changes: 6 additions & 0 deletions Makefile
Expand Up @@ -573,6 +573,12 @@ test-message: test-build
test-wpt: all
$(PYTHON) tools/test.py $(PARALLEL_ARGS) wpt

.PHONY: test-wpt-report
test-wpt-report:
$(RM) -r out/wpt
mkdir -p out/wpt
WPT_REPORT=1 $(PYTHON) tools/test.py --shell $(NODE) $(PARALLEL_ARGS) wpt

.PHONY: test-simple
test-simple: | cctest # Depends on 'all'.
$(PYTHON) tools/test.py $(PARALLEL_ARGS) parallel sequential
Expand Down
2 changes: 1 addition & 1 deletion common.gypi
Expand Up @@ -37,7 +37,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.24',
'v8_embedder_string': '-node.26',

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

Expand Down
31 changes: 31 additions & 0 deletions configure.py
Expand Up @@ -57,6 +57,11 @@
with open ('tools/icu/icu_versions.json') as f:
icu_versions = json.load(f)

shareable_builtins = {'cjs_module_lexer/lexer': 'deps/cjs-module-lexer/lexer.js',
'cjs_module_lexer/dist/lexer': 'deps/cjs-module-lexer/dist/lexer.js',
'undici/undici': 'deps/undici/undici.js'
}

# create option groups
shared_optgroup = parser.add_argument_group("Shared libraries",
"Flags that allows you to control whether you want to build against "
Expand All @@ -70,6 +75,9 @@
"library you want to build against.")
http2_optgroup = parser.add_argument_group("HTTP2",
"Flags that allows you to control HTTP2 features in Node.js")
shared_builtin_optgroup = parser.add_argument_group("Shared builtins",
"Flags that allows you to control whether you want to build against "
"internal builtins or shared files.")

# Options should be in alphabetical order but keep --prefix at the top,
# that's arguably the one people will be looking for most.
Expand Down Expand Up @@ -427,6 +435,16 @@

parser.add_argument_group(shared_optgroup)

for builtin in shareable_builtins:
builtin_id = 'shared_builtin_' + builtin + '_path'
shared_builtin_optgroup.add_argument('--shared-builtin-' + builtin + '-path',
action='store',
dest='node_shared_builtin_' + builtin.replace('/', '_') + '_path',
help='Path to shared file for ' + builtin + ' builtin. '
'Will be used instead of bundled version at runtime')

parser.add_argument_group(shared_builtin_optgroup)

static_optgroup.add_argument('--static-zoslib-gyp',
action='store',
dest='static_zoslib_gyp',
Expand Down Expand Up @@ -2006,6 +2024,19 @@ def make_bin_override():
configure_inspector(output)
configure_section_file(output)

# configure shareable builtins
output['variables']['node_builtin_shareable_builtins'] = []
for builtin in shareable_builtins:
builtin_id = 'node_shared_builtin_' + builtin.replace('/', '_') + '_path'
if getattr(options, builtin_id):
if options.with_intl == 'none':
option_name = '--shared-builtin-' + builtin + '-path'
error(option_name + ' is incompatible with --with-intl=none' )
else:
output['defines'] += [builtin_id.upper() + '=' + getattr(options, builtin_id)]
else:
output['variables']['node_builtin_shareable_builtins'] += [shareable_builtins[builtin]]

# Forward OSS-Fuzz settings
output['variables']['ossfuzz'] = b(options.ossfuzz)

Expand Down