Bug 1942260 - Build node 22 for Linux from source. r=firefox-build-system-reviewers,sergesanspaille

While here, build node 18 on faster workers.

Differential Revision: https://phabricator.services.mozilla.com/D243081
This commit is contained in:
Mike Hommey
2025-05-20 16:23:47 +00:00
committed by mbanner@mozilla.com
parent 1ec46baf57
commit d131c7ed2e
3 changed files with 31 additions and 0 deletions

View File

@@ -631,6 +631,17 @@ nodejs-18-source:
strip-components: 1 strip-components: 1
add-prefix: node/ add-prefix: node/
nodejs-22-source:
description: nodejs 22 source
fetch:
type: static-url
url: https://nodejs.org/dist/v22.11.0/node-v22.11.0.tar.gz
sha256: 24e5130fa7bc1eaab218a0c9cb05e03168fa381bb9e3babddc6a11f655799222
size: 96927828
artifact-name: nodejs.tar.zst
strip-components: 1
add-prefix: node/
gnumake: gnumake:
description: GNU make source description: GNU make source
fetch: fetch:

View File

@@ -26,6 +26,7 @@ linux64-node-18:
description: "Node toolchain build" description: "Node toolchain build"
treeherder: treeherder:
symbol: TL(node-18) symbol: TL(node-18)
worker-type: b-linux-large-gcp
run: run:
script: build-nodejs.sh script: build-nodejs.sh
toolchain-alias: toolchain-alias:
@@ -37,6 +38,22 @@ linux64-node-18:
- linux64-gcc-11 - linux64-gcc-11
- linux64-toolchain-sysroot-gcc10 - linux64-toolchain-sysroot-gcc10
linux64-node-22:
# The upstream prebuilt binary requires glibc 2.28, which is too recent for Ubuntu 18.04,
# so we build our own that won't have that requirement.
description: "Node toolchain build"
treeherder:
symbol: TL(node-22)
worker-type: b-linux-large-gcp
run:
script: build-nodejs.sh
fetches:
fetch:
- nodejs-22-source
toolchain:
- linux64-gcc-11
- linux64-toolchain-sysroot-gcc10
linux64-aarch64-node-18: linux64-aarch64-node-18:
treeherder: treeherder:
symbol: TLA64(node-18) symbol: TLA64(node-18)

View File

@@ -14,6 +14,9 @@ export LDFLAGS="--sysroot=$MOZ_FETCHES_DIR/sysroot -L$MOZ_FETCHES_DIR/sysroot/li
export CC=$MOZ_FETCHES_DIR/gcc/bin/gcc export CC=$MOZ_FETCHES_DIR/gcc/bin/gcc
export CXX=$MOZ_FETCHES_DIR/gcc/bin/g++ export CXX=$MOZ_FETCHES_DIR/gcc/bin/g++
# The glibc in our sysroot doesn't have `sys/random.h`/`getrandom`.
sed -i '/HAVE_SYS_RANDOM_H/d;/HAVE_GETRANDOM/d' deps/cares/config/linux/ares_config.h
# --partly-static allows the resulting binary to run on Ubuntu 18.04 (which has libstdc++ 8) # --partly-static allows the resulting binary to run on Ubuntu 18.04 (which has libstdc++ 8)
./configure --verbose --prefix=/ --partly-static ./configure --verbose --prefix=/ --partly-static
make -j$(nproc) install DESTDIR=$workspace/$project make -j$(nproc) install DESTDIR=$workspace/$project