Skip to content

Commit 6101402

Browse files
committed
Update to node 24.1.0
This brings in a new major version of v8 and Various tweaks are needed: - upgrade the CI images to get a toolchain capable of compiling V8 - upgrade the macos image to macos-15-xlarge because the non-xlarge runner does not have enough memory - compile without debug info on the macos runner, otherwise it runs out of free disk space - patch a header file to pacify clang - link in V8's new dependencies abseil, highway and simdutf - disable ccache because it does not seem to play well with V8 anymore and is not otherwise useful for building on CI (hit rate: 0%)
1 parent 2397d48 commit 6101402

File tree

8 files changed

+109
-31
lines changed

8 files changed

+109
-31
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
jobs:
77
rubocop:
88
name: Lint (Rubocop)
9-
runs-on: ubuntu-20.04
9+
runs-on: ubuntu-24.04
1010
container: ruby:3.1
1111
steps:
1212
- name: Checkout
@@ -17,7 +17,7 @@ jobs:
1717
run: bundle exec rubocop -f simple
1818
shellcheck:
1919
name: Lint (Shellcheck)
20-
runs-on: ubuntu-20.04
20+
runs-on: ubuntu-24.04
2121
container: debian:10
2222
steps:
2323
- name: Checkout
@@ -30,7 +30,7 @@ jobs:
3030
name: Build (ruby)
3131
outputs:
3232
GEM_VERSION: ${{ steps.set-metadata.outputs.GEM_VERSION }}
33-
runs-on: ubuntu-20.04
33+
runs-on: ubuntu-24.04
3434
container: ruby:3.1
3535
steps:
3636
- name: Update Rubygems and Bundler
@@ -77,12 +77,11 @@ jobs:
7777
fail-fast: false
7878
matrix:
7979
platform:
80-
- x86_64
8180
- arm64
8281
name: Build (darwin)
8382
outputs:
8483
GEM_VERSION: ${{ steps.set-metadata.outputs.GEM_VERSION }}
85-
runs-on: macos-13
84+
runs-on: macos-15-xlarge
8685
env:
8786
TARGET_PLATFORM: ${{ matrix.platform }}-darwin
8887
RUBY_TARGET_PLATFORM: ${{ matrix.platform }}-darwin
@@ -162,7 +161,7 @@ jobs:
162161
name: Build (linux)
163162
outputs:
164163
GEM_VERSION: ${{ steps.set-metadata.outputs.GEM_VERSION }}
165-
runs-on: ubuntu-20.04
164+
runs-on: ubuntu-24.04
166165
steps:
167166
- name: Set cross-compilation platform
168167
id: platform
@@ -311,7 +310,7 @@ jobs:
311310
libc: musl
312311
name: Test (ruby) (${{ matrix.container.version }}, ${{ matrix.platform }}, ${{ matrix.container.libc }})
313312
needs: build-ruby
314-
runs-on: ubuntu-20.04
313+
runs-on: ubuntu-24.04
315314
container: ${{ matrix.container.image }}
316315
steps:
317316
- name: Install Alpine system dependencies
@@ -352,7 +351,7 @@ jobs:
352351
# arm64
353352
name: Test (darwin)
354353
needs: build-darwin
355-
runs-on: macos-13
354+
runs-on: macos-15-xlarge
356355
steps:
357356
- name: Set metadata
358357
id: set-metadata
@@ -404,7 +403,7 @@ jobs:
404403
libc: 'gnu'
405404
name: Test (linux)
406405
needs: build-linux
407-
runs-on: ubuntu-20.04
406+
runs-on: ubuntu-24.04
408407
steps:
409408
- name: Enable ${{ matrix.platform }} platform
410409
id: qemu

lib/libv8/node/version.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module Libv8
44
end
55

66
module Libv8::Node
7-
VERSION = '23.8.0.0'
8-
NODE_VERSION = '23.8.0'
9-
LIBV8_VERSION = '12.9.202.28' # from src/node-.../deps/v8/include/v8-version.h
7+
VERSION = '24.1.0.0'
8+
NODE_VERSION = '24.1.0'
9+
LIBV8_VERSION = '13.6.233.10' # from src/node-.../deps/v8/include/v8-version.h
1010
end

