Skip to content

Commit ce30c03

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

File tree

7 files changed

+81
-54
lines changed

7 files changed

+81
-54
lines changed

.github/workflows/test-shared.yml

Lines changed: 36 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -113,45 +113,45 @@ permissions:
113113
contents: read
114114

115115
jobs:
116-
build-tarball:
117-
if: github.event.pull_request.draft == false
118-
name: ${{ github.event_name == 'workflow_dispatch' && 'Skipped job' || 'Build slim tarball' }}
119-
runs-on: ubuntu-slim
120-
steps:
121-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
122-
if: ${{ github.event_name != 'workflow_dispatch' }}
123-
with:
124-
persist-credentials: false
116+
# build-tarball:
117+
# if: github.event.pull_request.draft == false
118+
# name: ${{ github.event_name == 'workflow_dispatch' && 'Skipped job' || 'Build slim tarball' }}
119+
# runs-on: ubuntu-slim
120+
# steps:
121+
# - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
122+
# if: ${{ github.event_name != 'workflow_dispatch' }}
123+
# with:
124+
# persist-credentials: false
125125

126-
- name: Make tarball
127-
if: ${{ github.event_name != 'workflow_dispatch' }}
128-
run: |
129-
export DATESTRING=$(date "+%Y-%m-%d")
130-
export COMMIT=$(git rev-parse --short=10 "$GITHUB_SHA")
131-
./configure && make tar -j4 SKIP_XZ=1 SKIP_SHARED_DEPS=1
132-
env:
133-
DISTTYPE: nightly
126+
# - name: Make tarball
127+
# if: ${{ github.event_name != 'workflow_dispatch' }}
128+
# run: |
129+
# export DATESTRING=$(date "+%Y-%m-%d")
130+
# export COMMIT=$(git rev-parse --short=10 "$GITHUB_SHA")
131+
# ./configure && make tar -j4 SKIP_XZ=1 SKIP_SHARED_DEPS=1
132+
# env:
133+
# DISTTYPE: nightly
134134

135-
- name: Upload tarball artifact
136-
if: ${{ github.event_name != 'workflow_dispatch' }}
137-
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
138-
with:
139-
name: tarballs
140-
path: '*.tar.gz'
141-
compression-level: 0
135+
# - name: Upload tarball artifact
136+
# if: ${{ github.event_name != 'workflow_dispatch' }}
137+
# uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
138+
# with:
139+
# name: tarballs
140+
# path: '*.tar.gz'
141+
# compression-level: 0
142142

143143
build:
144-
needs: build-tarball
144+
# needs: build-tarball
145145
strategy:
146146
fail-fast: false
147147
matrix:
148148
include:
149-
- runner: ubuntu-24.04
150-
system: x86_64-linux
151-
- runner: ubuntu-24.04-arm
152-
system: aarch64-linux
153-
- runner: macos-15-intel
154-
system: x86_64-darwin
149+
# - runner: ubuntu-24.04
150+
# system: x86_64-linux
151+
# - runner: ubuntu-24.04-arm
152+
# system: aarch64-linux
153+
# - runner: macos-15-intel
154+
# system: x86_64-darwin
155155
- runner: macos-latest
156156
system: aarch64-darwin
157157
name: '${{ matrix.system }}: with shared libraries'
@@ -162,6 +162,9 @@ jobs:
162162
with:
163163
name: tarballs
164164
path: tarballs
165+
github-token: ${{ github.token }}
166+
repository: ${{ github.repository }}
167+
run-id: 22434821289
165168

166169
- name: Extract tarball
167170
if: ${{ github.event_name != 'workflow_dispatch' }}
@@ -189,14 +192,15 @@ jobs:
189192
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
190193
core.exportVariable('NIX_SCCACHE', '(import <nixpkgs> {}).sccache');
191194
195+
- run: nix-store --realise /nix/store/kq9b5w8mybvri9sfi8fazvqjxgavgclb-v8-14.3.127.18-node.12
192196
- name: Build Node.js and run tests
193197
run: |
194198
nix-shell \
195199
-I "nixpkgs=$TAR_DIR/tools/nix/pkgs.nix" \
196200
--pure --keep TAR_DIR --keep FLAKY_TESTS \
197201
--keep SCCACHE_GHA_ENABLED --keep ACTIONS_CACHE_SERVICE_V2 --keep ACTIONS_RESULTS_URL --keep ACTIONS_RUNTIME_TOKEN \
198202
--arg loadJSBuiltinsDynamically false \
199-
--arg useSeparateDerivationForV8 true \
203+
--argstr useSeparateDerivationForV8 '/nix/store/kq9b5w8mybvri9sfi8fazvqjxgavgclb-v8-14.3.127.18-node.12' \
200204
--arg ccache "${NIX_SCCACHE:-null}" \
201205
--arg devTools '[]' \
202206
--arg benchmarkTools '[]' \

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/default.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ symlinkJoin {
6363
"-lv8_zlib"
6464
]
6565
}
66-
Cflags: -I$out/include
66+
Cflags: -I$out/include -I$out/include/third_party/simdutf
6767
EOF
6868
install -Dm0644 v8-third_party.pc -t $out/lib/pkgconfig
6969
'';

