Skip to content

Commit 9d1a3b6

Browse files
committed
doc,lib,src,test: make --experimental-report a nop
This commit makes the --experimental-report CLI flag a no-op. PR-URL: nodejs#32242 Fixes: nodejs#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 4c64e7c commit 9d1a3b6

17 files changed

+35
-134
lines changed

doc/api/cli.md

+8-16
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: v13.4.0
@@ -635,9 +628,9 @@ changes:
635628

636629
Enables the report to be triggered on fatal errors (internal errors within
637630
the Node.js runtime such as out of memory) that lead to termination of the
638-
application, if `--experimental-report` is enabled. Useful to inspect various
639-
diagnostic data elements such as heap, stack, event loop state, resource
640-
consumption etc. to reason about the fatal error.
631+
application. Useful to inspect various diagnostic data elements such as heap,
632+
stack, event loop state, resource consumption etc. to reason about the fatal
633+
error.
641634

642635
### `--report-on-signal`
643636
<!-- YAML
@@ -650,8 +643,8 @@ changes:
650643
-->
651644

652645
Enables report to be generated upon receiving the specified (or predefined)
653-
signal to the running Node.js process, if `--experimental-report` is enabled.
654-
The signal to trigger the report is specified through `--report-signal`.
646+
signal to the running Node.js process. The signal to trigger the report is
647+
specified through `--report-signal`.
655648

656649
### `--report-signal=signal`
657650
<!-- YAML
@@ -676,9 +669,9 @@ changes:
676669
`--report-uncaught-exception`
677670
-->
678671

679-
Enables report to be generated on un-caught exceptions, if
680-
`--experimental-report` is enabled. Useful when inspecting JavaScript stack in
681-
conjunction with native stack and other runtime environment data.
672+
Enables report to be generated on uncaught exceptions. Useful when inspecting
673+
the JavaScript stack in conjunction with native stack and other runtime
674+
environment data.
682675

683676
### `--throw-deprecation`
684677
<!-- YAML
@@ -1098,7 +1091,6 @@ Node.js options that are allowed are:
10981091
* `--experimental-modules`
10991092
* `--experimental-policy`
11001093
* `--experimental-repl-await`
1101-
* `--experimental-report`
11021094
* `--experimental-specifier-resolution`
11031095
* `--experimental-vm-modules`
11041096
* `--experimental-wasi-unstable-preview1`

doc/api/report.md

+3-8
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"
@@ -392,14 +391,10 @@ is provided below for reference.
392391
## Usage
393392

394393
```bash
395-
node --experimental-report --report-uncaught-exception \
396-
--report-on-signal --report-on-fatalerror app.js
394+
node --report-uncaught-exception --report-on-signal \
395+
--report-on-fatalerror app.js
397396
```
398397

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