libexec/build-libv8

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ NJOBS="${NJOBS:-1}"
1414
echo "parallel job count: ${NJOBS}"
1515

1616
BUILDTYPE="${BUILDTYPE:-Release}"
17+
GITHUB_ACTIONS="${GITHUB_ACTIONS:-}"
1718

1819
cd "${src}/node-v${version}"
1920

@@ -42,5 +43,15 @@ if [ "$host_platform" != "$target_platform" ] && [ "${target_platform%%-*}" = "a
4243
find . -iname "*.host.mk" -exec sed -i '/-msign-return-address/d' {} ';'
4344
fi
4445

46+
if [ "${BUILDTYPE}" = "Release" ] && [ "${GITHUB_ACTIONS}" != "" ]; then
47+
case "${target_platform}" in
48+
arm64*-darwin*)
49+
# dwarf debug info for v8 is so massive the macos
50+
# builder runs out of disk space when it's enabled
51+
find out -name '*.mk' -exec sed -i '' -e 's/gdwarf-2/g0/g' {} ';'
52+
;;
53+
esac
54+
fi
55+
4556
export PATH="${PWD}/out/tools/bin:${PATH}"
46-
make -j"${NJOBS}" -C out BUILDTYPE="${BUILDTYPE}" V=0 CC=clang CC.host=clang CXX=clang++ CXX.host=clang++
57+
make -j"${NJOBS}" -C out BUILDTYPE="${BUILDTYPE}" V=

libexec/build-monolith

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ platform=$(uname)
2121
rm -f "${LIBV8_MONOLITH}"
2222
case "${platform}" in
2323
"SunOS")
24-
/usr/xpg4/bin/find . '(' '!' -path './icutools/deps/icu-small/source/stubdata/stubdata.o' ')' -path "./torque_*/**/*.o" -or -path "./v8*/**/*.o" -or -path "./icu*/**/*.o" | sort | uniq | xargs ar cq "${LIBV8_MONOLITH}"
24+
/usr/xpg4/bin/find . '(' '!' -path './icutools/deps/icu-small/source/stubdata/stubdata.o' ')' -path "./torque_*/**/*.o" -or -path "./v8*/**/*.o" -or -path "./icu*/**/*.o" -or -path './abseil/deps/v8/third_party/abseil-cpp/absl/**/*.o' -or -path './highway/deps/v8/third_party/highway/**/*.o' -or -path './simdutf/deps/v8/third_party/simdutf/*.o' | sort | uniq | xargs ar cq "${LIBV8_MONOLITH}"
2525
;;
2626
"Darwin")
27-
/usr/bin/find . '(' '!' -path './icutools/deps/icu-small/source/stubdata/stubdata.o' ')' -path "./torque_*/**/*.o" -or -path "./v8*/**/*.o" -or -path "./icu*/**/*.o" | sort | uniq | xargs /usr/bin/ar -cq "${LIBV8_MONOLITH}"
27+
/usr/bin/find . '(' '!' -path './icutools/deps/icu-small/source/stubdata/stubdata.o' ')' -path "./torque_*/**/*.o" -or -path "./v8*/**/*.o" -or -path "./icu*/**/*.o" -or -path './abseil/deps/v8/third_party/abseil-cpp/absl/**/*.o' -or -path './highway/deps/v8/third_party/highway/**/*.o' -or -path './simdutf/deps/v8/third_party/simdutf/*.o' | sort | uniq | xargs /usr/bin/ar -cq "${LIBV8_MONOLITH}"
2828
;;
2929
"Linux")
30-
find . '(' '!' -path './icutools/deps/icu-small/source/stubdata/stubdata.o' ')' -and '(' -path "./torque_*/**/*.o" -or -path "./v8*/**/*.o" -or -path "./icu*/**/*.o" ')' | sort | uniq | xargs ar -cqSP "${LIBV8_MONOLITH}"
30+
find . '(' '!' -path './icutools/deps/icu-small/source/stubdata/stubdata.o' ')' -and '(' -path "./torque_*/**/*.o" -or -path "./v8*/**/*.o" -or -path "./icu*/**/*.o" -or -path './abseil/deps/v8/third_party/abseil-cpp/absl/**/*.o' -or -path './highway/deps/v8/third_party/highway/**/*.o' -or -path './simdutf/deps/v8/third_party/simdutf/*.o' ')' | sort | uniq | xargs ar -cqSP "${LIBV8_MONOLITH}"
3131
ar -sP "${LIBV8_MONOLITH}"
3232
;;
3333
*)

