Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -1009,6 +1031,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',
Expand Down Expand Up @@ -1802,6 +1831,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)
Expand Down Expand Up @@ -2357,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)
Expand Down
8 changes: 6 additions & 2 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
{
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; },
benchmarkTools ? import ./tools/nix/benchmarkTools.nix { inherit pkgs; },
extraConfigFlags ? [
"--without-npm"
"--debug-node"
]
++ pkgs.lib.optionals withTemporal [
"--v8-enable-temporal-support"
],
}:

Expand All @@ -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
Expand Down
4 changes: 4 additions & 0 deletions tools/nix/sharedLibDeps.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
pkgs ? import ./pkgs.nix { },
withTemporal ? false,
}:
{
inherit (pkgs)
Expand Down Expand Up @@ -45,3 +46,6 @@
];
});
}
// (pkgs.lib.optionalAttrs withTemporal {
inherit (pkgs) temporal_capi;
})
7 changes: 7 additions & 0 deletions tools/v8_gypfiles/features.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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',],
Expand Down
15 changes: 15 additions & 0 deletions tools/v8_gypfiles/v8.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "torque_files =.*?v8_enable_i18n_support.*?torque_files \\+= ")',
],
}],
['v8_enable_temporal_support==1', {
'torque_files': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "torque_files =.*?v8_enable_temporal_support.*?torque_files \\+= ")',
],
}],
['v8_enable_webassembly==1', {
'torque_files': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "torque_files =.*?v8_enable_webassembly.*?torque_files \\+= ")',
Expand Down Expand Up @@ -660,6 +665,11 @@
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?v8_enable_snapshot_compression.*?sources \\+= ")',
],
}],
['v8_enable_temporal_support==1', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?v8_enable_temporal_support.*?sources \\+= ")',
],
}],
['v8_enable_sparkplug==1', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?v8_enable_sparkplug.*?sources \\+= ")',
Expand Down Expand Up @@ -1117,6 +1127,11 @@
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_enable_snapshot_compression.*?sources \\+= ")',
],
}],
['v8_enable_temporal_support==1', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_enable_temporal_support.*?sources \\+= ")',
],
}],
['v8_enable_sparkplug==1', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_enable_sparkplug.*?sources \\+= ")',
Expand Down
Loading