From 2e1c6651bc8a1206fbb3a38a38ab5f4d7360dc90 Mon Sep 17 00:00:00 2001 From: vitaliylag Date: Thu, 3 Jul 2025 19:59:08 +0400 Subject: [PATCH 01/24] Fix CentOS 7 recipes --- bin/copy-recipes.sh | 52 +++++++++++++++ recipes/x64-glibc-217/Dockerfile | 42 ++++-------- .../files/etc__yum.repos.d__devtoolset.repo | 4 ++ .../x64-glibc-217/files/installFromSourceCode | 36 ++++++++++ .../x64-glibc-217/files/installPrerequisites | 12 ++++ .../x64-glibc-217/files/opt__gcc15__enable | 15 +++++ recipes/x64-glibc-217/run.sh | 64 +++++++++++------- recipes/x64-glibc-217/run_other.sh | 9 +++ recipes/x64-glibc-217/run_versions.sh | 15 +++++ recipes/x64-glibc-217/should-build.sh | 2 +- recipes/x64-pointer-compression/Dockerfile | 54 ++++----------- .../x64-pointer-compression/cloudlinux.repo | 9 --- .../files/etc__yum.repos.d__devtoolset.repo | 4 ++ .../files/installFromSourceCode | 36 ++++++++++ .../files/installPrerequisites | 12 ++++ .../files/opt__gcc15__enable | 15 +++++ recipes/x64-pointer-compression/run.sh | 64 ++++++++++++------ recipes/x64-pointer-compression/run_other.sh | 6 ++ .../x64-pointer-compression/run_versions.sh | 15 +++++ .../x64-pointer-compression/should-build.sh | 2 +- recipes/x86/Dockerfile | 33 ++++------ recipes/x86/cloudlinux.repo | 9 --- .../files/etc__yum.repos.d__devtoolset.repo | 4 ++ recipes/x86/files/etc__yum.repos.d__epel.repo | 4 ++ recipes/x86/files/installFromSourceCode | 36 ++++++++++ recipes/x86/files/installPrerequisites | 16 +++++ recipes/x86/files/opt__gcc15__enable | 15 +++++ recipes/x86/run.sh | 66 ++++++++++++------- recipes/x86/run_other.sh | 34 ++++++++++ recipes/x86/run_versions.sh | 18 +++++ recipes/x86/should-build.sh | 3 +- 31 files changed, 531 insertions(+), 175 deletions(-) create mode 100755 bin/copy-recipes.sh create mode 100644 recipes/x64-glibc-217/files/etc__yum.repos.d__devtoolset.repo create mode 100644 recipes/x64-glibc-217/files/installFromSourceCode create mode 100644 recipes/x64-glibc-217/files/installPrerequisites create mode 100644 recipes/x64-glibc-217/files/opt__gcc15__enable create mode 100644 recipes/x64-glibc-217/run_other.sh create mode 100644 recipes/x64-glibc-217/run_versions.sh delete mode 100644 recipes/x64-pointer-compression/cloudlinux.repo create mode 100644 recipes/x64-pointer-compression/files/etc__yum.repos.d__devtoolset.repo create mode 100644 recipes/x64-pointer-compression/files/installFromSourceCode create mode 100644 recipes/x64-pointer-compression/files/installPrerequisites create mode 100644 recipes/x64-pointer-compression/files/opt__gcc15__enable create mode 100644 recipes/x64-pointer-compression/run_other.sh create mode 100644 recipes/x64-pointer-compression/run_versions.sh delete mode 100644 recipes/x86/cloudlinux.repo create mode 100644 recipes/x86/files/etc__yum.repos.d__devtoolset.repo create mode 100644 recipes/x86/files/etc__yum.repos.d__epel.repo create mode 100644 recipes/x86/files/installFromSourceCode create mode 100644 recipes/x86/files/installPrerequisites create mode 100644 recipes/x86/files/opt__gcc15__enable create mode 100644 recipes/x86/run_other.sh create mode 100644 recipes/x86/run_versions.sh diff --git a/bin/copy-recipes.sh b/bin/copy-recipes.sh new file mode 100755 index 0000000..f7908b5 --- /dev/null +++ b/bin/copy-recipes.sh @@ -0,0 +1,52 @@ +#!/bin/bash -eu + +# Copies files from recipes/x64-glibc-217 to: +# recipes/x64-pointer-compression +# recipes/x86 + +__dirname="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +recipesDir="$(dirname "$__dirname")/recipes" +srcRecipeDir="$recipesDir/x64-glibc-217" + + + +# Copy to x64-pointer-compression + +for dirBase in x64-pointer-compression; do + destRecipeDir="$recipesDir/$dirBase" + mkdir -p "$destRecipeDir/files" + + cp -f "$srcRecipeDir/Dockerfile" "$destRecipeDir/" + cp -f "$srcRecipeDir/run.sh" "$destRecipeDir/" + # cp -f "$srcRecipeDir/run_other.sh" "$destRecipeDir/" # Recipe specific code + cp -f "$srcRecipeDir/run_versions.sh" "$destRecipeDir/" + # cp -f "$srcRecipeDir/should-build.sh" "$destRecipeDir/" # Pointer compression is supported from v13.4 + cp -rf "$srcRecipeDir/files/"* "$destRecipeDir/files/" +done + + + +# Copy to x86 + +if true; then + destRecipeDir="$recipesDir/x86" + mkdir -p "$destRecipeDir/files" + + cp -f "$srcRecipeDir/Dockerfile" "$destRecipeDir/" + cp -f "$srcRecipeDir/run.sh" "$destRecipeDir/" + # cp -f "$srcRecipeDir/run_other.sh" "$destRecipeDir/" # Recipe specific code + # cp -f "$srcRecipeDir/run_versions.sh" "$destRecipeDir/" # Different versions of programs are used (because devtoolset-12 is not available) + # cp -f "$srcRecipeDir/should-build.sh" "$destRecipeDir/" + + # cp -f "$srcRecipeDir/files/"*.repo "$destRecipeDir/files/" # Different versions of programs are used (because devtoolset-12 is not available) + # cp -f "$srcRecipeDir/files/installPrerequisites" "$destRecipeDir/files/" # Different versions of programs are used (because devtoolset-12 is not available) + cp -f "$srcRecipeDir/files/installFromSourceCode" "$destRecipeDir/files/" + cp -f "$srcRecipeDir/files/opt__gcc15__enable" "$destRecipeDir/files/" + + sed -i -e 's/ --platform=linux\/amd64 / --platform=linux\/386 /g' "$destRecipeDir/Dockerfile" + sed -i -E 's/# RUN (.* binutils )/RUN \1/g' "$destRecipeDir/Dockerfile" + sed -i -E 's/--build=x86_64-redhat-linux/--build=i686-redhat-linux/g' "$destRecipeDir/Dockerfile" + # sed -i -e 's/gcc-15.1.0/gcc-12.4.0/g' "$destRecipeDir/Dockerfile" + # sed -i -e 's/gcc15/gcc12/g' "$destRecipeDir/Dockerfile" "$destRecipeDir/files/opt__gcc12__enable" "$destRecipeDir/files/installFromSourceCode" + sed -i -e 's/devtoolset-12/devtoolset-9/g' "$destRecipeDir/files/opt__gcc"*'__enable' +fi diff --git a/recipes/x64-glibc-217/Dockerfile b/recipes/x64-glibc-217/Dockerfile index f83868d..01856fa 100644 --- a/recipes/x64-glibc-217/Dockerfile +++ b/recipes/x64-glibc-217/Dockerfile @@ -1,4 +1,4 @@ -FROM centos:7 +FROM --platform=linux/amd64 centos:7 ARG GID=1000 ARG UID=1000 @@ -6,34 +6,18 @@ ARG UID=1000 RUN groupadd --gid $GID node \ && adduser --gid $GID --uid $UID node -RUN cat </dev/null && ./contrib/download_prerequisites +./configure $configureArgsStr +make -j $(nproc) +make install + +hash -r +ccache -s > "/root/ccacheStat_$name.txt" diff --git a/recipes/x64-glibc-217/files/installPrerequisites b/recipes/x64-glibc-217/files/installPrerequisites new file mode 100644 index 0000000..38ba177 --- /dev/null +++ b/recipes/x64-glibc-217/files/installPrerequisites @@ -0,0 +1,12 @@ +#!/bin/bash -eux + +sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* +sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* +yum install -y epel-release # Adds extra repos +yum upgrade -y + +yum install -y bzip2 # Required to compile gcc +yum install -y gcc-c++ # Required to compile Node.js v7- +yum install -y make # Allows compilation +yum install -y ccache # Allows caching +yum install -y devtoolset-12 # Includes gcc 12.1.1 diff --git a/recipes/x64-glibc-217/files/opt__gcc15__enable b/recipes/x64-glibc-217/files/opt__gcc15__enable new file mode 100644 index 0000000..f25221a --- /dev/null +++ b/recipes/x64-glibc-217/files/opt__gcc15__enable @@ -0,0 +1,15 @@ +#!/bin/bash -eux + +DIR=/opt/gcc15 + +source /opt/rh/devtoolset-12/enable + +export PATH="$DIR/bin${PATH:+:${PATH}}" +export MANPATH="$DIR/share/man${MANPATH:+:${MANPATH}}" +export INFOPATH="$DIR/share/info${INFOPATH:+:${INFOPATH}}" +export LD_LIBRARY_PATH="$DIR/lib64:$DIR/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}" +export PKG_CONFIG_PATH="$DIR/lib64/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}}" + +if [ -f "$DIR/bin/gcc" ]; then + export LDFLAGS='-static-libstdc++' +fi diff --git a/recipes/x64-glibc-217/run.sh b/recipes/x64-glibc-217/run.sh index 740e069..0138d6e 100755 --- a/recipes/x64-glibc-217/run.sh +++ b/recipes/x64-glibc-217/run.sh @@ -1,7 +1,8 @@ -#!/usr/bin/env bash +#!/bin/bash -eux -set -e -set -x + + +# Init release_urlbase="$1" disttype="$2" @@ -11,37 +12,55 @@ commit="$5" fullversion="$6" source_url="$7" source_urlbase="$8" -config_flags="" -cd /home/node +homeDir=/home/node +nodeDir="$homeDir/node-$fullversion" + +tar --directory="$homeDir" -xf "$homeDir/node.tar.xz" -tar -xf node.tar.xz -# configuring cares correctly to not use sys/random.h on this target -cd "node-${fullversion}"/deps/cares -sed -i 's/define HAVE_SYS_RANDOM_H 1/undef HAVE_SYS_RANDOM_H/g' ./config/linux/ares_config.h -sed -i 's/define HAVE_GETRANDOM 1/undef HAVE_GETRANDOM/g' ./config/linux/ares_config.h -# fix https://github.com/c-ares/c-ares/issues/850 -if [[ "$(grep -o 'ARES_VERSION_STR "[^"]*"' ./include/ares_version.h | awk '{print $2}' | tr -d '"')" == "1.33.0" ]]; then - sed -i 's/MSG_FASTOPEN/TCP_FASTOPEN_CONNECT/g' ./src/lib/ares__socket.c +# Patch the code + +# Configuring cares correctly to not use sys/random.h on this target +cd "$nodeDir/deps/cares/config/linux" +sed -i 's/define HAVE_SYS_RANDOM_H 1/undef HAVE_SYS_RANDOM_H/g' ares_config.h +sed -i 's/define HAVE_GETRANDOM 1/undef HAVE_GETRANDOM/g' ares_config.h + +# Fix https://github.com/c-ares/c-ares/issues/850 +cd "$nodeDir/deps/cares" +if [[ "$(grep -o 'ARES_VERSION_STR "[^"]*"' include/ares_version.h | awk '{print $2}' | tr -d '"')" == "1.33.0" ]]; then + sed -i 's/MSG_FASTOPEN/TCP_FASTOPEN_CONNECT/g' src/lib/ares__socket.c fi -cd /home/node +# Linux implementation of experimental WASM memory control requires Linux 3.17 & glibc 2.27 so disable it +cd "$nodeDir/deps/v8/src" +[ -f d8/d8.cc ] && sed -i -e 's/#if V8_TARGET_OS_LINUX/#if false/g' wasm/wasm-objects.cc d8/d8.cc + -cd "node-${fullversion}" -export CC="ccache gcc" -export CXX="ccache g++" +# Prepare to compile Node.js + export MAJOR_VERSION=$(echo ${fullversion} | cut -d . -f 1 | tr --delete v) -. /opt/rh/devtoolset-12/enable -. /opt/rh/rh-python38/enable +source "$homeDir/run_other.sh" +source "$homeDir/run_versions.sh" + +setPython +setGCC + + + +# Compile Node.js + +cd "$nodeDir" +export CC='ccache gcc' +export CXX='ccache g++' make -j$(getconf _NPROCESSORS_ONLN) binary V= \ - DESTCPU="x64" \ - ARCH="x64" \ - VARIATION="glibc-217" \ + DESTCPU="$destCPU" \ + ARCH="$arch" \ + VARIATION="$variation" \ DISTTYPE="$disttype" \ CUSTOMTAG="$customtag" \ DATESTRING="$datestring" \ @@ -49,4 +68,5 @@ make -j$(getconf _NPROCESSORS_ONLN) binary V= \ RELEASE_URLBASE="$release_urlbase" \ CONFIG_FLAGS="$config_flags" +"$nodeDir/node" -p process.versions mv node-*.tar.?z /out/ diff --git a/recipes/x64-glibc-217/run_other.sh b/recipes/x64-glibc-217/run_other.sh new file mode 100644 index 0000000..f09863c --- /dev/null +++ b/recipes/x64-glibc-217/run_other.sh @@ -0,0 +1,9 @@ +#!/bin/bash -eux + +config_flags= +destCPU=x64 +arch=x64 +variation=glibc-217 + +# export CFLAGS='-march=skylake' +# export CXXFLAGS='-march=skylake' diff --git a/recipes/x64-glibc-217/run_versions.sh b/recipes/x64-glibc-217/run_versions.sh new file mode 100644 index 0000000..4870f18 --- /dev/null +++ b/recipes/x64-glibc-217/run_versions.sh @@ -0,0 +1,15 @@ +#!/bin/bash -eux + +setPython() { + if [ "$MAJOR_VERSION" -ge 23 ]; then export PYTHON='python3.13'; return; fi # Python 3.13: Node.js v22.3 ~ latest (v24.3) + if [ "$MAJOR_VERSION" -ge 15 ]; then export PYTHON='python3.9'; return; fi # Python 3.9: Node.js v14.14 ~ latest (v24.3) + if [ "$MAJOR_VERSION" -ge 4 ]; then export PYTHON='python2.7'; return; fi # Python 2.7: Node.js v4.0 ~ v15.14 (latest) + + # Node.js v16.0 is first version not supporting Python 2.7 but supports Python 3.6 ~ 3.9 so Python 3.9 is chosen +} + +setGCC() { + if [ "$MAJOR_VERSION" -ge 23 ]; then source /opt/gcc15/enable; return; fi # GCC 15.1: Node.js v22.3 ~ latest (v24.3) (v22.3~v22.17 has more compilation warnings) + if [ "$MAJOR_VERSION" -ge 8 ]; then source /opt/rh/devtoolset-12/enable; return; fi # GCC 12.1: Node.js v8.0 ~ v23.7 + # GCC 4.8.5: Node.js v4.0 ~ v10.14 (v9.0~v10.2 have compatibility warning by Node.js) +} diff --git a/recipes/x64-glibc-217/should-build.sh b/recipes/x64-glibc-217/should-build.sh index 2453d49..82d438d 100755 --- a/recipes/x64-glibc-217/should-build.sh +++ b/recipes/x64-glibc-217/should-build.sh @@ -7,4 +7,4 @@ fullversion=$2 decode "$fullversion" -test "$major" -ge "18" +[ "$major" -ge 7 ] || ( [ "$major" -eq 6 ] && [ "$minor" -ge 2 ] ) diff --git a/recipes/x64-pointer-compression/Dockerfile b/recipes/x64-pointer-compression/Dockerfile index 84ddff6..01856fa 100644 --- a/recipes/x64-pointer-compression/Dockerfile +++ b/recipes/x64-pointer-compression/Dockerfile @@ -1,4 +1,4 @@ -FROM centos:7 +FROM --platform=linux/amd64 centos:7 ARG GID=1000 ARG UID=1000 @@ -6,46 +6,18 @@ ARG UID=1000 RUN groupadd --gid $GID node \ && adduser --gid $GID --uid $UID node -COPY cloudlinux.repo /etc/yum.repos.d/cloudlinux.repo - -# patch repos and install base dependencies -RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* \ - && sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* \ - && yum install -y epel-release \ - && yum upgrade -y \ - && yum install -y \ - git \ - curl \ - make \ - python2 \ - ccache \ - xz-utils \ - devtoolset-8 \ - devtoolset-9 \ - glibc-devel - -# installs c compiler dev tools and builds python >=3.8 from source as it is needed for node >=v22 -ENV PYTHON_VERSION="3.10.15" -RUN yum groupinstall -y "Development Tools" \ - && yum install -y \ - gcc \ - gcc-c++ \ - make \ - zlib-devel \ - bzip2-devel \ - openssl-devel \ - libffi-devel \ - sqlite-devel \ - readline-devel \ - && curl https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz -O \ - && tar xzf Python-${PYTHON_VERSION}.tgz \ - && cd Python-${PYTHON_VERSION} \ - && ./configure --enable-optimizations \ - && make altinstall \ - && PYTHON_MAJOR_MINOR_VERSION=$(echo $PYTHON_VERSION | cut -d. -f1,2) \ - && ln -sf /usr/local/bin/python${PYTHON_MAJOR_MINOR_VERSION} /usr/bin/python3 - -COPY --chown=node:node run.sh /home/node/run.sh +COPY --chmod=755 files/installPrerequisites /root/installPrerequisites +COPY files/*.repo /etc/yum.repos.d/ +RUN /root/installPrerequisites + +COPY --chmod=755 files/installFromSourceCode /root/installFromSourceCode +COPY --chmod=755 files/opt__gcc15__enable /opt/gcc15/enable +RUN --mount=type=cache,target=/root/.ccache --mount=type=tmpfs,target=/usr/src /root/installFromSourceCode python3 https://www.python.org/ftp/python/3.9.23/Python-3.9.23.tar.xz '--prefix=/usr/local/' +RUN --mount=type=cache,target=/root/.ccache --mount=type=tmpfs,target=/usr/src /root/installFromSourceCode python3 https://www.python.org/ftp/python/3.13.5/Python-3.13.5.tar.xz '--prefix=/usr/local/' +RUN --mount=type=cache,target=/root/.ccache --mount=type=tmpfs,target=/usr/src /root/installFromSourceCode gcc https://gcc.gnu.org/pub/gcc/releases/gcc-15.1.0/gcc-15.1.0.tar.xz '--prefix=/opt/gcc15/ --with-default-libstdcxx-abi=gcc4-compatible --enable-languages=c,c++ --enable-checking=release --enable-gnu-indirect-function --with-linker-hash-style=gnu --disable-bootstrap --disable-multilib --build=x86_64-redhat-linux' +# RUN --mount=type=cache,target=/root/.ccache --mount=type=tmpfs,target=/usr/src /root/installFromSourceCode binutils https://sourceware.org/pub/binutils/releases/binutils-2.44.tar.xz '--prefix=/opt/gcc15/ --without-debuginfod --disable-nls LDFLAGS=-pthread' + +COPY --chmod=755 --chown=node:node run.sh run_other.sh run_versions.sh /home/node/ VOLUME /home/node/.ccache VOLUME /out diff --git a/recipes/x64-pointer-compression/cloudlinux.repo b/recipes/x64-pointer-compression/cloudlinux.repo deleted file mode 100644 index 2ca8962..0000000 --- a/recipes/x64-pointer-compression/cloudlinux.repo +++ /dev/null @@ -1,9 +0,0 @@ -[cloudlinux-sclo-devtoolset-8] -name=Cloudlinux devtoolset-8 -baseurl=https://repo.cloudlinux.com/cloudlinux/7/sclo/devtoolset-8/x86_64/ -gpgcheck=0 - -[cloudlinux-sclo-devtoolset-9] -name=Cloudlinux devtoolset-9 -baseurl=https://repo.cloudlinux.com/cloudlinux/7/sclo/devtoolset-9/x86_64/ -gpgcheck=0 diff --git a/recipes/x64-pointer-compression/files/etc__yum.repos.d__devtoolset.repo b/recipes/x64-pointer-compression/files/etc__yum.repos.d__devtoolset.repo new file mode 100644 index 0000000..81064ea --- /dev/null +++ b/recipes/x64-pointer-compression/files/etc__yum.repos.d__devtoolset.repo @@ -0,0 +1,4 @@ +[devtoolset-12] +name=Devtoolset 12 +baseurl=https://buildlogs.centos.org/c7-devtoolset-12.x86_64/ +gpgcheck=0 diff --git a/recipes/x64-pointer-compression/files/installFromSourceCode b/recipes/x64-pointer-compression/files/installFromSourceCode new file mode 100644 index 0000000..ebbab3b --- /dev/null +++ b/recipes/x64-pointer-compression/files/installFromSourceCode @@ -0,0 +1,36 @@ +#!/bin/bash -eux + +# Calc vars + + id="$1" +url="$2" +configureArgsStr="$3" + +base=$(basename "$url") +name=${base%.*} +name=${name%.tar} + ext=${base:${#name}} + +case "$ext" in + .tar.xz|.txz) formatOpt=--xz;; + .tar.gz|.tgz) formatOpt=--gzip;; + .tar.bz2|.tbz2) formatOpt=--bzip2;; + *) formatOpt=--auto-compress +esac + +# Run commands + +curl -fL "$url" | tar --extract --directory=/usr/src "$formatOpt" + +source /opt/gcc15/enable +export CC='ccache gcc' +export CXX='ccache g++' + +cd "/usr/src/$name" +chmod +x ./contrib/download_prerequisites 2>/dev/null && ./contrib/download_prerequisites +./configure $configureArgsStr +make -j $(nproc) +make install + +hash -r +ccache -s > "/root/ccacheStat_$name.txt" diff --git a/recipes/x64-pointer-compression/files/installPrerequisites b/recipes/x64-pointer-compression/files/installPrerequisites new file mode 100644 index 0000000..38ba177 --- /dev/null +++ b/recipes/x64-pointer-compression/files/installPrerequisites @@ -0,0 +1,12 @@ +#!/bin/bash -eux + +sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* +sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* +yum install -y epel-release # Adds extra repos +yum upgrade -y + +yum install -y bzip2 # Required to compile gcc +yum install -y gcc-c++ # Required to compile Node.js v7- +yum install -y make # Allows compilation +yum install -y ccache # Allows caching +yum install -y devtoolset-12 # Includes gcc 12.1.1 diff --git a/recipes/x64-pointer-compression/files/opt__gcc15__enable b/recipes/x64-pointer-compression/files/opt__gcc15__enable new file mode 100644 index 0000000..f25221a --- /dev/null +++ b/recipes/x64-pointer-compression/files/opt__gcc15__enable @@ -0,0 +1,15 @@ +#!/bin/bash -eux + +DIR=/opt/gcc15 + +source /opt/rh/devtoolset-12/enable + +export PATH="$DIR/bin${PATH:+:${PATH}}" +export MANPATH="$DIR/share/man${MANPATH:+:${MANPATH}}" +export INFOPATH="$DIR/share/info${INFOPATH:+:${INFOPATH}}" +export LD_LIBRARY_PATH="$DIR/lib64:$DIR/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}" +export PKG_CONFIG_PATH="$DIR/lib64/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}}" + +if [ -f "$DIR/bin/gcc" ]; then + export LDFLAGS='-static-libstdc++' +fi diff --git a/recipes/x64-pointer-compression/run.sh b/recipes/x64-pointer-compression/run.sh index 7ac9dab..0138d6e 100755 --- a/recipes/x64-pointer-compression/run.sh +++ b/recipes/x64-pointer-compression/run.sh @@ -1,7 +1,8 @@ -#!/usr/bin/env bash +#!/bin/bash -eux -set -e -set -x + + +# Init release_urlbase="$1" disttype="$2" @@ -11,33 +12,55 @@ commit="$5" fullversion="$6" source_url="$7" source_urlbase="$8" -config_flags=--experimental-enable-pointer-compression -cd /home/node +homeDir=/home/node +nodeDir="$homeDir/node-$fullversion" -tar -xf node.tar.xz +tar --directory="$homeDir" -xf "$homeDir/node.tar.xz" -# configuring cares correctly to not use sys/random.h on this target -cd "node-${fullversion}"/deps/cares/config/linux -sed -i 's/define HAVE_SYS_RANDOM_H 1/undef HAVE_SYS_RANDOM_H/g' ./ares_config.h -sed -i 's/define HAVE_GETRANDOM 1/undef HAVE_GETRANDOM/g' ./ares_config.h -cd /home/node -cd "node-${fullversion}" +# Patch the code -export CC="ccache gcc" -export CXX="ccache g++" -export MAJOR_VERSION=$(echo ${fullversion} | cut -d . -f 1 | tr --delete v) +# Configuring cares correctly to not use sys/random.h on this target +cd "$nodeDir/deps/cares/config/linux" +sed -i 's/define HAVE_SYS_RANDOM_H 1/undef HAVE_SYS_RANDOM_H/g' ares_config.h +sed -i 's/define HAVE_GETRANDOM 1/undef HAVE_GETRANDOM/g' ares_config.h -if [ $MAJOR_VERSION -ge 16 ]; then - . /opt/rh/devtoolset-9/enable +# Fix https://github.com/c-ares/c-ares/issues/850 +cd "$nodeDir/deps/cares" +if [[ "$(grep -o 'ARES_VERSION_STR "[^"]*"' include/ares_version.h | awk '{print $2}' | tr -d '"')" == "1.33.0" ]]; then + sed -i 's/MSG_FASTOPEN/TCP_FASTOPEN_CONNECT/g' src/lib/ares__socket.c fi +# Linux implementation of experimental WASM memory control requires Linux 3.17 & glibc 2.27 so disable it +cd "$nodeDir/deps/v8/src" +[ -f d8/d8.cc ] && sed -i -e 's/#if V8_TARGET_OS_LINUX/#if false/g' wasm/wasm-objects.cc d8/d8.cc + + + +# Prepare to compile Node.js + +export MAJOR_VERSION=$(echo ${fullversion} | cut -d . -f 1 | tr --delete v) + +source "$homeDir/run_other.sh" +source "$homeDir/run_versions.sh" + +setPython +setGCC + + + +# Compile Node.js + +cd "$nodeDir" +export CC='ccache gcc' +export CXX='ccache g++' + make -j$(getconf _NPROCESSORS_ONLN) binary V= \ - DESTCPU="x64" \ - ARCH="x64" \ - VARIATION="pointer-compression" \ + DESTCPU="$destCPU" \ + ARCH="$arch" \ + VARIATION="$variation" \ DISTTYPE="$disttype" \ CUSTOMTAG="$customtag" \ DATESTRING="$datestring" \ @@ -45,4 +68,5 @@ make -j$(getconf _NPROCESSORS_ONLN) binary V= \ RELEASE_URLBASE="$release_urlbase" \ CONFIG_FLAGS="$config_flags" +"$nodeDir/node" -p process.versions mv node-*.tar.?z /out/ diff --git a/recipes/x64-pointer-compression/run_other.sh b/recipes/x64-pointer-compression/run_other.sh new file mode 100644 index 0000000..6a9d469 --- /dev/null +++ b/recipes/x64-pointer-compression/run_other.sh @@ -0,0 +1,6 @@ +#!/bin/bash -eux + +config_flags=--experimental-enable-pointer-compression +destCPU=x64 +arch=x64 +variation=pointer-compression diff --git a/recipes/x64-pointer-compression/run_versions.sh b/recipes/x64-pointer-compression/run_versions.sh new file mode 100644 index 0000000..4870f18 --- /dev/null +++ b/recipes/x64-pointer-compression/run_versions.sh @@ -0,0 +1,15 @@ +#!/bin/bash -eux + +setPython() { + if [ "$MAJOR_VERSION" -ge 23 ]; then export PYTHON='python3.13'; return; fi # Python 3.13: Node.js v22.3 ~ latest (v24.3) + if [ "$MAJOR_VERSION" -ge 15 ]; then export PYTHON='python3.9'; return; fi # Python 3.9: Node.js v14.14 ~ latest (v24.3) + if [ "$MAJOR_VERSION" -ge 4 ]; then export PYTHON='python2.7'; return; fi # Python 2.7: Node.js v4.0 ~ v15.14 (latest) + + # Node.js v16.0 is first version not supporting Python 2.7 but supports Python 3.6 ~ 3.9 so Python 3.9 is chosen +} + +setGCC() { + if [ "$MAJOR_VERSION" -ge 23 ]; then source /opt/gcc15/enable; return; fi # GCC 15.1: Node.js v22.3 ~ latest (v24.3) (v22.3~v22.17 has more compilation warnings) + if [ "$MAJOR_VERSION" -ge 8 ]; then source /opt/rh/devtoolset-12/enable; return; fi # GCC 12.1: Node.js v8.0 ~ v23.7 + # GCC 4.8.5: Node.js v4.0 ~ v10.14 (v9.0~v10.2 have compatibility warning by Node.js) +} diff --git a/recipes/x64-pointer-compression/should-build.sh b/recipes/x64-pointer-compression/should-build.sh index 513aff9..baf25c8 100755 --- a/recipes/x64-pointer-compression/should-build.sh +++ b/recipes/x64-pointer-compression/should-build.sh @@ -7,4 +7,4 @@ fullversion=$2 decode "$fullversion" -test "$major" -ge "14" && test "$major" -lt "23" +[ "$major" -ge 14 ] || ( [ "$major" -eq 13 ] && [ "$minor" -ge 4 ] ) diff --git a/recipes/x86/Dockerfile b/recipes/x86/Dockerfile index d195706..cb806d6 100644 --- a/recipes/x86/Dockerfile +++ b/recipes/x86/Dockerfile @@ -1,4 +1,4 @@ -FROM centos:7 +FROM --platform=linux/386 centos:7 ARG GID=1000 ARG UID=1000 @@ -6,25 +6,18 @@ ARG UID=1000 RUN groupadd --gid $GID node \ && adduser --gid $GID --uid $UID node -COPY cloudlinux.repo /etc/yum.repos.d/cloudlinux.repo - -RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* \ - && sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* \ - && yum install -y epel-release \ - && yum upgrade -y \ - && yum install -y \ - git \ - curl \ - make \ - python2 \ - python3 \ - ccache \ - xz-utils \ - devtoolset-6.i686 \ - devtoolset-9.i686 \ - glibc-devel.i686 - -COPY --chown=node:node run.sh /home/node/run.sh +COPY --chmod=755 files/installPrerequisites /root/installPrerequisites +COPY files/*.repo /etc/yum.repos.d/ +RUN /root/installPrerequisites + +COPY --chmod=755 files/installFromSourceCode /root/installFromSourceCode +COPY --chmod=755 files/opt__gcc15__enable /opt/gcc15/enable +RUN --mount=type=cache,target=/root/.ccache --mount=type=tmpfs,target=/usr/src /root/installFromSourceCode python3 https://www.python.org/ftp/python/3.9.23/Python-3.9.23.tar.xz '--prefix=/usr/local/' +RUN --mount=type=cache,target=/root/.ccache --mount=type=tmpfs,target=/usr/src /root/installFromSourceCode python3 https://www.python.org/ftp/python/3.13.5/Python-3.13.5.tar.xz '--prefix=/usr/local/' +RUN --mount=type=cache,target=/root/.ccache --mount=type=tmpfs,target=/usr/src /root/installFromSourceCode gcc https://gcc.gnu.org/pub/gcc/releases/gcc-15.1.0/gcc-15.1.0.tar.xz '--prefix=/opt/gcc15/ --with-default-libstdcxx-abi=gcc4-compatible --enable-languages=c,c++ --enable-checking=release --enable-gnu-indirect-function --with-linker-hash-style=gnu --disable-bootstrap --disable-multilib --build=i686-redhat-linux' +RUN --mount=type=cache,target=/root/.ccache --mount=type=tmpfs,target=/usr/src /root/installFromSourceCode binutils https://sourceware.org/pub/binutils/releases/binutils-2.44.tar.xz '--prefix=/opt/gcc15/ --without-debuginfod --disable-nls LDFLAGS=-pthread' + +COPY --chmod=755 --chown=node:node run.sh run_other.sh run_versions.sh /home/node/ VOLUME /home/node/.ccache VOLUME /out diff --git a/recipes/x86/cloudlinux.repo b/recipes/x86/cloudlinux.repo deleted file mode 100644 index e4551b0..0000000 --- a/recipes/x86/cloudlinux.repo +++ /dev/null @@ -1,9 +0,0 @@ -[cloudlinux-sclo-devtoolset-6] -name=Cloudlinux devtoolset-6 -baseurl=https://repo.cloudlinux.com/cloudlinux/7/sclo/devtoolset-6/i386/ -gpgcheck=0 - -[cloudlinux-sclo-devtoolset-9] -name=Cloudlinux devtoolset-9 -baseurl=https://repo.cloudlinux.com/cloudlinux/7/sclo/devtoolset-9/i386/ -gpgcheck=0 diff --git a/recipes/x86/files/etc__yum.repos.d__devtoolset.repo b/recipes/x86/files/etc__yum.repos.d__devtoolset.repo new file mode 100644 index 0000000..4d03dac --- /dev/null +++ b/recipes/x86/files/etc__yum.repos.d__devtoolset.repo @@ -0,0 +1,4 @@ +[cloudlinux-sclo-devtoolset-9] +name=Cloudlinux devtoolset-9 +baseurl=https://repo.cloudlinux.com/cloudlinux/7/sclo/devtoolset-9/i386/ +gpgcheck=0 diff --git a/recipes/x86/files/etc__yum.repos.d__epel.repo b/recipes/x86/files/etc__yum.repos.d__epel.repo new file mode 100644 index 0000000..cd99e33 --- /dev/null +++ b/recipes/x86/files/etc__yum.repos.d__epel.repo @@ -0,0 +1,4 @@ +[epel] +name=epel +baseurl=https://buildlogs.centos.org/c7-epel.i386/ +gpgcheck=0 diff --git a/recipes/x86/files/installFromSourceCode b/recipes/x86/files/installFromSourceCode new file mode 100644 index 0000000..ebbab3b --- /dev/null +++ b/recipes/x86/files/installFromSourceCode @@ -0,0 +1,36 @@ +#!/bin/bash -eux + +# Calc vars + + id="$1" +url="$2" +configureArgsStr="$3" + +base=$(basename "$url") +name=${base%.*} +name=${name%.tar} + ext=${base:${#name}} + +case "$ext" in + .tar.xz|.txz) formatOpt=--xz;; + .tar.gz|.tgz) formatOpt=--gzip;; + .tar.bz2|.tbz2) formatOpt=--bzip2;; + *) formatOpt=--auto-compress +esac + +# Run commands + +curl -fL "$url" | tar --extract --directory=/usr/src "$formatOpt" + +source /opt/gcc15/enable +export CC='ccache gcc' +export CXX='ccache g++' + +cd "/usr/src/$name" +chmod +x ./contrib/download_prerequisites 2>/dev/null && ./contrib/download_prerequisites +./configure $configureArgsStr +make -j $(nproc) +make install + +hash -r +ccache -s > "/root/ccacheStat_$name.txt" diff --git a/recipes/x86/files/installPrerequisites b/recipes/x86/files/installPrerequisites new file mode 100644 index 0000000..c7211fd --- /dev/null +++ b/recipes/x86/files/installPrerequisites @@ -0,0 +1,16 @@ +#!/bin/bash -eux + +sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* +sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* +yum upgrade -y + +yum install -y bzip2 # Required to compile gcc +yum install -y zlib-devel # Required to compile Python +yum install -y bzip2-devel # Required to compile Python with bz2 module (required by Node.js) +yum install -y gcc-c++ # Required to compile Node.js v7- +yum install -y make # Allows compilation +yum install -y ccache # Allows caching +yum install -y devtoolset-9.i686 # Includes gcc 9.3.1 + +# Fix bugs +sed -i -e 's/:\${MANPATH}/\${MANPATH:+:\${MANPATH}}/g' /opt/rh/devtoolset-9/enable diff --git a/recipes/x86/files/opt__gcc15__enable b/recipes/x86/files/opt__gcc15__enable new file mode 100644 index 0000000..ef0676c --- /dev/null +++ b/recipes/x86/files/opt__gcc15__enable @@ -0,0 +1,15 @@ +#!/bin/bash -eux + +DIR=/opt/gcc15 + +source /opt/rh/devtoolset-9/enable + +export PATH="$DIR/bin${PATH:+:${PATH}}" +export MANPATH="$DIR/share/man${MANPATH:+:${MANPATH}}" +export INFOPATH="$DIR/share/info${INFOPATH:+:${INFOPATH}}" +export LD_LIBRARY_PATH="$DIR/lib64:$DIR/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}" +export PKG_CONFIG_PATH="$DIR/lib64/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}}" + +if [ -f "$DIR/bin/gcc" ]; then + export LDFLAGS='-static-libstdc++' +fi diff --git a/recipes/x86/run.sh b/recipes/x86/run.sh index b2ad774..0138d6e 100755 --- a/recipes/x86/run.sh +++ b/recipes/x86/run.sh @@ -1,7 +1,8 @@ -#!/usr/bin/env bash +#!/bin/bash -eux -set -e -set -x + + +# Init release_urlbase="$1" disttype="$2" @@ -11,35 +12,55 @@ commit="$5" fullversion="$6" source_url="$7" source_urlbase="$8" -config_flags=--openssl-no-asm -cd /home/node +homeDir=/home/node +nodeDir="$homeDir/node-$fullversion" -tar -xf node.tar.xz +tar --directory="$homeDir" -xf "$homeDir/node.tar.xz" -# configuring cares correctly to not use sys/random.h on this target -cd "node-${fullversion}"/deps/cares/config/linux -sed -i 's/define HAVE_SYS_RANDOM_H 1/undef HAVE_SYS_RANDOM_H/g' ./ares_config.h -sed -i 's/define HAVE_GETRANDOM 1/undef HAVE_GETRANDOM/g' ./ares_config.h -cd /home/node -cd "node-${fullversion}" +# Patch the code -export CC="ccache gcc" -export CXX="ccache g++" -export CXXFLAGS=-m32 -export CFLAGS=-m32 -export MAJOR_VERSION=$(echo ${fullversion} | cut -d . -f 1 | tr --delete v) +# Configuring cares correctly to not use sys/random.h on this target +cd "$nodeDir/deps/cares/config/linux" +sed -i 's/define HAVE_SYS_RANDOM_H 1/undef HAVE_SYS_RANDOM_H/g' ares_config.h +sed -i 's/define HAVE_GETRANDOM 1/undef HAVE_GETRANDOM/g' ares_config.h -if [ $MAJOR_VERSION -ge 16 ]; then - . /opt/rh/devtoolset-9/enable +# Fix https://github.com/c-ares/c-ares/issues/850 +cd "$nodeDir/deps/cares" +if [[ "$(grep -o 'ARES_VERSION_STR "[^"]*"' include/ares_version.h | awk '{print $2}' | tr -d '"')" == "1.33.0" ]]; then + sed -i 's/MSG_FASTOPEN/TCP_FASTOPEN_CONNECT/g' src/lib/ares__socket.c fi +# Linux implementation of experimental WASM memory control requires Linux 3.17 & glibc 2.27 so disable it +cd "$nodeDir/deps/v8/src" +[ -f d8/d8.cc ] && sed -i -e 's/#if V8_TARGET_OS_LINUX/#if false/g' wasm/wasm-objects.cc d8/d8.cc + + + +# Prepare to compile Node.js + +export MAJOR_VERSION=$(echo ${fullversion} | cut -d . -f 1 | tr --delete v) + +source "$homeDir/run_other.sh" +source "$homeDir/run_versions.sh" + +setPython +setGCC + + + +# Compile Node.js + +cd "$nodeDir" +export CC='ccache gcc' +export CXX='ccache g++' + make -j$(getconf _NPROCESSORS_ONLN) binary V= \ - DESTCPU="x86" \ - ARCH="x86" \ - VARIATION="" \ + DESTCPU="$destCPU" \ + ARCH="$arch" \ + VARIATION="$variation" \ DISTTYPE="$disttype" \ CUSTOMTAG="$customtag" \ DATESTRING="$datestring" \ @@ -47,4 +68,5 @@ make -j$(getconf _NPROCESSORS_ONLN) binary V= \ RELEASE_URLBASE="$release_urlbase" \ CONFIG_FLAGS="$config_flags" +"$nodeDir/node" -p process.versions mv node-*.tar.?z /out/ diff --git a/recipes/x86/run_other.sh b/recipes/x86/run_other.sh new file mode 100644 index 0000000..25908ef --- /dev/null +++ b/recipes/x86/run_other.sh @@ -0,0 +1,34 @@ +#!/bin/bash -eux + +config_flags= +destCPU=x86 +arch=x86 +variation= + +# GCC forbids SSE by default for x86 but it is required by Node.js so enable it manually +export CFLAGS='-msse2' +export CXXFLAGS='-msse2' +# export CFLAGS='-msse4.2' # This can be used too for modern CPUs (~2008) +# export CFLAGS='-mavx' # This can be used too for modern CPUs (~2011) +# export CFLAGS='-mavx2' # This can be used too for modern CPUs (~2013) +# export CFLAGS='-mavx2 -maes' # This can be used too for modern CPUs (~2015) +# export CFLAGS='-march=znver1' # This can be used too for modern AMD CPUs (~2017) +# export CFLAGS='-march=sandybridge' # This can be used too for modern Intel CPUs (~2011) + +# x86 does not support _mm_cvtsi128_si64 instruction so forbid it's usage and fallback to non-SSE solution +cd "$nodeDir/deps/v8/src" +find . -name '*.cc' -type f -print0 | xargs -0 sed -i -e 's/#ifdef __SSE2__/#if false/g' + +# Replace %ifdef with #ifdef in assembler code +cd "$nodeDir/deps/openssl/config/archs/linux-elf/asm" && +find . -name '*.S' -type f -print0 | xargs -0 --no-run-if-empty sed -i -e 's/%ifdef/#ifdef/g' -e 's/%endif/#endif/g' + +# Fix https://github.com/nodejs/node/issues/58458 +str1='return __ Tuple\(result, __ Word32Constant\(0\)\);' +str2='V result_ = result; return __ Tuple\(result_, __ Word32Constant\(0\)\);' +cd "$nodeDir/deps/v8/src/compiler/turboshaft" && +[ -f int64-lowering-reducer.h ] && sed -i -E "s/$str1/$str2/g" int64-lowering-reducer.h +# https://github.com/nodejs/node/issues/58458#issuecomment-2916873746 +# https://github.com/nodejs/node/commit/02f8cdb0c7a73d970ed7134a481a211bbd599c02 + +true # To allow "&&" above diff --git a/recipes/x86/run_versions.sh b/recipes/x86/run_versions.sh new file mode 100644 index 0000000..b6d3c3b --- /dev/null +++ b/recipes/x86/run_versions.sh @@ -0,0 +1,18 @@ +#!/bin/bash -eux + +setPython() { + if [ "$MAJOR_VERSION" -ge 23 ]; then export PYTHON='python3.13'; return; fi # Python 3.13: Node.js v22.3 ~ latest (v24.3) + if [ "$MAJOR_VERSION" -ge 15 ]; then export PYTHON='python3.9'; return; fi # Python 3.9: Node.js v14.14 ~ latest (v24.3) + if [ "$MAJOR_VERSION" -ge 4 ]; then export PYTHON='python2.7'; return; fi # Python 2.7: Node.js v4.0 ~ v15.14 (latest) + + # Node.js v16.0 is first version not supporting Python 2.7 but supports Python 3.6 ~ 3.9 so Python 3.9 is chosen +} + +setGCC() { + if [ "$MAJOR_VERSION" -ge 22 ]; then source /opt/gcc15/enable; return; fi # GCC 15.1: Node.js v22.3 ~ latest (v24.3) (v22.3~v22.17 has more compilation warnings) + if [ "$MAJOR_VERSION" -ge 8 ]; then source /opt/rh/devtoolset-9/enable; return; fi # GCC 9.3: Node.js v7.10 ~ v21.7 (latest) (v20.0~v21.7 has compatibility warning by Node.js) + # GCC 4.8.5: Node.js v4.0 ~ v10.14 (v9.0~v10.2 have compatibility warning by Node.js) + + # Node.js v22.0 is first version not supporting GCC 9.3 but supports GCC 12.4- so GCC 12.4 + # should be chosen, but support of v22.0~v22.2 is dropped and GCC 15.1 is chosen instead +} diff --git a/recipes/x86/should-build.sh b/recipes/x86/should-build.sh index 10ff5ba..d319b35 100755 --- a/recipes/x86/should-build.sh +++ b/recipes/x86/should-build.sh @@ -7,4 +7,5 @@ fullversion=$2 decode "$fullversion" -test "$major" -lt "22" +[ "$major" -ge 7 ] || ( [ "$major" -eq 6 ] && [ "$minor" -ge 2 ] ) +[[ ! "$fullversion" =~ ^v22\.[0-2]\. ]] From 97e3f3586195ece1b93b77d5aaa646d0dd880a88 Mon Sep 17 00:00:00 2001 From: vitaliylag Date: Fri, 4 Jul 2025 10:46:18 +0400 Subject: [PATCH 02/24] Update should-build.sh for pointer-compression --- recipes/x64-pointer-compression/should-build.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipes/x64-pointer-compression/should-build.sh b/recipes/x64-pointer-compression/should-build.sh index baf25c8..dba41b1 100755 --- a/recipes/x64-pointer-compression/should-build.sh +++ b/recipes/x64-pointer-compression/should-build.sh @@ -8,3 +8,5 @@ fullversion=$2 decode "$fullversion" [ "$major" -ge 14 ] || ( [ "$major" -eq 13 ] && [ "$minor" -ge 4 ] ) +[ "$major" -ne 20 ] || [ "$minor" -le 16 ] +[ "$major" -ne 23 ] || [ "$minor" -le 7 ] From dab6687d3940e8a1a71f162359614d3ad4309ac0 Mon Sep 17 00:00:00 2001 From: vitaliylag Date: Fri, 4 Jul 2025 10:59:54 +0400 Subject: [PATCH 03/24] Update should-build.sh for pointer-compression --- recipes/x64-pointer-compression/should-build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/x64-pointer-compression/should-build.sh b/recipes/x64-pointer-compression/should-build.sh index dba41b1..9eb4a48 100755 --- a/recipes/x64-pointer-compression/should-build.sh +++ b/recipes/x64-pointer-compression/should-build.sh @@ -9,4 +9,4 @@ decode "$fullversion" [ "$major" -ge 14 ] || ( [ "$major" -eq 13 ] && [ "$minor" -ge 4 ] ) [ "$major" -ne 20 ] || [ "$minor" -le 16 ] -[ "$major" -ne 23 ] || [ "$minor" -le 7 ] +[ "$major" -ne 23 ] From 4a7769ea8b98f44bef40411c9084f19daf49535b Mon Sep 17 00:00:00 2001 From: vitaliylag Date: Fri, 4 Jul 2025 12:07:26 +0400 Subject: [PATCH 04/24] Update should-build.sh for pointer-compression --- recipes/x64-pointer-compression/should-build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/x64-pointer-compression/should-build.sh b/recipes/x64-pointer-compression/should-build.sh index 9eb4a48..e1e2f9c 100755 --- a/recipes/x64-pointer-compression/should-build.sh +++ b/recipes/x64-pointer-compression/should-build.sh @@ -10,3 +10,4 @@ decode "$fullversion" [ "$major" -ge 14 ] || ( [ "$major" -eq 13 ] && [ "$minor" -ge 4 ] ) [ "$major" -ne 20 ] || [ "$minor" -le 16 ] [ "$major" -ne 23 ] +[[ ! "$fullversion" =~ ^v24\.[0-1]\. ]] From 9cf9c9c3cdbfee4bd2fda85be4e156ef7c5711bd Mon Sep 17 00:00:00 2001 From: vitaliylag Date: Sat, 5 Jul 2025 07:46:07 +0400 Subject: [PATCH 05/24] Update should-build.sh and add comments --- recipes/x64-glibc-217/should-build.sh | 3 ++- recipes/x64-pointer-compression/should-build.sh | 9 +++++---- recipes/x86/should-build.sh | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/recipes/x64-glibc-217/should-build.sh b/recipes/x64-glibc-217/should-build.sh index 82d438d..eff8c2f 100755 --- a/recipes/x64-glibc-217/should-build.sh +++ b/recipes/x64-glibc-217/should-build.sh @@ -7,4 +7,5 @@ fullversion=$2 decode "$fullversion" -[ "$major" -ge 7 ] || ( [ "$major" -eq 6 ] && [ "$minor" -ge 2 ] ) +[ "$major" -ge 7 ] || ( [ "$major" -eq 6 ] && [ "$minor" -ge 2 ] ) # Node.js v6.1- cannot download required files due to broken links +[ "$major" -ne 17 ] # Not supported neigher by GCC 12.1 nor GCC 4.8.5 (works with GCC 9.3) diff --git a/recipes/x64-pointer-compression/should-build.sh b/recipes/x64-pointer-compression/should-build.sh index e1e2f9c..2bd0ae4 100755 --- a/recipes/x64-pointer-compression/should-build.sh +++ b/recipes/x64-pointer-compression/should-build.sh @@ -7,7 +7,8 @@ fullversion=$2 decode "$fullversion" -[ "$major" -ge 14 ] || ( [ "$major" -eq 13 ] && [ "$minor" -ge 4 ] ) -[ "$major" -ne 20 ] || [ "$minor" -le 16 ] -[ "$major" -ne 23 ] -[[ ! "$fullversion" =~ ^v24\.[0-1]\. ]] +[ "$major" -ge 14 ] || ( [ "$major" -eq 13 ] && [ "$minor" -ge 4 ] ) # Pointer compression is supported since Node.js v13.4 +[ "$major" -ne 17 ] # Not supported neigher by GCC 12.1 nor GCC 4.8.5 (works with GCC 9.3) +[ "$major" -ne 20 ] || [ "$minor" -le 16 ] # Pointer compression does not work in Node.js v20.17~v20.19 +[ "$major" -ne 23 ] # Pointer compression does not work in Node.js v23.0~v24.1 +[[ ! "$fullversion" =~ ^v24\.[0-1]\. ]] # Pointer compression does not work in Node.js v23.0~v24.1 diff --git a/recipes/x86/should-build.sh b/recipes/x86/should-build.sh index d319b35..612353b 100755 --- a/recipes/x86/should-build.sh +++ b/recipes/x86/should-build.sh @@ -7,5 +7,5 @@ fullversion=$2 decode "$fullversion" -[ "$major" -ge 7 ] || ( [ "$major" -eq 6 ] && [ "$minor" -ge 2 ] ) -[[ ! "$fullversion" =~ ^v22\.[0-2]\. ]] +[ "$major" -ge 7 ] || ( [ "$major" -eq 6 ] && [ "$minor" -ge 2 ] ) # Node.js v6.1- cannot download required files due to broken links +[[ ! "$fullversion" =~ ^v22\.[0-2]\. ]] # Not supported neigher by GCC 15.1 nor GCC 9.3 (GCC 12.4 would be good but is not installed) From 3f940e52b1c2a5ac9329847b4d8be030220db641 Mon Sep 17 00:00:00 2001 From: vitaliylag Date: Sat, 5 Jul 2025 09:17:10 +0400 Subject: [PATCH 06/24] Update should-build.sh and add comments --- recipes/x64-glibc-217/should-build.sh | 2 +- recipes/x64-pointer-compression/should-build.sh | 2 +- recipes/x86/should-build.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/recipes/x64-glibc-217/should-build.sh b/recipes/x64-glibc-217/should-build.sh index eff8c2f..6bff63c 100755 --- a/recipes/x64-glibc-217/should-build.sh +++ b/recipes/x64-glibc-217/should-build.sh @@ -8,4 +8,4 @@ fullversion=$2 decode "$fullversion" [ "$major" -ge 7 ] || ( [ "$major" -eq 6 ] && [ "$minor" -ge 2 ] ) # Node.js v6.1- cannot download required files due to broken links -[ "$major" -ne 17 ] # Not supported neigher by GCC 12.1 nor GCC 4.8.5 (works with GCC 9.3) +[ "$major" -ne 17 ] # GCC version between 4.8.5 and 12.1 is required but not installed diff --git a/recipes/x64-pointer-compression/should-build.sh b/recipes/x64-pointer-compression/should-build.sh index 2bd0ae4..08c922e 100755 --- a/recipes/x64-pointer-compression/should-build.sh +++ b/recipes/x64-pointer-compression/should-build.sh @@ -8,7 +8,7 @@ fullversion=$2 decode "$fullversion" [ "$major" -ge 14 ] || ( [ "$major" -eq 13 ] && [ "$minor" -ge 4 ] ) # Pointer compression is supported since Node.js v13.4 -[ "$major" -ne 17 ] # Not supported neigher by GCC 12.1 nor GCC 4.8.5 (works with GCC 9.3) +[ "$major" -ne 17 ] # GCC version between 4.8.5 and 12.1 is required but not installed [ "$major" -ne 20 ] || [ "$minor" -le 16 ] # Pointer compression does not work in Node.js v20.17~v20.19 [ "$major" -ne 23 ] # Pointer compression does not work in Node.js v23.0~v24.1 [[ ! "$fullversion" =~ ^v24\.[0-1]\. ]] # Pointer compression does not work in Node.js v23.0~v24.1 diff --git a/recipes/x86/should-build.sh b/recipes/x86/should-build.sh index 612353b..522c2a1 100755 --- a/recipes/x86/should-build.sh +++ b/recipes/x86/should-build.sh @@ -8,4 +8,4 @@ fullversion=$2 decode "$fullversion" [ "$major" -ge 7 ] || ( [ "$major" -eq 6 ] && [ "$minor" -ge 2 ] ) # Node.js v6.1- cannot download required files due to broken links -[[ ! "$fullversion" =~ ^v22\.[0-2]\. ]] # Not supported neigher by GCC 15.1 nor GCC 9.3 (GCC 12.4 would be good but is not installed) +[[ ! "$fullversion" =~ ^v22\.[0-2]\. ]] # GCC version between 9.3 and 15.1 is required but not installed From fb14ffec5f233b5ff004876981c20c42fa265721 Mon Sep 17 00:00:00 2001 From: vitaliylag Date: Sat, 5 Jul 2025 09:21:36 +0400 Subject: [PATCH 07/24] Update should-build.sh for pointer-compression --- recipes/x64-pointer-compression/should-build.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/recipes/x64-pointer-compression/should-build.sh b/recipes/x64-pointer-compression/should-build.sh index 08c922e..4450971 100755 --- a/recipes/x64-pointer-compression/should-build.sh +++ b/recipes/x64-pointer-compression/should-build.sh @@ -10,5 +10,4 @@ decode "$fullversion" [ "$major" -ge 14 ] || ( [ "$major" -eq 13 ] && [ "$minor" -ge 4 ] ) # Pointer compression is supported since Node.js v13.4 [ "$major" -ne 17 ] # GCC version between 4.8.5 and 12.1 is required but not installed [ "$major" -ne 20 ] || [ "$minor" -le 16 ] # Pointer compression does not work in Node.js v20.17~v20.19 -[ "$major" -ne 23 ] # Pointer compression does not work in Node.js v23.0~v24.1 -[[ ! "$fullversion" =~ ^v24\.[0-1]\. ]] # Pointer compression does not work in Node.js v23.0~v24.1 +[[ ! "$fullversion" =~ ^v(23|24\.[0-1]\.) ]] # Pointer compression does not work in Node.js v23.0~v24.1 From 9082183aacf47e9ef607d9f2225702b1c029c77a Mon Sep 17 00:00:00 2001 From: vitaliylag Date: Sat, 5 Jul 2025 23:07:07 +0400 Subject: [PATCH 08/24] Add version test function --- recipes/x64-glibc-217/run.sh | 4 ++++ recipes/x64-glibc-217/run_versions.sh | 12 ++++++------ recipes/x64-pointer-compression/run.sh | 4 ++++ recipes/x64-pointer-compression/run_versions.sh | 12 ++++++------ recipes/x86/run.sh | 4 ++++ recipes/x86/run_versions.sh | 12 ++++++------ 6 files changed, 30 insertions(+), 18 deletions(-) diff --git a/recipes/x64-glibc-217/run.sh b/recipes/x64-glibc-217/run.sh index 0138d6e..8e484f7 100755 --- a/recipes/x64-glibc-217/run.sh +++ b/recipes/x64-glibc-217/run.sh @@ -43,6 +43,10 @@ cd "$nodeDir/deps/v8/src" export MAJOR_VERSION=$(echo ${fullversion} | cut -d . -f 1 | tr --delete v) +isNodeVersionGE() { + printf "$2\n$fullversion" | sort -VC +} + source "$homeDir/run_other.sh" source "$homeDir/run_versions.sh" diff --git a/recipes/x64-glibc-217/run_versions.sh b/recipes/x64-glibc-217/run_versions.sh index 4870f18..fad9eea 100644 --- a/recipes/x64-glibc-217/run_versions.sh +++ b/recipes/x64-glibc-217/run_versions.sh @@ -1,15 +1,15 @@ #!/bin/bash -eux setPython() { - if [ "$MAJOR_VERSION" -ge 23 ]; then export PYTHON='python3.13'; return; fi # Python 3.13: Node.js v22.3 ~ latest (v24.3) - if [ "$MAJOR_VERSION" -ge 15 ]; then export PYTHON='python3.9'; return; fi # Python 3.9: Node.js v14.14 ~ latest (v24.3) - if [ "$MAJOR_VERSION" -ge 4 ]; then export PYTHON='python2.7'; return; fi # Python 2.7: Node.js v4.0 ~ v15.14 (latest) + if isNodeVersionGE 'v22.3'; then export PYTHON='python3.13'; return; fi # Python 3.13: Node.js v22.3 ~ latest (v24.3) + if isNodeVersionGE 'v14.14'; then export PYTHON='python3.9'; return; fi # Python 3.9: Node.js v14.14 ~ latest (v24.3) + if isNodeVersionGE 'v4.0'; then export PYTHON='python2.7'; return; fi # Python 2.7: Node.js v4.0 ~ v15.14 (latest) # Node.js v16.0 is first version not supporting Python 2.7 but supports Python 3.6 ~ 3.9 so Python 3.9 is chosen } setGCC() { - if [ "$MAJOR_VERSION" -ge 23 ]; then source /opt/gcc15/enable; return; fi # GCC 15.1: Node.js v22.3 ~ latest (v24.3) (v22.3~v22.17 has more compilation warnings) - if [ "$MAJOR_VERSION" -ge 8 ]; then source /opt/rh/devtoolset-12/enable; return; fi # GCC 12.1: Node.js v8.0 ~ v23.7 - # GCC 4.8.5: Node.js v4.0 ~ v10.14 (v9.0~v10.2 have compatibility warning by Node.js) + if isNodeVersionGE 'v22.3'; then source /opt/gcc15/enable; return; fi # GCC 15.1: Node.js v22.3 ~ latest (v24.3) (v22.3~v22.17 has more compilation warnings) + if isNodeVersionGE 'v8.0'; then source /opt/rh/devtoolset-12/enable; return; fi # GCC 12.1: Node.js v8.0 ~ v23.7 + # GCC 4.8.5: Node.js v4.0 ~ v10.14 (v9.0~v10.2 have compatibility warning by Node.js) } diff --git a/recipes/x64-pointer-compression/run.sh b/recipes/x64-pointer-compression/run.sh index 0138d6e..8e484f7 100755 --- a/recipes/x64-pointer-compression/run.sh +++ b/recipes/x64-pointer-compression/run.sh @@ -43,6 +43,10 @@ cd "$nodeDir/deps/v8/src" export MAJOR_VERSION=$(echo ${fullversion} | cut -d . -f 1 | tr --delete v) +isNodeVersionGE() { + printf "$2\n$fullversion" | sort -VC +} + source "$homeDir/run_other.sh" source "$homeDir/run_versions.sh" diff --git a/recipes/x64-pointer-compression/run_versions.sh b/recipes/x64-pointer-compression/run_versions.sh index 4870f18..fad9eea 100644 --- a/recipes/x64-pointer-compression/run_versions.sh +++ b/recipes/x64-pointer-compression/run_versions.sh @@ -1,15 +1,15 @@ #!/bin/bash -eux setPython() { - if [ "$MAJOR_VERSION" -ge 23 ]; then export PYTHON='python3.13'; return; fi # Python 3.13: Node.js v22.3 ~ latest (v24.3) - if [ "$MAJOR_VERSION" -ge 15 ]; then export PYTHON='python3.9'; return; fi # Python 3.9: Node.js v14.14 ~ latest (v24.3) - if [ "$MAJOR_VERSION" -ge 4 ]; then export PYTHON='python2.7'; return; fi # Python 2.7: Node.js v4.0 ~ v15.14 (latest) + if isNodeVersionGE 'v22.3'; then export PYTHON='python3.13'; return; fi # Python 3.13: Node.js v22.3 ~ latest (v24.3) + if isNodeVersionGE 'v14.14'; then export PYTHON='python3.9'; return; fi # Python 3.9: Node.js v14.14 ~ latest (v24.3) + if isNodeVersionGE 'v4.0'; then export PYTHON='python2.7'; return; fi # Python 2.7: Node.js v4.0 ~ v15.14 (latest) # Node.js v16.0 is first version not supporting Python 2.7 but supports Python 3.6 ~ 3.9 so Python 3.9 is chosen } setGCC() { - if [ "$MAJOR_VERSION" -ge 23 ]; then source /opt/gcc15/enable; return; fi # GCC 15.1: Node.js v22.3 ~ latest (v24.3) (v22.3~v22.17 has more compilation warnings) - if [ "$MAJOR_VERSION" -ge 8 ]; then source /opt/rh/devtoolset-12/enable; return; fi # GCC 12.1: Node.js v8.0 ~ v23.7 - # GCC 4.8.5: Node.js v4.0 ~ v10.14 (v9.0~v10.2 have compatibility warning by Node.js) + if isNodeVersionGE 'v22.3'; then source /opt/gcc15/enable; return; fi # GCC 15.1: Node.js v22.3 ~ latest (v24.3) (v22.3~v22.17 has more compilation warnings) + if isNodeVersionGE 'v8.0'; then source /opt/rh/devtoolset-12/enable; return; fi # GCC 12.1: Node.js v8.0 ~ v23.7 + # GCC 4.8.5: Node.js v4.0 ~ v10.14 (v9.0~v10.2 have compatibility warning by Node.js) } diff --git a/recipes/x86/run.sh b/recipes/x86/run.sh index 0138d6e..8e484f7 100755 --- a/recipes/x86/run.sh +++ b/recipes/x86/run.sh @@ -43,6 +43,10 @@ cd "$nodeDir/deps/v8/src" export MAJOR_VERSION=$(echo ${fullversion} | cut -d . -f 1 | tr --delete v) +isNodeVersionGE() { + printf "$2\n$fullversion" | sort -VC +} + source "$homeDir/run_other.sh" source "$homeDir/run_versions.sh" diff --git a/recipes/x86/run_versions.sh b/recipes/x86/run_versions.sh index b6d3c3b..473e90f 100644 --- a/recipes/x86/run_versions.sh +++ b/recipes/x86/run_versions.sh @@ -1,17 +1,17 @@ #!/bin/bash -eux setPython() { - if [ "$MAJOR_VERSION" -ge 23 ]; then export PYTHON='python3.13'; return; fi # Python 3.13: Node.js v22.3 ~ latest (v24.3) - if [ "$MAJOR_VERSION" -ge 15 ]; then export PYTHON='python3.9'; return; fi # Python 3.9: Node.js v14.14 ~ latest (v24.3) - if [ "$MAJOR_VERSION" -ge 4 ]; then export PYTHON='python2.7'; return; fi # Python 2.7: Node.js v4.0 ~ v15.14 (latest) + if isNodeVersionGE 'v22.3'; then export PYTHON='python3.13'; return; fi # Python 3.13: Node.js v22.3 ~ latest (v24.3) + if isNodeVersionGE 'v14.14'; then export PYTHON='python3.9'; return; fi # Python 3.9: Node.js v14.14 ~ latest (v24.3) + if isNodeVersionGE 'v4.0'; then export PYTHON='python2.7'; return; fi # Python 2.7: Node.js v4.0 ~ v15.14 (latest) # Node.js v16.0 is first version not supporting Python 2.7 but supports Python 3.6 ~ 3.9 so Python 3.9 is chosen } setGCC() { - if [ "$MAJOR_VERSION" -ge 22 ]; then source /opt/gcc15/enable; return; fi # GCC 15.1: Node.js v22.3 ~ latest (v24.3) (v22.3~v22.17 has more compilation warnings) - if [ "$MAJOR_VERSION" -ge 8 ]; then source /opt/rh/devtoolset-9/enable; return; fi # GCC 9.3: Node.js v7.10 ~ v21.7 (latest) (v20.0~v21.7 has compatibility warning by Node.js) - # GCC 4.8.5: Node.js v4.0 ~ v10.14 (v9.0~v10.2 have compatibility warning by Node.js) + if isNodeVersionGE 'v22.3'; then source /opt/gcc15/enable; return; fi # GCC 15.1: Node.js v22.3 ~ latest (v24.3) (v22.3~v22.17 has more compilation warnings) + if isNodeVersionGE 'v7.10'; then source /opt/rh/devtoolset-9/enable; return; fi # GCC 9.3: Node.js v7.10 ~ v21.7 (latest) (v20.0~v21.7 has compatibility warning by Node.js) + # GCC 4.8.5: Node.js v4.0 ~ v10.14 (v9.0~v10.2 have compatibility warning by Node.js) # Node.js v22.0 is first version not supporting GCC 9.3 but supports GCC 12.4- so GCC 12.4 # should be chosen, but support of v22.0~v22.2 is dropped and GCC 15.1 is chosen instead From 5793b67329793f16b19a93472457f130b375d18d Mon Sep 17 00:00:00 2001 From: vitaliylag Date: Sat, 5 Jul 2025 23:26:48 +0400 Subject: [PATCH 09/24] Add version test function (patch) --- recipes/x64-glibc-217/run.sh | 2 +- recipes/x64-glibc-217/run_versions.sh | 6 +++--- recipes/x64-pointer-compression/run.sh | 2 +- recipes/x64-pointer-compression/run_versions.sh | 6 +++--- recipes/x86/run.sh | 2 +- recipes/x86/run_versions.sh | 9 +++------ 6 files changed, 12 insertions(+), 15 deletions(-) diff --git a/recipes/x64-glibc-217/run.sh b/recipes/x64-glibc-217/run.sh index 8e484f7..6b9c749 100755 --- a/recipes/x64-glibc-217/run.sh +++ b/recipes/x64-glibc-217/run.sh @@ -44,7 +44,7 @@ cd "$nodeDir/deps/v8/src" export MAJOR_VERSION=$(echo ${fullversion} | cut -d . -f 1 | tr --delete v) isNodeVersionGE() { - printf "$2\n$fullversion" | sort -VC + printf "$1\n$fullversion" | sort -VC } source "$homeDir/run_other.sh" diff --git a/recipes/x64-glibc-217/run_versions.sh b/recipes/x64-glibc-217/run_versions.sh index fad9eea..3adc9f6 100644 --- a/recipes/x64-glibc-217/run_versions.sh +++ b/recipes/x64-glibc-217/run_versions.sh @@ -9,7 +9,7 @@ setPython() { } setGCC() { - if isNodeVersionGE 'v22.3'; then source /opt/gcc15/enable; return; fi # GCC 15.1: Node.js v22.3 ~ latest (v24.3) (v22.3~v22.17 has more compilation warnings) - if isNodeVersionGE 'v8.0'; then source /opt/rh/devtoolset-12/enable; return; fi # GCC 12.1: Node.js v8.0 ~ v23.7 - # GCC 4.8.5: Node.js v4.0 ~ v10.14 (v9.0~v10.2 have compatibility warning by Node.js) + if isNodeVersionGE 'v22.3'; then source /opt/gcc15/enable; return; fi # GCC 15.1: Node.js v22.3 ~ latest (v24.3) + if isNodeVersionGE 'v8.0'; then source /opt/rh/devtoolset-12/enable; return; fi # GCC 12.1: Node.js v8.0 ~ v22.2 + # GCC 4.8.5: Node.js v4.0 ~ v10.14 } diff --git a/recipes/x64-pointer-compression/run.sh b/recipes/x64-pointer-compression/run.sh index 8e484f7..6b9c749 100755 --- a/recipes/x64-pointer-compression/run.sh +++ b/recipes/x64-pointer-compression/run.sh @@ -44,7 +44,7 @@ cd "$nodeDir/deps/v8/src" export MAJOR_VERSION=$(echo ${fullversion} | cut -d . -f 1 | tr --delete v) isNodeVersionGE() { - printf "$2\n$fullversion" | sort -VC + printf "$1\n$fullversion" | sort -VC } source "$homeDir/run_other.sh" diff --git a/recipes/x64-pointer-compression/run_versions.sh b/recipes/x64-pointer-compression/run_versions.sh index fad9eea..3adc9f6 100644 --- a/recipes/x64-pointer-compression/run_versions.sh +++ b/recipes/x64-pointer-compression/run_versions.sh @@ -9,7 +9,7 @@ setPython() { } setGCC() { - if isNodeVersionGE 'v22.3'; then source /opt/gcc15/enable; return; fi # GCC 15.1: Node.js v22.3 ~ latest (v24.3) (v22.3~v22.17 has more compilation warnings) - if isNodeVersionGE 'v8.0'; then source /opt/rh/devtoolset-12/enable; return; fi # GCC 12.1: Node.js v8.0 ~ v23.7 - # GCC 4.8.5: Node.js v4.0 ~ v10.14 (v9.0~v10.2 have compatibility warning by Node.js) + if isNodeVersionGE 'v22.3'; then source /opt/gcc15/enable; return; fi # GCC 15.1: Node.js v22.3 ~ latest (v24.3) + if isNodeVersionGE 'v8.0'; then source /opt/rh/devtoolset-12/enable; return; fi # GCC 12.1: Node.js v8.0 ~ v22.2 + # GCC 4.8.5: Node.js v4.0 ~ v10.14 } diff --git a/recipes/x86/run.sh b/recipes/x86/run.sh index 8e484f7..6b9c749 100755 --- a/recipes/x86/run.sh +++ b/recipes/x86/run.sh @@ -44,7 +44,7 @@ cd "$nodeDir/deps/v8/src" export MAJOR_VERSION=$(echo ${fullversion} | cut -d . -f 1 | tr --delete v) isNodeVersionGE() { - printf "$2\n$fullversion" | sort -VC + printf "$1\n$fullversion" | sort -VC } source "$homeDir/run_other.sh" diff --git a/recipes/x86/run_versions.sh b/recipes/x86/run_versions.sh index 473e90f..997d604 100644 --- a/recipes/x86/run_versions.sh +++ b/recipes/x86/run_versions.sh @@ -9,10 +9,7 @@ setPython() { } setGCC() { - if isNodeVersionGE 'v22.3'; then source /opt/gcc15/enable; return; fi # GCC 15.1: Node.js v22.3 ~ latest (v24.3) (v22.3~v22.17 has more compilation warnings) - if isNodeVersionGE 'v7.10'; then source /opt/rh/devtoolset-9/enable; return; fi # GCC 9.3: Node.js v7.10 ~ v21.7 (latest) (v20.0~v21.7 has compatibility warning by Node.js) - # GCC 4.8.5: Node.js v4.0 ~ v10.14 (v9.0~v10.2 have compatibility warning by Node.js) - - # Node.js v22.0 is first version not supporting GCC 9.3 but supports GCC 12.4- so GCC 12.4 - # should be chosen, but support of v22.0~v22.2 is dropped and GCC 15.1 is chosen instead + if isNodeVersionGE 'v22.3'; then source /opt/gcc15/enable; return; fi # GCC 15.1: Node.js v22.3 ~ latest (v24.3) + if isNodeVersionGE 'v7.10'; then source /opt/rh/devtoolset-9/enable; return; fi # GCC 9.3: Node.js v7.10 ~ v21.7 (latest) + # GCC 4.8.5: Node.js v4.0 ~ v10.14 } From e2dcb2593da799376824022b0e410531e26e2a28 Mon Sep 17 00:00:00 2001 From: vitaliylag Date: Sun, 6 Jul 2025 01:07:06 +0400 Subject: [PATCH 10/24] Update versions --- recipes/x64-glibc-217/run_versions.sh | 2 +- recipes/x64-glibc-217/should-build.sh | 2 ++ recipes/x64-pointer-compression/run_versions.sh | 2 +- recipes/x64-pointer-compression/should-build.sh | 3 +++ recipes/x86/should-build.sh | 1 + 5 files changed, 8 insertions(+), 2 deletions(-) diff --git a/recipes/x64-glibc-217/run_versions.sh b/recipes/x64-glibc-217/run_versions.sh index 3adc9f6..b5d1130 100644 --- a/recipes/x64-glibc-217/run_versions.sh +++ b/recipes/x64-glibc-217/run_versions.sh @@ -10,6 +10,6 @@ setPython() { setGCC() { if isNodeVersionGE 'v22.3'; then source /opt/gcc15/enable; return; fi # GCC 15.1: Node.js v22.3 ~ latest (v24.3) - if isNodeVersionGE 'v8.0'; then source /opt/rh/devtoolset-12/enable; return; fi # GCC 12.1: Node.js v8.0 ~ v22.2 + if isNodeVersionGE 'v8.0'; then source /opt/rh/devtoolset-12/enable; return; fi # GCC 12.1: Node.js v8.0 ~ v22.1 # GCC 4.8.5: Node.js v4.0 ~ v10.14 } diff --git a/recipes/x64-glibc-217/should-build.sh b/recipes/x64-glibc-217/should-build.sh index 6bff63c..2c525ab 100755 --- a/recipes/x64-glibc-217/should-build.sh +++ b/recipes/x64-glibc-217/should-build.sh @@ -8,4 +8,6 @@ fullversion=$2 decode "$fullversion" [ "$major" -ge 7 ] || ( [ "$major" -eq 6 ] && [ "$minor" -ge 2 ] ) # Node.js v6.1- cannot download required files due to broken links + [ "$major" -ne 17 ] # GCC version between 4.8.5 and 12.1 is required but not installed +[[ ! "$fullversion" =~ ^v22\.2\.) ]] # GCC version between 12.1 and 15.1 is required but not installed diff --git a/recipes/x64-pointer-compression/run_versions.sh b/recipes/x64-pointer-compression/run_versions.sh index 3adc9f6..b5d1130 100644 --- a/recipes/x64-pointer-compression/run_versions.sh +++ b/recipes/x64-pointer-compression/run_versions.sh @@ -10,6 +10,6 @@ setPython() { setGCC() { if isNodeVersionGE 'v22.3'; then source /opt/gcc15/enable; return; fi # GCC 15.1: Node.js v22.3 ~ latest (v24.3) - if isNodeVersionGE 'v8.0'; then source /opt/rh/devtoolset-12/enable; return; fi # GCC 12.1: Node.js v8.0 ~ v22.2 + if isNodeVersionGE 'v8.0'; then source /opt/rh/devtoolset-12/enable; return; fi # GCC 12.1: Node.js v8.0 ~ v22.1 # GCC 4.8.5: Node.js v4.0 ~ v10.14 } diff --git a/recipes/x64-pointer-compression/should-build.sh b/recipes/x64-pointer-compression/should-build.sh index 4450971..804564d 100755 --- a/recipes/x64-pointer-compression/should-build.sh +++ b/recipes/x64-pointer-compression/should-build.sh @@ -8,6 +8,9 @@ fullversion=$2 decode "$fullversion" [ "$major" -ge 14 ] || ( [ "$major" -eq 13 ] && [ "$minor" -ge 4 ] ) # Pointer compression is supported since Node.js v13.4 + [ "$major" -ne 17 ] # GCC version between 4.8.5 and 12.1 is required but not installed +[[ ! "$fullversion" =~ ^v22\.2\.) ]] # GCC version between 12.1 and 15.1 is required but not installed + [ "$major" -ne 20 ] || [ "$minor" -le 16 ] # Pointer compression does not work in Node.js v20.17~v20.19 [[ ! "$fullversion" =~ ^v(23|24\.[0-1]\.) ]] # Pointer compression does not work in Node.js v23.0~v24.1 diff --git a/recipes/x86/should-build.sh b/recipes/x86/should-build.sh index 522c2a1..9be0b56 100755 --- a/recipes/x86/should-build.sh +++ b/recipes/x86/should-build.sh @@ -8,4 +8,5 @@ fullversion=$2 decode "$fullversion" [ "$major" -ge 7 ] || ( [ "$major" -eq 6 ] && [ "$minor" -ge 2 ] ) # Node.js v6.1- cannot download required files due to broken links + [[ ! "$fullversion" =~ ^v22\.[0-2]\. ]] # GCC version between 9.3 and 15.1 is required but not installed From b5427aacff4f2833b28da582640c0611679f2a5c Mon Sep 17 00:00:00 2001 From: vitaliylag Date: Sun, 6 Jul 2025 08:33:00 +0400 Subject: [PATCH 11/24] Fix typo --- recipes/x64-glibc-217/should-build.sh | 2 +- recipes/x64-pointer-compression/should-build.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/x64-glibc-217/should-build.sh b/recipes/x64-glibc-217/should-build.sh index 2c525ab..6bf1b92 100755 --- a/recipes/x64-glibc-217/should-build.sh +++ b/recipes/x64-glibc-217/should-build.sh @@ -10,4 +10,4 @@ decode "$fullversion" [ "$major" -ge 7 ] || ( [ "$major" -eq 6 ] && [ "$minor" -ge 2 ] ) # Node.js v6.1- cannot download required files due to broken links [ "$major" -ne 17 ] # GCC version between 4.8.5 and 12.1 is required but not installed -[[ ! "$fullversion" =~ ^v22\.2\.) ]] # GCC version between 12.1 and 15.1 is required but not installed +[[ ! "$fullversion" =~ ^v22\.2\. ]] # GCC version between 12.1 and 15.1 is required but not installed diff --git a/recipes/x64-pointer-compression/should-build.sh b/recipes/x64-pointer-compression/should-build.sh index 804564d..d341fb4 100755 --- a/recipes/x64-pointer-compression/should-build.sh +++ b/recipes/x64-pointer-compression/should-build.sh @@ -10,7 +10,7 @@ decode "$fullversion" [ "$major" -ge 14 ] || ( [ "$major" -eq 13 ] && [ "$minor" -ge 4 ] ) # Pointer compression is supported since Node.js v13.4 [ "$major" -ne 17 ] # GCC version between 4.8.5 and 12.1 is required but not installed -[[ ! "$fullversion" =~ ^v22\.2\.) ]] # GCC version between 12.1 and 15.1 is required but not installed +[[ ! "$fullversion" =~ ^v22\.2\. ]] # GCC version between 12.1 and 15.1 is required but not installed [ "$major" -ne 20 ] || [ "$minor" -le 16 ] # Pointer compression does not work in Node.js v20.17~v20.19 [[ ! "$fullversion" =~ ^v(23|24\.[0-1]\.) ]] # Pointer compression does not work in Node.js v23.0~v24.1 From 9776ab247e76ab0010512698ea76d0e132224de9 Mon Sep 17 00:00:00 2001 From: vitaliylag Date: Mon, 7 Jul 2025 08:01:20 +0400 Subject: [PATCH 12/24] Update should-build.sh for pointer-compression --- recipes/x64-glibc-217/run.sh | 2 +- recipes/x64-pointer-compression/run.sh | 2 +- recipes/x64-pointer-compression/should-build.sh | 5 +++-- recipes/x86/run.sh | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/recipes/x64-glibc-217/run.sh b/recipes/x64-glibc-217/run.sh index 6b9c749..b0f5c2f 100755 --- a/recipes/x64-glibc-217/run.sh +++ b/recipes/x64-glibc-217/run.sh @@ -72,5 +72,5 @@ make -j$(getconf _NPROCESSORS_ONLN) binary V= \ RELEASE_URLBASE="$release_urlbase" \ CONFIG_FLAGS="$config_flags" -"$nodeDir/node" -p process.versions +"$nodeDir/node" -p process.versions # Make sure there is no "Segmentation fault" error (example: node v21.0~v21.2 x64-pointer-compression) mv node-*.tar.?z /out/ diff --git a/recipes/x64-pointer-compression/run.sh b/recipes/x64-pointer-compression/run.sh index 6b9c749..b0f5c2f 100755 --- a/recipes/x64-pointer-compression/run.sh +++ b/recipes/x64-pointer-compression/run.sh @@ -72,5 +72,5 @@ make -j$(getconf _NPROCESSORS_ONLN) binary V= \ RELEASE_URLBASE="$release_urlbase" \ CONFIG_FLAGS="$config_flags" -"$nodeDir/node" -p process.versions +"$nodeDir/node" -p process.versions # Make sure there is no "Segmentation fault" error (example: node v21.0~v21.2 x64-pointer-compression) mv node-*.tar.?z /out/ diff --git a/recipes/x64-pointer-compression/should-build.sh b/recipes/x64-pointer-compression/should-build.sh index d341fb4..7920f89 100755 --- a/recipes/x64-pointer-compression/should-build.sh +++ b/recipes/x64-pointer-compression/should-build.sh @@ -12,5 +12,6 @@ decode "$fullversion" [ "$major" -ne 17 ] # GCC version between 4.8.5 and 12.1 is required but not installed [[ ! "$fullversion" =~ ^v22\.2\. ]] # GCC version between 12.1 and 15.1 is required but not installed -[ "$major" -ne 20 ] || [ "$minor" -le 16 ] # Pointer compression does not work in Node.js v20.17~v20.19 -[[ ! "$fullversion" =~ ^v(23|24\.[0-1]\.) ]] # Pointer compression does not work in Node.js v23.0~v24.1 +[ "$major" -ne 20 ] || [ "$minor" -le 16 ] # Pointer compression does not work in Node.js v20.17~v20.19 (Compilation error) +[[ ! "$fullversion" =~ ^v21\.[0-2]\. ]] # Pointer compression does not work in Node.js v21.0~v21.2 (Segmentation fault) +[[ ! "$fullversion" =~ ^v(23|24\.[0-1]\.) ]] # Pointer compression does not work in Node.js v23.0~v24.1 (Compilation error) diff --git a/recipes/x86/run.sh b/recipes/x86/run.sh index 6b9c749..b0f5c2f 100755 --- a/recipes/x86/run.sh +++ b/recipes/x86/run.sh @@ -72,5 +72,5 @@ make -j$(getconf _NPROCESSORS_ONLN) binary V= \ RELEASE_URLBASE="$release_urlbase" \ CONFIG_FLAGS="$config_flags" -"$nodeDir/node" -p process.versions +"$nodeDir/node" -p process.versions # Make sure there is no "Segmentation fault" error (example: node v21.0~v21.2 x64-pointer-compression) mv node-*.tar.?z /out/ From 3f53f5c5d7511af0511486f45845931c8a31c7d4 Mon Sep 17 00:00:00 2001 From: vitaliylag Date: Tue, 8 Jul 2025 13:25:21 +0400 Subject: [PATCH 13/24] Update should-build.sh for pointer-compression --- recipes/x64-pointer-compression/should-build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recipes/x64-pointer-compression/should-build.sh b/recipes/x64-pointer-compression/should-build.sh index 7920f89..4a7207c 100755 --- a/recipes/x64-pointer-compression/should-build.sh +++ b/recipes/x64-pointer-compression/should-build.sh @@ -12,6 +12,7 @@ decode "$fullversion" [ "$major" -ne 17 ] # GCC version between 4.8.5 and 12.1 is required but not installed [[ ! "$fullversion" =~ ^v22\.2\. ]] # GCC version between 12.1 and 15.1 is required but not installed -[ "$major" -ne 20 ] || [ "$minor" -le 16 ] # Pointer compression does not work in Node.js v20.17~v20.19 (Compilation error) +[ "$major" -ne 20 ] || [ "$minor" -lt 17 ] # Pointer compression does not work in Node.js v20.17~v20.19 (Compilation error) [[ ! "$fullversion" =~ ^v21\.[0-2]\. ]] # Pointer compression does not work in Node.js v21.0~v21.2 (Segmentation fault) +[ "$major" -ne 22 ] || [ "$minor" -lt 6 ] || [ "$minor" -gt 16 ] # Pointer compression does not work in Node.js v22.6~v22.16 (Compilation error) [[ ! "$fullversion" =~ ^v(23|24\.[0-1]\.) ]] # Pointer compression does not work in Node.js v23.0~v24.1 (Compilation error) From 38df85d4fa039aa50cd4a785d3463f6ddb526839 Mon Sep 17 00:00:00 2001 From: vitaliylag Date: Tue, 8 Jul 2025 14:37:38 +0400 Subject: [PATCH 14/24] Simplify all should-build.sh --- recipes/x64-glibc-217/should-build.sh | 14 +++++++----- .../x64-pointer-compression/should-build.sh | 22 +++++++++++-------- recipes/x86/should-build.sh | 12 ++++++---- 3 files changed, 30 insertions(+), 18 deletions(-) diff --git a/recipes/x64-glibc-217/should-build.sh b/recipes/x64-glibc-217/should-build.sh index 6bf1b92..1fd6ba2 100755 --- a/recipes/x64-glibc-217/should-build.sh +++ b/recipes/x64-glibc-217/should-build.sh @@ -3,11 +3,15 @@ __dirname=$1 fullversion=$2 -. ${__dirname}/_decode_version.sh +isNodeVersionGE() { + printf "$1\n$fullversion" | sort -VC +} -decode "$fullversion" +isNodeVersionLT() { + ! printf "$1\n$fullversion" | sort -VC +} -[ "$major" -ge 7 ] || ( [ "$major" -eq 6 ] && [ "$minor" -ge 2 ] ) # Node.js v6.1- cannot download required files due to broken links +isNodeVersionGE 'v6.2' # Node.js v6.1- cannot download required files due to broken links -[ "$major" -ne 17 ] # GCC version between 4.8.5 and 12.1 is required but not installed -[[ ! "$fullversion" =~ ^v22\.2\. ]] # GCC version between 12.1 and 15.1 is required but not installed +! ( isNodeVersionGE 'v17.0' && isNodeVersionLT 'v18.0' ) # GCC version between 4.8.5 and 12.1 is required but not installed +! ( isNodeVersionGE 'v22.2' && isNodeVersionLT 'v22.3' ) # GCC version between 12.1 and 15.1 is required but not installed diff --git a/recipes/x64-pointer-compression/should-build.sh b/recipes/x64-pointer-compression/should-build.sh index 4a7207c..2b7de4c 100755 --- a/recipes/x64-pointer-compression/should-build.sh +++ b/recipes/x64-pointer-compression/should-build.sh @@ -3,16 +3,20 @@ __dirname=$1 fullversion=$2 -. ${__dirname}/_decode_version.sh +isNodeVersionGE() { + printf "$1\n$fullversion" | sort -VC +} -decode "$fullversion" +isNodeVersionLT() { + ! printf "$1\n$fullversion" | sort -VC +} -[ "$major" -ge 14 ] || ( [ "$major" -eq 13 ] && [ "$minor" -ge 4 ] ) # Pointer compression is supported since Node.js v13.4 +isNodeVersionGE 'v13.4' # Pointer compression is supported since Node.js v13.4 -[ "$major" -ne 17 ] # GCC version between 4.8.5 and 12.1 is required but not installed -[[ ! "$fullversion" =~ ^v22\.2\. ]] # GCC version between 12.1 and 15.1 is required but not installed +! ( isNodeVersionGE 'v17.0' && isNodeVersionLT 'v18.0' ) # GCC version between 4.8.5 and 12.1 is required but not installed +! ( isNodeVersionGE 'v22.2' && isNodeVersionLT 'v22.3' ) # GCC version between 12.1 and 15.1 is required but not installed -[ "$major" -ne 20 ] || [ "$minor" -lt 17 ] # Pointer compression does not work in Node.js v20.17~v20.19 (Compilation error) -[[ ! "$fullversion" =~ ^v21\.[0-2]\. ]] # Pointer compression does not work in Node.js v21.0~v21.2 (Segmentation fault) -[ "$major" -ne 22 ] || [ "$minor" -lt 6 ] || [ "$minor" -gt 16 ] # Pointer compression does not work in Node.js v22.6~v22.16 (Compilation error) -[[ ! "$fullversion" =~ ^v(23|24\.[0-1]\.) ]] # Pointer compression does not work in Node.js v23.0~v24.1 (Compilation error) +! ( isNodeVersionGE 'v20.17' && isNodeVersionLT 'v21.0' ) # Pointer compression does not work in Node.js v20.17~v20.19 (Compilation error) +! ( isNodeVersionGE 'v21.0' && isNodeVersionLT 'v21.3' ) # Pointer compression does not work in Node.js v21.0~v21.2 (Segmentation fault) +! ( isNodeVersionGE 'v22.6' && isNodeVersionLT 'v22.17' ) # Pointer compression does not work in Node.js v22.6~v22.16 (Compilation error) +! ( isNodeVersionGE 'v23.0' && isNodeVersionLT 'v24.2' ) # Pointer compression does not work in Node.js v23.0~v24.1 (Compilation error) diff --git a/recipes/x86/should-build.sh b/recipes/x86/should-build.sh index 9be0b56..f310ce3 100755 --- a/recipes/x86/should-build.sh +++ b/recipes/x86/should-build.sh @@ -3,10 +3,14 @@ __dirname=$1 fullversion=$2 -. ${__dirname}/_decode_version.sh +isNodeVersionGE() { + printf "$1\n$fullversion" | sort -VC +} -decode "$fullversion" +isNodeVersionLT() { + ! printf "$1\n$fullversion" | sort -VC +} -[ "$major" -ge 7 ] || ( [ "$major" -eq 6 ] && [ "$minor" -ge 2 ] ) # Node.js v6.1- cannot download required files due to broken links +isNodeVersionGE 'v6.2' # Node.js v6.1- cannot download required files due to broken links -[[ ! "$fullversion" =~ ^v22\.[0-2]\. ]] # GCC version between 9.3 and 15.1 is required but not installed +! ( isNodeVersionGE 'v22.0' && isNodeVersionLT 'v22.3' ) # GCC version between 9.3 and 15.1 is required but not installed From b7475f794f06a209435965088efd08c45fdac7d0 Mon Sep 17 00:00:00 2001 From: vitaliylag Date: Tue, 8 Jul 2025 16:13:35 +0400 Subject: [PATCH 15/24] Simplify all should-build.sh (patch) --- recipes/x64-glibc-217/should-build.sh | 6 +++--- recipes/x64-pointer-compression/should-build.sh | 14 +++++++------- recipes/x86/should-build.sh | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/recipes/x64-glibc-217/should-build.sh b/recipes/x64-glibc-217/should-build.sh index 1fd6ba2..3f0e74c 100755 --- a/recipes/x64-glibc-217/should-build.sh +++ b/recipes/x64-glibc-217/should-build.sh @@ -11,7 +11,7 @@ isNodeVersionLT() { ! printf "$1\n$fullversion" | sort -VC } -isNodeVersionGE 'v6.2' # Node.js v6.1- cannot download required files due to broken links +isNodeVersionGE 'v6.2' # Node.js v6.1- cannot download required files due to broken links -! ( isNodeVersionGE 'v17.0' && isNodeVersionLT 'v18.0' ) # GCC version between 4.8.5 and 12.1 is required but not installed -! ( isNodeVersionGE 'v22.2' && isNodeVersionLT 'v22.3' ) # GCC version between 12.1 and 15.1 is required but not installed +isNodeVersionLT 'v17.0' || isNodeVersionGE 'v18.0' # Node.js v17 requires GCC version between 4.8.5 and 12.1 which is not installed +isNodeVersionLT 'v22.2' || isNodeVersionGE 'v22.3' # Node.js v22.2 requires GCC version between 12.1 and 15.1 which is not installed diff --git a/recipes/x64-pointer-compression/should-build.sh b/recipes/x64-pointer-compression/should-build.sh index 2b7de4c..6c2fb6f 100755 --- a/recipes/x64-pointer-compression/should-build.sh +++ b/recipes/x64-pointer-compression/should-build.sh @@ -11,12 +11,12 @@ isNodeVersionLT() { ! printf "$1\n$fullversion" | sort -VC } -isNodeVersionGE 'v13.4' # Pointer compression is supported since Node.js v13.4 +isNodeVersionGE 'v13.4' # Pointer compression is supported since Node.js v13.4 -! ( isNodeVersionGE 'v17.0' && isNodeVersionLT 'v18.0' ) # GCC version between 4.8.5 and 12.1 is required but not installed -! ( isNodeVersionGE 'v22.2' && isNodeVersionLT 'v22.3' ) # GCC version between 12.1 and 15.1 is required but not installed +isNodeVersionLT 'v17.0' || isNodeVersionGE 'v18.0' # Node.js v17 requires GCC version between 4.8.5 and 12.1 which is not installed +isNodeVersionLT 'v22.2' || isNodeVersionGE 'v22.3' # Node.js v22.2 requires GCC version between 12.1 and 15.1 which is not installed -! ( isNodeVersionGE 'v20.17' && isNodeVersionLT 'v21.0' ) # Pointer compression does not work in Node.js v20.17~v20.19 (Compilation error) -! ( isNodeVersionGE 'v21.0' && isNodeVersionLT 'v21.3' ) # Pointer compression does not work in Node.js v21.0~v21.2 (Segmentation fault) -! ( isNodeVersionGE 'v22.6' && isNodeVersionLT 'v22.17' ) # Pointer compression does not work in Node.js v22.6~v22.16 (Compilation error) -! ( isNodeVersionGE 'v23.0' && isNodeVersionLT 'v24.2' ) # Pointer compression does not work in Node.js v23.0~v24.1 (Compilation error) +isNodeVersionLT 'v20.17' || isNodeVersionGE 'v21.0' # Pointer compression does not work in Node.js v20.17~v20.19 (Compilation error) +isNodeVersionLT 'v21.0' || isNodeVersionGE 'v21.3' # Pointer compression does not work in Node.js v21.0~v21.2 (Segmentation fault) +isNodeVersionLT 'v22.6' || isNodeVersionGE 'v22.17' # Pointer compression does not work in Node.js v22.6~v22.16 (Compilation error) +isNodeVersionLT 'v23.0' || isNodeVersionGE 'v24.2' # Pointer compression does not work in Node.js v23.0~v24.1 (Compilation error) diff --git a/recipes/x86/should-build.sh b/recipes/x86/should-build.sh index f310ce3..ed3bad4 100755 --- a/recipes/x86/should-build.sh +++ b/recipes/x86/should-build.sh @@ -11,6 +11,6 @@ isNodeVersionLT() { ! printf "$1\n$fullversion" | sort -VC } -isNodeVersionGE 'v6.2' # Node.js v6.1- cannot download required files due to broken links +isNodeVersionGE 'v6.2' # Node.js v6.1- cannot download required files due to broken links -! ( isNodeVersionGE 'v22.0' && isNodeVersionLT 'v22.3' ) # GCC version between 9.3 and 15.1 is required but not installed +isNodeVersionLT 'v22.0' || isNodeVersionGE 'v22.3' # Node.js v22.0~v22.2 requires GCC version between 9.3 and 15.1 which is not installed From 2ced16e2eba9776af73fe8eb7d659e47e592ed6f Mon Sep 17 00:00:00 2001 From: Henry Hsieh Date: Sat, 16 May 2026 14:53:45 +0800 Subject: [PATCH 16/24] refactor(glibc-217): add checksum and don't generate recipes --- bin/_config.sh | 2 + bin/copy-recipes.sh | 52 ------------------- bin/prepare-images.sh | 5 ++ recipes/centos7-toolchain/Dockerfile | 19 +++++++ recipes/centos7-toolchain/files/checksums.sh | 4 ++ .../files/etc__yum.repos.d__devtoolset.repo | 0 .../files/installFromSourceCode | 50 ++++++++++++++++++ .../files/installPrerequisites | 0 .../files/opt__gcc15__enable | 0 recipes/centos7-toolchain/should-build.sh | 4 ++ recipes/x64-glibc-217/Dockerfile | 13 +---- .../x64-glibc-217/files/installFromSourceCode | 36 ------------- recipes/x64-pointer-compression/Dockerfile | 13 +---- .../files/etc__yum.repos.d__devtoolset.repo | 4 -- .../files/installFromSourceCode | 36 ------------- .../files/installPrerequisites | 12 ----- .../files/opt__gcc15__enable | 15 ------ recipes/x86/Dockerfile | 10 ++-- recipes/x86/files/checksums.sh | 5 ++ recipes/x86/files/installFromSourceCode | 28 +++++++--- 20 files changed, 118 insertions(+), 190 deletions(-) delete mode 100755 bin/copy-recipes.sh create mode 100644 recipes/centos7-toolchain/Dockerfile create mode 100644 recipes/centos7-toolchain/files/checksums.sh rename recipes/{x64-glibc-217 => centos7-toolchain}/files/etc__yum.repos.d__devtoolset.repo (100%) create mode 100644 recipes/centos7-toolchain/files/installFromSourceCode rename recipes/{x64-glibc-217 => centos7-toolchain}/files/installPrerequisites (100%) rename recipes/{x64-glibc-217 => centos7-toolchain}/files/opt__gcc15__enable (100%) create mode 100644 recipes/centos7-toolchain/should-build.sh delete mode 100644 recipes/x64-glibc-217/files/installFromSourceCode delete mode 100644 recipes/x64-pointer-compression/files/etc__yum.repos.d__devtoolset.repo delete mode 100644 recipes/x64-pointer-compression/files/installFromSourceCode delete mode 100644 recipes/x64-pointer-compression/files/installPrerequisites delete mode 100644 recipes/x64-pointer-compression/files/opt__gcc15__enable create mode 100644 recipes/x86/files/checksums.sh diff --git a/bin/_config.sh b/bin/_config.sh index 346d402..6b40fb8 100644 --- a/bin/_config.sh +++ b/bin/_config.sh @@ -1,5 +1,7 @@ # All of our build recipes, new recipes should be added here. +# centos7-toolchain must be listed first as other recipes FROM it. recipes=( + "centos7-toolchain" "headers" "x86" "musl" diff --git a/bin/copy-recipes.sh b/bin/copy-recipes.sh deleted file mode 100755 index f7908b5..0000000 --- a/bin/copy-recipes.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/bash -eu - -# Copies files from recipes/x64-glibc-217 to: -# recipes/x64-pointer-compression -# recipes/x86 - -__dirname="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -recipesDir="$(dirname "$__dirname")/recipes" -srcRecipeDir="$recipesDir/x64-glibc-217" - - - -# Copy to x64-pointer-compression - -for dirBase in x64-pointer-compression; do - destRecipeDir="$recipesDir/$dirBase" - mkdir -p "$destRecipeDir/files" - - cp -f "$srcRecipeDir/Dockerfile" "$destRecipeDir/" - cp -f "$srcRecipeDir/run.sh" "$destRecipeDir/" - # cp -f "$srcRecipeDir/run_other.sh" "$destRecipeDir/" # Recipe specific code - cp -f "$srcRecipeDir/run_versions.sh" "$destRecipeDir/" - # cp -f "$srcRecipeDir/should-build.sh" "$destRecipeDir/" # Pointer compression is supported from v13.4 - cp -rf "$srcRecipeDir/files/"* "$destRecipeDir/files/" -done - - - -# Copy to x86 - -if true; then - destRecipeDir="$recipesDir/x86" - mkdir -p "$destRecipeDir/files" - - cp -f "$srcRecipeDir/Dockerfile" "$destRecipeDir/" - cp -f "$srcRecipeDir/run.sh" "$destRecipeDir/" - # cp -f "$srcRecipeDir/run_other.sh" "$destRecipeDir/" # Recipe specific code - # cp -f "$srcRecipeDir/run_versions.sh" "$destRecipeDir/" # Different versions of programs are used (because devtoolset-12 is not available) - # cp -f "$srcRecipeDir/should-build.sh" "$destRecipeDir/" - - # cp -f "$srcRecipeDir/files/"*.repo "$destRecipeDir/files/" # Different versions of programs are used (because devtoolset-12 is not available) - # cp -f "$srcRecipeDir/files/installPrerequisites" "$destRecipeDir/files/" # Different versions of programs are used (because devtoolset-12 is not available) - cp -f "$srcRecipeDir/files/installFromSourceCode" "$destRecipeDir/files/" - cp -f "$srcRecipeDir/files/opt__gcc15__enable" "$destRecipeDir/files/" - - sed -i -e 's/ --platform=linux\/amd64 / --platform=linux\/386 /g' "$destRecipeDir/Dockerfile" - sed -i -E 's/# RUN (.* binutils )/RUN \1/g' "$destRecipeDir/Dockerfile" - sed -i -E 's/--build=x86_64-redhat-linux/--build=i686-redhat-linux/g' "$destRecipeDir/Dockerfile" - # sed -i -e 's/gcc-15.1.0/gcc-12.4.0/g' "$destRecipeDir/Dockerfile" - # sed -i -e 's/gcc15/gcc12/g' "$destRecipeDir/Dockerfile" "$destRecipeDir/files/opt__gcc12__enable" "$destRecipeDir/files/installFromSourceCode" - sed -i -e 's/devtoolset-12/devtoolset-9/g' "$destRecipeDir/files/opt__gcc"*'__enable' -fi diff --git a/bin/prepare-images.sh b/bin/prepare-images.sh index ee7f03c..995e398 100755 --- a/bin/prepare-images.sh +++ b/bin/prepare-images.sh @@ -7,7 +7,12 @@ source "${__dirname}/_config.sh" docker build "${__dirname}/../fetch-source" -t "${image_tag_pfx}fetch-source" --build-arg UID=1000 --build-arg GID=1000 +# Build the shared base image first (must precede recipes that FROM it) +docker build "${recipes_dir}/centos7-toolchain/" -t "${image_tag_pfx}centos7-toolchain" --build-arg UID=1000 --build-arg GID=1000 + for recipe in "${recipes[@]}"; do + # Skip the base image - already built above + [ "$recipe" = "centos7-toolchain" ] && continue docker build "${recipes_dir}/${recipe}/" -t "${image_tag_pfx}${recipe}" --build-arg UID=1000 --build-arg GID=1000 done diff --git a/recipes/centos7-toolchain/Dockerfile b/recipes/centos7-toolchain/Dockerfile new file mode 100644 index 0000000..5f4eb80 --- /dev/null +++ b/recipes/centos7-toolchain/Dockerfile @@ -0,0 +1,19 @@ +FROM --platform=linux/amd64 centos:7 + +ARG GID=1000 +ARG UID=1000 + +RUN groupadd --gid $GID node \ + && adduser --gid $GID --uid $UID node + +COPY --chmod=755 files/installPrerequisites /root/installPrerequisites +COPY files/*.repo /etc/yum.repos.d/ +RUN /root/installPrerequisites + +COPY --chmod=755 files/installFromSourceCode /root/installFromSourceCode +COPY --chmod=755 files/opt__gcc15__enable /opt/gcc15/enable +COPY --chmod=755 files/checksums.sh /root/checksums.sh + +RUN --mount=type=cache,target=/root/.ccache --mount=type=tmpfs,target=/usr/src . /root/checksums.sh && /root/installFromSourceCode https://www.python.org/ftp/python/3.9.23/Python-3.9.23.tar.xz "$sha256_python39" '--prefix=/usr/local/' +RUN --mount=type=cache,target=/root/.ccache --mount=type=tmpfs,target=/usr/src . /root/checksums.sh && /root/installFromSourceCode https://www.python.org/ftp/python/3.13.5/Python-3.13.5.tar.xz "$sha256_python313" '--prefix=/usr/local/' +RUN --mount=type=cache,target=/root/.ccache --mount=type=tmpfs,target=/usr/src . /root/checksums.sh && /root/installFromSourceCode https://gcc.gnu.org/pub/gcc/releases/gcc-15.1.0/gcc-15.1.0.tar.xz "$sha256_gcc15" '--prefix=/opt/gcc15/ --with-default-libstdcxx-abi=gcc4-compatible --enable-languages=c,c++ --enable-checking=release --enable-gnu-indirect-function --with-linker-hash-style=gnu --disable-bootstrap --disable-multilib --build=x86_64-redhat-linux' diff --git a/recipes/centos7-toolchain/files/checksums.sh b/recipes/centos7-toolchain/files/checksums.sh new file mode 100644 index 0000000..b000ca7 --- /dev/null +++ b/recipes/centos7-toolchain/files/checksums.sh @@ -0,0 +1,4 @@ +# SHA256 checksums for source tarballs +sha256_python39='61a42919e13d539f7673cf11d1c404380e28e540510860b9d242196e165709c9' +sha256_python313='93e583f243454e6e9e4588ca2c2662206ad961659863277afcdb96801647d640' +sha256_gcc15='e2b09ec21660f01fecffb715e0120265216943f038d0e48a9868713e54f06cea' diff --git a/recipes/x64-glibc-217/files/etc__yum.repos.d__devtoolset.repo b/recipes/centos7-toolchain/files/etc__yum.repos.d__devtoolset.repo similarity index 100% rename from recipes/x64-glibc-217/files/etc__yum.repos.d__devtoolset.repo rename to recipes/centos7-toolchain/files/etc__yum.repos.d__devtoolset.repo diff --git a/recipes/centos7-toolchain/files/installFromSourceCode b/recipes/centos7-toolchain/files/installFromSourceCode new file mode 100644 index 0000000..31e1163 --- /dev/null +++ b/recipes/centos7-toolchain/files/installFromSourceCode @@ -0,0 +1,50 @@ +#!/bin/bash -eux + +# Args: url expectedSha256 configureArgsStr + +url="$1" +expectedSha256="$2" +configureArgsStr="$3" + +base=$(basename "$url") +name=${base%.*} +name=${name%.tar} +ext=${base:${#name}} + +case "$ext" in + .tar.xz|.txz) formatOpt=--xz;; + .tar.gz|.tgz) formatOpt=--gzip;; + .tar.bz2|.tbz2) formatOpt=--bzip2;; + *) formatOpt=--auto-compress +esac + +# Download and verify checksum +tmpFile="/usr/src/${base}" +curl -fL -o "$tmpFile" "$url" + +if [ -n "$expectedSha256" ]; then + actualSha256=$(sha256sum "$tmpFile" | awk '{print $1}') + if [ "$actualSha256" != "$expectedSha256" ]; then + echo "SHA256 mismatch for $base!" >&2 + echo " expected: $expectedSha256" >&2 + echo " actual: $actualSha256" >&2 + exit 1 + fi + echo "SHA256 verified: $base" +fi + +tar --extract --file="$tmpFile" --directory=/usr/src "$formatOpt" +rm -f "$tmpFile" + +source /opt/gcc15/enable +export CC='ccache gcc' +export CXX='ccache g++' + +cd "/usr/src/$name" +chmod +x ./contrib/download_prerequisites 2>/dev/null && ./contrib/download_prerequisites +./configure $configureArgsStr +make -j $(nproc) +make install + +hash -r +ccache -s > "/root/ccacheStat_$name.txt" diff --git a/recipes/x64-glibc-217/files/installPrerequisites b/recipes/centos7-toolchain/files/installPrerequisites similarity index 100% rename from recipes/x64-glibc-217/files/installPrerequisites rename to recipes/centos7-toolchain/files/installPrerequisites diff --git a/recipes/x64-glibc-217/files/opt__gcc15__enable b/recipes/centos7-toolchain/files/opt__gcc15__enable similarity index 100% rename from recipes/x64-glibc-217/files/opt__gcc15__enable rename to recipes/centos7-toolchain/files/opt__gcc15__enable diff --git a/recipes/centos7-toolchain/should-build.sh b/recipes/centos7-toolchain/should-build.sh new file mode 100644 index 0000000..cfde68b --- /dev/null +++ b/recipes/centos7-toolchain/should-build.sh @@ -0,0 +1,4 @@ +#!/bin/bash +# This is a base image used by other recipes, not a build recipe itself. +# Always skip during the build phase. +exit 1 diff --git a/recipes/x64-glibc-217/Dockerfile b/recipes/x64-glibc-217/Dockerfile index 01856fa..20072fa 100644 --- a/recipes/x64-glibc-217/Dockerfile +++ b/recipes/x64-glibc-217/Dockerfile @@ -1,4 +1,4 @@ -FROM --platform=linux/amd64 centos:7 +FROM --platform=linux/amd64 unofficial-build-recipe-centos7-toolchain ARG GID=1000 ARG UID=1000 @@ -6,17 +6,6 @@ ARG UID=1000 RUN groupadd --gid $GID node \ && adduser --gid $GID --uid $UID node -COPY --chmod=755 files/installPrerequisites /root/installPrerequisites -COPY files/*.repo /etc/yum.repos.d/ -RUN /root/installPrerequisites - -COPY --chmod=755 files/installFromSourceCode /root/installFromSourceCode -COPY --chmod=755 files/opt__gcc15__enable /opt/gcc15/enable -RUN --mount=type=cache,target=/root/.ccache --mount=type=tmpfs,target=/usr/src /root/installFromSourceCode python3 https://www.python.org/ftp/python/3.9.23/Python-3.9.23.tar.xz '--prefix=/usr/local/' -RUN --mount=type=cache,target=/root/.ccache --mount=type=tmpfs,target=/usr/src /root/installFromSourceCode python3 https://www.python.org/ftp/python/3.13.5/Python-3.13.5.tar.xz '--prefix=/usr/local/' -RUN --mount=type=cache,target=/root/.ccache --mount=type=tmpfs,target=/usr/src /root/installFromSourceCode gcc https://gcc.gnu.org/pub/gcc/releases/gcc-15.1.0/gcc-15.1.0.tar.xz '--prefix=/opt/gcc15/ --with-default-libstdcxx-abi=gcc4-compatible --enable-languages=c,c++ --enable-checking=release --enable-gnu-indirect-function --with-linker-hash-style=gnu --disable-bootstrap --disable-multilib --build=x86_64-redhat-linux' -# RUN --mount=type=cache,target=/root/.ccache --mount=type=tmpfs,target=/usr/src /root/installFromSourceCode binutils https://sourceware.org/pub/binutils/releases/binutils-2.44.tar.xz '--prefix=/opt/gcc15/ --without-debuginfod --disable-nls LDFLAGS=-pthread' - COPY --chmod=755 --chown=node:node run.sh run_other.sh run_versions.sh /home/node/ VOLUME /home/node/.ccache diff --git a/recipes/x64-glibc-217/files/installFromSourceCode b/recipes/x64-glibc-217/files/installFromSourceCode deleted file mode 100644 index ebbab3b..0000000 --- a/recipes/x64-glibc-217/files/installFromSourceCode +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash -eux - -# Calc vars - - id="$1" -url="$2" -configureArgsStr="$3" - -base=$(basename "$url") -name=${base%.*} -name=${name%.tar} - ext=${base:${#name}} - -case "$ext" in - .tar.xz|.txz) formatOpt=--xz;; - .tar.gz|.tgz) formatOpt=--gzip;; - .tar.bz2|.tbz2) formatOpt=--bzip2;; - *) formatOpt=--auto-compress -esac - -# Run commands - -curl -fL "$url" | tar --extract --directory=/usr/src "$formatOpt" - -source /opt/gcc15/enable -export CC='ccache gcc' -export CXX='ccache g++' - -cd "/usr/src/$name" -chmod +x ./contrib/download_prerequisites 2>/dev/null && ./contrib/download_prerequisites -./configure $configureArgsStr -make -j $(nproc) -make install - -hash -r -ccache -s > "/root/ccacheStat_$name.txt" diff --git a/recipes/x64-pointer-compression/Dockerfile b/recipes/x64-pointer-compression/Dockerfile index 01856fa..20072fa 100644 --- a/recipes/x64-pointer-compression/Dockerfile +++ b/recipes/x64-pointer-compression/Dockerfile @@ -1,4 +1,4 @@ -FROM --platform=linux/amd64 centos:7 +FROM --platform=linux/amd64 unofficial-build-recipe-centos7-toolchain ARG GID=1000 ARG UID=1000 @@ -6,17 +6,6 @@ ARG UID=1000 RUN groupadd --gid $GID node \ && adduser --gid $GID --uid $UID node -COPY --chmod=755 files/installPrerequisites /root/installPrerequisites -COPY files/*.repo /etc/yum.repos.d/ -RUN /root/installPrerequisites - -COPY --chmod=755 files/installFromSourceCode /root/installFromSourceCode -COPY --chmod=755 files/opt__gcc15__enable /opt/gcc15/enable -RUN --mount=type=cache,target=/root/.ccache --mount=type=tmpfs,target=/usr/src /root/installFromSourceCode python3 https://www.python.org/ftp/python/3.9.23/Python-3.9.23.tar.xz '--prefix=/usr/local/' -RUN --mount=type=cache,target=/root/.ccache --mount=type=tmpfs,target=/usr/src /root/installFromSourceCode python3 https://www.python.org/ftp/python/3.13.5/Python-3.13.5.tar.xz '--prefix=/usr/local/' -RUN --mount=type=cache,target=/root/.ccache --mount=type=tmpfs,target=/usr/src /root/installFromSourceCode gcc https://gcc.gnu.org/pub/gcc/releases/gcc-15.1.0/gcc-15.1.0.tar.xz '--prefix=/opt/gcc15/ --with-default-libstdcxx-abi=gcc4-compatible --enable-languages=c,c++ --enable-checking=release --enable-gnu-indirect-function --with-linker-hash-style=gnu --disable-bootstrap --disable-multilib --build=x86_64-redhat-linux' -# RUN --mount=type=cache,target=/root/.ccache --mount=type=tmpfs,target=/usr/src /root/installFromSourceCode binutils https://sourceware.org/pub/binutils/releases/binutils-2.44.tar.xz '--prefix=/opt/gcc15/ --without-debuginfod --disable-nls LDFLAGS=-pthread' - COPY --chmod=755 --chown=node:node run.sh run_other.sh run_versions.sh /home/node/ VOLUME /home/node/.ccache diff --git a/recipes/x64-pointer-compression/files/etc__yum.repos.d__devtoolset.repo b/recipes/x64-pointer-compression/files/etc__yum.repos.d__devtoolset.repo deleted file mode 100644 index 81064ea..0000000 --- a/recipes/x64-pointer-compression/files/etc__yum.repos.d__devtoolset.repo +++ /dev/null @@ -1,4 +0,0 @@ -[devtoolset-12] -name=Devtoolset 12 -baseurl=https://buildlogs.centos.org/c7-devtoolset-12.x86_64/ -gpgcheck=0 diff --git a/recipes/x64-pointer-compression/files/installFromSourceCode b/recipes/x64-pointer-compression/files/installFromSourceCode deleted file mode 100644 index ebbab3b..0000000 --- a/recipes/x64-pointer-compression/files/installFromSourceCode +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash -eux - -# Calc vars - - id="$1" -url="$2" -configureArgsStr="$3" - -base=$(basename "$url") -name=${base%.*} -name=${name%.tar} - ext=${base:${#name}} - -case "$ext" in - .tar.xz|.txz) formatOpt=--xz;; - .tar.gz|.tgz) formatOpt=--gzip;; - .tar.bz2|.tbz2) formatOpt=--bzip2;; - *) formatOpt=--auto-compress -esac - -# Run commands - -curl -fL "$url" | tar --extract --directory=/usr/src "$formatOpt" - -source /opt/gcc15/enable -export CC='ccache gcc' -export CXX='ccache g++' - -cd "/usr/src/$name" -chmod +x ./contrib/download_prerequisites 2>/dev/null && ./contrib/download_prerequisites -./configure $configureArgsStr -make -j $(nproc) -make install - -hash -r -ccache -s > "/root/ccacheStat_$name.txt" diff --git a/recipes/x64-pointer-compression/files/installPrerequisites b/recipes/x64-pointer-compression/files/installPrerequisites deleted file mode 100644 index 38ba177..0000000 --- a/recipes/x64-pointer-compression/files/installPrerequisites +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -eux - -sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* -sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* -yum install -y epel-release # Adds extra repos -yum upgrade -y - -yum install -y bzip2 # Required to compile gcc -yum install -y gcc-c++ # Required to compile Node.js v7- -yum install -y make # Allows compilation -yum install -y ccache # Allows caching -yum install -y devtoolset-12 # Includes gcc 12.1.1 diff --git a/recipes/x64-pointer-compression/files/opt__gcc15__enable b/recipes/x64-pointer-compression/files/opt__gcc15__enable deleted file mode 100644 index f25221a..0000000 --- a/recipes/x64-pointer-compression/files/opt__gcc15__enable +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -eux - -DIR=/opt/gcc15 - -source /opt/rh/devtoolset-12/enable - -export PATH="$DIR/bin${PATH:+:${PATH}}" -export MANPATH="$DIR/share/man${MANPATH:+:${MANPATH}}" -export INFOPATH="$DIR/share/info${INFOPATH:+:${INFOPATH}}" -export LD_LIBRARY_PATH="$DIR/lib64:$DIR/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}" -export PKG_CONFIG_PATH="$DIR/lib64/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}}" - -if [ -f "$DIR/bin/gcc" ]; then - export LDFLAGS='-static-libstdc++' -fi diff --git a/recipes/x86/Dockerfile b/recipes/x86/Dockerfile index cb806d6..36a7cb8 100644 --- a/recipes/x86/Dockerfile +++ b/recipes/x86/Dockerfile @@ -12,10 +12,12 @@ RUN /root/installPrerequisites COPY --chmod=755 files/installFromSourceCode /root/installFromSourceCode COPY --chmod=755 files/opt__gcc15__enable /opt/gcc15/enable -RUN --mount=type=cache,target=/root/.ccache --mount=type=tmpfs,target=/usr/src /root/installFromSourceCode python3 https://www.python.org/ftp/python/3.9.23/Python-3.9.23.tar.xz '--prefix=/usr/local/' -RUN --mount=type=cache,target=/root/.ccache --mount=type=tmpfs,target=/usr/src /root/installFromSourceCode python3 https://www.python.org/ftp/python/3.13.5/Python-3.13.5.tar.xz '--prefix=/usr/local/' -RUN --mount=type=cache,target=/root/.ccache --mount=type=tmpfs,target=/usr/src /root/installFromSourceCode gcc https://gcc.gnu.org/pub/gcc/releases/gcc-15.1.0/gcc-15.1.0.tar.xz '--prefix=/opt/gcc15/ --with-default-libstdcxx-abi=gcc4-compatible --enable-languages=c,c++ --enable-checking=release --enable-gnu-indirect-function --with-linker-hash-style=gnu --disable-bootstrap --disable-multilib --build=i686-redhat-linux' -RUN --mount=type=cache,target=/root/.ccache --mount=type=tmpfs,target=/usr/src /root/installFromSourceCode binutils https://sourceware.org/pub/binutils/releases/binutils-2.44.tar.xz '--prefix=/opt/gcc15/ --without-debuginfod --disable-nls LDFLAGS=-pthread' +COPY --chmod=755 files/checksums.sh /root/checksums.sh + +RUN --mount=type=cache,target=/root/.ccache --mount=type=tmpfs,target=/usr/src . /root/checksums.sh && /root/installFromSourceCode https://www.python.org/ftp/python/3.9.23/Python-3.9.23.tar.xz "$sha256_python39" '--prefix=/usr/local/' +RUN --mount=type=cache,target=/root/.ccache --mount=type=tmpfs,target=/usr/src . /root/checksums.sh && /root/installFromSourceCode https://www.python.org/ftp/python/3.13.5/Python-3.13.5.tar.xz "$sha256_python313" '--prefix=/usr/local/' +RUN --mount=type=cache,target=/root/.ccache --mount=type=tmpfs,target=/usr/src . /root/checksums.sh && /root/installFromSourceCode https://gcc.gnu.org/pub/gcc/releases/gcc-15.1.0/gcc-15.1.0.tar.xz "$sha256_gcc15" '--prefix=/opt/gcc15/ --with-default-libstdcxx-abi=gcc4-compatible --enable-languages=c,c++ --enable-checking=release --enable-gnu-indirect-function --with-linker-hash-style=gnu --disable-bootstrap --disable-multilib --build=i686-redhat-linux' +RUN --mount=type=cache,target=/root/.ccache --mount=type=tmpfs,target=/usr/src . /root/checksums.sh && /root/installFromSourceCode https://sourceware.org/pub/binutils/releases/binutils-2.44.tar.xz "$sha256_binutils" '--prefix=/opt/gcc15/ --without-debuginfod --disable-nls LDFLAGS=-pthread' COPY --chmod=755 --chown=node:node run.sh run_other.sh run_versions.sh /home/node/ diff --git a/recipes/x86/files/checksums.sh b/recipes/x86/files/checksums.sh new file mode 100644 index 0000000..99fb2f4 --- /dev/null +++ b/recipes/x86/files/checksums.sh @@ -0,0 +1,5 @@ +# SHA256 checksums for source tarballs +sha256_python39='61a42919e13d539f7673cf11d1c404380e28e540510860b9d242196e165709c9' +sha256_python313='93e583f243454e6e9e4588ca2c2662206ad961659863277afcdb96801647d640' +sha256_gcc15='e2b09ec21660f01fecffb715e0120265216943f038d0e48a9868713e54f06cea' +sha256_binutils='ce2017e059d63e67ddb9240e9d4ec49c2893605035cd60e92ad53177f4377237' diff --git a/recipes/x86/files/installFromSourceCode b/recipes/x86/files/installFromSourceCode index ebbab3b..31e1163 100644 --- a/recipes/x86/files/installFromSourceCode +++ b/recipes/x86/files/installFromSourceCode @@ -1,15 +1,15 @@ #!/bin/bash -eux -# Calc vars +# Args: url expectedSha256 configureArgsStr - id="$1" -url="$2" +url="$1" +expectedSha256="$2" configureArgsStr="$3" base=$(basename "$url") name=${base%.*} name=${name%.tar} - ext=${base:${#name}} +ext=${base:${#name}} case "$ext" in .tar.xz|.txz) formatOpt=--xz;; @@ -18,9 +18,23 @@ case "$ext" in *) formatOpt=--auto-compress esac -# Run commands - -curl -fL "$url" | tar --extract --directory=/usr/src "$formatOpt" +# Download and verify checksum +tmpFile="/usr/src/${base}" +curl -fL -o "$tmpFile" "$url" + +if [ -n "$expectedSha256" ]; then + actualSha256=$(sha256sum "$tmpFile" | awk '{print $1}') + if [ "$actualSha256" != "$expectedSha256" ]; then + echo "SHA256 mismatch for $base!" >&2 + echo " expected: $expectedSha256" >&2 + echo " actual: $actualSha256" >&2 + exit 1 + fi + echo "SHA256 verified: $base" +fi + +tar --extract --file="$tmpFile" --directory=/usr/src "$formatOpt" +rm -f "$tmpFile" source /opt/gcc15/enable export CC='ccache gcc' From b129d05f35fa4a885db984834f66bbc8d00ff1bc Mon Sep 17 00:00:00 2001 From: Henry Hsieh Date: Sat, 16 May 2026 15:50:06 +0800 Subject: [PATCH 17/24] chore: align shebang with main branch --- recipes/centos7-toolchain/files/installFromSourceCode | 5 ++++- recipes/centos7-toolchain/files/installPrerequisites | 5 ++++- recipes/centos7-toolchain/files/opt__gcc15__enable | 5 ++++- recipes/x64-glibc-217/run_other.sh | 5 ++++- recipes/x64-glibc-217/run_versions.sh | 5 ++++- recipes/x64-pointer-compression/run_other.sh | 5 ++++- recipes/x64-pointer-compression/run_versions.sh | 5 ++++- recipes/x86/files/installFromSourceCode | 5 ++++- recipes/x86/files/installPrerequisites | 5 ++++- recipes/x86/files/opt__gcc15__enable | 5 ++++- recipes/x86/run_other.sh | 5 ++++- recipes/x86/run_versions.sh | 5 ++++- 12 files changed, 48 insertions(+), 12 deletions(-) diff --git a/recipes/centos7-toolchain/files/installFromSourceCode b/recipes/centos7-toolchain/files/installFromSourceCode index 31e1163..4b281d2 100644 --- a/recipes/centos7-toolchain/files/installFromSourceCode +++ b/recipes/centos7-toolchain/files/installFromSourceCode @@ -1,4 +1,7 @@ -#!/bin/bash -eux +#!/usr/bin/env bash + +set -e +set -x # Args: url expectedSha256 configureArgsStr diff --git a/recipes/centos7-toolchain/files/installPrerequisites b/recipes/centos7-toolchain/files/installPrerequisites index 38ba177..5b6b6d3 100644 --- a/recipes/centos7-toolchain/files/installPrerequisites +++ b/recipes/centos7-toolchain/files/installPrerequisites @@ -1,4 +1,7 @@ -#!/bin/bash -eux +#!/usr/bin/env bash + +set -e +set -x sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* diff --git a/recipes/centos7-toolchain/files/opt__gcc15__enable b/recipes/centos7-toolchain/files/opt__gcc15__enable index f25221a..50f1235 100644 --- a/recipes/centos7-toolchain/files/opt__gcc15__enable +++ b/recipes/centos7-toolchain/files/opt__gcc15__enable @@ -1,4 +1,7 @@ -#!/bin/bash -eux +#!/usr/bin/env bash + +set -e +set -x DIR=/opt/gcc15 diff --git a/recipes/x64-glibc-217/run_other.sh b/recipes/x64-glibc-217/run_other.sh index f09863c..ac34479 100644 --- a/recipes/x64-glibc-217/run_other.sh +++ b/recipes/x64-glibc-217/run_other.sh @@ -1,4 +1,7 @@ -#!/bin/bash -eux +#!/usr/bin/env bash + +set -e +set -x config_flags= destCPU=x64 diff --git a/recipes/x64-glibc-217/run_versions.sh b/recipes/x64-glibc-217/run_versions.sh index b5d1130..3fbf23b 100644 --- a/recipes/x64-glibc-217/run_versions.sh +++ b/recipes/x64-glibc-217/run_versions.sh @@ -1,4 +1,7 @@ -#!/bin/bash -eux +#!/usr/bin/env bash + +set -e +set -x setPython() { if isNodeVersionGE 'v22.3'; then export PYTHON='python3.13'; return; fi # Python 3.13: Node.js v22.3 ~ latest (v24.3) diff --git a/recipes/x64-pointer-compression/run_other.sh b/recipes/x64-pointer-compression/run_other.sh index 6a9d469..7a0c2bd 100644 --- a/recipes/x64-pointer-compression/run_other.sh +++ b/recipes/x64-pointer-compression/run_other.sh @@ -1,4 +1,7 @@ -#!/bin/bash -eux +#!/usr/bin/env bash + +set -e +set -x config_flags=--experimental-enable-pointer-compression destCPU=x64 diff --git a/recipes/x64-pointer-compression/run_versions.sh b/recipes/x64-pointer-compression/run_versions.sh index b5d1130..3fbf23b 100644 --- a/recipes/x64-pointer-compression/run_versions.sh +++ b/recipes/x64-pointer-compression/run_versions.sh @@ -1,4 +1,7 @@ -#!/bin/bash -eux +#!/usr/bin/env bash + +set -e +set -x setPython() { if isNodeVersionGE 'v22.3'; then export PYTHON='python3.13'; return; fi # Python 3.13: Node.js v22.3 ~ latest (v24.3) diff --git a/recipes/x86/files/installFromSourceCode b/recipes/x86/files/installFromSourceCode index 31e1163..4b281d2 100644 --- a/recipes/x86/files/installFromSourceCode +++ b/recipes/x86/files/installFromSourceCode @@ -1,4 +1,7 @@ -#!/bin/bash -eux +#!/usr/bin/env bash + +set -e +set -x # Args: url expectedSha256 configureArgsStr diff --git a/recipes/x86/files/installPrerequisites b/recipes/x86/files/installPrerequisites index c7211fd..8140205 100644 --- a/recipes/x86/files/installPrerequisites +++ b/recipes/x86/files/installPrerequisites @@ -1,4 +1,7 @@ -#!/bin/bash -eux +#!/usr/bin/env bash + +set -e +set -x sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* diff --git a/recipes/x86/files/opt__gcc15__enable b/recipes/x86/files/opt__gcc15__enable index ef0676c..4088ba8 100644 --- a/recipes/x86/files/opt__gcc15__enable +++ b/recipes/x86/files/opt__gcc15__enable @@ -1,4 +1,7 @@ -#!/bin/bash -eux +#!/usr/bin/env bash + +set -e +set -x DIR=/opt/gcc15 diff --git a/recipes/x86/run_other.sh b/recipes/x86/run_other.sh index 25908ef..7527db6 100644 --- a/recipes/x86/run_other.sh +++ b/recipes/x86/run_other.sh @@ -1,4 +1,7 @@ -#!/bin/bash -eux +#!/usr/bin/env bash + +set -e +set -x config_flags= destCPU=x86 diff --git a/recipes/x86/run_versions.sh b/recipes/x86/run_versions.sh index 997d604..b4253b3 100644 --- a/recipes/x86/run_versions.sh +++ b/recipes/x86/run_versions.sh @@ -1,4 +1,7 @@ -#!/bin/bash -eux +#!/usr/bin/env bash + +set -e +set -x setPython() { if isNodeVersionGE 'v22.3'; then export PYTHON='python3.13'; return; fi # Python 3.13: Node.js v22.3 ~ latest (v24.3) From 4ef8cbab2b072d15a9f5f339a5bcb54e48fce53a Mon Sep 17 00:00:00 2001 From: Henry Hsieh Date: Sat, 16 May 2026 15:50:33 +0800 Subject: [PATCH 18/24] chore: use https instead of http --- recipes/centos7-toolchain/files/installPrerequisites | 2 +- recipes/x64-usdt/Dockerfile | 2 +- recipes/x86/files/installPrerequisites | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/recipes/centos7-toolchain/files/installPrerequisites b/recipes/centos7-toolchain/files/installPrerequisites index 5b6b6d3..a55a436 100644 --- a/recipes/centos7-toolchain/files/installPrerequisites +++ b/recipes/centos7-toolchain/files/installPrerequisites @@ -4,7 +4,7 @@ set -e set -x sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* -sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* +sed -i 's|#baseurl=http://mirror.centos.org|baseurl=https://vault.centos.org|g' /etc/yum.repos.d/CentOS-* yum install -y epel-release # Adds extra repos yum upgrade -y diff --git a/recipes/x64-usdt/Dockerfile b/recipes/x64-usdt/Dockerfile index 448fd84..aa0a1e5 100644 --- a/recipes/x64-usdt/Dockerfile +++ b/recipes/x64-usdt/Dockerfile @@ -9,7 +9,7 @@ RUN groupadd --gid $GID node \ COPY cloudlinux.repo /etc/yum.repos.d/cloudlinux.repo RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* \ - && sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* \ + && sed -i 's|#baseurl=http://mirror.centos.org|baseurl=https://vault.centos.org|g' /etc/yum.repos.d/CentOS-* \ && yum install -y epel-release \ && yum upgrade -y \ && yum install -y \ diff --git a/recipes/x86/files/installPrerequisites b/recipes/x86/files/installPrerequisites index 8140205..f4414a4 100644 --- a/recipes/x86/files/installPrerequisites +++ b/recipes/x86/files/installPrerequisites @@ -4,7 +4,7 @@ set -e set -x sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* -sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* +sed -i 's|#baseurl=http://mirror.centos.org|baseurl=https://vault.centos.org|g' /etc/yum.repos.d/CentOS-* yum upgrade -y yum install -y bzip2 # Required to compile gcc From 8a1a82b8c391ca8eeaf7541acea26265c25778b9 Mon Sep 17 00:00:00 2001 From: Henry Hsieh Date: Sat, 16 May 2026 15:50:55 +0800 Subject: [PATCH 19/24] build: local build should consider base image --- bin/local_build.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bin/local_build.sh b/bin/local_build.sh index 8c62156..fef548a 100755 --- a/bin/local_build.sh +++ b/bin/local_build.sh @@ -97,6 +97,13 @@ fi echo "Building ${recipe} recipe and tagging as ${image_tag_pfx}${recipe}..." docker build "${__dirname}/../fetch-source/" -t "${image_tag_pfx}fetch-source" --build-arg UID=${USER_ID} --build-arg GID=${GROUP_ID} + +# If the recipe depends on the centos7-toolchain base image, build it first +if grep -q "FROM.*centos7-toolchain" "${recipes_dir}/${recipe}/Dockerfile" 2>/dev/null; then + echo "Building centos7-toolchain base image first..." + docker build "${recipes_dir}/centos7-toolchain/" -t "${image_tag_pfx}centos7-toolchain" --build-arg UID=${USER_ID} --build-arg GID=${GROUP_ID} +fi + docker build "${recipes_dir}/${recipe}/" -t "${image_tag_pfx}${recipe}" --build-arg UID=${USER_ID} --build-arg GID=${GROUP_ID} ## -- DOWNLOAD SOURCE -- ## From 810c25dd372434b61e5d74ae5342b827855d68a3 Mon Sep 17 00:00:00 2001 From: Henry Hsieh Date: Sat, 16 May 2026 15:53:47 +0800 Subject: [PATCH 20/24] build: don't add user when using base image --- recipes/x64-glibc-217/Dockerfile | 6 ------ recipes/x64-pointer-compression/Dockerfile | 6 ------ 2 files changed, 12 deletions(-) diff --git a/recipes/x64-glibc-217/Dockerfile b/recipes/x64-glibc-217/Dockerfile index 20072fa..4d34995 100644 --- a/recipes/x64-glibc-217/Dockerfile +++ b/recipes/x64-glibc-217/Dockerfile @@ -1,11 +1,5 @@ FROM --platform=linux/amd64 unofficial-build-recipe-centos7-toolchain -ARG GID=1000 -ARG UID=1000 - -RUN groupadd --gid $GID node \ - && adduser --gid $GID --uid $UID node - COPY --chmod=755 --chown=node:node run.sh run_other.sh run_versions.sh /home/node/ VOLUME /home/node/.ccache diff --git a/recipes/x64-pointer-compression/Dockerfile b/recipes/x64-pointer-compression/Dockerfile index 20072fa..4d34995 100644 --- a/recipes/x64-pointer-compression/Dockerfile +++ b/recipes/x64-pointer-compression/Dockerfile @@ -1,11 +1,5 @@ FROM --platform=linux/amd64 unofficial-build-recipe-centos7-toolchain -ARG GID=1000 -ARG UID=1000 - -RUN groupadd --gid $GID node \ - && adduser --gid $GID --uid $UID node - COPY --chmod=755 --chown=node:node run.sh run_other.sh run_versions.sh /home/node/ VOLUME /home/node/.ccache From db1b098b95ab1b11db9c91e1f51ebc3e8ec37ec0 Mon Sep 17 00:00:00 2001 From: Henry Hsieh Date: Sat, 16 May 2026 17:50:29 +0800 Subject: [PATCH 21/24] build: also use inactive gpg keys for building old versions --- fetch-source/run.sh | 2 +- recipes/headers/run.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fetch-source/run.sh b/fetch-source/run.sh index 886a473..0314cab 100755 --- a/fetch-source/run.sh +++ b/fetch-source/run.sh @@ -32,7 +32,7 @@ cd /home/node curl_with_retry "$source_url" if [[ "$disttype" = "release" ]]; then - curl_with_retry https://github.com/nodejs/release-keys/raw/HEAD/gpg-only-active-keys/pubring.kbx + curl_with_retry https://github.com/nodejs/release-keys/raw/HEAD/gpg/pubring.kbx curl_with_retry "${source_urlbase}/SHASUMS256.txt.asc" gpgv --keyring="$(pwd)/pubring.kbx" --output - < SHASUMS256.txt.asc \ diff --git a/recipes/headers/run.sh b/recipes/headers/run.sh index 153395c..3fee927 100755 --- a/recipes/headers/run.sh +++ b/recipes/headers/run.sh @@ -19,7 +19,7 @@ curl -fsSLO --compressed "${source_urlbase}/node-${fullversion}-headers.tar.xz" if [[ "$disttype" = "release" ]]; then pubring=$(mktemp) - curl -sSLo "$pubring" https://github.com/nodejs/release-keys/raw/HEAD/gpg-only-active-keys/pubring.kbx + curl -sSLo "$pubring" https://github.com/nodejs/release-keys/raw/HEAD/gpg/pubring.kbx curl -sSL "${source_urlbase}/SHASUMS256.txt.asc" \ | gpgv --keyring="${pubring}" --output - \ From 38f23ec9d4637a8230872c2657f5635dee996598 Mon Sep 17 00:00:00 2001 From: Henry Hsieh Date: Sat, 16 May 2026 20:49:42 +0800 Subject: [PATCH 22/24] build: change recipes order --- bin/_config.sh | 8 ++++---- bin/prepare-images.sh | 5 ----- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/bin/_config.sh b/bin/_config.sh index f416246..e92b0d6 100644 --- a/bin/_config.sh +++ b/bin/_config.sh @@ -3,7 +3,6 @@ # them out for a given version are skipped instantly. # centos7-toolchain must be listed first as other recipes FROM it. recipes=( - "centos7-toolchain" # Active recipes, ordered by likely popularity "headers" "musl" @@ -11,9 +10,10 @@ recipes=( "riscv64" "loong64" "riscv64-pointer-compression" - "x86" # major < 22 - "x64-glibc-217" # major < 24 - "x64-pointer-compression" # major < 23 + "centos7-toolchain" # Shared recipe should be built first + "x86" + "x64-glibc-217" + "x64-pointer-compression" # Legacy recipes, currently gated out for modern Node.js versions "armv6l" # major < 24 diff --git a/bin/prepare-images.sh b/bin/prepare-images.sh index 995e398..ee7f03c 100755 --- a/bin/prepare-images.sh +++ b/bin/prepare-images.sh @@ -7,12 +7,7 @@ source "${__dirname}/_config.sh" docker build "${__dirname}/../fetch-source" -t "${image_tag_pfx}fetch-source" --build-arg UID=1000 --build-arg GID=1000 -# Build the shared base image first (must precede recipes that FROM it) -docker build "${recipes_dir}/centos7-toolchain/" -t "${image_tag_pfx}centos7-toolchain" --build-arg UID=1000 --build-arg GID=1000 - for recipe in "${recipes[@]}"; do - # Skip the base image - already built above - [ "$recipe" = "centos7-toolchain" ] && continue docker build "${recipes_dir}/${recipe}/" -t "${image_tag_pfx}${recipe}" --build-arg UID=1000 --build-arg GID=1000 done From 00d5a6e8dd0e71d6600b413f2269cc794ff5cc57 Mon Sep 17 00:00:00 2001 From: Henry Hsieh Date: Sat, 16 May 2026 21:15:26 +0800 Subject: [PATCH 23/24] build: cd back to $nodeDir after source run_other.sh --- recipes/x64-glibc-217/run.sh | 1 + recipes/x64-pointer-compression/run.sh | 1 + recipes/x86/run.sh | 1 + 3 files changed, 3 insertions(+) diff --git a/recipes/x64-glibc-217/run.sh b/recipes/x64-glibc-217/run.sh index f39c3e3..3a8b94d 100755 --- a/recipes/x64-glibc-217/run.sh +++ b/recipes/x64-glibc-217/run.sh @@ -45,6 +45,7 @@ isNodeVersionGE() { source "$homeDir/run_other.sh" source "$homeDir/run_versions.sh" +cd "$nodeDir" setPython setGCC diff --git a/recipes/x64-pointer-compression/run.sh b/recipes/x64-pointer-compression/run.sh index f39c3e3..3a8b94d 100755 --- a/recipes/x64-pointer-compression/run.sh +++ b/recipes/x64-pointer-compression/run.sh @@ -45,6 +45,7 @@ isNodeVersionGE() { source "$homeDir/run_other.sh" source "$homeDir/run_versions.sh" +cd "$nodeDir" setPython setGCC diff --git a/recipes/x86/run.sh b/recipes/x86/run.sh index f39c3e3..3a8b94d 100755 --- a/recipes/x86/run.sh +++ b/recipes/x86/run.sh @@ -45,6 +45,7 @@ isNodeVersionGE() { source "$homeDir/run_other.sh" source "$homeDir/run_versions.sh" +cd "$nodeDir" setPython setGCC From 0bb0c6ed39601e25222ab84381f64587a33ef500 Mon Sep 17 00:00:00 2001 From: Henry Hsieh Date: Sat, 16 May 2026 21:41:13 +0800 Subject: [PATCH 24/24] build: share x64 run.sh --- recipes/centos7-toolchain/Dockerfile | 2 + .../run.sh | 0 recipes/x64-glibc-217/Dockerfile | 2 +- recipes/x64-pointer-compression/Dockerfile | 2 +- recipes/x64-pointer-compression/run.sh | 65 ------------------- 5 files changed, 4 insertions(+), 67 deletions(-) rename recipes/{x64-glibc-217 => centos7-toolchain}/run.sh (100%) delete mode 100755 recipes/x64-pointer-compression/run.sh diff --git a/recipes/centos7-toolchain/Dockerfile b/recipes/centos7-toolchain/Dockerfile index 5f4eb80..d25fcfe 100644 --- a/recipes/centos7-toolchain/Dockerfile +++ b/recipes/centos7-toolchain/Dockerfile @@ -17,3 +17,5 @@ COPY --chmod=755 files/checksums.sh /root/checksums.sh RUN --mount=type=cache,target=/root/.ccache --mount=type=tmpfs,target=/usr/src . /root/checksums.sh && /root/installFromSourceCode https://www.python.org/ftp/python/3.9.23/Python-3.9.23.tar.xz "$sha256_python39" '--prefix=/usr/local/' RUN --mount=type=cache,target=/root/.ccache --mount=type=tmpfs,target=/usr/src . /root/checksums.sh && /root/installFromSourceCode https://www.python.org/ftp/python/3.13.5/Python-3.13.5.tar.xz "$sha256_python313" '--prefix=/usr/local/' RUN --mount=type=cache,target=/root/.ccache --mount=type=tmpfs,target=/usr/src . /root/checksums.sh && /root/installFromSourceCode https://gcc.gnu.org/pub/gcc/releases/gcc-15.1.0/gcc-15.1.0.tar.xz "$sha256_gcc15" '--prefix=/opt/gcc15/ --with-default-libstdcxx-abi=gcc4-compatible --enable-languages=c,c++ --enable-checking=release --enable-gnu-indirect-function --with-linker-hash-style=gnu --disable-bootstrap --disable-multilib --build=x86_64-redhat-linux' + +COPY --chmod=755 --chown=node:node run.sh /home/node/ diff --git a/recipes/x64-glibc-217/run.sh b/recipes/centos7-toolchain/run.sh similarity index 100% rename from recipes/x64-glibc-217/run.sh rename to recipes/centos7-toolchain/run.sh diff --git a/recipes/x64-glibc-217/Dockerfile b/recipes/x64-glibc-217/Dockerfile index 4d34995..b996d41 100644 --- a/recipes/x64-glibc-217/Dockerfile +++ b/recipes/x64-glibc-217/Dockerfile @@ -1,6 +1,6 @@ FROM --platform=linux/amd64 unofficial-build-recipe-centos7-toolchain -COPY --chmod=755 --chown=node:node run.sh run_other.sh run_versions.sh /home/node/ +COPY --chmod=755 --chown=node:node run_other.sh run_versions.sh /home/node/ VOLUME /home/node/.ccache VOLUME /out diff --git a/recipes/x64-pointer-compression/Dockerfile b/recipes/x64-pointer-compression/Dockerfile index 4d34995..b996d41 100644 --- a/recipes/x64-pointer-compression/Dockerfile +++ b/recipes/x64-pointer-compression/Dockerfile @@ -1,6 +1,6 @@ FROM --platform=linux/amd64 unofficial-build-recipe-centos7-toolchain -COPY --chmod=755 --chown=node:node run.sh run_other.sh run_versions.sh /home/node/ +COPY --chmod=755 --chown=node:node run_other.sh run_versions.sh /home/node/ VOLUME /home/node/.ccache VOLUME /out diff --git a/recipes/x64-pointer-compression/run.sh b/recipes/x64-pointer-compression/run.sh deleted file mode 100755 index 3a8b94d..0000000 --- a/recipes/x64-pointer-compression/run.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -x - -release_urlbase="$1" -disttype="$2" -customtag="$3" -datestring="$4" -commit="$5" -fullversion="$6" -source_url="$7" -source_urlbase="$8" -config_flags="" - -homeDir=/home/node -nodeDir="$homeDir/node-$fullversion" - -tar --directory="$homeDir" -xf "$homeDir/node.tar.xz" - -# configuring cares correctly to not use sys/random.h on this target -cd "$nodeDir/deps/cares" -sed -i 's/define HAVE_SYS_RANDOM_H 1/undef HAVE_SYS_RANDOM_H/g' ./config/linux/ares_config.h -sed -i 's/define HAVE_GETRANDOM 1/undef HAVE_GETRANDOM/g' ./config/linux/ares_config.h - -# fix https://github.com/c-ares/c-ares/issues/850 -if [[ "$(grep -o 'ARES_VERSION_STR "[^"]*"' ./include/ares_version.h | awk '{print $2}' | tr -d '"')" == "1.33.0" ]]; then - sed -i 's/MSG_FASTOPEN/TCP_FASTOPEN_CONNECT/g' ./src/lib/ares__socket.c -fi - -# Linux implementation of experimental WASM memory control requires Linux 3.17 & glibc 2.27 so disable it -cd "$nodeDir/deps/v8/src" -[ -f d8/d8.cc ] && sed -i -e 's/#if V8_TARGET_OS_LINUX/#if false/g' wasm/wasm-objects.cc d8/d8.cc - -cd "$nodeDir" - -export CCACHE_BASEDIR="$PWD" -export CC="ccache gcc" -export CXX="ccache g++" -export MAJOR_VERSION=$(echo ${fullversion} | cut -d . -f 1 | tr --delete v) - -isNodeVersionGE() { - printf "$1\n$fullversion" | sort -VC -} - -source "$homeDir/run_other.sh" -source "$homeDir/run_versions.sh" -cd "$nodeDir" - -setPython -setGCC - -make -j$(getconf _NPROCESSORS_ONLN) binary V= \ - DESTCPU="$destCPU" \ - ARCH="$arch" \ - VARIATION="$variation" \ - DISTTYPE="$disttype" \ - CUSTOMTAG="$customtag" \ - DATESTRING="$datestring" \ - COMMIT="$commit" \ - RELEASE_URLBASE="$release_urlbase" \ - CONFIG_FLAGS="$config_flags" - -"$nodeDir/node" -p process.versions # Make sure there is no "Segmentation fault" error (example: node v21.0~v21.2 x64-pointer-compression) -mv node-*.tar.?z /out/