build: add flag to compile V8 with Temporal support · nodejs/node@91b20c5 · GitHub
Skip to content

Commit 91b20c5

Browse files
aduh95targos
authored andcommitted
build: add flag to compile V8 with Temporal support
Refs: #58730 Co-authored-by: =?UTF-8?q?Micha=C3=ABl=20Zasso?= <targos@protonmail.com> Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com> PR-URL: #60701 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
1 parent 0aaed24 commit 91b20c5

5 files changed

Lines changed: 63 additions & 2 deletions

File tree

configure.py

Lines changed: 31 additions & 0 deletions

shell.nix

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
{
22
pkgs ? import ./tools/nix/pkgs.nix { },
33
loadJSBuiltinsDynamically ? true, # Load `lib/**.js` from disk instead of embedding
4+
withTemporal ? false,
45
ncu-path ? null, # Provide this if you want to use a local version of NCU
56
icu ? pkgs.icu,
6-
sharedLibDeps ? import ./tools/nix/sharedLibDeps.nix { inherit pkgs; },
7+
sharedLibDeps ? import ./tools/nix/sharedLibDeps.nix { inherit pkgs withTemporal; },
78
ccache ? pkgs.ccache,
89
ninja ? pkgs.ninja,
910
devTools ? import ./tools/nix/devTools.nix { inherit pkgs ncu-path; },
1011
benchmarkTools ? import ./tools/nix/benchmarkTools.nix { inherit pkgs; },
1112
extraConfigFlags ? [
1213
"--without-npm"
1314
"--debug-node"
15+
]
16+
++ pkgs.lib.optionals withTemporal [
17+
"--v8-enable-temporal-support"
1418
],
1519
}:
1620

@@ -22,7 +26,7 @@ in
2226
pkgs.mkShell {
2327
inherit (pkgs.nodejs_latest) nativeBuildInputs;
2428

25-
buildInputs = builtins.attrValues sharedLibDeps ++ pkgs.lib.optionals useSharedICU [ icu ];
29+
buildInputs = builtins.attrValues sharedLibDeps ++ pkgs.lib.optional useSharedICU icu;
2630

2731
packages = [
2832
ccache

tools/nix/sharedLibDeps.nix

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
pkgs ? import ./pkgs.nix { },
3+
withTemporal ? false,
34
}:
45
{
56
inherit (pkgs)
@@ -36,3 +37,6 @@
3637
];
3738
});
3839
}
40+
// (pkgs.lib.optionalAttrs withTemporal {
41+
inherit (pkgs) temporal_capi;
42+
})

tools/v8_gypfiles/features.gypi

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,10 @@
295295
# add a dependency on the ICU library.
296296
'v8_enable_i18n_support%': 1,
297297

298+
# Enable Temporal API. Enabling this feature will
299+
# add a dependency on the temporal_rs library.
300+
'v8_enable_temporal_support%': 0,
301+
298302
# Lite mode disables a number of performance optimizations to reduce memory
299303
# at the cost of performance.
300304
# Sets --DV8_LITE_MODE.
@@ -410,6 +414,9 @@
410414
['v8_enable_i18n_support==1', {
411415
'defines': ['V8_INTL_SUPPORT',],
412416
}],
417+
['v8_enable_temporal_support==1', {
418+
'defines': ['V8_TEMPORAL_SUPPORT',],
419+
}],
413420
# Refs: https://github.com/nodejs/node/pull/23801
414421
# ['v8_enable_handle_zapping==1', {
415422
# 'defines': ['ENABLE_HANDLE_ZAPPING',],

tools/v8_gypfiles/v8.gyp

Lines changed: 15 additions & 0 deletions

0 commit comments

Comments
 (0)