Skip to content

Commit 90d35ad

Browse files
cjihrigtargos
authored andcommitted
doc,lib,src,test: make --experimental-report a nop
This commit makes the --experimental-report CLI flag a no-op. PR-URL: #32242 Fixes: #26293 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: David Carlier <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
1 parent 6a0bc83 commit 90d35ad

17 files changed

+35
-134
lines changed

doc/api/cli.md

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -199,13 +199,6 @@ added: v10.0.0
199199

200200
Enable experimental top-level `await` keyword support in REPL.
201201

202-
### `--experimental-report`
203-
<!-- YAML
204-
added: v11.8.0
205-
-->
206-
207-
Enable experimental diagnostic report feature.
208-
209202
### `--experimental-specifier-resolution=mode`
210203
<!-- YAML
211204
added: v12.16.0
@@ -658,9 +651,9 @@ changes:
658651

659652
Enables the report to be triggered on fatal errors (internal errors within
660653
the Node.js runtime such as out of memory) that lead to termination of the
661-
application, if `--experimental-report` is enabled. Useful to inspect various
662-
diagnostic data elements such as heap, stack, event loop state, resource
663-
consumption etc. to reason about the fatal error.
654+
application. Useful to inspect various diagnostic data elements such as heap,
655+
stack, event loop state, resource consumption etc. to reason about the fatal
656+
error.
664657

665658
### `--report-on-signal`
666659
<!-- YAML
@@ -673,8 +666,8 @@ changes:
673666
-->
674667

675668
Enables report to be generated upon receiving the specified (or predefined)
676-
signal to the running Node.js process, if `--experimental-report` is enabled.
677-
The signal to trigger the report is specified through `--report-signal`.
669+
signal to the running Node.js process. The signal to trigger the report is
670+
specified through `--report-signal`.
678671

679672
### `--report-signal=signal`
680673
<!-- YAML
@@ -699,9 +692,9 @@ changes:
699692
`--report-uncaught-exception`
700693
-->
701694

702-
Enables report to be generated on un-caught exceptions, if
703-
`--experimental-report` is enabled. Useful when inspecting JavaScript stack in
704-
conjunction with native stack and other runtime environment data.
695+
Enables report to be generated on uncaught exceptions. Useful when inspecting
696+
the JavaScript stack in conjunction with native stack and other runtime
697+
environment data.
705698

706699
### `--throw-deprecation`
707700
<!-- YAML
@@ -1121,7 +1114,6 @@ Node.js options that are allowed are:
11211114
* `--experimental-modules`
11221115
* `--experimental-policy`
11231116
* `--experimental-repl-await`
1124-
* `--experimental-report`
11251117
* `--experimental-specifier-resolution`
11261118
* `--experimental-vm-modules`
11271119
* `--experimental-wasi-unstable-preview1`

