Skip to content

Commit 0a0185c

Browse files
committed
fixup! build: add flag to compile V8 with Temporal support
1 parent 76f0636 commit 0a0185c

File tree

4 files changed

+63
-2
lines changed

4 files changed

+63
-2
lines changed

configure.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,28 @@
573573
dest='shared_sqlite_libpath',
574574
help='a directory to search for the shared sqlite DLL')
575575

576+
shared_optgroup.add_argument('--shared-temporal_capi',
577+
action='store_true',
578+
dest='shared_temporal_capi',
579+
default=None,
580+
help='link to a shared temporal_capi DLL instead of static linking')
581+
582+
shared_optgroup.add_argument('--shared-temporal_capi-includes',
583+
action='store',
584+
dest='shared_temporal_capi_includes',
585+
help='directory containing temporal_capi header files')
586+
587+
shared_optgroup.add_argument('--shared-temporal_capi-libname',
588+
action='store',
589+
dest='shared_temporal_capi_libname',
590+
default='temporal_capi',
591+
help='alternative lib name to link to [default: %(default)s]')
592+
593+
shared_optgroup.add_argument('--shared-temporal_capi-libpath',
594+
action='store',
595+
dest='shared_temporal_capi_libpath',
596+
help='a directory to search for the shared temporal_capi DLL')
597+
576598
shared_optgroup.add_argument('--shared-zstd',
577599
action='store_true',
578600
dest='shared_zstd',
@@ -2365,6 +2387,7 @@ def make_bin_override():
23652387
configure_library('nghttp3', output, pkgname='libnghttp3')
23662388
configure_library('ngtcp2', output, pkgname='libngtcp2')
23672389
configure_sqlite(output);
2390+
configure_library('temporal_capi', output)
23682391
configure_library('uvwasi', output)
23692392
configure_library('zstd', output, pkgname='libzstd')
23702393
configure_v8(output, configurations)

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: 19 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)
@@ -45,3 +46,21 @@
4546
];
4647
});
4748
}
49+
// (pkgs.lib.optionalAttrs withTemporal {
50+
temporal_capi =
51+
import
52+
(builtins.fetchurl {
53+
url = "https://github.com/NixOS/nixpkgs/raw/c2247d3f04fe4da90a09244acc1df2f8b3dd6cfa/pkgs/by-name/te/temporal_capi/package.nix";
54+
sha256 = "1igiqjsw7jnb15xy0a5jq7z1wrpypflv37qidq056vsd1p2fks69";
55+
})
56+
{
57+
inherit (pkgs)
58+
lib
59+
stdenv
60+
rustPlatform
61+
fetchFromGitHub
62+
nix-update-script
63+
testers
64+
;
65+
};
66+
})

tools/v8_gypfiles/v8.gyp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@
2727
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "torque_files =.*?v8_enable_i18n_support.*?torque_files \\+= ")',
2828
],
2929
}],
30+
['v8_enable_temporal_support==1', {
31+
'torque_files': [
32+
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "torque_files =.*?v8_enable_temporal_support.*?torque_files \\+= ")',
33+
],
34+
}],
3035
['v8_enable_webassembly==1', {
3136
'torque_files': [
3237
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "torque_files =.*?v8_enable_webassembly.*?torque_files \\+= ")',
@@ -660,6 +665,11 @@
660665
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?v8_enable_snapshot_compression.*?sources \\+= ")',
661666
],
662667
}],
668+
['v8_enable_temporal_support==1', {
669+
'sources': [
670+
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?v8_enable_temporal_support.*?sources \\+= ")',
671+
],
672+
}],
663673
['v8_enable_sparkplug==1', {
664674
'sources': [
665675
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?v8_enable_sparkplug.*?sources \\+= ")',
@@ -1117,6 +1127,11 @@
11171127
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_enable_snapshot_compression.*?sources \\+= ")',
11181128
],
11191129
}],
1130+
['v8_enable_temporal_support==1', {
1131+
'sources': [
1132+
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_enable_temporal_support.*?sources \\+= ")',
1133+
],
1134+
}],
11201135
['v8_enable_sparkplug==1', {
11211136
'sources': [
11221137
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_enable_sparkplug.*?sources \\+= ")',

0 commit comments

Comments
 (0)