Files
electron/patches/node/cli_move_--trace-atomics-wait_to_eol.patch
electron-roller[bot] d920c82fc4 chore: bump chromium to 143.0.7451.0 (main) (#48362)
* chore: bump chromium in DEPS to 142.0.7429.0

* chore: bump chromium in DEPS to 142.0.7430.0

* 6954508: Reland Migrate WrappableWithNamedPropertyInterceptor to gin::Wrappable | https://chromium-review.googlesource.com/c/chromium/src/+/6954508

* https://chromium-review.googlesource.com/c/chromium/src/+/6955633

* 5584820: Fix font face resolution when renderer is blocked | https://chromium-review.googlesource.com/c/chromium/src/+/5584820

* chore: export patches

* chore: remove patch that keeley says is ok to remove in comments

* chore: bump chromium in DEPS to 142.0.7432.0

* chore: export patches

* chore: bump chromium in DEPS to 142.0.7434.0

* 6973697: Use type tags for data stored in V8 internal fields | https://chromium-review.googlesource.com/c/chromium/src/+/6973697

* 6976272: Revert Reland mac: click through content area in main window | https://chromium-review.googlesource.com/c/chromium/src/+/6976272

* chore: export patches

* 6938086: Rename native_widget_types.h -> native_ui_types.h | https://chromium-review.googlesource.com/c/chromium/src/+/6938086

* 6951252: Correct PersistentCache backed code cache context grouping

* chore: bump chromium in DEPS to 142.0.7436.0

* 6981628: Reland Use unordered_map in AcceleratorMap | https://chromium-review.googlesource.com/c/chromium/src/+/6981628

* chore: export patches

* chore: resolve patch conflict with main

* chore: merge conflict with main

* chore: bump chromium in DEPS to 142.0.7438.0

* chore: bump chromium in DEPS to 142.0.7440.0

* chore: bump chromium in DEPS to 142.0.7442.0

* chore: bump chromium in DEPS to 142.0.7444.0

* chore: bump chromium in DEPS to 143.0.7445.0

* chore: bump chromium in DEPS to 143.0.7447.0

* chore: bump chromium in DEPS to 143.0.7449.0

* chore: bump chromium in DEPS to 143.0.7451.0

* 7001364: Migrate GURL accessors to Get* variants in //content | https://chromium-review.googlesource.com/c/chromium/src/+/7001364

* 6986521: Implicit second value 'any' instead of 'span-all' for fallback query | https://chromium-review.googlesource.com/c/chromium/src/+/6986521

* chore: update chromium patches

* chore: update chromium patches

* chore: update patches

* fix: parse macOS SDK version across line break
https://chromium-review.googlesource.com/c/chromium/src/+/6980166

* fix: replace v8::Object::SetPrototype() usage
https://chromium-review.googlesource.com/c/v8/v8/+/6983465
https://github.com/nodejs/node/pull/55453

* fix: regenerate filenames.libcxx.gni
https://chromium-review.googlesource.com/c/chromium/src/+/6980307

* fix: replace additional usages of SetPrototype
https://chromium-review.googlesource.com/c/v8/v8/+/6983465

* build: use macos 15 minimum
https://chromium-review.googlesource.com/c/chromium/src/+/6980166

* ci: ignore missing dir for strip_universal_deep

* fix: js2c compilation failure

https://chromium-review.googlesource.com/c/chromium/src/+/6950738

See patch description explaining MacOS 26 SDK headers incompatibility.

* fixup! chore: export patches

* feat: add new memory-eviction exit reason
https://chromium-review.googlesource.com/c/chromium/src/+/6991933

* fix: set JSON reader parsing options
https://chromium-review.googlesource.com/c/chromium/src/+/6992114

* fix: provide DeviceEmulationCacheBehavior param
https://chromium-review.googlesource.com/c/chromium/src/+/6965238

* fix: views::NonClientFrameView -> views::FrameView
https://chromium-review.googlesource.com/c/chromium/src/+/7005027
https://chromium-review.googlesource.com/c/chromium/src/+/6966937

* fix: check new forced colors enum value
https://chromium-review.googlesource.com/c/chromium/src/+/6944403

* fix: migrate NetworkConditions -> MatchedNetworkConditions
https://chromium-review.googlesource.com/c/chromium/src/+/6827307

* fix: migrate GURL string methods to Get*()
https://chromium-review.googlesource.com/c/chromium/src/+/7007010

* fix: disable C++ modules in electron_lib builds
https://chromium-review.googlesource.com/c/chromium/src/+/6950738

* fix: partially revert is_headless_mode removal
https://chromium-review.googlesource.com/c/chromium/src/+/6955633

This patch should likely be reworked. For now, this partially reverts the
removal of a required class property to restore behavior.

* Revert "build: use macos 15 minimum"

This reverts commit 2fc12d6acc.

Initially this change was made to test if it fixes libcxx
compilation issues. As that's now resolved by disabling libcxx
modules, this can be reverted.

* fix: disable C++ modules in libnode builds

* fixup! fix: replace v8::Object::SetPrototype() usage https://chromium-review.googlesource.com/c/v8/v8/+/6983465 https://github.com/nodejs/node/pull/55453

* fixup! fix: replace v8::Object::SetPrototype() usage https://chromium-review.googlesource.com/c/v8/v8/+/6983465 https://github.com/nodejs/node/pull/55453

* build: switch to macos-15 runner

build/mac/find_sdk.py now requires macOS 15 SDK as a minimum version. The
macos 15 runners default to an Xcode using the 15 SDK and removes older
versions.

* fixup! fix: check new forced colors enum value https://chromium-review.googlesource.com/c/chromium/src/+/6944403

* fixup! fix: migrate GURL string methods to Get*() https://chromium-review.googlesource.com/c/chromium/src/+/7007010

* fix: use std::u16string for Extension::Create() error parameter
https://chromium-review.googlesource.com/c/chromium/src/+/6975452

* fix: add missing image_skia include
https://chromium-review.googlesource.com/c/chromium/src/+/6986762

* fixup! fix: add missing image_skia include https://chromium-review.googlesource.com/c/chromium/src/+/6986762

* fix: remove outdated V8 flag
https://chromium-review.googlesource.com/c/v8/v8/+/6948286

* fix: disable protocol handler DCHECK

https://chromium-review.googlesource.com/c/chromium/src/+/6727594

Ignore the extension custom protocol handler registry DCHECK until
we invest in supporting it. Replacing this DCHECK seems harmless
and will unblock the roll.

* fix: replace deprecated usage of SetPrototype
https://chromium-review.googlesource.com/c/v8/v8/+/6983465

* fixup! fix: migrate NetworkConditions -> MatchedNetworkConditions https://chromium-review.googlesource.com/c/chromium/src/+/6827307

* fixup! fix: migrate GURL string methods to Get*() https://chromium-review.googlesource.com/c/chromium/src/+/7007010

* chore: remove patch already included in roll

* chore: remove extraneous formatting added to patch

* chore: remove fix_harden_blink_scriptstate_maybefrom.patch
https://chromium-review.googlesource.com/c/chromium/src/+/6973697

No longer needed since the above CL landed.

* 6973697: Use type tags for data stored in V8 internal fields

https://chromium-review.googlesource.com/c/chromium/src/+/6973697

* chore: update patches

* fixup! chore: export patches

* chore: restore electron embedder data tag patch

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Alice Zhao <alicelovescake@anthropic.com>
Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
Co-authored-by: Samuel Maddock <smaddock@slack-corp.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2025-10-13 12:21:54 -04:00

306 lines
12 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Marco Ippolito <marcoippolito54@gmail.com>
Date: Wed, 1 May 2024 14:24:48 +0200
Subject: cli: move --trace-atomics-wait to eol
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
PR-URL: https://github.com/nodejs/node/pull/52747
Fixes: https://github.com/nodejs/node/issues/42982
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
diff --git a/doc/api/cli.md b/doc/api/cli.md
index 9a0e83b95a72486ab9751b3b8818f4beeb527041..1da7126b9d51238e9b89ee6bed602df3f5598a9e 100644
--- a/doc/api/cli.md
+++ b/doc/api/cli.md
@@ -2727,39 +2727,6 @@ added: v12.0.0
Set default [`tls.DEFAULT_MIN_VERSION`][] to 'TLSv1.3'. Use to disable support
for TLSv1.2, which is not as secure as TLSv1.3.
-### `--trace-atomics-wait`
-
-<!-- YAML
-added: v14.3.0
-deprecated:
- - v18.8.0
- - v16.18.0
--->
-
-> Stability: 0 - Deprecated
-
-Print short summaries of calls to [`Atomics.wait()`][] to stderr.
-The output could look like this:
-
-```text
-(node:15701) [Thread 0] Atomics.wait(&lt;address> + 0, 1, inf) started
-(node:15701) [Thread 0] Atomics.wait(&lt;address> + 0, 1, inf) did not wait because the values mismatched
-(node:15701) [Thread 0] Atomics.wait(&lt;address> + 0, 0, 10) started
-(node:15701) [Thread 0] Atomics.wait(&lt;address> + 0, 0, 10) timed out
-(node:15701) [Thread 0] Atomics.wait(&lt;address> + 4, 0, inf) started
-(node:15701) [Thread 1] Atomics.wait(&lt;address> + 4, -1, inf) started
-(node:15701) [Thread 0] Atomics.wait(&lt;address> + 4, 0, inf) was woken up by another thread
-(node:15701) [Thread 1] Atomics.wait(&lt;address> + 4, -1, inf) was woken up by another thread
-```
-
-The fields here correspond to:
-
-* The thread id as given by [`worker_threads.threadId`][]
-* The base address of the `SharedArrayBuffer` in question, as well as the
- byte offset corresponding to the index passed to `Atomics.wait()`
-* The expected value that was passed to `Atomics.wait()`
-* The timeout passed to `Atomics.wait`
-
### `--trace-deprecation`
<!-- YAML
@@ -3445,7 +3412,6 @@ one is included in the list below.
* `--tls-min-v1.1`
* `--tls-min-v1.2`
* `--tls-min-v1.3`
-* `--trace-atomics-wait`
* `--trace-deprecation`
* `--trace-env-js-stack`
* `--trace-env-native-stack`
diff --git a/doc/node.1 b/doc/node.1
index e3b2c45af01b2e9b9522964da2572988edd2b9e9..64e975546285a1042dda6fdb54fdd502f338a929 100644
--- a/doc/node.1
+++ b/doc/node.1
@@ -542,11 +542,6 @@ but the option is supported for compatibility with older Node.js versions.
Set default minVersion to 'TLSv1.3'. Use to disable support for TLSv1.2 in
favour of TLSv1.3, which is more secure.
.
-.It Fl -trace-atomics-wait
-Print short summaries of calls to
-.Sy Atomics.wait() .
-.
-This flag is deprecated.
.It Fl -trace-deprecation
Print stack traces for deprecations.
.
diff --git a/src/node.cc b/src/node.cc
index 0725cc97510375bc616534ddf3de4b231bae6bf5..f21687ad9dfd69c829aaaf8f3ed66b6bf6713765 100644
--- a/src/node.cc
+++ b/src/node.cc
@@ -232,44 +232,6 @@ void Environment::WaitForInspectorFrontendByOptions() {
}
#endif // HAVE_INSPECTOR
-#define ATOMIC_WAIT_EVENTS(V) \
- V(kStartWait, "started") \
- V(kWokenUp, "was woken up by another thread") \
- V(kTimedOut, "timed out") \
- V(kTerminatedExecution, "was stopped by terminated execution") \
- V(kAPIStopped, "was stopped through the embedder API") \
- V(kNotEqual, "did not wait because the values mismatched") \
-
-static void AtomicsWaitCallback(Isolate::AtomicsWaitEvent event,
- Local<v8::SharedArrayBuffer> array_buffer,
- size_t offset_in_bytes, int64_t value,
- double timeout_in_ms,
- Isolate::AtomicsWaitWakeHandle* stop_handle,
- void* data) {
- Environment* env = static_cast<Environment*>(data);
-
- const char* message = "(unknown event)";
- switch (event) {
-#define V(key, msg) \
- case Isolate::AtomicsWaitEvent::key: \
- message = msg; \
- break;
- ATOMIC_WAIT_EVENTS(V)
-#undef V
- }
-
- fprintf(stderr,
- "(node:%d) [Thread %" PRIu64 "] Atomics.wait(%p + %zx, %" PRId64
- ", %.f) %s\n",
- static_cast<int>(uv_os_getpid()),
- env->thread_id(),
- array_buffer->Data(),
- offset_in_bytes,
- value,
- timeout_in_ms,
- message);
-}
-
void Environment::InitializeDiagnostics() {
isolate_->GetHeapProfiler()->AddBuildEmbedderGraphCallback(
Environment::BuildEmbedderGraph, this);
@@ -278,17 +240,6 @@ void Environment::InitializeDiagnostics() {
}
if (options_->trace_uncaught)
isolate_->SetCaptureStackTraceForUncaughtExceptions(true);
- if (options_->trace_atomics_wait) {
- ProcessEmitDeprecationWarning(
- Environment::GetCurrent(isolate_),
- "The flag --trace-atomics-wait is deprecated.",
- "DEP0165");
- isolate_->SetAtomicsWaitCallback(AtomicsWaitCallback, this);
- AddCleanupHook([](void* data) {
- Environment* env = static_cast<Environment*>(data);
- env->isolate()->SetAtomicsWaitCallback(nullptr, nullptr);
- }, this);
- }
if (options_->trace_promises) {
isolate_->SetPromiseHook(TracePromises);
}
diff --git a/src/node_options.cc b/src/node_options.cc
index e8424d7539db191a55edebb7d33a3c1dc37e2403..556776b79282d953fdc371d1901f21ca301bec1a 100644
--- a/src/node_options.cc
+++ b/src/node_options.cc
@@ -773,10 +773,6 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
"throw an exception on deprecations",
&EnvironmentOptions::throw_deprecation,
kAllowedInEnvvar);
- AddOption("--trace-atomics-wait",
- "(deprecated) trace Atomics.wait() operations",
- &EnvironmentOptions::trace_atomics_wait,
- kAllowedInEnvvar);
AddOption("--trace-deprecation",
"show stack traces on deprecations",
&EnvironmentOptions::trace_deprecation,
diff --git a/src/node_options.h b/src/node_options.h
index 418dee360f867c363f1576012b32213a51c4fdd0..7078d2493ed696bc5bd92df9c629b714c1a8fbfb 100644
--- a/src/node_options.h
+++ b/src/node_options.h
@@ -205,7 +205,6 @@ class EnvironmentOptions : public Options {
std::vector<std::string> coverage_include_pattern;
std::vector<std::string> coverage_exclude_pattern;
bool throw_deprecation = false;
- bool trace_atomics_wait = false;
bool trace_deprecation = false;
bool trace_exit = false;
bool trace_sync_io = false;
diff --git a/test/parallel/test-trace-atomic-deprecation.js b/test/parallel/test-trace-atomic-deprecation.js
deleted file mode 100644
index 8aeddb28e938d23e646d882cfe24b2e2311f9ab2..0000000000000000000000000000000000000000
--- a/test/parallel/test-trace-atomic-deprecation.js
+++ /dev/null
@@ -1,14 +0,0 @@
-'use strict';
-
-const common = require('../common');
-const assert = require('node:assert');
-const { test } = require('node:test');
-
-test('should emit deprecation warning DEP0165', async () => {
- const { code, stdout, stderr } = await common.spawnPromisified(
- process.execPath, ['--trace-atomics-wait', '-e', '{}']
- );
- assert.match(stderr, /\[DEP0165\] DeprecationWarning:/);
- assert.strictEqual(stdout, '');
- assert.strictEqual(code, 0);
-});
diff --git a/test/parallel/test-trace-atomics-wait.js b/test/parallel/test-trace-atomics-wait.js
deleted file mode 100644
index 6449a2be2b47e0758090dc13d136877b1874c635..0000000000000000000000000000000000000000
--- a/test/parallel/test-trace-atomics-wait.js
+++ /dev/null
@@ -1,101 +0,0 @@
-'use strict';
-require('../common');
-const assert = require('assert');
-const child_process = require('child_process');
-const { Worker } = require('worker_threads');
-
-if (process.argv[2] === 'child') {
- const i32arr = new Int32Array(new SharedArrayBuffer(8));
- assert.strictEqual(Atomics.wait(i32arr, 0, 1), 'not-equal');
- assert.strictEqual(Atomics.wait(i32arr, 0, 0, 10), 'timed-out');
-
- new Worker(`
- const i32arr = require('worker_threads').workerData;
- Atomics.store(i32arr, 1, -1);
- Atomics.notify(i32arr, 1);
- Atomics.wait(i32arr, 1, -1);
- `, { eval: true, workerData: i32arr });
-
- Atomics.wait(i32arr, 1, 0);
- assert.strictEqual(Atomics.load(i32arr, 1), -1);
- Atomics.store(i32arr, 1, 0);
- Atomics.notify(i32arr, 1);
- return;
-}
-
-const proc = child_process.spawnSync(
- process.execPath,
- [ '--disable-warning=DEP0165', '--trace-atomics-wait', __filename, 'child' ],
- { encoding: 'utf8', stdio: [ 'inherit', 'inherit', 'pipe' ] });
-
-if (proc.status !== 0) console.log(proc);
-assert.strictEqual(proc.status, 0);
-
-const SABAddress = proc.stderr.match(/Atomics\.wait\((?<SAB>.+) \+/).groups.SAB;
-const actualTimeline = proc.stderr
- .replace(new RegExp(SABAddress, 'g'), '<address>')
- .replace(new RegExp(`\\(node:${proc.pid}\\) `, 'g'), '')
- .replace(/\binf(inity)?\b/gi, 'inf')
- .replace(/\r/g, '')
- .trim();
-console.log('+++ normalized stdout +++');
-console.log(actualTimeline);
-console.log('--- normalized stdout ---');
-
-const begin =
-`[Thread 0] Atomics.wait(<address> + 0, 1, inf) started
-[Thread 0] Atomics.wait(<address> + 0, 1, inf) did not wait because the \
-values mismatched
-[Thread 0] Atomics.wait(<address> + 0, 0, 10) started
-[Thread 0] Atomics.wait(<address> + 0, 0, 10) timed out`;
-
-const expectedTimelines = [
- `${begin}
-[Thread 0] Atomics.wait(<address> + 4, 0, inf) started
-[Thread 1] Atomics.wait(<address> + 4, -1, inf) started
-[Thread 0] Atomics.wait(<address> + 4, 0, inf) was woken up by another thread
-[Thread 1] Atomics.wait(<address> + 4, -1, inf) was woken up by another thread`,
- `${begin}
-[Thread 1] Atomics.wait(<address> + 4, 0, inf) started
-[Thread 0] Atomics.wait(<address> + 4, -1, inf) started
-[Thread 0] Atomics.wait(<address> + 4, 0, inf) was woken up by another thread
-[Thread 1] Atomics.wait(<address> + 4, -1, inf) was woken up by another thread`,
- `${begin}
-[Thread 0] Atomics.wait(<address> + 4, 0, inf) started
-[Thread 0] Atomics.wait(<address> + 4, 0, inf) was woken up by another thread
-[Thread 1] Atomics.wait(<address> + 4, -1, inf) started
-[Thread 1] Atomics.wait(<address> + 4, -1, inf) was woken up by another thread`,
- `${begin}
-[Thread 0] Atomics.wait(<address> + 4, 0, inf) started
-[Thread 0] Atomics.wait(<address> + 4, 0, inf) was woken up by another thread
-[Thread 1] Atomics.wait(<address> + 4, -1, inf) started
-[Thread 1] Atomics.wait(<address> + 4, -1, inf) did not wait because the \
-values mismatched`,
- `${begin}
-[Thread 0] Atomics.wait(<address> + 4, 0, inf) started
-[Thread 1] Atomics.wait(<address> + 4, -1, inf) started
-[Thread 0] Atomics.wait(<address> + 4, 0, inf) was woken up by another thread
-[Thread 1] Atomics.wait(<address> + 4, -1, inf) did not wait because the \
-values mismatched`,
- `${begin}
-[Thread 1] Atomics.wait(<address> + 4, 0, inf) started
-[Thread 0] Atomics.wait(<address> + 4, -1, inf) started
-[Thread 0] Atomics.wait(<address> + 4, 0, inf) was woken up by another thread
-[Thread 1] Atomics.wait(<address> + 4, -1, inf) did not wait because the \
-values mismatched`,
- `${begin}
-[Thread 0] Atomics.wait(<address> + 4, 0, inf) started
-[Thread 0] Atomics.wait(<address> + 4, 0, inf) did not wait because the \
-values mismatched
-[Thread 1] Atomics.wait(<address> + 4, -1, inf) started
-[Thread 1] Atomics.wait(<address> + 4, -1, inf) did not wait because the \
-values mismatched`,
- `${begin}
-[Thread 1] Atomics.wait(<address> + 4, -1, inf) started
-[Thread 0] Atomics.wait(<address> + 4, 0, inf) started
-[Thread 0] Atomics.wait(<address> + 4, 0, inf) did not wait because the \
-values mismatched
-[Thread 1] Atomics.wait(<address> + 4, -1, inf) was woken up by another thread`,
-];
-
-assert(expectedTimelines.includes(actualTimeline));