Skip to content

Commit

Permalink
unixPB: Install gcc 10.3 into /usr/local/gcc10 on Linux (#2420)
Browse files Browse the repository at this point in the history
* unixPB: Install gcc 10.3 into /usr/local/gcc10 on Linux

Signed-off-by: Stewart X Addison <[email protected]>
  • Loading branch information
sxa authored Jan 11, 2022
1 parent 7690e5b commit 8611a63
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 6 deletions.
8 changes: 4 additions & 4 deletions ansible/pbTestScripts/testJDK.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ if [[ "$(uname)" == "FreeBSD" ]]; then
cp -r $HOME/openjdk-build/workspace/build/src/build/*/jdk* $HOME
export TEST_JDK_HOME=$HOME/jdk
else
export TEST_JDK_HOME=$(ls -1d $HOME/openjdk-build/workspace/build/src/build/*/images/jdk* |grep -v ".*jre.*"|grep -v ".*-image")
echo SXA: TEST_JDK_HOME = "$TEST_JDK_HOME"
ls -ld $HOME/openjdk-build/workspace/build/src/build/*/images/*
ls -ld $HOME/openjdk-build/workspace/build/src/build/*/images/jdk*
export TEST_JDK_HOME=$(ls -1d $HOME/openjdk-build/workspace/build/src/build/*/images/jdk* |egrep -v 'jre|-image|static-libs')
fi

echo DEBUG: TEST_JDK_HOME = $TEST_JDK_HOME

# Special case for Solaris. See: https://github.com/adoptium/infrastructure/pull/2405#issuecomment-999498345
if [[ "$(uname)" == "SunOS" ]]; then
export PATH="/opt/csw/bin:/usr/local/bin:${PATH}"
fi


mkdir -p $HOME/testLocation
[ ! -d $HOME/testLocation/aqa-tests ] && git clone https://github.com/adoptium/aqa-tests.git $HOME/testLocation/aqa-tests
# cd to aqa-tests as required by https://github.com/adoptium/aqa-tests/issues/2691#issue-932959102
Expand Down
6 changes: 4 additions & 2 deletions ansible/playbooks/AdoptOpenJDK_Unix_Playbook/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@
- gcc_48
- role: gcc_7 # OpenJ9
tags: [build_tools, build_tools_openj9]
- role: gcc_9
- role: gcc_9 # Dragonwell
tags: [build_tools]
- role: gcc_10 # JDK17+
tags: [build_tools]
- role: Xcode
when: ansible_distribution == "MacOSX"
Expand Down Expand Up @@ -109,7 +111,7 @@
- ansible_distribution != "Solaris"
- ansible_architecture != "riscv64"
tags: build_tools
- role: adoptopenjdk_install # JDK18 Build Bootstrap
- role: adoptopenjdk_install # JDK18 Build Bootstrap
jdk_version: 17
when:
- ansible_distribution != "Alpine"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
##########
# gcc_10 #
##########

- name: Check if gcc 10.3 is installed on RHEL/CentOS/Ubuntu16
shell: /usr/local/gcc10/bin/gcc-10.3 --version 2>&1 > /dev/null
ignore_errors: yes
register: gcc10_installed
when: ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "openSUSE" or (ansible_architecture == "armv7l" and ((ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "16") or ansible_distribution == "Debian"))
changed_when: False
tags: gcc_10

# Unable to check the checksum of the binary as it'll be different for each architecture's tar.xz file
- name: Download AdoptOpenJDK gcc-10.3 binary
get_url:
url: https://ci.adoptopenjdk.net/userContent/gcc/gcc103.{{ ansible_architecture }}.tar.xz
dest: '/tmp/ansible-adoptopenjdk-gcc-10.tar.xz'
force: no
mode: 0644
when:
- ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "openSUSE" or (ansible_architecture == "armv7l" and ((ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "16") or ansible_distribution == "Debian"))
- gcc10_installed.rc != 0
tags: gcc_10

- name: Extract AdoptOpenJDK gcc-10 binary to /usr/local/gcc10
unarchive:
src: /tmp/ansible-adoptopenjdk-gcc-10.tar.xz
dest: /usr/local/
copy: False
when:
- ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "openSUSE" or (ansible_architecture == "armv7l" and ((ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "16") or ansible_distribution == "Debian"))
- gcc10_installed.rc != 0
tags: gcc_10

- name: Remove downloaded gcc 10 binary tarball
file:
path: '/tmp/ansible-adoptopenjdk-gcc-10.tar.xz'
state: absent
when:
- ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "openSUSE" or (ansible_architecture == "armv7l" and ((ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "16") or ansible_distribution == "Debian"))
- gcc10_installed.rc != 0
tags: gcc_10

0 comments on commit 8611a63

Please sign in to comment.