libexec/extract-node

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ extract "${src}" "${src}/node-v${version}.tar.gz"
2929

3030
cd "${src}/node-v${version}"
3131

32+
patch -p1 < "${top}"/patch/v8-add-missing-typename.patch
3233
patch -p1 < "${top}"/patch/v8-std-is-trivially-destructible.patch
3334
patch -p1 < "${top}"/patch/v8-disable-madv-dontfork.patch
3435
patch -p1 < "${top}"/patch/v8-disable-pkey.patch

libexec/platform

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
set -e
44
set -u
55

6-
if command -v clang >/dev/null 2>&1; then
7-
CC="${CC:-clang}"
8-
CXX="${CXX:-clang++}"
9-
elif command -v gcc >/dev/null 2>&1; then
6+
if command -v gcc >/dev/null 2>&1; then
107
CC="${CC:-gcc}"
118
CXX="${CXX:-g++}"
9+
elif command -v clang >/dev/null 2>&1; then
10+
CC="${CC:-clang}"
11+
CXX="${CXX:-clang++}"
1212
elif command -v cc >/dev/null 2>&1; then
1313
CC="${CC:-cc}"
1414
CXX="${CXX:-c++}"
@@ -142,17 +142,17 @@ fi
142142
# ;;
143143
# esac
144144

145-
if command -v ccache >/dev/null 2>&1; then
146-
if [ -n "${CC:-}" ] && [ "${CC}" = "${CC#ccache}" ]; then
147-
CC="ccache ${CC}"
148-
CXX="ccache ${CXX}"
149-
fi
150-
151-
if [ -n "${CC_host:-}" ] && [ "${CC_host}" = "${CC_host#ccache}" ]; then
152-
CC_host="ccache ${CC_host}"
153-
CXX_host="ccache ${CXX_host}"
154-
fi
155-
fi
145+
#if command -v ccache >/dev/null 2>&1; then
146+
# if [ -n "${CC:-}" ] && [ "${CC}" = "${CC#ccache}" ]; then
147+
# CC="ccache ${CC}"
148+
# CXX="ccache ${CXX}"
149+
# fi
150+
#
151+
# if [ -n "${CC_host:-}" ] && [ "${CC_host}" = "${CC_host#ccache}" ]; then
152+
# CC_host="ccache ${CC_host}"
153+
# CXX_host="ccache ${CXX_host}"
154+
# fi
155+
#fi
156156

157157
cat <<EOF
158158
export CC='${CC}'

