From d131c7ed2e9686f20cb51badd76c5b6cc63b83f5 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Tue, 20 May 2025 16:23:47 +0000 Subject: [PATCH] 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 --- taskcluster/kinds/fetch/toolchains.yml | 11 +++++++++++ taskcluster/kinds/toolchain/node.yml | 17 +++++++++++++++++ taskcluster/scripts/misc/build-nodejs.sh | 3 +++ 3 files changed, 31 insertions(+) diff --git a/taskcluster/kinds/fetch/toolchains.yml b/taskcluster/kinds/fetch/toolchains.yml index 3098a9352390..463c349d51ab 100644 --- a/taskcluster/kinds/fetch/toolchains.yml +++ b/taskcluster/kinds/fetch/toolchains.yml @@ -631,6 +631,17 @@ nodejs-18-source: strip-components: 1 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: description: GNU make source fetch: diff --git a/taskcluster/kinds/toolchain/node.yml b/taskcluster/kinds/toolchain/node.yml index eef46dba42ac..50b8744835de 100644 --- a/taskcluster/kinds/toolchain/node.yml +++ b/taskcluster/kinds/toolchain/node.yml @@ -26,6 +26,7 @@ linux64-node-18: description: "Node toolchain build" treeherder: symbol: TL(node-18) + worker-type: b-linux-large-gcp run: script: build-nodejs.sh toolchain-alias: @@ -37,6 +38,22 @@ linux64-node-18: - linux64-gcc-11 - 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: treeherder: symbol: TLA64(node-18) diff --git a/taskcluster/scripts/misc/build-nodejs.sh b/taskcluster/scripts/misc/build-nodejs.sh index d1772ce15677..399c4dc5d53e 100755 --- a/taskcluster/scripts/misc/build-nodejs.sh +++ b/taskcluster/scripts/misc/build-nodejs.sh @@ -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 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) ./configure --verbose --prefix=/ --partly-static make -j$(nproc) install DESTDIR=$workspace/$project