Colin Ihrig
c7ece464a1
test_runner: remove runtime experimental warning
...
This commit removes the experimental warning that is emitted
when the test runner is used. The test runner feature is still
considered experimental, but this change makes its output
easier to read.
PR-URL: https://github.com/nodejs/node/pull/44844
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: James M Snell <jasnell@gmail.com >
2022-10-05 11:54:20 +01:00
Keyhan Vakil
37808b3355
build: convert V8 test JSON to JUnit XML
...
This introduces some code to convert from V8's test JSON output to JUnit
XML. We need this because V8's latest refactor of their test runner has
made it difficult to float our JUnit reporter patch on top (see the
referenced issue).
I also think that there needs to be the same changes to vcbuild.bat, but
I don't know how to do test those yet. I can create a Windows VM and
test it if we decide to go with this approach.
Refs: https://github.com/nodejs/node-v8/issues/236
PR-URL: https://github.com/nodejs/node/pull/44049
Fixes: https://github.com/nodejs/node-v8/issues/236
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
2022-10-05 11:54:20 +01:00
Gerhard Stöbich
a854bb39c9
node-api: create reference only when needed
...
Optimize napi_create_external() to create the reference for calling
finalizer only if user actually provides a finalizer callback.
PR-URL: https://github.com/nodejs/node/pull/44827
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2022-10-05 11:54:20 +01:00
MURAKAMI Masahiko
dc2af265d7
test: improve lib/internal/source_map/source_map.js coverage
...
PR-URL: https://github.com/nodejs/node/pull/42771
Refs: https://coverage.nodejs.org/coverage-0699150267c08fb2/lib/internal/source_map/source_map.js.html#L154
Refs: https://coverage.nodejs.org/coverage-0699150267c08fb2/lib/internal/source_map/source_map.js.html#L165
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Kohei Ueno <kohei.ueno119@gmail.com >
2022-10-05 11:54:20 +01:00
Richard Lau
60a05d6dea
test: skip some binding tests on IBMi PASE
...
IBM i PASE Node.js always links to shared openssl
libraries. Skip recently added OpenSSL addons
tests as we do for other OpenSSL addons tests on
IBM i.
Refs: https://github.com/nodejs/node/pull/31967
Refs: https://github.com/nodejs/node/pull/44148
PR-URL: https://github.com/nodejs/node/pull/44810
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2022-10-05 11:54:19 +01:00
Rafael Gonzaga
6ae9bc8fbc
doc: add extra step for reporter pre-approval
...
As discussed in the #security-triagge (OpenJS channel).
To avoid insufficient CVE fixes across Security Release,
might make sense to request a reporter pre-approval.
PR-URL: https://github.com/nodejs/node/pull/44806
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Chengzhong Wu <legendecas@gmail.com >
2022-10-05 11:54:19 +01:00
Joyee Cheung
8dacedaa3d
test: remove unused variable in addon test
...
This fixes the compiler warning for the unused variable in the
report-api addon test.
PR-URL: https://github.com/nodejs/node/pull/44809
Reviewed-By: Richard Lau <rlau@redhat.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2022-10-05 11:54:19 +01:00
Richard Lau
c54cee1c3f
test: check server status in test-tls-psk-client
...
Add assertions to sequential/test-tls-psk-client to check if the
spawned OpenSSL server has exited in any way except for the expected
termination by the cleanUp() function. The added assertions will
prevent the test from spinning forever trying to connect to the
non-existent server in the case that the spawned process has exited.
Include stderr and stdout in the assertion failure message to aid
debugging.
PR-URL: https://github.com/nodejs/node/pull/44824
Refs: https://github.com/nodejs/node/issues/44821
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2022-10-05 11:54:19 +01:00
Kohei Ueno
ccf31d8bca
doc: add anchor link for --preserve-symlinks
...
PR-URL: https://github.com/nodejs/node/pull/44858
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Darshan Sen <raisinten@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2022-10-05 11:54:19 +01:00
Moshe Atlow
2efe4d985b
meta: label test.js and test.md with test_runner label
...
PR-URL: https://github.com/nodejs/node/pull/44863
Reviewed-By: Darshan Sen <raisinten@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2022-10-05 11:54:18 +01:00
Simone Busoli
7c5c19ee54
doc: update node prefix require.cache example
...
PR-URL: https://github.com/nodejs/node/pull/44724
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Akhil Marsonya <akhil.marsonya27@gmail.com >
Reviewed-By: Darshan Sen <raisinten@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: James M Snell <jasnell@gmail.com >
2022-10-05 11:54:18 +01:00
Daeyeon Jeong
f300f197da
stream: handle enqueuing chunks when a pending BYOB pull request exists
...
Signed-off-by: Daeyeon Jeong <daeyeon.dev@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/44770
Refs: https://streams.spec.whatwg.org/#readable-byte-stream-controller-enqueue
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2022-10-05 11:54:18 +01:00
Vladimir de Turckheim
2a5bce6318
doc: include last security release date
...
PR-URL: https://github.com/nodejs/node/pull/44794
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Michael Dawson <midawson@redhat.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2022-10-05 11:54:18 +01:00
Node.js GitHub Bot
fd9feb3a6c
meta: update AUTHORS
...
PR-URL: https://github.com/nodejs/node/pull/44857
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com >
2022-10-05 11:54:18 +01:00
Darshan Sen
131adece37
tools: fix typo in tools/update-authors.mjs
...
The filename ends with an s.
Signed-off-by: Darshan Sen <raisinten@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/44780
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com >
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Akhil Marsonya <akhil.marsonya27@gmail.com >
2022-10-05 11:54:18 +01:00
pete3249
ee3c6a4dc5
test: use async/await in test-debugger-exceptions
...
PR-URL: https://github.com/nodejs/node/pull/44690
Reviewed-By: Rich Trott <rtrott@gmail.com >
2022-10-05 11:54:17 +01:00
Chandana
9f14625fe5
test: use async/await in test-debugger-help
...
PR-URL: https://github.com/nodejs/node/pull/44686
Reviewed-By: Rich Trott <rtrott@gmail.com >
2022-10-05 11:54:17 +01:00
mmeenapriya
8033ad846b
test: update test-debugger-scripts to use await/async
...
PR-URL: https://github.com/nodejs/node/pull/44692
Reviewed-By: Rich Trott <rtrott@gmail.com >
2022-10-05 11:54:17 +01:00
Anjana Krishnakumar Vellore
f4f08be384
test: use await in test-debugger-invalid-json
...
Changes the promises to async/await in
test/parallel/test-debugger-invalid-json.
PR-URL: https://github.com/nodejs/node/pull/44689
Reviewed-By: Rich Trott <rtrott@gmail.com >
2022-10-05 11:54:17 +01:00
Monu-Chaudhary
d2f36169f3
test: use async/await in test-debugger-random-port-with-inspect-port
...
PR-URL: https://github.com/nodejs/node/pull/44695
Reviewed-By: Rich Trott <rtrott@gmail.com >
2022-10-05 11:54:17 +01:00
Brinda Ashar
ddf029725b
test: use async/await in test-debugger-heap-profiler
...
PR-URL: https://github.com/nodejs/node/pull/44693
Reviewed-By: Rich Trott <rtrott@gmail.com >
2022-10-05 11:54:16 +01:00
David Benjamin
e0fbba0939
crypto: use EVP_PKEY_CTX_set_dsa_paramgen_q_bits when available
...
This matches the formulation described in the documentation:
https://www.openssl.org/docs/man3.0/man3/EVP_PKEY_CTX_set_dsa_paramgen_q_bits.html
It is also, starting OpenSSL 3.0, more type-safe because the wrapper
macros were finally converted to real functions. In OpenSSL 3.0, it is
also no longer quite a wrapper over EVP_PKEY_CTX_ctrl, so using this
name saves some extra OSSL_PARAM <-> EVP_PKEY_CTRL conversions.
Alas, it was only backported to OpenSSL 1.1.1e, so I've left a temporary
compatibility define until you all decide to drop pre-1.1.1e releases of
1.1.1.
PR-URL: https://github.com/nodejs/node/pull/44561
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
2022-10-05 11:54:16 +01:00
samyuktaprabhu
117f068250
test: use async/await in test-debugger-auto-resume
...
PR-URL: https://github.com/nodejs/node/pull/44675
Reviewed-By: Rich Trott <rtrott@gmail.com >
2022-10-05 11:54:16 +01:00
Tobias Nießen
b27b336a7a
src: remove ParseIP() in cares_wrap.cc
...
This function is only used in one place where the result argument is
never nullptr, so remove special handling of that case. Also, instead
of returning magic values 0/4/6 and then later translating those into
error/AF_INET/AF_INET6, use AF_INET/AF_INET6 directly. Lastly, inline
the function, which is simpler overall.
PR-URL: https://github.com/nodejs/node/pull/44771
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com >
2022-10-05 11:54:16 +01:00
Rathi N Das
143c428cae
test: migrated from Promise chains to Async/Await
...
PR-URL: https://github.com/nodejs/node/pull/44674
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
2022-10-05 11:54:16 +01:00
Juliet Zhang
e609a3309c
test: change promises to async/await in test-debugger-backtrace.js
...
PR-URL: https://github.com/nodejs/node/pull/44677
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2022-10-05 11:54:15 +01:00
Hope Olaidé
eeabd23ca6
test: use async/await in test-debugger-sb-before-load
...
PR-URL: https://github.com/nodejs/node/pull/44697
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2022-10-05 11:54:15 +01:00
Connor Burton
5c63d1464e
test: add extra tests for basename with ext option
...
PR-URL: https://github.com/nodejs/node/pull/44772
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2022-10-05 11:54:15 +01:00
cjihrig
dc6379bdc2
fs: don't hard code name in validatePosition()
...
The name of the position being validated by validatePosition()
was not being used. Instead, the string 'position' was being
used everywhere. It worked out because the only call sites were
using the name 'position' as well.
PR-URL: https://github.com/nodejs/node/pull/44767
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com >
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com >
Reviewed-By: Kohei Ueno <kohei.ueno119@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
2022-10-05 11:54:15 +01:00
cjihrig
f85d3471ee
child_process: remove lookup of undefined property
...
execSync() passes opts.args to checkExecSyncError(). There are
two problems:
1. opts.args appears to always be undefined.
2. Even if it was defined, checkExecSyncError() would not use
it since the command input is guaranteed to be defined.
This commit updates the code to pass undefined instead.
PR-URL: https://github.com/nodejs/node/pull/44766
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2022-10-05 11:54:15 +01:00
Joyee Cheung
4e82521af1
bootstrap: update comments in bootstrap/node.js
...
The comments in bootstrap/node.js are now out of date due to
recent changes to the bootstrap process. Update them to reflect
the current status.
PR-URL: https://github.com/nodejs/node/pull/44726
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Chengzhong Wu <legendecas@gmail.com >
2022-10-05 11:54:15 +01:00
Joyee Cheung
91514393dc
dns: support dns module in the snapshot
...
For the initial iteration, only the default resolver can be
serialized/deserialized. If `dns.setServers()` has been
called, we'll preserve the configured DNS servers in the snapshot.
We can consider exposing the serialization method if it becomes
necessary for user-land snapshots.
PR-URL: https://github.com/nodejs/node/pull/44633
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2022-10-05 11:54:01 +01:00
Divya Mohan
f8b2d7a059
test: refactor to async/await
...
PR-URL: https://github.com/nodejs/node/pull/44694
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2022-10-05 11:52:58 +01:00
Geoffrey Booth
910fbd0ece
esm: fix duplicated test
...
PR-URL: https://github.com/nodejs/node/pull/44779
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
2022-10-05 11:52:58 +01:00
Madhuri
ab22777e65
tools: refactor deprecated format in no-unescaped-regexp-dot
...
PR-URL: https://github.com/nodejs/node/pull/44763
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2022-10-05 11:52:58 +01:00
Rich Trott
4efaf4265c
doc: remove "currently" and comma splice from child_process.md
...
Remove redundant use of "currently" and fix a comma splice.
PR-URL: https://github.com/nodejs/node/pull/44789
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Akhil Marsonya <akhil.marsonya27@gmail.com >
Reviewed-By: Harshitha K P <harshitha014@gmail.com >
Reviewed-By: Darshan Sen <raisinten@gmail.com >
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com >
2022-10-05 11:52:57 +01:00
Priya Shastri
9864bde9ab
test: modify test-debugger-custom-port.js to use async-await
...
PR-URL: https://github.com/nodejs/node/pull/44680
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2022-10-05 11:52:57 +01:00
Alex
f92871a52b
build: update timezone-update.yml
...
Signed-off-by: sashashura <93376818+sashashura@users.noreply.github.com >
PR-URL: https://github.com/nodejs/node/pull/44717
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Mestery <mestery@protonmail.com >
Reviewed-By: Tierney Cyren <hello@bnb.im >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2022-10-05 11:52:57 +01:00
Momtchil Momtchev
af30823881
test: upgrade all 1024 bit RSA keys to 2048 bits
...
Ubuntu 22.04 Jammy rejects 1024 bit RSA Keys
PR-URL: https://github.com/nodejs/node/pull/44498
Refs: https://github.com/nodejs/node/issues/44497
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Michael Dawson <midawson@redhat.com >
2022-10-05 11:52:57 +01:00
Archana Kamath
0fb669e31f
test: update test-debugger-breakpoint-exists.js to use async/await
...
PR-URL: https://github.com/nodejs/node/pull/44682
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2022-10-05 11:52:57 +01:00
poorvitusam
cca253503e
test: use async/await in test-debugger-preserve-breaks
...
PR-URL: https://github.com/nodejs/node/pull/44696
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2022-10-05 11:52:56 +01:00
surbhirjain
0b2e8b1681
test: use async/await in test-debugger-profile
...
PR-URL: https://github.com/nodejs/node/pull/44684
Reviewed-By: Rich Trott <rtrott@gmail.com >
2022-10-05 11:52:56 +01:00
Ankita Khiratkar
4db72a65cf
test: change the promises to async/await in test-debugger-exec-scope.js
...
PR-URL: https://github.com/nodejs/node/pull/44685
Reviewed-By: Rich Trott <rtrott@gmail.com >
2022-10-05 11:52:56 +01:00
andiemontoyeah
3ad0fae89d
tools: update eslint-check.js to object style
...
Updated rule from deprecated function-style
format to object-style format.
Refs: https://eslint.org/docs/latest/developer-guide/working-with-rules
PR-URL: https://github.com/nodejs/node/pull/44706
Reviewed-By: Rich Trott <rtrott@gmail.com >
2022-10-05 11:52:56 +01:00
Rich Trott
fd5c26b8db
path: change basename() argument from ext to suffix
...
Closes: https://github.com/nodejs/node/issues/44773
PR-URL: https://github.com/nodejs/node/pull/44774
Fixes: https://github.com/nodejs/node/issues/44773
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Darshan Sen <raisinten@gmail.com >
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
2022-10-05 11:52:56 +01:00
Node.js GitHub Bot
e9d572a9bd
tools: update eslint to 8.24.0
...
PR-URL: https://github.com/nodejs/node/pull/44778
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Darshan Sen <raisinten@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2022-10-05 11:52:55 +01:00
Node.js GitHub Bot
984b0b4a6c
tools: update lint-md-dependencies to rollup@2.79.1
...
PR-URL: https://github.com/nodejs/node/pull/44776
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com >
2022-10-05 11:52:55 +01:00
Ben Noordhuis
c892f35815
deps: V8: fix debug build
...
This is a (very) partial cherry-pick of upstream change v8/v8@f8fddd6b13
that fixes the following debug mode build error with clang:
../deps/v8/src/codegen/register.h:29:48: error: member reference
base type 'RegListBase' is not a structure or union
int num_different_regs = RegListBase{regs...}.Count();
Fixes: https://github.com/nodejs/node/issues/44371
PR-URL: https://github.com/nodejs/node/pull/44392
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Jiawen Geng <technicalcute@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com >
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com >
2022-10-05 11:24:33 +01:00
Jordan Harband
576ccdf125
util: increase robustness with primordials
...
(backported from #41212 )
Backport-PR-URL: https://github.com/nodejs/node/pull/44797
PR-URL: https://github.com/nodejs/node/pull/41212
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2022-10-04 16:18:23 +01:00
Anna Henningsen
f99f5d3c01
src: add detailed embedder process initialization API
...
So far, process initialization has been a bit all over the place
in Node.js. `InitializeNodeWithArgs()` is our main public API
for this, but inclusion of items in it vs. `InitializeOncePerProcess()`
and `PlatformInit()` has been random at best. Likewise,
some pieces of initialization have been guarded by
`NODE_SHARED_MODE`, but also fairly randomly and without
any meaningful connection to shared library usage.
This leaves embedders in a position to cherry-pick some of
the initialization code into their own code to make their
application behave like typical Node.js applications to the
degree to which they desire it.
Electron takes an alternative route and makes direct use of
`InitializeOncePerProcess()` already while it is a private
API, with a `TODO` to add it to the public API in Node.js.
This commit addresses that `TODO`, and `TODO`s around the
`NODE_SHARED_MODE` usage. Specifically:
- `InitializeOncePerProcess()` and `TearDownOncePerProcess()`
are added to the public API.
- The `flags` option of these functions are merged with the
`flags` option for `InitializeNodeWithArgs()`, since they
essentially share the same semantics.
- The return value of the function is made an abstract class,
rather than a struct, for easier API/ABI stability.
- Initialization code from `main()` is brought into these
functions (since that makes sense in general).
- Add a `TODO` for turning `InitializeNodeWithArgs()` into
a small wrapper around `InitializeOncePerProcess()` and
eventually removing it (at least one major release cycle
each, presumably).
- Remove `NODE_SHARED_MODE` guards and replace them with
runtime options.
PR-URL: https://github.com/nodejs/node/pull/44121
Backport-PR-URL: https://github.com/nodejs/node/pull/44358
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Michael Dawson <midawson@redhat.com >
2022-10-04 11:39:51 +01:00