From 5cb984ad76712568d5cf23b73e6cf0d5be545803 Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Fri, 13 Feb 2026 18:14:49 +0000 Subject: [PATCH] build: enable Temporal by default Enabling Temporal support requires `cargo` and `rustc`, which are new build toolchain requirements. Add a `--v8-disable-temporal-support` option to `configure.py` to explicitly opt-out of Temporal support (i.e. no need for Rust). If the existing `--v8-enable-temporal-support` option is not explicitly passed to `configure.py`: - Attempt to detect `cargo` and `rustc`. - If neither `cargo` and `rustc` are detected, print a warning and disable Temporal support. - If both `cargo` and `rustc` are detected, enable Temporal support. If `--v8-enable-temporal-support` is passed to `configure.py`, then the build will error and stop if `cargo` and/or `rustc` are not detected. To avoid ambiguity, `configure.py` will error and stop if both `--v8-disable-temporal-support` and `--v8-enable-temporal-support` are used. --- configure.py | 63 ++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 46 insertions(+), 17 deletions(-) diff --git a/configure.py b/configure.py index 59a263d4e77246..189f6a6e8f94be 100755 --- a/configure.py +++ b/configure.py @@ -1156,6 +1156,11 @@ default=None, help='Enable the built-in snapshot compression in V8.') +parser.add_argument('--v8-disable-temporal-support', + action='store_true', + dest='v8_disable_temporal_support', + default=None, + help='Disable Temporal support in V8.') parser.add_argument('--v8-enable-temporal-support', action='store_true', @@ -1450,9 +1455,7 @@ def get_cargo_version(cargo): stdin=subprocess.PIPE, stderr=subprocess.PIPE, stdout=subprocess.PIPE) except OSError: - error('''No acceptable cargo found! - - Please make sure you have cargo installed on your system.''') + return '0.0' with proc: cargo_ret = to_utf8(proc.communicate()[0]) @@ -1471,11 +1474,7 @@ def get_rustc_version(rustc): stdin=subprocess.PIPE, stderr=subprocess.PIPE, stdout=subprocess.PIPE) except OSError: - error('''No acceptable rustc compiler found! - - Please make sure you have a rust compiler installed on your system and/or - consider adjusting the RUSTC environment variable if you have installed - it in a non-standard prefix.''') + return '0.0' with proc: rustc_ret = to_utf8(proc.communicate()[0]) @@ -1536,22 +1535,48 @@ def check_compiler(o): o['variables']['llvm_version'] = get_llvm_version(CC) if is_clang else '0.0' # cargo and rustc are needed for Temporal. - if options.v8_enable_temporal_support and not options.shared_temporal_capi: + if not options.v8_disable_temporal_support or not options.shared_temporal_capi: # Minimum cargo and rustc versions should match values in BUILDING.md. min_cargo_ver_tuple = (1, 82) min_rustc_ver_tuple = (1, 82) cargo_ver = get_cargo_version('cargo') print_verbose(f'Detected cargo: {cargo_ver}') - cargo_ver_tuple = tuple(map(int, cargo_ver.split('.'))) - if cargo_ver_tuple < min_cargo_ver_tuple: - warn(f'cargo {cargo_ver} too old, need cargo {".".join(map(str, min_cargo_ver_tuple))}') + if cargo_ver == '0.0': + # Error if --v8-enable-temporal-support is explicitly set, + # otherwise disable support for Temporal. + if options.v8_enable_temporal_support: + error('''No acceptable cargo found! + + Enabling Temporal support requires cargo. + Please make sure you have cargo installed on your system.''') + else: + warn('cargo not found! Support for Temporal will be disabled.') + options.v8_disable_temporal_support = True + else: + cargo_ver_tuple = tuple(map(int, cargo_ver.split('.'))) + if cargo_ver_tuple < min_cargo_ver_tuple: + warn(f'cargo {cargo_ver} too old, need cargo {".".join(map(str, min_cargo_ver_tuple))}') # cargo supports RUSTC environment variable to override "rustc". rustc = os.environ.get('RUSTC', 'rustc') rustc_ver = get_rustc_version(rustc) - print_verbose(f'Detected rustc (RUSTC={rustc}): {rustc_ver}') - rust_ver_tuple = tuple(map(int, rustc_ver.split('.'))) - if rust_ver_tuple < min_rustc_ver_tuple: - warn(f'rustc {rustc_ver} too old, need rustc {".".join(map(str, min_rustc_ver_tuple))}') + if rustc_ver == '0.0': + # Error if --v8-enable-temporal-support is explicitly set, + # otherwise disable support for Temporal. + if options.v8_enable_temporal_support: + error('''No acceptable rustc compiler found! + + Enabling Temporal support requires a Rust toolchain. + Please make sure you have a Rust compiler installed on your system and/or + consider adjusting the RUSTC environment variable if you have installed + it in a non-standard prefix.''') + else: + warn(f'{rustc} not found! Support for Temporal will be disabled.') + options.v8_disable_temporal_support = True + else: + print_verbose(f'Detected rustc (RUSTC={rustc}): {rustc_ver}') + rust_ver_tuple = tuple(map(int, rustc_ver.split('.'))) + if rust_ver_tuple < min_rustc_ver_tuple: + warn(f'rustc {rustc_ver} too old, need rustc {".".join(map(str, min_rustc_ver_tuple))}') # Need xcode_version or gas_version when openssl asm files are compiled. if options.without_ssl or options.openssl_no_asm or options.shared_openssl: @@ -2055,7 +2080,7 @@ def configure_v8(o, configs): o['variables']['v8_enable_external_code_space'] = 1 if options.enable_pointer_compression else 0 o['variables']['v8_enable_31bit_smis_on_64bit_arch'] = 1 if options.enable_pointer_compression else 0 o['variables']['v8_enable_extensible_ro_snapshot'] = 0 - o['variables']['v8_enable_temporal_support'] = 1 if options.v8_enable_temporal_support else 0 + o['variables']['v8_enable_temporal_support'] = 0 if options.v8_disable_temporal_support else 1 o['variables']['v8_trace_maps'] = 1 if options.trace_maps else 0 o['variables']['node_use_v8_platform'] = b(not options.without_v8_platform) o['variables']['node_use_bundled_v8'] = b(not options.without_bundled_v8) @@ -2081,6 +2106,10 @@ def configure_v8(o, configs): raise Exception( 'Only one of the --v8-enable-object-print or --v8-disable-object-print options ' 'can be specified at a time.') + if all(opt in sys.argv for opt in ['--v8-enable-temporal-support', '--v8-disable-temporal-support']): + raise Exception( + 'Only one of the --v8-enable-temporal-support or --v8-disable-temporal-support options ' + 'can be specified at a time.') if sys.platform != 'darwin': if o['variables']['v8_enable_webassembly'] and o['variables']['target_arch'] == 'x64': o['variables']['v8_enable_wasm_simd256_revec'] = 1