From 7efe7bb01f8f18c71a0537653d9f0463c0a0f3f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Sun, 1 Sep 2024 11:50:53 +0200 Subject: [PATCH] jenkins: select gcc-12 on RHEL for Node.js 23 Refs: https://github.com/nodejs/build/issues/3806 --- jenkins/scripts/select-compiler.sh | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/jenkins/scripts/select-compiler.sh b/jenkins/scripts/select-compiler.sh index 31e37ee72..b5d905912 100644 --- a/jenkins/scripts/select-compiler.sh +++ b/jenkins/scripts/select-compiler.sh @@ -37,7 +37,9 @@ fi case $NODE_NAME in *rhel9*|*ubi9*) echo "Setting compiler for Node.js $NODEJS_MAJOR_VERSION on" `cat /etc/redhat-release` - if [ "$NODEJS_MAJOR_VERSION" -gt "21" ]; then + if [ "$NODEJS_MAJOR_VERSION" -gt "22" ]; then + . /opt/rh/gcc-toolset-12/enable + elif [ "$NODEJS_MAJOR_VERSION" -gt "21" ]; then # s390x, use later toolset to avoid https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106355 if [ "$SELECT_ARCH" = "S390X" ]; then . /opt/rh/gcc-toolset-12/enable @@ -52,7 +54,11 @@ case $NODE_NAME in case "$CONFIG_FLAGS" in *--enable-lto*) echo "Setting compiler for Node.js $NODEJS_MAJOR_VERSION (LTO) on" `cat /etc/redhat-release` - . /opt/rh/gcc-toolset-11/enable + if [ "$NODEJS_MAJOR_VERSION" -gt "22" ]; then + . /opt/rh/gcc-toolset-12/enable + else + . /opt/rh/devtoolset-11/enable + fi export CC="ccache gcc" export CXX="ccache g++" echo "Selected compiler:" `${CXX} -dumpversion` @@ -60,6 +66,13 @@ case $NODE_NAME in ;; *) echo "Setting compiler for Node.js $NODEJS_MAJOR_VERSION on" `cat /etc/redhat-release` + if [ "$NODEJS_MAJOR_VERSION" -gt "22" ]; then + . /opt/rh/gcc-toolset-12/enable + export CC="ccache gcc" + export CXX="ccache g++" + echo "Selected compiler:" `${CXX} -dumpversion` + return + fi if [ "$NODEJS_MAJOR_VERSION" -gt "21" ]; then # s390x, use later toolset to avoid https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106355 if [ "$SELECT_ARCH" = "S390X" ]; then