Skip to content

Commit 9ff36e4

Browse files
ShogunPandasxa
authored andcommitted
build: add --enable-all-experimentals build flag
Signed-off-by: Paolo Insogna <paolo@cowtech.it> PR-URL: #62755 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Signed-off-by: Stewart X Addison <sxa@ibm.com>
1 parent 2390e3a commit 9ff36e4

3 files changed

Lines changed: 24 additions & 9 deletions

File tree

common.gypi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
'python%': 'python',
1616

1717
'node_shared%': 'false',
18+
'node_enable_experimentals%': 'false',
1819
'force_dynamic_crt%': 0,
1920
'node_use_v8_platform%': 'true',
2021
'node_use_bundled_v8%': 'true',
@@ -440,6 +441,9 @@
440441
}],
441442
# The defines bellow must include all things from the external_v8_defines
442443
# list in v8/BUILD.gn.
444+
['node_enable_experimentals == "true"', {
445+
'defines': ['EXPERIMENTALS_DEFAULT_VALUE=true'],
446+
}],
443447
['v8_enable_v8_checks == 1', {
444448
'defines': ['V8_ENABLE_CHECKS'],
445449
}],

configure.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -731,6 +731,12 @@
731731
default=None,
732732
help='Enable the --trace-maps flag in V8 (use at your own risk)')
733733

734+
parser.add_argument('--enable-all-experimentals',
735+
action='store_true',
736+
dest='enable_all_experimentals',
737+
default=None,
738+
help='Enable all experimental features by default')
739+
734740
parser.add_argument('--experimental-enable-pointer-compression',
735741
action='store_true',
736742
dest='enable_pointer_compression',
@@ -1608,6 +1614,7 @@ def configure_node_cctest_sources(o):
16081614
def configure_node(o):
16091615
if options.dest_os == 'android':
16101616
o['variables']['OS'] = 'android'
1617+
o['variables']['node_enable_experimentals'] = b(options.enable_all_experimentals)
16111618
o['variables']['node_prefix'] = options.prefix
16121619
o['variables']['node_install_npm'] = b(not options.without_npm)
16131620
o['variables']['node_install_corepack'] = b(not options.without_corepack)

src/node_options.h

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ class DebugOptions : public Options {
112112
std::vector<std::string>* argv) override;
113113
};
114114

115+
#ifndef EXPERIMENTALS_DEFAULT_VALUE
116+
#define EXPERIMENTALS_DEFAULT_VALUE false
117+
#endif
118+
115119
class EnvironmentOptions : public Options {
116120
public:
117121
bool abort_on_uncaught_exception = false;
@@ -122,18 +126,18 @@ class EnvironmentOptions : public Options {
122126
bool require_module = true;
123127
std::string dns_result_order;
124128
bool enable_source_maps = false;
125-
bool experimental_addon_modules = false;
126-
bool experimental_eventsource = false;
129+
bool experimental_addon_modules = EXPERIMENTALS_DEFAULT_VALUE;
130+
bool experimental_eventsource = EXPERIMENTALS_DEFAULT_VALUE;
127131
bool experimental_websocket = true;
128132
bool experimental_sqlite = HAVE_SQLITE;
129133
bool experimental_webstorage = false;
130134
#ifndef OPENSSL_NO_QUIC
131-
bool experimental_quic = false;
135+
bool experimental_quic = EXPERIMENTALS_DEFAULT_VALUE;
132136
#endif
133137
std::string localstorage_file;
134138
bool experimental_global_navigator = true;
135139
bool experimental_global_web_crypto = true;
136-
bool experimental_import_meta_resolve = false;
140+
bool experimental_import_meta_resolve = EXPERIMENTALS_DEFAULT_VALUE;
137141
std::string input_type; // Value of --input-type
138142
bool entry_is_url = false;
139143
bool permission = false;
@@ -145,7 +149,7 @@ class EnvironmentOptions : public Options {
145149
bool allow_wasi = false;
146150
bool allow_worker_threads = false;
147151
bool experimental_repl_await = true;
148-
bool experimental_vm_modules = false;
152+
bool experimental_vm_modules = EXPERIMENTALS_DEFAULT_VALUE;
149153
bool async_context_frame = true;
150154
bool expose_internals = false;
151155
bool force_node_api_uncaught_exceptions_policy = false;
@@ -172,10 +176,10 @@ class EnvironmentOptions : public Options {
172176
uint64_t cpu_prof_interval = kDefaultCpuProfInterval;
173177
std::string cpu_prof_name;
174178
bool cpu_prof = false;
175-
bool experimental_network_inspection = false;
176-
bool experimental_worker_inspection = false;
177-
bool experimental_storage_inspection = false;
178-
bool experimental_inspector_network_resource = false;
179+
bool experimental_network_inspection = EXPERIMENTALS_DEFAULT_VALUE;
180+
bool experimental_worker_inspection = EXPERIMENTALS_DEFAULT_VALUE;
181+
bool experimental_storage_inspection = EXPERIMENTALS_DEFAULT_VALUE;
182+
bool experimental_inspector_network_resource = EXPERIMENTALS_DEFAULT_VALUE;
179183
std::string heap_prof_dir;
180184
std::string heap_prof_name;
181185
static const uint64_t kDefaultHeapProfInterval = 512 * 1024;

0 commit comments

Comments
 (0)