Skip to content

Commit

Permalink
ansible,jenkins: install gcc-7 on ubuntu1604 machines, use on node>12
Browse files Browse the repository at this point in the history
Ref: #1970
  • Loading branch information
rvagg committed Oct 23, 2019
1 parent e3e376e commit 8c681e9
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 1 deletion.
9 changes: 9 additions & 0 deletions ansible/roles/baselayout/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,15 @@
- gcc
- g++

- name: ubuntu1604 | update package alternatives
when: os == "ubuntu1604"
alternatives: link=/usr/bin/{{ gcc }} name={{ gcc }} path=/usr/bin/{{ gcc }}-5
loop_control:
loop_var: gcc
with_items:
- gcc
- g++

- name: smartos17 | update gcc symlinks
when: os == "smartos17"
file:
Expand Down
12 changes: 12 additions & 0 deletions ansible/roles/baselayout/tasks/partials/repo/ubuntu1604.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---

#
# add PPA for gcc updates
#

- name: "repo : add Ubuntu Toolchain PPA"
apt_repository:
repo: 'ppa:ubuntu-toolchain-r/test'
state: present
update_cache: yes
register: has_updated_package_repo
2 changes: 1 addition & 1 deletion ansible/roles/baselayout/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ packages: {
],

ubuntu: [
'ccache,g++,gcc,git,libfontconfig1,sudo',
'ccache,g++,gcc,g++-6,gcc-6,git,libfontconfig1,sudo',
],

ubuntu1404: [
Expand Down
31 changes: 31 additions & 0 deletions jenkins/scripts/select-compiler.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ if [ "$DONTSELECT_COMPILER" != "DONT" ]; then
*ppc64*le* ) SELECT_ARCH=PPC64LE ;;
*s390x* ) SELECT_ARCH=S390X ;;
*aix* ) SELECT_ARCH=AIXPPC ;;
*x64* ) SELECT_ARCH=X64 ;;
*arm64* ) SELECT_ARCH=ARM64 ;;
esac
fi

Expand Down Expand Up @@ -112,4 +114,33 @@ elif [ "$SELECT_ARCH" = "AIXPPC" ]; then
# front of PATH
echo "Compiler set to default at 4.8.5"
fi

elif [ "$SELECT_ARCH" = "X64" ]; then
echo "Setting compiler for Node version $NODEJS_MAJOR_VERSION on x64"


if test $nodes = "centos6-64-gcc48"; then
. /opt/rh/devtoolset-2/enable
echo "Compiler set to devtoolset-2"
elif [[ "$nodes" =~ centos[67]-64-gcc6 ]]; then
. /opt/rh/devtoolset-6/enable
echo "Compiler set to devtoolset-6"
elif test $nodes = "ubuntu1604-64"; then
if [ "$NODEJS_MAJOR_VERSION" -gt "12" ]; then
export CC="gcc-6"
export CXX="g++-6"
export LINK="g++-6"
echo "Compiler set to GCC 6 for $NODEJS_MAJOR_VERSION"
fi
fi

elif [ "$SELECT_ARCH" = "ARM64" ]; then
echo "Setting compiler for Node version $NODEJS_MAJOR_VERSION on arm64"


if [[ "$nodes" =~ centos[67]-arm64-gcc6 ]]; then
. /opt/rh/devtoolset-6/enable
echo "Compiler set to devtoolset-6"
fi

fi

0 comments on commit 8c681e9

Please sign in to comment.