Skip to content

Commit 4907bbc

Browse files
authored
ansible,jenkins: use gcc 10 on RHEL 8 for Node.js 20 (#3249)
Refs: nodejs/node#46806 Refs: https://github.com/orgs/nodejs/discussions/45892
1 parent d49bf8a commit 4907bbc

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

ansible/roles/baselayout/vars/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ packages: {
134134
],
135135

136136
rhel8: [
137-
'ccache,cmake,gcc-c++,gcc-toolset-11,git,make,python3',
137+
'ccache,cmake,gcc-c++,gcc-toolset-10,gcc-toolset-11,git,make,python3',
138138
],
139139

140140
smartos: [

ansible/roles/docker/templates/rhel8.Dockerfile.j2

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ RUN dnf install --disableplugin=subscription-manager -y \
2727
xz \
2828
&& dnf --disableplugin=subscription-manager clean all
2929

30+
RUN dnf install --disableplugin=subscription-manager -y \
31+
http://mirror.centos.org/centos/8-stream/AppStream/{{ ansible_architecture }}/os/Packages/gcc-toolset-10-gcc-10.3.1-1.2.el8_5.{{ ansible_architecture }}.rpm \
32+
http://mirror.centos.org/centos/8-stream/AppStream/{{ ansible_architecture }}/os/Packages/gcc-toolset-10-gcc-c++-10.3.1-1.2.el8_5.{{ ansible_architecture }}.rpm \
33+
http://mirror.centos.org/centos/8-stream/AppStream/{{ ansible_architecture }}/os/Packages/gcc-toolset-10-libstdc++-devel-10.3.1-1.2.el8_5.{{ ansible_architecture }}.rpm \
34+
http://mirror.centos.org/centos/8-stream/AppStream/{{ ansible_architecture }}/os/Packages/gcc-toolset-10-runtime-10.1-0.el8.{{ ansible_architecture }}.rpm
35+
3036
RUN groupadd -r -g {{ server_user_gid.stdout_lines[0] }} {{ server_user }} \
3137
&& adduser -r -m -d /home/{{ server_user }}/ \
3238
-g {{ server_user_gid.stdout_lines[0] }} \

jenkins/scripts/select-compiler.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@ case $NODE_NAME in
4646
;;
4747
*)
4848
echo "Setting compiler for Node.js $NODEJS_MAJOR_VERSION on" `cat /etc/redhat-release`
49+
if [ "$NODEJS_MAJOR_VERSION" -gt "19" ]; then
50+
. /opt/rh/gcc-toolset-10/enable
51+
export CC="ccache gcc"
52+
export CXX="ccache g++"
53+
echo "Selected compiler:" `${CXX} -dumpversion`
54+
return
55+
fi
4956
# Default gcc on RHEL 8 is gcc 8.
5057
if [ "$v8test" != "" ]; then
5158
# For V8 builds make `gcc` and `g++` point to non-ccache shims.

0 commit comments

Comments
 (0)