tools/nix/v8-third_party/highway.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,6 @@ libhwy.overrideAttrs {
3535
src = fetchgit {
3636
inherit url rev hash;
3737
};
38+
39+
doCheck = false;
3840
}

tools/nix/v8-third_party/simdutf.nix

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,17 @@ stdenv.mkDerivation {
4141
buildPhase =
4242
if stdenv.buildPlatform.isDarwin then
4343
''
44-
$CXX -dynamiclib simdutf.cpp \
44+
$CXX -std=c++20 -dynamiclib simdutf.cpp \
4545
-o libsimdutf.dylib \
4646
-install_name $out/lib/libsimdutf.dylib
4747
''
4848
else
4949
''
50-
$CXX -fPIC -shared simdutf.cpp \
51-
-o libsimdutf.dylib
50+
$CXX -std=c++20 -fPIC -shared simdutf.cpp \
51+
-o libsimdutf.so
5252
'';
5353
installPhase = ''
54-
install -Dm0644 libsimdutf.dylib -t $out/lib
54+
install -Dm0644 libsimdutf.* -t $out/lib
5555
install -Dm0644 simdutf.h -t $out/include/third_party/simdutf
5656
5757
cat -> simdutf.pc <<EOF

tools/nix/v8-third_party/zlib.nix

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,29 @@ let
2929
else
3030
"sha256-d01Vdo+kZ43AhES5MYGFae67fH6L6ATh3xQadMu7Hw0=";
3131
in
32-
stdenv.mkDerivation {
32+
stdenv.mkDerivation (finalAttrs: {
3333
pname = "v8_zlib";
3434
version = "1.3.1";
3535

3636
src = fetchgit {
3737
inherit url rev hash;
3838
};
3939
postPatch = ''
40-
substituteInPlace CMakeLists.txt --replace-fail 'OUTPUT_NAME z' 'OUTPUT_NAME v8_zlib'
40+
substituteInPlace CMakeLists.txt \
41+
--replace-fail 'OUTPUT_NAME z' 'OUTPUT_NAME v8_zlib' \
42+
--replace-fail 'INSTALL_INC_DIR "''${CMAKE_INSTALL_PREFIX}/include"' 'INSTALL_INC_DIR "''${CMAKE_INSTALL_PREFIX}/include/third_party/zlib"' \
43+
--replace-fail 'set(ZLIB_PUBLIC_HDRS' 'set(ZLIB_PUBLIC_HDRS chromeconf.h google/compression_utils_portable.h' \
44+
--replace-fail 'set(ZLIB_SRCS' 'set(ZLIB_SRCS google/compression_utils_portable.cc'
45+
'';
46+
47+
NIX_CFLAGS_COMPILE = ''
48+
-DZLIB_IMPLEMENTATION
49+
-include ${finalAttrs.src}/chromeconf.h
4150
'';
4251

4352
nativeBuildInputs = [ cmake ];
4453
postInstall = ''
45-
mkdir -p $out/include/third_party/zlib
46-
mv $out/include/*.h $out/include/third_party/zlib/.
54+
mkdir $out/include/third_party/zlib/google
55+
mv $out/include/third_party/zlib/compression_utils_portable.h $out/include/third_party/zlib/google/.
4756
'';
48-
}
57+
})

tools/v8_gypfiles/v8.gyp

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2454,15 +2454,19 @@
24542454
'target_name': 'simdutf',
24552455
'type': 'static_library',
24562456
'toolsets': ['host', 'target'],
2457-
'direct_dependent_settings': {
2458-
'include_dirs': [
2459-
'<(V8_ROOT)/third_party/simdutf',
2460-
],
2461-
},
2462-
'include_dirs': ['.'],
2463-
'sources': [
2464-
'<(V8_ROOT)/third_party/simdutf/simdutf.cpp',
2465-
],
2457+
'conditions': [
2458+
['node_use_bundled_v8_third_party!="false"', {
2459+
'direct_dependent_settings': {
2460+
'include_dirs': [
2461+
'<(V8_ROOT)/third_party/simdutf',
2462+
],
2463+
},
2464+
'include_dirs': ['.'],
2465+
'sources': [
2466+
'<(V8_ROOT)/third_party/simdutf/simdutf.cpp',
2467+
],
2468+
}],
2469+
]
24662470
}, # simdutf
24672471
],
24682472
}

0 commit comments

Comments
 (0)