-
Notifications
You must be signed in to change notification settings - Fork 15.1k
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
chore: bump node to v18.17.0 (main) #39154
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Split things into review blocks to reduce some clutter 😸
WHATWG test failure
Looks like
node feature contexts in renderer URL handling in the renderer process can successfully handle WHATWG URLs constructed by Blink
is failing, with an error i've seen before unfortunately:
"Uncaught TypeError: The "path" argument must be of type string or an instance of Buffer or URL. Received an instance of URL",
Usually this means that Node.js has changed the prototype so it doesn't recognize URLs properly - this is something we'd want to fix since they should both follow WHATWG standards. If i had to guess it's nodejs/node@f495cb6 - isURL
probably is returning a false negative in this block via fs.createReadStream
. From taking a quick look at nodejs/node#46904 - it looks like we either need to revert what did make it back or pull back more of the changes in that PR
The snapshot Node.js specs failing (parallel/test-snapshot-argv1
& parallel/test-snapshot-namespaced-builtin
) we can add to the disabled test roster since we don't support that type of snapshotting at the moment. It also looks like a few of the other failing specs are call stack exceeded errors also rooted in the URL changes 🤔
Yes, that's very close to what's happening! The path to the failure is And you're right about that upstream commit: The easiest answer -- if it works -- would be to also backport the |
Backporting upstream's new implementation as-is causes an infinite loop because it accesses some property getters which, in 18, also call 1135783 patches around the issue by using both isURL() versions: first it tries the |
The |
Quick update on the console test failures: it's coming from fontconfig being unable to find a writable cache dir. Since Electron isn't giving these same warnings, I tried incrementally adding some tracer statements into fontconfig and got these results:
Where my So apparently |
…and_custom_embedder_js.patch Xref: nodejs/node#46930 manually sync patch to minor upstream code shear
…ng_a_new.patch Xref: nodejs/node#48248 manually sync patch to minor upstream code shear
…der.patch Xref: nodejs/node#47824 chore: upstream func throwIfUnsupportedURLProtocol() has been removed, so no need to patch it
Xref: nodejs/node#47695 manually sync patch to minor upstream code shear
….patch Xref: nodejs/node#46979 (upstreamed patch) Xref: https://chromium-review.googlesource.com/c/v8/v8/+/2718147 (related)
Xref: nodejs/node#47274 manually sync patch to minor upstream code shear some tests moved from sequential to parallel
Xref: fix_libc_buffer_overflow_in_string_view_ctor.patch patch is no longer needed due to upstream bump to ada 2.2.0
…atch Xref: nodejs/node#47339 patch is no longer needed due to upstream bump to ada 2.2.0
several files removed/added/changed upstream
upstream dep histogram 0.11.7 moved its include path from src/ to include/ Xref: nodejs/node#47742
Xref: nodejs/node#47160 BoringSSL doesn't support BIO_s_secmem() (a secure heap variant of BIO_s_mem()), so use BIO_s_mem() instead. Related discussion of secure heap support in BoringSSL: https://boringssl-review.googlesource.com/c/boringssl/+/54309
Upstream used `BIO_s_secmem()`, a secure heap variant of `BIO_s_mem()`. BoringSSL doesn't support it, so this PR opts for `BIO_s_mem()` instead. Upstream Node.js change that prompted this: nodejs/node#47160 Related discussion of BoringSSL support of secure heap: https://boringssl-review.googlesource.com/c/boringssl/+/54309
test: add parallel/test-snapshot-namespaced-builtin to disabled list We don't support that type of snapshotting at the moment.
…rror fails upstream in v18.x on my box as well
fix: infinite loop regression
The line numbers in the stacktrace from our v8 build don't match what Node's tests are expecting, so update the stacktrace to match our build. The specific numbers probably aren't t needed for the force_colors test, which is trying to see whether or not the lines are greyed out. One option is to upstream a test change to stop hardcoding the stacktrace.
fix; pull in upstream bugfix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments but nothing blocking :)
patches/node/ci_ensure_node_tests_set_electron_run_as_node.patch
Outdated
Show resolved
Hide resolved
Date: Mon, 7 Aug 2023 13:12:29 -0500 | ||
Subject: ci: ensure node tests set ELECTRON_RUN_AS_NODE=1 | ||
|
||
Some node tests / test fixtures spawn other tests that clobber env, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't upstreamable in its current state, but i think it could be! I wouldn't necessarily block on it for this PR, but we can probably address this with something more like this:
Diff Suggestion
diff --git a/test/common/assertSnapshot.js b/test/common/assertSnapshot.js
index 83ee45f5f9..2bc7f0092c 100644
--- a/test/common/assertSnapshot.js
+++ b/test/common/assertSnapshot.js
@@ -62,7 +62,7 @@ async function spawnAndAssert(filename, transform = (x) => x, { tty = false, ...
const flags = common.parseTestFlags(filename);
const executable = tty ? 'tools/pseudo-tty.py' : process.execPath;
const args = tty ? [process.execPath, ...flags, filename] : [...flags, filename];
- if (options && options.env) options.env.ELECTRON_RUN_AS_NODE = 1;
+ if (options?.env) options.env = { ...process.env, ...options.env };
const { stdout, stderr } = await common.spawnPromisified(executable, args, options);
await assertSnapshot(transform(`${stdout}${stderr}`), filename);
}
diff --git a/test/fixtures/test-runner/output/arbitrary-output-colored.js b/test/fixtures/test-runner/output/arbitrary-output-colored.js
index dd8296e631..0dbaff42d0 100644
--- a/test/fixtures/test-runner/output/arbitrary-output-colored.js
+++ b/test/fixtures/test-runner/output/arbitrary-output-colored.js
@@ -6,6 +6,6 @@ const fixtures = require('../../../common/fixtures');
(async function run() {
const test = fixtures.path('test-runner/output/arbitrary-output-colored-1.js');
- await once(spawn(process.execPath, ['--test', test], { stdio: 'inherit', env: { ELECTRON_RUN_AS_NODE: 1, FORCE_COLOR: 1 } }), 'exit');
- await once(spawn(process.execPath, ['--test', '--test-reporter', 'tap', test], { stdio: 'inherit', env: { ELECTRON_RUN_AS_NODE: 1, FORCE_COLOR: 1 } }), 'exit');
+ await once(spawn(process.execPath, ['--test', test], { stdio: 'inherit', env: { ...process.env, FORCE_COLOR: 1 } }), 'exit');
+ await once(spawn(process.execPath, ['--test', '--test-reporter', 'tap', test], { stdio: 'inherit', env: { ...process.env, FORCE_COLOR: 1 } }), 'exit');
})().then(common.mustCall());
\ No newline at end of file
diff --git a/test/parallel/test-node-output-console.mjs b/test/parallel/test-node-output-console.mjs
index efca7811dc..5a1b9feb6c 100644
--- a/test/parallel/test-node-output-console.mjs
+++ b/test/parallel/test-node-output-console.mjs
@@ -31,7 +31,6 @@ describe('console output', { concurrency: true }, () => {
.transform(snapshot.replaceWindowsLineEndings, snapshot.replaceWindowsPaths, replaceStackTrace);
for (const { name, transform, env } of tests) {
it(name, async () => {
- if (env) env.ELECTRON_RUN_AS_NODE = 1;
await snapshot.spawnAndAssert(fixtures.path(name), transform ?? defaultTransform, { env });
});
}
diff --git a/test/parallel/test-node-output-errors.mjs b/test/parallel/test-node-output-errors.mjs
index b9a55fb7ea..fca2149fea 100644
--- a/test/parallel/test-node-output-errors.mjs
+++ b/test/parallel/test-node-output-errors.mjs
@@ -53,7 +53,6 @@ describe('errors output', { concurrency: true }, () => {
!skipForceColors ? { name: 'errors/force_colors.js', env: { FORCE_COLOR: 1 } } : null,
].filter(Boolean);
for (const { name, transform, env } of tests) {
- if (env) env.ELECTRON_RUN_AS_NODE = 1;
it(name, async () => {
await snapshot.spawnAndAssert(fixtures.path(name), transform ?? defaultTransform, { env });
});
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea of changing this into some upstreamable form, but unconditionally inheriting all of process.env seems problematic -- I can think of plenty of use cases for a test to intentionally clobber env.
What would you think of having some some mechanism of which vars to inherit, either with a metavariable or passing in some option into tools/test.py
?
-[90m at Function.executeUserEntryPoint [as runMain] (node:internal*modules*run_main:81:12)[39m | ||
+[90m at Module._compile (node:internal*modules*cjs*loader:1271:14)[39m | ||
+[90m at Object..js (node:internal*modules*cjs*loader:1326:10)[39m | ||
+[90m at Module.load (node:internal*modules*cjs*loader:1126:32)[39m |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also wouldn't block on it since we'd need to temporarily patch this regardless, but historically we've addressed this by making the snapshot regex matches more generic to account for both Electron and Node.js.
Here's an example of something previously upstreamed: nodejs/node#36489
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed it would be better to find a way to upstream this.
It's using the assertSnapshot
mechanism in test/common
which is looking for a verbatim snapshot. Looks like the way they handle stacktrace changes upstream is just to periodically set process.env.NODE_REGENERATE_SNAPSHOTS
and rebuild the snapshots.
As far as nodejs/node#36489 goes, TBH customizing this test would be easier if it was using that ${testname}.js
+ ${testname.out}
mechanism since that has wildcard support via testcfg.py, e.g. message/assert_throws_stack.out
shows how a stacktrace can be wildcarded. But even then, it looks like matching is done on a per-line basis? Since our stacktrace has a different number of lines than upsream, we'd still need another approach.
In order to upstream this I think we'd need to propose some way of doing multiline pattern matching
chore: do not inject ELECTRON_RUN_AS_NODE in test-assert-colors.js
Release Notes Persisted
|
* chore: bump node in DEPS to v18.17.0 * chore: update build_modify_js2c_py_to_allow_injection_of_original-fs_and_custom_embedder_js.patch Xref: nodejs/node#46930 manually sync patch to minor upstream code shear * chore: update build_ensure_native_module_compilation_fails_if_not_using_a_new.patch Xref: nodejs/node#48248 manually sync patch to minor upstream code shear * chore: update fix_expose_the_built-in_electron_module_via_the_esm_loader.patch Xref: nodejs/node#47824 chore: upstream func throwIfUnsupportedURLProtocol() has been removed, so no need to patch it * chore: update api_pass_oomdetails_to_oomerrorcallback.patch Xref: nodejs/node#47695 manually sync patch to minor upstream code shear * chore: remove fix_prevent_changing_functiontemplateinfo_after_publish.patch Xref: nodejs/node#46979 (upstreamed patch) Xref: https://chromium-review.googlesource.com/c/v8/v8/+/2718147 (related) * chore: update fix_adapt_debugger_tests_for_upstream_v8_changes.patch Xref: nodejs/node#47274 manually sync patch to minor upstream code shear some tests moved from sequential to parallel * chore: remove fix_libc_buffer_overflow_in_string_view_ctor.patch Xref: fix_libc_buffer_overflow_in_string_view_ctor.patch patch is no longer needed due to upstream bump to ada 2.2.0 * chore: remove fix_preventing_potential_oob_in_ada_no_scheme_parsing.patch Xref: nodejs/node#47339 patch is no longer needed due to upstream bump to ada 2.2.0 * chore: rebuild filenames.json several files removed/added/changed upstream * chore: update build_add_gn_build_files.patch upstream dep histogram 0.11.7 moved its include path from src/ to include/ Xref: nodejs/node#47742 * chore: update fix_crypto_tests_to_run_with_bssl.patch Xref: nodejs/node#47160 BoringSSL doesn't support BIO_s_secmem() (a secure heap variant of BIO_s_mem()), so use BIO_s_mem() instead. Related discussion of secure heap support in BoringSSL: https://boringssl-review.googlesource.com/c/boringssl/+/54309 * fix: ftbfs in node dep ada * fix: ftbfs in node dep uvwasi * chore: rebuild patches * chore: update fix_handle_boringssl_and_openssl_incompatibilities.patch Upstream used `BIO_s_secmem()`, a secure heap variant of `BIO_s_mem()`. BoringSSL doesn't support it, so this PR opts for `BIO_s_mem()` instead. Upstream Node.js change that prompted this: nodejs/node#47160 Related discussion of BoringSSL support of secure heap: https://boringssl-review.googlesource.com/c/boringssl/+/54309 * fix: work around Node 18 isURL() regression * chore: sort script/node-disabled-tests.json alphabetically * test: add parallel/test-snapshot-argv1 to disabled list test: add parallel/test-snapshot-namespaced-builtin to disabled list We don't support that type of snapshotting at the moment. * chore: disable flaky node test parallel/test-dgram-send-cb-quelches-error fails upstream in v18.x on my box as well * ci: ensure spawned node tests have ELECTRON_RUN_AS_NODE set * fixup! fix: work around Node 18 isURL() regression fix: infinite loop regression * fixup! fix: work around Node 18 isURL() regression * chore: patch fixtures/errors/force_colors.snapshot The line numbers in the stacktrace from our v8 build don't match what Node's tests are expecting, so update the stacktrace to match our build. The specific numbers probably aren't t needed for the force_colors test, which is trying to see whether or not the lines are greyed out. One option is to upstream a test change to stop hardcoding the stacktrace. * fixup! fix: work around Node 18 isURL() regression fix; pull in upstream bugfix * fixup! ci: ensure spawned node tests have ELECTRON_RUN_AS_NODE set chore: do not inject ELECTRON_RUN_AS_NODE in test-assert-colors.js * chore: disable flaky node test parallel/test-debugger-random-port-with-inspect-port --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Charles Kerr <charles@charleskerr.com>
* chore: bump node in DEPS to v18.17.0 * chore: update build_modify_js2c_py_to_allow_injection_of_original-fs_and_custom_embedder_js.patch Xref: nodejs/node#46930 manually sync patch to minor upstream code shear * chore: update build_ensure_native_module_compilation_fails_if_not_using_a_new.patch Xref: nodejs/node#48248 manually sync patch to minor upstream code shear * chore: update fix_expose_the_built-in_electron_module_via_the_esm_loader.patch Xref: nodejs/node#47824 chore: upstream func throwIfUnsupportedURLProtocol() has been removed, so no need to patch it * chore: update api_pass_oomdetails_to_oomerrorcallback.patch Xref: nodejs/node#47695 manually sync patch to minor upstream code shear * chore: remove fix_prevent_changing_functiontemplateinfo_after_publish.patch Xref: nodejs/node#46979 (upstreamed patch) Xref: https://chromium-review.googlesource.com/c/v8/v8/+/2718147 (related) * chore: update fix_adapt_debugger_tests_for_upstream_v8_changes.patch Xref: nodejs/node#47274 manually sync patch to minor upstream code shear some tests moved from sequential to parallel * chore: remove fix_libc_buffer_overflow_in_string_view_ctor.patch Xref: fix_libc_buffer_overflow_in_string_view_ctor.patch patch is no longer needed due to upstream bump to ada 2.2.0 * chore: remove fix_preventing_potential_oob_in_ada_no_scheme_parsing.patch Xref: nodejs/node#47339 patch is no longer needed due to upstream bump to ada 2.2.0 * chore: rebuild filenames.json several files removed/added/changed upstream * chore: update build_add_gn_build_files.patch upstream dep histogram 0.11.7 moved its include path from src/ to include/ Xref: nodejs/node#47742 * chore: update fix_crypto_tests_to_run_with_bssl.patch Xref: nodejs/node#47160 BoringSSL doesn't support BIO_s_secmem() (a secure heap variant of BIO_s_mem()), so use BIO_s_mem() instead. Related discussion of secure heap support in BoringSSL: https://boringssl-review.googlesource.com/c/boringssl/+/54309 * fix: ftbfs in node dep ada * fix: ftbfs in node dep uvwasi * chore: rebuild patches * chore: update fix_handle_boringssl_and_openssl_incompatibilities.patch Upstream used `BIO_s_secmem()`, a secure heap variant of `BIO_s_mem()`. BoringSSL doesn't support it, so this PR opts for `BIO_s_mem()` instead. Upstream Node.js change that prompted this: nodejs/node#47160 Related discussion of BoringSSL support of secure heap: https://boringssl-review.googlesource.com/c/boringssl/+/54309 * fix: work around Node 18 isURL() regression * chore: sort script/node-disabled-tests.json alphabetically * test: add parallel/test-snapshot-argv1 to disabled list test: add parallel/test-snapshot-namespaced-builtin to disabled list We don't support that type of snapshotting at the moment. * chore: disable flaky node test parallel/test-dgram-send-cb-quelches-error fails upstream in v18.x on my box as well * ci: ensure spawned node tests have ELECTRON_RUN_AS_NODE set * fixup! fix: work around Node 18 isURL() regression fix: infinite loop regression * fixup! fix: work around Node 18 isURL() regression * chore: patch fixtures/errors/force_colors.snapshot The line numbers in the stacktrace from our v8 build don't match what Node's tests are expecting, so update the stacktrace to match our build. The specific numbers probably aren't t needed for the force_colors test, which is trying to see whether or not the lines are greyed out. One option is to upstream a test change to stop hardcoding the stacktrace. * fixup! fix: work around Node 18 isURL() regression fix; pull in upstream bugfix * fixup! ci: ensure spawned node tests have ELECTRON_RUN_AS_NODE set chore: do not inject ELECTRON_RUN_AS_NODE in test-assert-colors.js * chore: disable flaky node test parallel/test-debugger-random-port-with-inspect-port --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Charles Kerr <charles@charleskerr.com>
Updating Node.js to v18.17.0.
See all changes in v18.16.1..v18.17.0
Notes: Updated Node.js to v18.17.0.