Skip to content

Commit 01cee9d

Browse files
committed
build: do not use bundled simdutf when built with --shared-simdutf
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com> PR-URL: #65891 Reviewed-By: Xuguang Mei <meixuguang@gmail.com>
1 parent d62a452 commit 01cee9d

10 files changed

Lines changed: 44 additions & 22 deletions

File tree

.github/workflows/test-shared.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ on:
3636
- deps/uvwasi/**
3737
- deps/v8/third_party/abseil-cpp/**
3838
- deps/v8/third_party/highway/**
39+
- deps/v8/third_party/simdutf/**
3940
- deps/zlib/**
4041
- deps/zstd/**
4142
- doc/**
@@ -92,6 +93,7 @@ on:
9293
- deps/uvwasi/**
9394
- deps/v8/third_party/abseil-cpp/**
9495
- deps/v8/third_party/highway/**
96+
- deps/v8/third_party/simdutf/**
9597
- deps/zlib/**
9698
- deps/zstd/**
9799
- doc/**

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,6 +1326,7 @@ ifeq ($(SKIP_SHARED_DEPS), 1)
13261326
$(RM) -r $(TARNAME)/deps/uvwasi
13271327
$(RM) -r $(TARNAME)/deps/v8/third_party/abseil-cpp
13281328
$(RM) -r $(TARNAME)/deps/v8/third_party/highway
1329+
$(RM) -r $(TARNAME)/deps/v8/third_party/simdutf
13291330
$(RM) -r $(TARNAME)/deps/zlib
13301331
$(RM) -r $(TARNAME)/deps/zstd
13311332
else

deps/ada/ada.gyp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
'type': 'static_library',
99
'include_dirs': [
1010
'.',
11-
'<(DEPTH)/deps/v8/third_party/simdutf',
1211
],
1312
'direct_dependent_settings': {
1413
'include_dirs': ['.'],
@@ -17,7 +16,7 @@
1716
'ADA_USE_SIMDUTF=1',
1817
],
1918
'dependencies': [
20-
'../../tools/v8_gypfiles/v8.gyp:simdutf',
19+
'../../tools/v8_gypfiles/simdutf.gyp:simdutf',
2120
],
2221
'sources': [ '<@(ada_sources)' ]
2322
},

node.gyp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1654,7 +1654,7 @@
16541654
'libraries': [ '-framework CoreFoundation -framework Security' ],
16551655
}],
16561656
[ 'node_shared_simdutf=="false" and node_use_bundled_v8!="false"', {
1657-
'dependencies': [ 'tools/v8_gypfiles/v8.gyp:simdutf#host' ],
1657+
'dependencies': [ 'tools/v8_gypfiles/simdutf.gyp:simdutf#host' ],
16581658
}],
16591659
[ 'node_shared_libuv=="false"', {
16601660
'dependencies': [ 'deps/uv/uv.gyp:libuv#host' ],

node.gypi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@
247247
}],
248248

249249
[ 'node_shared_simdutf=="false" and node_use_bundled_v8!="false"', {
250-
'dependencies': [ 'tools/v8_gypfiles/v8.gyp:simdutf' ],
250+
'dependencies': [ 'tools/v8_gypfiles/simdutf.gyp:simdutf' ],
251251
}],
252252

253253
[ 'node_shared_brotli=="false"', {

shell.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ let
6868
++ pkgs.lib.optional (builtins.hasAttr "abseil" sharedLibDeps) sharedLibDeps.abseil
6969
++ pkgs.lib.optional (builtins.hasAttr "highway" sharedLibDeps) sharedLibDeps.highway
7070
++ pkgs.lib.optional (withPerfetto && useSharedPerfetto) sharedLibDeps.perfetto
71+
++ pkgs.lib.optional (builtins.hasAttr "simdutf" sharedLibDeps) sharedLibDeps.simdutf
7172
++ pkgs.lib.optional (withTemporal && useSharedTemporal) sharedLibDeps.temporal_capi;
7273

7374
# Put here only the configure flags that affect the V8 build
@@ -83,6 +84,7 @@ let
8384
++ pkgs.lib.optional (builtins.hasAttr "abseil" sharedLibDeps) "--shared-abseil"
8485
++ pkgs.lib.optional (builtins.hasAttr "highway" sharedLibDeps) "--shared-highway"
8586
++ pkgs.lib.optional (withPerfetto && useSharedPerfetto) "--shared-perfetto"
87+
++ pkgs.lib.optional (builtins.hasAttr "simdutf" sharedLibDeps) "--shared-simdutf"
8688
++ pkgs.lib.optional (withTemporal && useSharedTemporal) "--shared-temporal_capi"
8789
++ pkgs.lib.optional withPerfetto "--with-perfetto";
8890
in

tools/nix/sharedLibDeps.nix

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
merve
1818
nbytes
1919
simdjson
20-
simdutf
2120
uvwasi
2221
zlib
2322
zstd
@@ -34,6 +33,10 @@
3433
hash = "sha256-PxhfWxw+d4heuc8/LE2ksan3OiS/WVe4KRg60Tf4Lcg=";
3534
};
3635
};
36+
simdutf = pkgs.simdutf.overrideAttrs (old: {
37+
# TODO: remove this once the pin we use has picked up https://github.com/NixOS/nixpkgs/pull/557405
38+
cmakeFlags = old.cmakeFlags ++ [ (pkgs.lib.cmakeFeature "SIMDUTF_CXX_STANDARD" "20") ];
39+
});
3740
}
3841
// (pkgs.lib.optionalAttrs withLief {
3942
inherit (pkgs) lief;

tools/nix/v8.nix

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
let
2626
useSharedAbseil = builtins.elem "--shared-abseil" configureFlags;
2727
useSharedHighway = builtins.elem "--shared-highway" configureFlags;
28+
useSharedSimdutf = builtins.elem "--shared-simdutf" configureFlags;
2829
src =
2930
let
3031
inherit (lib) fileset;
@@ -47,6 +48,7 @@ let
4748
]
4849
++ lib.optional (!useSharedAbseil) ../../tools/v8_gypfiles/abseil.gyp
4950
++ lib.optional (!useSharedHighway) ../../tools/v8_gypfiles/highway.gyp
51+
++ lib.optional (!useSharedSimdutf) ../../tools/v8_gypfiles/simdutf.gyp
5052
++ lib.optional (
5153
builtins.elem "--with-perfetto" configureFlags
5254
&& !(builtins.elem "--shared-perfetto" configureFlags)
@@ -76,6 +78,7 @@ let
7678
]
7779
++ lib.optional useSharedAbseil ../../deps/v8/third_party/abseil-cpp
7880
++ lib.optional useSharedHighway ../../deps/v8/third_party/highway
81+
++ lib.optional useSharedSimdutf ../../deps/v8/third_party/simdutf
7982
));
8083
trackedFiles =
8184
({
@@ -201,7 +204,9 @@ stdenv.mkDerivation (finalAttrs: {
201204
''
202205
}
203206
204-
install -Dm644 deps/v8/third_party/simdutf/simdutf.h -t $out/include
207+
${lib.optionalString (
208+
!useSharedSimdutf
209+
) "install -Dm644 deps/v8/third_party/simdutf/simdutf.h -t $out/include"}
205210
find deps/v8/include -name '*.h' -print0 | while read -r -d "" file; do
206211
install -Dm644 "$file" -T "$out/include/''${file#deps/v8/include/}"
207212
done

tools/v8_gypfiles/simdutf.gyp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
'includes': ['toolchain.gypi'],
3+
'targets': [
4+
{
5+
'target_name': 'simdutf',
6+
'type': 'static_library',
7+
'toolsets': ['host', 'target'],
8+
'variables': {
9+
'SIMDUTF_ROOT': '../../deps/v8/third_party/simdutf',
10+
},
11+
'all_dependent_settings': {
12+
'include_dirs': [
13+
'<(SIMDUTF_ROOT)',
14+
],
15+
},
16+
'include_dirs': ['.'],
17+
'sources': [
18+
'<(SIMDUTF_ROOT)/simdutf.cpp',
19+
],
20+
}, # simdutf
21+
],
22+
}

tools/v8_gypfiles/v8.gyp

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,10 @@
650650
}],
651651
['node_shared_highway=="false"', {
652652
'dependencies': ['highway.gyp:highway'],
653-
}]
653+
}],
654+
['node_shared_simdutf=="false"', {
655+
'dependencies': ['simdutf.gyp:simdutf'],
656+
}],
654657
],
655658
'direct_dependent_settings': {
656659
'sources': [
@@ -1118,7 +1121,6 @@
11181121
'v8_maybe_icu',
11191122
'v8_zlib',
11201123
'v8_pch',
1121-
'simdutf',
11221124
],
11231125
'includes': ['inspector.gypi'],
11241126
'direct_dependent_settings': {
@@ -2479,19 +2481,5 @@
24792481
],
24802482
},
24812483
}, # fp16
2482-
{
2483-
'target_name': 'simdutf',
2484-
'type': 'static_library',
2485-
'toolsets': ['host', 'target'],
2486-
'direct_dependent_settings': {
2487-
'include_dirs': [
2488-
'<(V8_ROOT)/third_party/simdutf',
2489-
],
2490-
},
2491-
'include_dirs': ['.'],
2492-
'sources': [
2493-
'<(V8_ROOT)/third_party/simdutf/simdutf.cpp',
2494-
],
2495-
}, # simdutf
24962484
],
24972485
}

0 commit comments

Comments
 (0)