Skip to content

Commit 777e728

Browse files
committed
ansible,jenkins: install gcc-7 on ubuntu1604 machines, use on node>12
Ref: #1970
1 parent e3e376e commit 777e728

File tree

4 files changed

+53
-1
lines changed

4 files changed

+53
-1
lines changed

ansible/roles/baselayout/tasks/main.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,15 @@
118118
- gcc
119119
- g++
120120

121+
- name: ubuntu1604 | update package alternatives
122+
when: os == "ubuntu1604"
123+
alternatives: link=/usr/bin/{{ gcc }} name={{ gcc }} path=/usr/bin/{{ gcc }}-5
124+
loop_control:
125+
loop_var: gcc
126+
with_items:
127+
- gcc
128+
- g++
129+
121130
- name: smartos17 | update gcc symlinks
122131
when: os == "smartos17"
123132
file:
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
3+
#
4+
# add PPA for gcc updates
5+
#
6+
7+
- name: "repo : add Ubuntu Toolchain PPA"
8+
apt_repository:
9+
repo: 'ppa:ubuntu-toolchain-r/test'
10+
state: present
11+
update_cache: yes
12+
register: has_updated_package_repo

ansible/roles/baselayout/vars/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ packages: {
120120
],
121121

122122
ubuntu: [
123-
'ccache,g++,gcc,git,libfontconfig1,sudo',
123+
'ccache,g++,gcc,g++-6,gcc-6,git,libfontconfig1,sudo',
124124
],
125125

126126
ubuntu1404: [

jenkins/scripts/select-compiler.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ if [ "$DONTSELECT_COMPILER" != "DONT" ]; then
1414
*ppc64*le* ) SELECT_ARCH=PPC64LE ;;
1515
*s390x* ) SELECT_ARCH=S390X ;;
1616
*aix* ) SELECT_ARCH=AIXPPC ;;
17+
*x64* ) SELECT_ARCH=X64 ;;
18+
*arm64* ) SELECT_ARCH=ARM64 ;;
1719
esac
1820
fi
1921

@@ -112,4 +114,33 @@ elif [ "$SELECT_ARCH" = "AIXPPC" ]; then
112114
# front of PATH
113115
echo "Compiler set to default at 4.8.5"
114116
fi
117+
118+
elif [ "$SELECT_ARCH" = "X64" ]; then
119+
echo "Setting compiler for Node version $NODEJS_MAJOR_VERSION on x64"
120+
121+
122+
if test $nodes = "centos6-64-gcc48"; then
123+
. /opt/rh/devtoolset-2/enable
124+
echo "Compiler set to devtoolset-2"
125+
elif [[ "$nodes" =~ centos[67]-64-gcc6 ]]; then
126+
. /opt/rh/devtoolset-6/enable
127+
echo "Compiler set to devtoolset-6"
128+
elif test $nodes = "ubuntu1604-64"; then
129+
if [ "$NODEJS_MAJOR_VERSION" -gt "12" ]; then
130+
export CC="gcc-6"
131+
export CXX="g++-6"
132+
export LINK="g++-6"
133+
echo "Compiler set to GCC 6 for $NODEJS_MAJOR_VERSION"
134+
fi
135+
fi
136+
137+
elif [ "$SELECT_ARCH" = "ARM64" ]; then
138+
echo "Setting compiler for Node version $NODEJS_MAJOR_VERSION on arm64"
139+
140+
141+
if [[ "$nodes" =~ centos[67]-arm64-gcc6 ]]; then
142+
. /opt/rh/devtoolset-6/enable
143+
echo "Compiler set to devtoolset-6"
144+
fi
145+
115146
fi

0 commit comments

Comments
 (0)