From 319c4806e9c174bc5f0da57e038c5ae353c8e761 Mon Sep 17 00:00:00 2001 From: Sam Roberts Date: Fri, 5 Apr 2019 13:07:55 -0700 Subject: [PATCH 1/2] Use HOSTNAME if NODE_NAME is not defined NODE_NAME is not defined when not running with jenkins, so anyone trying to do builds directly has to read the script and deduce that NODE_NAME has to be set, and to what it has to be set, or the script will silently do nothing. --- jenkins/scripts/select-compiler.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jenkins/scripts/select-compiler.sh b/jenkins/scripts/select-compiler.sh index 29a787233..096176299 100644 --- a/jenkins/scripts/select-compiler.sh +++ b/jenkins/scripts/select-compiler.sh @@ -1,6 +1,8 @@ #!/bin/bash if [ "$DONTSELECT_COMPILER" != "DONT" ]; then + NODE_NAME=${NODE_NAME:-$HOSTNAME} + echo "Selecting compiler based on $NODE_NAME" case $NODE_NAME in *ppc64_le* ) SELECT_ARCH=PPC64LE ;; *s390x* ) SELECT_ARCH=S390X ;; From 87693b6d3cbee28bf3b214d991be35442e3c8979 Mon Sep 17 00:00:00 2001 From: Sam Roberts Date: Fri, 5 Apr 2019 13:09:59 -0700 Subject: [PATCH 2/2] Use devtoolset-6 for s390x on node gt 11.x --- jenkins/scripts/select-compiler.sh | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/jenkins/scripts/select-compiler.sh b/jenkins/scripts/select-compiler.sh index 096176299..a96f66b80 100644 --- a/jenkins/scripts/select-compiler.sh +++ b/jenkins/scripts/select-compiler.sh @@ -46,22 +46,26 @@ elif [ "$SELECT_ARCH" = "S390X" ]; then echo "Setting compiler for Node version $NODEJS_MAJOR_VERSION on s390x" - if [ "$NODEJS_MAJOR_VERSION" -gt "11" ]; then - export PATH="/data/gcc-6.3/bin:/data/binutils-2.28/bin:$PATH" - export LD_LIBRARY_PATH="/data/gcc-6.3/lib64:$LD_LIBRARY_PATH" - export COMPILER_LEVEL="-6.3" - elif [ "$NODEJS_MAJOR_VERSION" -gt "9" ]; then - export PATH="/data/gcc-4.9/bin:/data/binutils-2.28/bin:$PATH" + if [ "$NODEJS_MAJOR_VERSION" -gt "9" ]; then + export PATH="/data/gcc-4.9/bin:$PATH" export LD_LIBRARY_PATH="/data/gcc-4.9/lib64:$LD_LIBRARY_PATH" export COMPILER_LEVEL="-4.9" fi - # Select the appropriate compiler - export CC="ccache gcc${COMPILER_LEVEL}" - export CXX="ccache g++${COMPILER_LEVEL}" - export LINK="g++${COMPILER_LEVEL}" - - echo "Compiler set to $COMPILER_LEVEL" + if [ "$NODEJS_MAJOR_VERSION" -gt "11" ]; then + # Setup devtoolset-6, sets LD_LIBRARY_PATH, PATH, etc. + . /opt/rh/devtoolset-6/enable + export CC="ccache s390x-redhat-linux-gcc" + export CXX="ccache s390x-redhat-linux-g++" + export LINK="s390x-redhat-linux-g++" + echo "Compiler set to devtoolset-6" + else + # Select the appropriate compiler + export CC="ccache gcc${COMPILER_LEVEL}" + export CXX="ccache g++${COMPILER_LEVEL}" + export LINK="g++${COMPILER_LEVEL}" + echo "Compiler set to $COMPILER_LEVEL" + fi elif [ "$SELECT_ARCH" = "AIXPPC" ]; then # get node version