From c38c9743d4cd74956c0548a93fb091ba8a8450a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Wed, 12 Nov 2025 16:11:16 +0100 Subject: [PATCH 1/2] build: add flag to compile V8 with Temporal support Refs: https://github.com/nodejs/node/issues/58730 Co-authored-by: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Co-authored-by: Antoine du Hamel --- configure.py | 8 ++++++++ tools/v8_gypfiles/features.gypi | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/configure.py b/configure.py index a752897e90aa25..c516977b4870d1 100755 --- a/configure.py +++ b/configure.py @@ -1009,6 +1009,13 @@ default=None, help='Enable the built-in snapshot compression in V8.') + +parser.add_argument('--v8-enable-temporal-support', + action='store_true', + dest='v8_enable_temporal_support', + default=None, + help='Enable Temporal support in V8.') + parser.add_argument('--node-builtin-modules-path', action='store', dest='node_builtin_modules_path', @@ -1802,6 +1809,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_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) diff --git a/tools/v8_gypfiles/features.gypi b/tools/v8_gypfiles/features.gypi index e62b69e9a7175f..c2805da739ce2a 100644 --- a/tools/v8_gypfiles/features.gypi +++ b/tools/v8_gypfiles/features.gypi @@ -295,6 +295,10 @@ # add a dependency on the ICU library. 'v8_enable_i18n_support%': 1, + # Enable Temporal API. Enabling this feature will + # add a dependency on the temporal_rs library. + 'v8_enable_temporal_support%': 0, + # Lite mode disables a number of performance optimizations to reduce memory # at the cost of performance. # Sets --DV8_LITE_MODE. @@ -410,6 +414,9 @@ ['v8_enable_i18n_support==1', { 'defines': ['V8_INTL_SUPPORT',], }], + ['v8_enable_temporal_support==1', { + 'defines': ['V8_TEMPORAL_SUPPORT',], + }], # Refs: https://github.com/nodejs/node/pull/23801 # ['v8_enable_handle_zapping==1', { # 'defines': ['ENABLE_HANDLE_ZAPPING',], From 11024b06641a5ed7c08ef6f4f13155fbbc70e21c Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Thu, 13 Nov 2025 10:35:32 +0100 Subject: [PATCH 2/2] fixup! build: add flag to compile V8 with Temporal support --- configure.py | 23 +++++++++++++++++++++++ shell.nix | 8 ++++++-- tools/nix/sharedLibDeps.nix | 4 ++++ tools/v8_gypfiles/v8.gyp | 15 +++++++++++++++ 4 files changed, 48 insertions(+), 2 deletions(-) diff --git a/configure.py b/configure.py index c516977b4870d1..9d252bab63cfd5 100755 --- a/configure.py +++ b/configure.py @@ -573,6 +573,28 @@ dest='shared_sqlite_libpath', help='a directory to search for the shared sqlite DLL') +shared_optgroup.add_argument('--shared-temporal_capi', + action='store_true', + dest='shared_temporal_capi', + default=None, + help='link to a shared temporal_capi DLL instead of static linking') + +shared_optgroup.add_argument('--shared-temporal_capi-includes', + action='store', + dest='shared_temporal_capi_includes', + help='directory containing temporal_capi header files') + +shared_optgroup.add_argument('--shared-temporal_capi-libname', + action='store', + dest='shared_temporal_capi_libname', + default='temporal_capi', + help='alternative lib name to link to [default: %(default)s]') + +shared_optgroup.add_argument('--shared-temporal_capi-libpath', + action='store', + dest='shared_temporal_capi_libpath', + help='a directory to search for the shared temporal_capi DLL') + shared_optgroup.add_argument('--shared-zstd', action='store_true', dest='shared_zstd', @@ -2365,6 +2387,7 @@ def make_bin_override(): configure_library('nghttp3', output, pkgname='libnghttp3') configure_library('ngtcp2', output, pkgname='libngtcp2') configure_sqlite(output); +configure_library('temporal_capi', output) configure_library('uvwasi', output) configure_library('zstd', output, pkgname='libzstd') configure_v8(output, configurations) diff --git a/shell.nix b/shell.nix index 143955fa33ee44..b22e3d6d11e4ab 100644 --- a/shell.nix +++ b/shell.nix @@ -1,9 +1,10 @@ { pkgs ? import ./tools/nix/pkgs.nix { }, loadJSBuiltinsDynamically ? true, # Load `lib/**.js` from disk instead of embedding + withTemporal ? false, ncu-path ? null, # Provide this if you want to use a local version of NCU icu ? pkgs.icu, - sharedLibDeps ? import ./tools/nix/sharedLibDeps.nix { inherit pkgs; }, + sharedLibDeps ? import ./tools/nix/sharedLibDeps.nix { inherit pkgs withTemporal; }, ccache ? pkgs.ccache, ninja ? pkgs.ninja, devTools ? import ./tools/nix/devTools.nix { inherit pkgs ncu-path; }, @@ -11,6 +12,9 @@ extraConfigFlags ? [ "--without-npm" "--debug-node" + ] + ++ pkgs.lib.optionals withTemporal [ + "--v8-enable-temporal-support" ], }: @@ -22,7 +26,7 @@ in pkgs.mkShell { inherit (pkgs.nodejs_latest) nativeBuildInputs; - buildInputs = builtins.attrValues sharedLibDeps ++ pkgs.lib.optionals useSharedICU [ icu ]; + buildInputs = builtins.attrValues sharedLibDeps ++ pkgs.lib.optional useSharedICU icu; packages = [ ccache diff --git a/tools/nix/sharedLibDeps.nix b/tools/nix/sharedLibDeps.nix index 6a4a088a579651..ba006fc9ce39ef 100644 --- a/tools/nix/sharedLibDeps.nix +++ b/tools/nix/sharedLibDeps.nix @@ -1,5 +1,6 @@ { pkgs ? import ./pkgs.nix { }, + withTemporal ? false, }: { inherit (pkgs) @@ -45,3 +46,6 @@ ]; }); } +// (pkgs.lib.optionalAttrs withTemporal { + inherit (pkgs) temporal_capi; +}) diff --git a/tools/v8_gypfiles/v8.gyp b/tools/v8_gypfiles/v8.gyp index c3ec7e3ee92bfc..2b05a75ec99d67 100644 --- a/tools/v8_gypfiles/v8.gyp +++ b/tools/v8_gypfiles/v8.gyp @@ -27,6 +27,11 @@ '