doc/api/report.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ is provided below for reference.
3232
"cwd": "/home/nodeuser/project/node",
3333
"commandLine": [
3434
"/home/nodeuser/project/node/out/Release/node",
35-
"--experimental-report",
3635
"--report-uncaught-exception",
3736
"/home/nodeuser/project/node/test/report/test-exception.js",
3837
"child"
@@ -393,14 +392,10 @@ is provided below for reference.
393392
## Usage
394393

395394
```bash
396-
node --experimental-report --report-uncaught-exception \
397-
--report-on-signal --report-on-fatalerror app.js
395+
node --report-uncaught-exception --report-on-signal \
396+
--report-on-fatalerror app.js
398397
```
399398

400-
* `--experimental-report` Enables the diagnostic report feature.
401-
In the absence of this flag, use of all other related options will result in
402-
an error.
403-
404399
* `--report-uncaught-exception` Enables report to be generated on
405400
un-caught exceptions. Useful when inspecting JavaScript stack in conjunction
406401
with native stack and other runtime environment data.
@@ -570,7 +565,7 @@ Configuration on module initialization is also available via
570565
environment variables:
571566

572567
```bash
573-
NODE_OPTIONS="--experimental-report --report-uncaught-exception \
568+
NODE_OPTIONS="--report-uncaught-exception \
574569
--report-on-fatalerror --report-on-signal \
575570
--report-signal=SIGUSR2 --report-filename=./report.json \
576571
--report-directory=/home/nodeuser"

doc/node.1

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,6 @@ keyword support in REPL.
138138
.It Fl -experimental-specifier-resolution
139139
Select extension resolution algorithm for ES Modules; either 'explicit' (default) or 'node'
140140
.
141-
.It Fl -experimental-report
142-
Enable experimental
143-
.Sy diagnostic report
144-
feature.
145-
.
146141
.It Fl -experimental-vm-modules
147142
Enable experimental ES module support in VM module.
148143
.
@@ -308,16 +303,16 @@ will be written.
308303
.It Fl -report-on-fatalerror
309304
Enables the
310305
.Sy diagnostic report
311-
to be triggered on fatal errors (internal errors within the Node.js runtime such as out of memory) that leads to termination of the application, if
312-
.Sy --experimental-report
313-
is enabled. Useful to inspect various diagnostic data elements such as heap, stack, event loop state, resource consumption etc. to reason about the fatal error.
306+
to be triggered on fatal errors (internal errors within the Node.js runtime such
307+
as out of memory) that leads to termination of the application. Useful to
308+
inspect various diagnostic data elements such as heap, stack, event loop state,
309+
resource consumption etc. to reason about the fatal error.
314310
.
315311
.It Fl -report-on-signal
316312
Enables
317313
.Sy diagnostic report
318-
to be generated upon receiving the specified (or predefined) signal to the running Node.js process, if
319-
.Sy --experimental-report
320-
is enabled. Default signal is SIGUSR2.
314+
to be generated upon receiving the specified (or predefined) signal to the
315+
running Node.js process. Default signal is SIGUSR2.
321316
.
322317
.It Fl -report-signal
323318
Sets or resets the signal for
@@ -327,9 +322,8 @@ generation (not supported on Windows). Default signal is SIGUSR2.
327322
.It Fl -report-uncaught-exception
328323
Enables
329324
.Sy diagnostic report
330-
to be generated on un-caught exceptions, if
331-
.Sy --experimental-report
332-
is enabled. Useful when inspecting JavaScript stack in conjunction with native stack and other runtime environment data.
325+
to be generated on un-caught exceptions. Useful when inspecting JavaScript
326+
stack in conjunction with native stack and other runtime environment data.
333327
.
334328
.It Fl -throw-deprecation
335329
Throw errors for deprecations.

lib/internal/bootstrap/pre_execution.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -163,16 +163,11 @@ function setupStacktracePrinterOnSigint() {
163163
}
164164

165165
function initializeReport() {
166-
if (!getOptionValue('--experimental-report')) {
167-
return;
168-
}
169166
const { report } = require('internal/process/report');
170-
const { emitExperimentalWarning } = require('internal/util');
171167
ObjectDefineProperty(process, 'report', {
172168
enumerable: false,
173169
configurable: true,
174170
get() {
175-
emitExperimentalWarning('report');
176171
return report;
177172
}
178173
});
@@ -187,10 +182,6 @@ function setupDebugEnv() {
187182

188183
// This has to be called after initializeReport() is called
189184
function initializeReportSignalHandlers() {
190-
if (!getOptionValue('--experimental-report')) {
191-
return;
192-
}
193-
194185
const { addSignalHandler } = require('internal/process/report');
195186

196187
addSignalHandler();

src/node_options.cc

Lines changed: 1 addition & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -76,47 +76,6 @@ void PerProcessOptions::CheckOptions(std::vector<std::string>* errors) {
7676

7777
void PerIsolateOptions::CheckOptions(std::vector<std::string>* errors) {
7878
per_env->CheckOptions(errors);
79-
80-
if (per_env->experimental_report) {
81-
// Assign the report_signal default value here. Once the
82-
// --experimental-report flag is dropped, move this initialization to
83-
// node_options.h, where report_signal is declared.
84-
if (report_signal.empty())
85-
report_signal = "SIGUSR2";
86-
return;
87-
}
88-
89-
if (!report_directory.empty()) {
90-
errors->push_back("--report-directory option is valid only when "
91-
"--experimental-report is set");
92-
}
93-
94-
if (!report_filename.empty()) {
95-
errors->push_back("--report-filename option is valid only when "
96-
"--experimental-report is set");
97-
}
98-
99-
if (!report_signal.empty()) {
100-
errors->push_back("--report-signal option is valid only when "
101-
"--experimental-report is set");
102-
}
103-
104-
if (report_on_fatalerror) {
105-
errors->push_back(
106-
"--report-on-fatalerror option is valid only when "
107-
"--experimental-report is set");
108-
}
109-
110-
if (report_on_signal) {
111-
errors->push_back("--report-on-signal option is valid only when "
112-
"--experimental-report is set");
113-
}
114-
115-
if (report_uncaught_exception) {
116-
errors->push_back(
117-
"--report-uncaught-exception option is valid only when "
118-
"--experimental-report is set");
119-
}
12079
}
12180

12281
void EnvironmentOptions::CheckOptions(std::vector<std::string>* errors) {
@@ -395,10 +354,7 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
395354
&EnvironmentOptions::experimental_vm_modules,
396355
kAllowedInEnvironment);
397356
AddOption("--experimental-worker", "", NoOp{}, kAllowedInEnvironment);
398-
AddOption("--experimental-report",
399-
"enable report generation",
400-
&EnvironmentOptions::experimental_report,
401-
kAllowedInEnvironment);
357+
AddOption("--experimental-report", "", NoOp{}, kAllowedInEnvironment);
402358
AddOption("--experimental-wasi-unstable-preview1",
403359
"experimental WASI support",
404360
&EnvironmentOptions::experimental_wasi,

src/node_options.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ class EnvironmentOptions : public Options {
152152

153153
bool syntax_check_only = false;
154154
bool has_eval_string = false;
155-
bool experimental_report = false;
156155
bool experimental_wasi = false;
157156
std::string eval_string;
158157
bool print_eval = false;
@@ -189,7 +188,7 @@ class PerIsolateOptions : public Options {
189188
bool report_uncaught_exception = false;
190189
bool report_on_signal = false;
191190
bool report_on_fatalerror = false;
192-
std::string report_signal;
191+
std::string report_signal = "SIGUSR2";
193192
std::string report_filename;
194193
std::string report_directory;
195194
inline EnvironmentOptions* get_per_env_options();

test/addons/worker-addon/test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// Flags: --experimental-report
21
'use strict';
32
const common = require('../../common');
43
const assert = require('assert');

test/parallel/test-bootstrap-modules.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const expectedModules = new Set([
2222
'Internal Binding native_module',
2323
'Internal Binding options',
2424
'Internal Binding process_methods',
25+
'Internal Binding report',
2526
'Internal Binding string_decoder',
2627
'Internal Binding task_queue',
2728
'Internal Binding timers',
@@ -54,6 +55,7 @@ const expectedModules = new Set([
5455
'NativeModule internal/process/execution',
5556
'NativeModule internal/process/per_thread',
5657
'NativeModule internal/process/promises',
58+
'NativeModule internal/process/report',
5759
'NativeModule internal/process/signal',
5860
'NativeModule internal/process/task_queues',
5961
'NativeModule internal/process/warning',

test/parallel/test-process-env-allowed-flags-are-documented.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ const undocumented = difference(process.allowedNodeEnvironmentFlags,
8484
// Remove intentionally undocumented options.
8585
assert(undocumented.delete('--debug-arraybuffer-allocations'));
8686
assert(undocumented.delete('--es-module-specifier-resolution'));
87+
assert(undocumented.delete('--experimental-report'));
8788
assert(undocumented.delete('--experimental-worker'));
8889
assert(undocumented.delete('--no-node-snapshot'));
8990
assert(undocumented.delete('--loader'));

test/report/test-report-config.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
// Flags: --experimental-report --report-on-fatalerror --report-on-signal --report-uncaught-exception
1+
// Flags: --report-on-fatalerror --report-on-signal --report-uncaught-exception
22
'use strict';
33
const common = require('../common');
44
const assert = require('assert');
55

6-
common.expectWarning('ExperimentalWarning',
7-
'report is an experimental feature. This feature could ' +
8-
'change at any time');
9-
106
// Verify that process.report.directory behaves properly.
117
assert.strictEqual(process.report.directory, '');
128
process.report.directory = __dirname;

0 commit comments

Comments
 (0)