571566
```bash
572-
NODE_OPTIONS="--experimental-report --report-uncaught-exception \
567+
NODE_OPTIONS="--report-uncaught-exception \
573568
--report-on-fatalerror --report-on-signal \
574569
--report-signal=SIGUSR2 --report-filename=./report.json \
575570
--report-directory=/home/nodeuser"

doc/node.1

+8-14
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
.
@@ -299,16 +294,16 @@ will be written.
299294
.It Fl -report-on-fatalerror
300295
Enables the
301296
.Sy diagnostic report
302-
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
303-
.Sy --experimental-report
304-
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.
297+
to be triggered on fatal errors (internal errors within the Node.js runtime such
298+
as out of memory) that leads to termination of the application. Useful to
299+
inspect various diagnostic data elements such as heap, stack, event loop state,
300+
resource consumption etc. to reason about the fatal error.
305301
.
306302
.It Fl -report-on-signal
307303
Enables
308304
.Sy diagnostic report
309-
to be generated upon receiving the specified (or predefined) signal to the running Node.js process, if
310-
.Sy --experimental-report
311-
is enabled. Default signal is SIGUSR2.
305+
to be generated upon receiving the specified (or predefined) signal to the
306+
running Node.js process. Default signal is SIGUSR2.
312307
.
313308
.It Fl -report-signal
314309
Sets or resets the signal for
@@ -318,9 +313,8 @@ generation (not supported on Windows). Default signal is SIGUSR2.
318313
.It Fl -report-uncaught-exception
319314
Enables
320315
.Sy diagnostic report
321-
to be generated on un-caught exceptions, if
322-
.Sy --experimental-report
323-
is enabled. Useful when inspecting JavaScript stack in conjunction with native stack and other runtime environment data.
316+
to be generated on un-caught exceptions. Useful when inspecting JavaScript
317+
stack in conjunction with native stack and other runtime environment data.
324318
.
325319
.It Fl -throw-deprecation
326320
Throw errors for deprecations.

lib/internal/bootstrap/pre_execution.js

-9
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

+1-45
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) {
@@ -360,10 +319,7 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
360319
&EnvironmentOptions::experimental_vm_modules,
361320
kAllowedInEnvironment);
362321
AddOption("--experimental-worker", "", NoOp{}, kAllowedInEnvironment);
363-
AddOption("--experimental-report",
364-
"enable report generation",
365-
&EnvironmentOptions::experimental_report,
366-
kAllowedInEnvironment);
322+
AddOption("--experimental-report", "", NoOp{}, kAllowedInEnvironment);
367323
AddOption("--experimental-wasi-unstable-preview1",
368324
"experimental WASI support",
369325
&EnvironmentOptions::experimental_wasi,

src/node_options.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ class EnvironmentOptions : public Options {
151151

152152
bool syntax_check_only = false;
153153
bool has_eval_string = false;
154-
bool experimental_report = false;
155154
bool experimental_wasi = false;
156155
std::string eval_string;
157156
bool print_eval = false;
@@ -188,7 +187,7 @@ class PerIsolateOptions : public Options {
188187
bool report_uncaught_exception = false;
189188
bool report_on_signal = false;
190189
bool report_on_fatalerror = false;
191-
std::string report_signal;
190+
std::string report_signal = "SIGUSR2";
192191
std::string report_filename;
193192
std::string report_directory;
194193
inline EnvironmentOptions* get_per_env_options();

test/addons/worker-addon/test.js

-1
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

+2
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',
@@ -64,6 +65,7 @@ const expectedModules = new Set([
6465
'NativeModule internal/process/execution',
6566
'NativeModule internal/process/per_thread',
6667
'NativeModule internal/process/promises',
68+
'NativeModule internal/process/report',
6769
'NativeModule internal/process/signal',
6870
'NativeModule internal/process/task_queues',
6971
'NativeModule internal/process/warning',

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

+1
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

+1-5
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;

test/report/test-report-fatal-error.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ if (process.argv[2] === 'child') {
2121
const tmpdir = require('../common/tmpdir');
2222
tmpdir.refresh();
2323
const spawn = require('child_process').spawn;
24-
const args = ['--experimental-report',
25-
'--report-on-fatalerror',
24+
const args = ['--report-on-fatalerror',
2625
'--max-old-space-size=20',
2726
__filename,
2827
'child'];

test/report/test-report-getreport.js

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
1-
// Flags: --experimental-report
21
'use strict';
3-
const common = require('../common');
2+
require('../common');
43
const assert = require('assert');
54
const helper = require('../common/report');
65

7-
common.expectWarning('ExperimentalWarning',
8-
'report is an experimental feature. This feature could ' +
9-
'change at any time');
10-
116
{
127
// Test with no arguments.
138
helper.validateContent(process.report.getReport());

test/report/test-report-signal.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Flags: --experimental-report --report-on-signal
1+
// Flags: --report-on-signal
22
'use strict';
33
// Test producing a report via signal.
44
const common = require('../common');
@@ -13,9 +13,6 @@ const assert = require('assert');
1313
const helper = require('../common/report');
1414
const tmpdir = require('../common/tmpdir');
1515

16-
common.expectWarning('ExperimentalWarning',
17-
'report is an experimental feature. This feature could ' +
18-
'change at any time');
1916
tmpdir.refresh();
2017
process.report.directory = tmpdir.path;
2118

test/report/test-report-uncaught-exception.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Flags: --experimental-report --report-uncaught-exception
1+
// Flags: --report-uncaught-exception
22
'use strict';
33
// Test producing a report on uncaught exception.
44
const common = require('../common');
@@ -7,9 +7,6 @@ const helper = require('../common/report');
77
const tmpdir = require('../common/tmpdir');
88
const error = new Error('test error');
99

10-
common.expectWarning('ExperimentalWarning',
11-
'report is an experimental feature. This feature could ' +
12-
'change at any time');
1310
tmpdir.refresh();
1411
process.report.directory = tmpdir.path;
1512

test/report/test-report-uv-handles.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -77,24 +77,20 @@ if (process.argv[2] === 'child') {
7777
const tmpdir = require('../common/tmpdir');
7878
tmpdir.refresh();
7979
const options = { encoding: 'utf8', silent: true, cwd: tmpdir.path };
80-
const child = fork('--experimental-report', [__filename, 'child'], options);
80+
const child = fork(__filename, ['child'], options);
8181
let child_data;
8282
child.on('message', (data) => { child_data = data; });
8383
let stderr = '';
8484
child.stderr.on('data', (chunk) => { stderr += chunk; });
8585
let stdout = '';
86-
const std_msg = 'Found messages in stderr unexpectedly: ';
8786
const report_msg = 'Report files were written: unexpectedly';
8887
child.stdout.on('data', (chunk) => { stdout += chunk; });
8988
child.on('exit', common.mustCall((code, signal) => {
9089
assert.deepStrictEqual(code, 0, 'Process exited unexpectedly with code: ' +
9190
`${code}`);
9291
assert.deepStrictEqual(signal, null, 'Process should have exited cleanly,' +
9392
` but did not: ${signal}`);
94-
assert.ok(stderr.match(
95-
'(node:.*) ExperimentalWarning: report is an experimental' +
96-
' feature. This feature could change at any time'),
97-
std_msg);
93+
assert.strictEqual(stderr.trim(), '');
9894

9995
const reports = helper.findReports(child.pid, tmpdir.path);
10096
assert.deepStrictEqual(reports, [], report_msg, reports);

test/report/test-report-worker.js

-1
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');

0 commit comments

Comments
 (0)