patch/v8-add-missing-typename.patch

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
diff --git a/deps/v8/src/objects/ordered-hash-table.h b/deps/v8/src/objects/ordered-hash-table.h
2+
index 0e1605d566..8145bb1b8a 100644
3+
--- a/deps/v8/src/objects/ordered-hash-table.h
4+
+++ b/deps/v8/src/objects/ordered-hash-table.h
5+
@@ -70,7 +70,7 @@ class OrderedHashTable : public FixedArray {
6+
// to add at least one new element.
7+
template <template <typename> typename HandleType>
8+
requires(std::is_convertible_v<HandleType<Derived>, DirectHandle<Derived>>)
9+
- static HandleType<Derived>::MaybeType EnsureCapacityForAdding(
10+
+ static typename HandleType<Derived>::MaybeType EnsureCapacityForAdding(
11+
Isolate* isolate, HandleType<Derived> table);
12+
13+
// Returns an OrderedHashTable (possibly |table|) that's shrunken
14+
@@ -218,11 +218,11 @@ class OrderedHashTable : public FixedArray {
15+
16+
template <template <typename> typename HandleType>
17+
requires(std::is_convertible_v<HandleType<Derived>, DirectHandle<Derived>>)
18+
- static HandleType<Derived>::MaybeType Rehash(Isolate* isolate,
19+
+ static typename HandleType<Derived>::MaybeType Rehash(Isolate* isolate,
20+
HandleType<Derived> table);
21+
template <template <typename> typename HandleType>
22+
requires(std::is_convertible_v<HandleType<Derived>, DirectHandle<Derived>>)
23+
- static HandleType<Derived>::MaybeType Rehash(Isolate* isolate,
24+
+ static typename HandleType<Derived>::MaybeType Rehash(Isolate* isolate,
25+
HandleType<Derived> table,
26+
int new_capacity);
27+
28+
@@ -287,7 +287,7 @@ class V8_EXPORT_PRIVATE OrderedHashSet
29+
template <template <typename> typename HandleType>
30+
requires(std::is_convertible_v<HandleType<OrderedHashSet>,
31+
DirectHandle<OrderedHashSet>>)
32+
- static HandleType<OrderedHashSet>::MaybeType Add(
33+
+ static typename HandleType<OrderedHashSet>::MaybeType Add(
34+
Isolate* isolate, HandleType<OrderedHashSet> table,
35+
DirectHandle<Object> value);
36+
static Handle<FixedArray> ConvertToKeysArray(Isolate* isolate,
37+
@@ -296,12 +296,12 @@ class V8_EXPORT_PRIVATE OrderedHashSet
38+
template <template <typename> typename HandleType>
39+
requires(std::is_convertible_v<HandleType<OrderedHashSet>,
40+
DirectHandle<OrderedHashSet>>)
41+
- static HandleType<OrderedHashSet>::MaybeType Rehash(
42+
+ static typename HandleType<OrderedHashSet>::MaybeType Rehash(
43+
Isolate* isolate, HandleType<OrderedHashSet> table);
44+
template <template <typename> typename HandleType>
45+
requires(std::is_convertible_v<HandleType<OrderedHashSet>,
46+
DirectHandle<OrderedHashSet>>)
47+
- static HandleType<OrderedHashSet>::MaybeType Rehash(
48+
+ static typename HandleType<OrderedHashSet>::MaybeType Rehash(
49+
Isolate* isolate, HandleType<OrderedHashSet> table, int new_capacity);
50+
51+
template <typename IsolateT>
52+
@@ -343,12 +343,12 @@ class V8_EXPORT_PRIVATE OrderedHashMap
53+
template <template <typename> typename HandleType>
54+
requires(std::is_convertible_v<HandleType<OrderedHashMap>,
55+
DirectHandle<OrderedHashMap>>)
56+
- static HandleType<OrderedHashMap>::MaybeType Rehash(
57+
+ static typename HandleType<OrderedHashMap>::MaybeType Rehash(
58+
Isolate* isolate, HandleType<OrderedHashMap> table);
59+
template <template <typename> typename HandleType>
60+
requires(std::is_convertible_v<HandleType<OrderedHashMap>,
61+
DirectHandle<OrderedHashMap>>)
62+
- static HandleType<OrderedHashMap>::MaybeType Rehash(
63+
+ static typename HandleType<OrderedHashMap>::MaybeType Rehash(
64+
Isolate* isolate, HandleType<OrderedHashMap> table, int new_capacity);
65+
66+
void SetEntry(InternalIndex entry, Tagged<Object> key, Tagged<Object> value);

sums/v24.1.0.sum

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
b565cba1dd8f2eb3db7c95e0c3a87ecc5e77f079611ea6a3688531511383ec72

0 commit comments

Comments
 (0)