Skip to content

Commit 2509a45

Browse files
committed
fixup! build: add --without-bundled-v8-third_party configure flag
1 parent 276bef8 commit 2509a45

File tree

18 files changed

+360
-159
lines changed

18 files changed

+360
-159
lines changed

.github/workflows/test-shared.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ on:
3333
- deps/uv/**
3434
- deps/uvwasi/**
3535
- deps/v8/third_party/abseil-cpp/**
36+
- deps/v8/third_party/dragonbox/**
37+
- deps/v8/third_party/fast_float/**
38+
- deps/v8/third_party/fp16/**
39+
- deps/v8/third_party/googletest/**
3640
- deps/v8/third_party/highway/**
3741
- deps/v8/third_party/simdutf/**
3842
- deps/v8/third_party/zlib/**
@@ -86,6 +90,14 @@ on:
8690
- deps/sqlite/**
8791
- deps/uv/**
8892
- deps/uvwasi/**
93+
- deps/v8/third_party/abseil-cpp/**
94+
- deps/v8/third_party/dragonbox/**
95+
- deps/v8/third_party/fast_float/**
96+
- deps/v8/third_party/fp16/**
97+
- deps/v8/third_party/googletest/**
98+
- deps/v8/third_party/highway/**
99+
- deps/v8/third_party/simdutf/**
100+
- deps/v8/third_party/zlib/**
89101
- deps/zlib/**
90102
- deps/zstd/**
91103
- doc/**

Makefile

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,10 +1251,18 @@ ifeq ($(SKIP_SHARED_DEPS), 1)
12511251
$(RM) -r $(TARNAME)/deps/sqlite
12521252
$(RM) -r $(TARNAME)/deps/uv
12531253
$(RM) -r $(TARNAME)/deps/uvwasi
1254-
$(RM) -r $(TARNAME)/deps/v8/third_party/abseil-cpp
1255-
$(RM) -r $(TARNAME)/deps/v8/third_party/highway
1256-
$(RM) -r $(TARNAME)/deps/v8/third_party/simdutf
1257-
$(RM) -r $(TARNAME)/deps/v8/third_party/zlib
1254+
find $(TARNAME)/deps/v8/third_party -maxdepth 1 -type f -exec $(RM) {} +
1255+
find $(TARNAME)/deps/v8/third_party -mindepth 1 -maxdepth 1 -type d \
1256+
-not -name inspector_protocol \
1257+
-not -name jinja2 \
1258+
-not -name markupsafe \
1259+
-not -name rapidhash-v8 \
1260+
-not -name siphash \
1261+
-not -name utf8-decoder \
1262+
-not -name valgrind \
1263+
-not -name v8 \
1264+
-not -name wasm-api \
1265+
-exec $(RM) -r {} +
12581266
$(RM) -r $(TARNAME)/deps/zlib
12591267
$(RM) -r $(TARNAME)/deps/zstd
12601268
else

node.gyp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,6 @@
894894
'<(SHARED_INTERMEDIATE_DIR)' # for node_natives.h
895895
],
896896
'dependencies': [
897-
'tools/v8_gypfiles/abseil.gyp:abseil',
898897
'node_js2c#host',
899898
],
900899

@@ -955,6 +954,11 @@
955954
'src/node_snapshot_stub.cc',
956955
]
957956
}],
957+
[ 'node_use_bundled_v8_third_party!="false"', {
958+
'dependencies': [
959+
'tools/v8_gypfiles/abseil.gyp:abseil',
960+
],
961+
}],
958962
[ 'node_shared_gtest=="false"', {
959963
'dependencies': [
960964
'deps/googletest/googletest.gyp:gtest_prod',
@@ -1275,7 +1279,6 @@
12751279

12761280
'dependencies': [
12771281
'<(node_lib_target_name)',
1278-
'tools/v8_gypfiles/abseil.gyp:abseil',
12791282
],
12801283

12811284
'includes': [
@@ -1309,6 +1312,11 @@
13091312
[ 'node_shared_gtest=="true"', {
13101313
'libraries': [ '-lgtest_main' ],
13111314
}],
1315+
[ 'node_use_bundled_v8_third_party!="false"', {
1316+
'dependencies': [
1317+
'tools/v8_gypfiles/abseil.gyp:abseil',
1318+
],
1319+
}],
13121320
[ 'node_shared_hdr_histogram=="false"', {
13131321
'dependencies': [
13141322
'deps/histogram/histogram.gyp:histogram',
@@ -1547,7 +1555,7 @@
15471555
[ 'OS=="mac"', {
15481556
'libraries': [ '-framework CoreFoundation -framework Security' ],
15491557
}],
1550-
[ 'node_shared_simdutf=="false"', {
1558+
[ 'node_shared_simdutf=="false" and node_use_bundled_v8_third_party!="false"', {
15511559
'dependencies': [ 'tools/v8_gypfiles/v8.gyp:simdutf#host' ],
15521560
}],
15531561
[ 'node_shared_libuv=="false"', {

tools/nix/v8-third_party/abseil-cpp.nix

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,13 @@
55
}:
66

77
let
8-
# Values from deps/v8/DEPS - third_party/abseil-cpp
98
url = "https://chromium.googlesource.com/chromium/src/third_party/abseil-cpp.git";
109
rev = "3fb321d9764442ceaf2e17b6e68ab6b6836bc78a";
1110

12-
hash =
13-
let
14-
v8Deps = builtins.match (
15-
".*'chromium_url': '([^']+)',.*"
16-
+ "'third_party/abseil-cpp': \\{"
17-
+ "[^']+'url': ?Var\\('chromium_url'\\) ?\\+ ?'([^']+)' ?\\+ ?'@' ?\\+ ?'([a-f0-9]+)',.*"
18-
) (builtins.readFile ../../../deps/v8/DEPS);
19-
expectedURL =
20-
if v8Deps == null then
21-
throw "v8/DEPS missing or not parsable"
22-
else
23-
"${builtins.elemAt v8Deps 0}${builtins.elemAt v8Deps 1}";
24-
expectedRev = builtins.elemAt v8Deps 2;
25-
in
26-
if skipCheck == false && (expectedURL != url || expectedRev != rev) then
27-
throw "Please run tools/nix/update-absl-nix.sh\n - Expected: ${expectedURL}@${expectedRev}\n - Got: ${url}@${rev}"
28-
else
29-
"sha256-KpjXpyWp9x0cSmyh3uwn0fwKreHA0Cb8c0rD+RHYB80=";
11+
hash = import ./utils/up-to-date-hash.nix {
12+
pname = "abseil-cpp";
13+
inherit skipCheck url rev;
14+
} "sha256-KpjXpyWp9x0cSmyh3uwn0fwKreHA0Cb8c0rD+RHYB80=";
3015
in
3116
(abseil-cpp.overrideAttrs {
3217
src = fetchgit {

tools/nix/v8-third_party/default.nix

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ symlinkJoin {
2525

2626
paths = [
2727
(callPackage ./abseil-cpp.nix { })
28+
(callPackage ./dragonbox.nix { })
29+
(callPackage ./fast_float.nix { })
30+
(callPackage ./fp16.nix { })
31+
(callPackage ./googletest.nix { })
2832
(callPackage ./highway.nix { })
2933
(callPackage ./simdutf.nix { })
3034
(callPackage ./zlib.nix { })
@@ -63,7 +67,7 @@ symlinkJoin {
6367
"-lv8_zlib"
6468
]
6569
}
66-
Cflags: -I$out/include
70+
Cflags: -I$out/include -I$out/include/third_party/simdutf
6771
EOF
6872
install -Dm0644 v8-third_party.pc -t $out/lib/pkgconfig
6973
'';
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
stdenv,
3+
fetchgit,
4+
skipCheck ? false, # update-v8-dep-nix.sh uses this to parse the file
5+
}:
6+
7+
let
8+
# Values from deps/v8/DEPS - third_party/dragonbox
9+
url = "https://chromium.googlesource.com/external/github.com/jk-jeon/dragonbox.git";
10+
rev = "6c7c925b571d54486b9ffae8d9d18a822801cbda";
11+
12+
pname = "dragonbox";
13+
hash = import ./utils/up-to-date-hash.nix {
14+
inherit
15+
pname
16+
skipCheck
17+
url
18+
rev
19+
;
20+
} "sha256-AOniXMPgwKpkJqivRd+GazEnhdw53FzhxKqG+GdU+cc=";
21+
in
22+
stdenv.mkDerivation {
23+
inherit pname;
24+
version = "1.8.0";
25+
26+
src = fetchgit {
27+
inherit url rev hash;
28+
};
29+
30+
doBuild = false;
31+
installPhase = ''
32+
install -Dm0644 include/${pname}/*.h -t $out/include/third_party/${pname}/src/include/${pname}
33+
'';
34+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
stdenv,
3+
fetchgit,
4+
skipCheck ? false, # update-v8-dep-nix.sh uses this to parse the file
5+
}:
6+
7+
let
8+
# Values from deps/v8/DEPS - third_party/fast_float
9+
url = "https://chromium.googlesource.com/external/github.com/fastfloat/fast_float.git";
10+
rev = "cb1d42aaa1e14b09e1452cfdef373d051b8c02a4";
11+
12+
pname = "fast_float";
13+
hash = import ./utils/up-to-date-hash.nix {
14+
inherit
15+
pname
16+
skipCheck
17+
url
18+
rev
19+
;
20+
} "sha256-CG5je117WYyemTe5PTqznDP0bvY5TeXn8Vu1Xh5yUzQ=";
21+
in
22+
stdenv.mkDerivation {
23+
inherit pname;
24+
version = "7.0.0";
25+
26+
src = fetchgit {
27+
inherit url rev hash;
28+
};
29+
30+
doBuild = false;
31+
installPhase = ''
32+
install -Dm0644 include/${pname}/*.h -t $out/include/third_party/${pname}/src/include/${pname}
33+
'';
34+
}

tools/nix/v8-third_party/fp16.nix

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
stdenv,
3+
fetchgit,
4+
skipCheck ? false, # update-v8-dep-nix.sh uses this to parse the file
5+
}:
6+
7+
let
8+
# Values from deps/v8/DEPS - third_party/fp16
9+
url = "https://chromium.googlesource.com/external/github.com/Maratyszcza/FP16.git";
10+
rev = "3d2de1816307bac63c16a297e8c4dc501b4076df";
11+
12+
pname = "fp16";
13+
hash = import ./utils/up-to-date-hash.nix {
14+
inherit
15+
pname
16+
skipCheck
17+
url
18+
rev
19+
;
20+
} "sha256-CR7h1d9RFE86l6btk4N8vbQxy0KQDxSMvckbiO87JEg=";
21+
in
22+
stdenv.mkDerivation {
23+
inherit pname;
24+
version = "0-unstable-2022-10-24";
25+
26+
src = fetchgit {
27+
inherit url rev hash;
28+
};
29+
30+
doBuild = false;
31+
installPhase = ''
32+
install -Dm0644 include/${pname}.h -t $out/include/third_party/${pname}/src/include
33+
install -Dm0644 include/${pname}/*.h -t $out/include/third_party/${pname}/src/include/${pname}
34+
ln -s $out/include/third_party/${pname}/src/include/${pname} $out/include/${pname}
35+
'';
36+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
stdenv,
3+
fetchgit,
4+
skipCheck ? false, # update-v8-dep-nix.sh uses this to parse the file
5+
}:
6+
7+
let
8+
# Values from deps/v8/DEPS - third_party/googletest
9+
url = "https://chromium.googlesource.com/external/github.com/google/googletest.git";
10+
rev = "b2b9072ecbe874f5937054653ef8f2731eb0f010";
11+
12+
pname = "googletest";
13+
hash = import ./utils/up-to-date-hash.nix {
14+
inherit
15+
pname
16+
skipCheck
17+
url
18+
rev
19+
;
20+
} "sha256-cTPx19WAXlyXDK4nY0pxbMI4oRojaARgIeASA+MB3NY=";
21+
in
22+
stdenv.mkDerivation {
23+
inherit pname;
24+
version = "1.8.0";
25+
26+
src = fetchgit {
27+
inherit url rev hash;
28+
# sparseCheckout = [ "*.h" ];
29+
# nonConeMode = true;
30+
};
31+
32+
doBuild = false;
33+
installPhase = ''
34+
install -Dm0644 googletest/include/gtest/*.h -t $out/include/third_party/${pname}/src/googletest/include/gtest
35+
'';
36+
}

tools/nix/v8-third_party/highway.nix

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,22 @@ let
99
url = "https://chromium.googlesource.com/external/github.com/google/highway.git";
1010
rev = "84379d1c73de9681b54fbe1c035a23c7bd5d272d";
1111

12-
hash =
13-
let
14-
v8Deps = builtins.match (
15-
".*'chromium_url': '([^']+)',.*"
16-
+ "'third_party/highway/src':"
17-
+ "[^']+Var\\('chromium_url'\\) ?\\+ ?'([^']+)' ?\\+ ?'@' ?\\+ ?'([a-f0-9]+)',.*"
18-
) (builtins.readFile ../../../deps/v8/DEPS);
19-
expectedURL =
20-
if v8Deps == null then
21-
throw "v8/DEPS missing or not parsable"
22-
else
23-
"${builtins.elemAt v8Deps 0}${builtins.elemAt v8Deps 1}";
24-
expectedRev = builtins.elemAt v8Deps 2;
25-
in
26-
if skipCheck == false && (expectedURL != url || expectedRev != rev) then
27-
throw "Please run `tools/nix/v8-third_party/update-dep-nix.sh highway`\n - Expected: ${expectedURL}@${expectedRev}\n - Got: ${url}@${rev}"
28-
else
29-
"sha256-HNrlqtAs1vKCoSJ5TASs34XhzjEbLW+ISco1NQON+BI=";
30-
version = "1.3.0";
12+
hash = import ./utils/up-to-date-hash.nix {
13+
pname = "highway";
14+
inherit skipCheck url rev;
15+
} "sha256-HNrlqtAs1vKCoSJ5TASs34XhzjEbLW+ISco1NQON+BI=";
3116
in
32-
libhwy.overrideAttrs {
33-
inherit version;
17+
libhwy.overrideAttrs (old: {
18+
version = "1.3.0";
3419

3520
src = fetchgit {
3621
inherit url rev hash;
3722
};
38-
}
23+
24+
postPatch = ''
25+
substituteInPlace hwy/ops/set_macros-inl.h \
26+
--replace-fail '",avx10.2-512"' '""'
27+
'';
28+
29+
doCheck = false;
30+
})

0 commit comments

Comments
 (0)