Skip to content

Commit 5f233e6

Browse files
authored
ansible: add gcc-8 to Ubuntu 18.04 hosts/containers (#2660)
* ansible: add gcc-8 to Ubuntu 18.04 hosts/containers Baseline gcc/g++ compiler version for Node.js 16 and above is 8. The default `gcc` and `g++` packages on Ubuntu 18.04 install version 7. Moves `gcc*` and `g++*` out of the common `ubuntu` packages into `ubuntu1604`. Update `select-compiler.sh` to select GCC 8 for Node.js 16 and later, otherwise use GCC 6. Refs: #2445
1 parent c7eb223 commit 5f233e6

File tree

4 files changed

+28
-6
lines changed

4 files changed

+28
-6
lines changed

ansible/roles/baselayout/vars/main.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,14 +144,20 @@ packages: {
144144
],
145145

146146
ubuntu: [
147-
'ccache,g++,gcc,g++-6,gcc-6,git,libfontconfig1,sudo,python3-pip',
147+
'ccache,git,libfontconfig1,sudo,python3-pip',
148148
],
149149

150150
ubuntu1404: [
151151
'ntp,gcc-8,g++-8,gcc-6,g++-6,g++-4.8,gcc-4.8,g++-4.9,gcc-4.9,binutils-2.26',
152152
],
153153

154+
# Default gcc/g++ package is 5.
154155
ubuntu1604: [
155-
'python3.9,python3.9-distutils',
156+
'gcc-8,g++-6,gcc-6,g++-6,python3.9,python3.9-distutils',
157+
],
158+
159+
# Default gcc/g++ package is 7.
160+
ubuntu1804: [
161+
'gcc-6,g++-6,gcc-8,g++-8',
156162
],
157163
}

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ ENV ARCH x64
1515

1616
RUN apt-get update && apt-get dist-upgrade -y && apt-get install -y \
1717
ccache \
18-
g++ \
19-
gcc \
18+
g++-6 \
19+
gcc-6 \
20+
g++-8 \
21+
gcc-8 \
2022
git \
2123
openjdk-8-jre-headless \
2224
curl \

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ ENV DEBIAN_FRONTEND noninteractive
1717
RUN apt-get update && apt-get install apt-utils -y && \
1818
apt-get dist-upgrade -y && apt-get install -y \
1919
ccache \
20-
g++ \
21-
gcc \
20+
g++-6 \
21+
gcc-6 \
22+
g++-8 \
23+
gcc-8 \
2224
git \
2325
openjdk-8-jre-headless \
2426
curl \

jenkins/scripts/select-compiler.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,18 @@ elif [ "$SELECT_ARCH" = "X64" ]; then
162162
echo "Compiler set to GCC 6 for $NODEJS_MAJOR_VERSION"
163163
fi
164164
;;
165+
*ubuntu1804*64 )
166+
if [ "$NODEJS_MAJOR_VERSION" -gt "15" ]; then
167+
export CC="ccache gcc-8"
168+
export CXX="ccache g++-8"
169+
export LINK="g++-8"
170+
else
171+
export CC="ccache gcc-6"
172+
export CXX="ccache g++-6"
173+
export LINK="g++-6"
174+
fi
175+
echo "Compiler set to GCC" `$CXX -dumpversion`
176+
;;
165177
esac
166178

167179
elif [ "$SELECT_ARCH" = "ARM64" ]; then

0 commit comments

Comments
 (0)