Skip to content

Commit 82f41e3

Browse files
committed
v23.0.0
1 parent ad9ba3e commit 82f41e3

File tree

6 files changed

+134
-16
lines changed

6 files changed

+134
-16
lines changed

.github/workflows/build.yml

Lines changed: 87 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ on:
77
workflow_dispatch:
88

99
jobs:
10-
build:
11-
name: build
10+
x86_64-linux:
11+
name: x86_64-linux
1212
runs-on: ubuntu-24.04
1313
steps:
1414

@@ -40,16 +40,99 @@ jobs:
4040
--volume $PWD:/workspace \
4141
--workdir /workspace \
4242
rust:alpine-mimalloc \
43-
/workspace/build.sh
43+
/workspace/build-alpine.sh
44+
45+
- name: upload-artifact
46+
uses: actions/upload-artifact@v4
47+
with:
48+
name: node-linux-x86_64
49+
path: node-v*-linux-x64-static.tar.xz
4450

4551
- name: test-node
4652
run: |
4753
tar xJf node-v*-linux-x64-static.tar.xz
4854
export PATH=$PWD/node-v*-linux-x64-static/bin:$PATH
4955
npm install @bjorn3/browser_wasi_shim
5056
57+
aarch64-linux:
58+
name: aarch64-linux
59+
runs-on: ubuntu-24.04
60+
steps:
61+
62+
- name: setup-podman
63+
uses: TerrorJack/setup-podman@master
64+
65+
- name: checkout
66+
uses: actions/checkout@v4
67+
68+
- name: build-node
69+
run: |
70+
podman run \
71+
--init \
72+
--network host \
73+
--rm \
74+
--tmpfs /tmp:exec \
75+
--volume $PWD:/workspace \
76+
--workdir /workspace \
77+
chimeralinux/chimera \
78+
/workspace/build-chimera.sh
79+
5180
- name: upload-artifact
5281
uses: actions/upload-artifact@v4
5382
with:
54-
name: node-linux-x64-static
83+
name: node-linux-aarch64
5584
path: node-v*-linux-x64-static.tar.xz
85+
86+
- name: test-node
87+
run: |
88+
tar xJf node-v*-linux-x64-static.tar.xz
89+
export PATH=$PWD/node-v*-linux-x64-static/bin:$PATH
90+
npm install @bjorn3/browser_wasi_shim
91+
92+
darwin:
93+
name: ${{ matrix.arch }}-darwin
94+
runs-on: ${{ matrix.os }}
95+
strategy:
96+
matrix:
97+
include:
98+
- arch: aarch64
99+
os: macos-15
100+
- arch: x86_64
101+
os: macos-15-large
102+
steps:
103+
104+
- name: setup-xcode
105+
run: |
106+
sudo xcode-select --switch /Applications/Xcode_16.1.app
107+
108+
- name: checkout
109+
uses: actions/checkout@v4
110+
111+
- name: build-node
112+
run: |
113+
set -euo pipefail
114+
115+
node_ver=v23.0.0
116+
117+
pushd "$(mktemp -d)"
118+
119+
curl -f -L --retry 5 https://github.com/nodejs/node/archive/refs/tags/$node_ver.tar.gz | tar xz --strip-components=1
120+
patch -p1 -i $GITHUB_WORKSPACE/bump-v8-wasm-limits.diff
121+
122+
make -j$(curl -f -L --retry 5 https://gitlab.haskell.org/ghc/ghc/-/raw/master/mk/detect-cpu-count.sh | sh) binary CONFIG_FLAGS="--v8-disable-maglev"
123+
124+
mv node-$node_ver-*.tar.xz $GITHUB_WORKSPACE
125+
126+
popd
127+
128+
- name: upload-artifact
129+
uses: actions/upload-artifact@v4
130+
with:
131+
name: node-darwin-${{ matrix.arch }}
132+
path: node-v*.tar.xz
133+
134+
- name: test-node
135+
run: |
136+
tar xJf node-v*.tar.xz
137+
export PATH=$PWD/node-v*/bin:$PATH
138+
npm install @bjorn3/browser_wasi_shim

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# `node-static`
22

3-
Highly opinionated x86_64-linux nodejs build, fully statically linked,
4-
with increased V8 wasm limits, pointer compression and mimalloc.
5-
Should be fast when it works, but it doesn't work with native addons,
6-
so don't use it in your project unless you know what you're doing.
3+
Highly opinionated nodejs build, fully statically linked with
4+
musl/mimalloc on linux, with increased V8 wasm limits. Don't use it in
5+
your own project unless you know what you're doing.

build.sh renamed to build-alpine.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
set -eu
44

5-
node_ver=v22.9.0
5+
node_ver=v23.0.0
66

77
apk add \
88
linux-headers \
@@ -12,12 +12,11 @@ apk add \
1212
cd "$(mktemp -d)"
1313

1414
curl -f -L --retry 5 https://nodejs.org/dist/$node_ver/node-$node_ver.tar.xz | tar xJ --strip-components=1
15-
sed -i -e '/v8_enable_sandbox/d' configure.py
1615
patch -p1 -i /workspace/bump-v8-wasm-limits.diff
17-
patch -p1 -i /workspace/use-etc-ssl-certs.patch
16+
patch -p1 -i /workspace/use-etc-ssl-certs.diff
1817

1918
make -j"$(nproc)" binary \
20-
CONFIG_FLAGS="--experimental-enable-pointer-compression --fully-static --openssl-use-def-ca-store" \
19+
CONFIG_FLAGS="--fully-static --openssl-use-def-ca-store --v8-disable-maglev" \
2120
VARIATION="static"
2221

2322
mv node-$node_ver-linux-x64-static.tar.xz /workspace

build-chimera.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/bin/sh
2+
3+
set -eu
4+
5+
node_ver=v23.0.0
6+
7+
apk add --no-interactive \
8+
base-cross-aarch64 \
9+
bsdtar \
10+
chimerautils-extra \
11+
curl \
12+
gmake \
13+
libatomic-chimera-cross-aarch64-static \
14+
libatomic-chimera-devel-static \
15+
libcxx-cross-aarch64-static \
16+
libcxx-devel-static \
17+
libcxxabi-cross-aarch64-static \
18+
libcxxabi-devel-static \
19+
libunwind-cross-aarch64-static \
20+
libunwind-devel-static \
21+
linux-headers \
22+
linux-headers-cross-aarch64 \
23+
musl-cross-aarch64-static \
24+
musl-devel-static \
25+
python
26+
27+
cd "$(mktemp -d)"
28+
29+
curl -f -L --retry 5 https://nodejs.org/dist/$node_ver/node-$node_ver.tar.xz | tar xJ --strip-components=1
30+
patch -p1 -i /workspace/bump-v8-wasm-limits.diff
31+
patch -p1 -i /workspace/use-etc-ssl-certs.diff
32+
33+
CC=aarch64-chimera-linux-musl-clang CXX=aarch64-chimera-linux-musl-clang++ CC_host=clang CXX_host=clang++ gmake -j"$(nproc)" binary \
34+
CONFIG_FLAGS="--dest-cpu=arm64 --fully-static --openssl-use-def-ca-store --v8-disable-maglev" \
35+
VARIATION="static"
36+
37+
mv node-$node_ver-linux-x64-static.tar.xz /workspace

bump-v8-wasm-limits.diff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
diff --git a/deps/v8/src/wasm/wasm-limits.h b/deps/v8/src/wasm/wasm-limits.h
2-
index c2a2fe6a50..56e3acd4e1 100644
2+
index e3f8b94b..abd09e1e 100644
33
--- a/deps/v8/src/wasm/wasm-limits.h
44
+++ b/deps/v8/src/wasm/wasm-limits.h
55
@@ -28,8 +28,8 @@ constexpr size_t kSpecMaxMemory64Pages = 262'144; // 16GB
66
// The limits are agreed upon with other engines for consistency.
77
constexpr size_t kV8MaxWasmTypes = 1'000'000;
8-
constexpr size_t kV8MaxWasmFunctions = 1'000'000;
8+
constexpr size_t kV8MaxWasmDefinedFunctions = 1'000'000;
99
-constexpr size_t kV8MaxWasmImports = 100'000;
1010
-constexpr size_t kV8MaxWasmExports = 100'000;
1111
+constexpr size_t kV8MaxWasmImports = 1'000'000;

use-etc-ssl-certs.patch renamed to use-etc-ssl-certs.diff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
diff --git a/deps/openssl/openssl/include/internal/cryptlib.h b/deps/openssl/openssl/include/internal/cryptlib.h
2-
index 329ef62..9a8df64 100644
2+
index 934d4b08..d45248e5 100644
33
--- a/deps/openssl/openssl/include/internal/cryptlib.h
44
+++ b/deps/openssl/openssl/include/internal/cryptlib.h
5-
@@ -56,7 +56,7 @@ DEFINE_LHASH_OF(MEM);
5+
@@ -66,7 +66,7 @@ DEFINE_LHASH_OF(MEM);
66
# ifndef OPENSSL_SYS_VMS
77
# define X509_CERT_AREA OPENSSLDIR
88
# define X509_CERT_DIR OPENSSLDIR "/certs"

0 commit comments

Comments
 (0)