From 587751e625baba5976a71916fd72e1e43a1d205e Mon Sep 17 00:00:00 2001 From: Stewart X Addison Date: Tue, 1 Jun 2021 20:42:21 +0100 Subject: [PATCH 1/5] docker: add ubuntu1604 ansible setup for arm32 Signed-off-by: Stewart X Addison --- ansible/Dockerfile.Ubuntu1604 | 39 ++++++++++++ .../roles/Common/tasks/Ubuntu.yml | 7 +++ .../roles/gcc_7/tasks/main.yml | 14 ++--- .../roles/gcc_7/tasks/main.yml~ | 62 +++++++++++++++++++ 4 files changed, 115 insertions(+), 7 deletions(-) create mode 100644 ansible/Dockerfile.Ubuntu1604 create mode 100644 ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/gcc_7/tasks/main.yml~ diff --git a/ansible/Dockerfile.Ubuntu1604 b/ansible/Dockerfile.Ubuntu1604 new file mode 100644 index 0000000000..92fd234ecd --- /dev/null +++ b/ansible/Dockerfile.Ubuntu1604 @@ -0,0 +1,39 @@ +FROM ubuntu:16.04 + +ARG user=jenkins + +RUN apt-get update +RUN apt-get -y install python git curl +RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py +RUN python2 get-pip.py + +# Prereqs for cryptography module. Ubuntu 16 has cryptography +# 1.2.3 in its repos. v3 won't build with ssl102 +RUN apt-get -y install python-dev libffi-dev libssl-dev +RUN apt-get -y install gcc +RUN pip install cryptography==2.9.2 + +RUN pip install ansible + +COPY . /ansible + +RUN echo "localhost ansible_connection=local" > /ansible/hosts + +RUN set -eux; \ + cd /ansible; \ + ansible-playbook -i hosts /ansible/playbooks/AdoptOpenJDK_Unix_Playbook/main.yml --skip-tags="debug,hosts_file,hostname,adoptopenjdk,jenkins,nagios,superuser,docker,swap_file,crontab,nvidia_cuda_toolkit,ntp_time" + +RUN rm -rf /ansible + +RUN groupadd -g 1000 ${user} +RUN useradd -c "Jenkins user" -d /home/${user} -u 1000 -g 1000 -m ${user} + +ENV \ + JDK7_BOOT_DIR="/usr/lib/jvm/jdk8" \ + JDK8_BOOT_DIR="/usr/lib/jvm/jdk8" \ + JDK10_BOOT_DIR="/usr/lib/jvm/jdk-10" \ + JDK11_BOOT_DIR="/usr/lib/jvm/jdk-11" \ + JDK13_BOOT_DIR="/usr/lib/jvm/jdk-13" \ + JDK14_BOOT_DIR="/usr/lib/jvm/jdk-14" \ + JDKLATEST_BOOT_DIR="/usr/lib/jvm/jdk-14" \ + JAVA_HOME="/usr/lib/jvm/java-1.8.0-openjdk" diff --git a/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/Common/tasks/Ubuntu.yml b/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/Common/tasks/Ubuntu.yml index 1eb1d19d2a..46317b77a0 100644 --- a/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/Common/tasks/Ubuntu.yml +++ b/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/Common/tasks/Ubuntu.yml @@ -133,6 +133,13 @@ when: - ansible_distribution_major_version == "16" +- name: Install additional Packages specific to Ubuntu 16 (Not armv7l) + package: "name={{ item }} state=latest" + with_items: openjdk-7-jdk + when: + - ansible_distribution_major_version == "16" + - ansible_architecture != "armv7l" + - name: Install additional Packages specific to Ubuntu 18 package: "name={{ item }} state=latest" with_items: "{{ Additional_Packages_Ubuntu18 }}" diff --git a/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/gcc_7/tasks/main.yml b/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/gcc_7/tasks/main.yml index 08b9261cfd..ee246b0d81 100644 --- a/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/gcc_7/tasks/main.yml +++ b/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/gcc_7/tasks/main.yml @@ -3,11 +3,11 @@ # gcc_7 # ######### -- name: Check if gcc 7.5 is installed on RHEL/CentOS +- name: Check if gcc 7.5 is installed on RHEL/CentOS/Ubuntu16 shell: /usr/local/gcc/bin/gcc-7.5 --version 2>&1 > /dev/null ignore_errors: yes register: gcc7_installed - when: ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "openSUSE" or (ansible_distribution == "Debian" and ansible_architecture == "armv7l") + 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")) tags: gcc_7 # Unable to check the checksum of the binary as it'll be different for each architecture's tar.xz file @@ -18,7 +18,7 @@ force: no mode: 0644 when: - - ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "openSUSE" or (ansible_distribution == "Debian" and ansible_architecture == "armv7l") + - 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")) - gcc7_installed.rc != 0 tags: gcc_7 @@ -28,7 +28,7 @@ dest: /usr/local/ copy: False when: - - ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "openSUSE" or (ansible_distribution == "Debian" and ansible_architecture == "armv7l") + - 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")) - gcc7_installed.rc != 0 tags: gcc_7 @@ -37,7 +37,7 @@ path: '/tmp/ansible-adoptopenjdk-gcc-7.tar.xz' state: absent when: - - ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "openSUSE" or (ansible_distribution == "Debian" and ansible_architecture == "armv7l") + - 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")) - gcc7_installed.rc != 0 tags: gcc_7 @@ -48,7 +48,7 @@ path: /usr/local/bin/ccache register: ccache_symlink when: - - ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "openSUSE" or (ansible_distribution == "Debian" and ansible_architecture == "armv7l") + - 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")) tags: gcc_7 - name: Create symlink for ccache @@ -57,6 +57,6 @@ dest: /usr/local/bin/ccache state: link when: - - ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "openSUSE" or (ansible_distribution == "Debian" and ansible_architecture == "armv7l") + - 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")) - not ccache_symlink.stat.exists tags: gcc_7 diff --git a/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/gcc_7/tasks/main.yml~ b/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/gcc_7/tasks/main.yml~ new file mode 100644 index 0000000000..7428cd8392 --- /dev/null +++ b/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/gcc_7/tasks/main.yml~ @@ -0,0 +1,62 @@ +--- +######### +# gcc_7 # +######### + +- name: Check if gcc 7.5 is installed on RHEL/CentOS + shell: /usr/local/gcc/bin/gcc-7.5 --version 2>&1 > /dev/null + ignore_errors: yes + register: gcc7_installed + when: ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "openSUSE" or (ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "16") or (ansible_distribution == "Debian" and ansible_architecture == "armv7l") + tags: gcc_7 + +# Unable to check the checksum of the binary as it'll be different for each architecture's tar.xz file +- name: Download AdoptOpenJDK gcc-7.5.0 binary + get_url: + url: https://ci.adoptopenjdk.net/userContent/gcc/gcc750+ccache.{{ ansible_architecture }}.tar.xz + dest: '/tmp/ansible-adoptopenjdk-gcc-7.tar.xz' + force: no + mode: 0644 + when: + - ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "openSUSE" or (ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "16") or (ansible_distribution == "Debian" and ansible_architecture == "armv7l") + - gcc7_installed.rc != 0 + tags: gcc_7 + +- name: Extract AdoptOpenJDK gcc-7 binary to /usr/local/gcc + unarchive: + src: /tmp/ansible-adoptopenjdk-gcc-7.tar.xz + dest: /usr/local/ + copy: False + when: + - ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "openSUSE" or (ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "16") or (ansible_distribution == "Debian" and ansible_architecture == "armv7l") + - gcc7_installed.rc != 0 + tags: gcc_7 + +- name: Remove downloaded gcc 7 binary tarball + file: + path: '/tmp/ansible-adoptopenjdk-gcc-7.tar.xz' + state: absent + when: + - ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "openSUSE" or (ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "16") or (ansible_distribution == "Debian" and ansible_architecture == "armv7l") + - gcc7_installed.rc != 0 + tags: gcc_7 + +# Stops buildng ccache from source when unnecessary +# See: https://github.com/AdoptOpenJDK/openjdk-infrastructure/issues/1472 +- name: Check if ccache is at /usr/local/bin/ccache + stat: + path: /usr/local/bin/ccache + register: ccache_symlink + when: + - ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "openSUSE" or (ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "16") or (ansible_distribution == "Debian" and ansible_architecture == "armv7l") + tags: gcc_7 + +- name: Create symlink for ccache + file: + src: /usr/local/gcc/bin/ccache + dest: /usr/local/bin/ccache + state: link + when: + - ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "openSUSE" or (ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "16") or (ansible_distribution == "Debian" and ansible_architecture == "armv7l") + - not ccache_symlink.stat.exists + tags: gcc_7 From 5e0ce42cbfe86c2809ba4e5a804d0090ab68ec71 Mon Sep 17 00:00:00 2001 From: Stewart X Addison Date: Mon, 14 Jun 2021 22:55:34 +0100 Subject: [PATCH 2/5] docker: force uname to show armv7l on aarch64 hosts Signed-off-by: Stewart X Addison --- ansible/{ => docker}/Dockerfile.Ubuntu1604 | 1 + .../roles/gcc_7/tasks/main.yml | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) rename ansible/{ => docker}/Dockerfile.Ubuntu1604 (90%) diff --git a/ansible/Dockerfile.Ubuntu1604 b/ansible/docker/Dockerfile.Ubuntu1604 similarity index 90% rename from ansible/Dockerfile.Ubuntu1604 rename to ansible/docker/Dockerfile.Ubuntu1604 index 92fd234ecd..af05266224 100644 --- a/ansible/Dockerfile.Ubuntu1604 +++ b/ansible/docker/Dockerfile.Ubuntu1604 @@ -27,6 +27,7 @@ RUN rm -rf /ansible RUN groupadd -g 1000 ${user} RUN useradd -c "Jenkins user" -d /home/${user} -u 1000 -g 1000 -m ${user} +RUN mv /bin/uname /bin/uname.real && echo "/bin/uname.real \$@ | sed 's/aarch64/armv7l/g'" > /bin/uname && chmod 755 /bin/uname ENV \ JDK7_BOOT_DIR="/usr/lib/jvm/jdk8" \ diff --git a/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/gcc_7/tasks/main.yml b/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/gcc_7/tasks/main.yml index ee246b0d81..8f9218ca08 100644 --- a/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/gcc_7/tasks/main.yml +++ b/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/gcc_7/tasks/main.yml @@ -10,11 +10,21 @@ 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")) tags: gcc_7 +- name: Configure gcc75 tarball extension on non-armv7l + set_fact: gccsuffix=.xz + tags: gcc_7 + when: ansible_architecture != "armv7l" + +- name: Configure gcc75 tarball extension on armv7l + set_fact: gccsuffix=.gz + tags: gcc_7 + when: ansible_architecture == "armv7l" + # Unable to check the checksum of the binary as it'll be different for each architecture's tar.xz file - name: Download AdoptOpenJDK gcc-7.5.0 binary get_url: - url: https://ci.adoptopenjdk.net/userContent/gcc/gcc750+ccache.{{ ansible_architecture }}.tar.xz - dest: '/tmp/ansible-adoptopenjdk-gcc-7.tar.xz' + url: https://ci.adoptopenjdk.net/userContent/gcc/gcc750+ccache.{{ ansible_architecture }}.tar{{ gccsuffix }} + dest: '/tmp/ansible-adoptopenjdk-gcc-7.tar{{ gccsuffix }}' force: no mode: 0644 when: @@ -24,7 +34,7 @@ - name: Extract AdoptOpenJDK gcc-7 binary to /usr/local/gcc unarchive: - src: /tmp/ansible-adoptopenjdk-gcc-7.tar.xz + src: /tmp/ansible-adoptopenjdk-gcc-7.tar{{ gccsuffix }} dest: /usr/local/ copy: False when: @@ -34,7 +44,7 @@ - name: Remove downloaded gcc 7 binary tarball file: - path: '/tmp/ansible-adoptopenjdk-gcc-7.tar.xz' + path: '/tmp/ansible-adoptopenjdk-gcc-7.tar{{ gccsuffix }}' 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")) From d318317fb29a591b729abe10c2c8703dd8e8c88d Mon Sep 17 00:00:00 2001 From: Stewart X Addison Date: Wed, 16 Jun 2021 23:40:49 +0100 Subject: [PATCH 3/5] unixPB: Install gcc/g++-7 on arm32 from Ubuntu repos Signed-off-by: Stewart X Addison --- .../roles/Common/tasks/Ubuntu.yml | 7 +++++++ .../roles/Common/vars/Ubuntu.yml | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/Common/tasks/Ubuntu.yml b/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/Common/tasks/Ubuntu.yml index 46317b77a0..823ced5670 100644 --- a/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/Common/tasks/Ubuntu.yml +++ b/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/Common/tasks/Ubuntu.yml @@ -117,6 +117,13 @@ - ansible_architecture == "aarch64" tags: build_tools +- name: Install additional build tools for x86 + package: "name={{ item }} state=latest" + with_items: "{{ Additional_Build_Tools_armv7l }}" + when: + - ansible_architecture == "armv7l" + tags: build_tools + ######################### # Additional Test Tools # ######################### diff --git a/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/Common/vars/Ubuntu.yml b/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/Common/vars/Ubuntu.yml index ffba4ca6a7..c8a8cf8cb4 100644 --- a/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/Common/vars/Ubuntu.yml +++ b/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/Common/vars/Ubuntu.yml @@ -97,6 +97,10 @@ Additional_Build_Tools_s390x: Additional_Build_Tools_aarch64: - libpng-dev +Additional_Build_Tools_armv7l: + - gcc-7 # Needed as pre-built version causes crashes + - g++-7 # Needed as pre-built version causes crashes + Test_Tool_Packages: - acl - mercurial From 45f383fb853ee52576f4546ea7a1f223ddfd06cc Mon Sep 17 00:00:00 2001 From: George Adams Date: Thu, 17 Jun 2021 00:19:05 +0100 Subject: [PATCH 4/5] Add dockerfile build support for Ubuntu16.04 --- Jenkinsfile | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 33c249b442..4d150b375b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,28 +3,36 @@ pipeline { stages { stage('Docker Build') { parallel { - stage('Linux x64') { + stage('CentOS7 x64') { agent { label "dockerBuild&&linux&&x64" } steps { - dockerBuild('amd64') + dockerBuild('amd64', 'centos7', 'Dockerfile.CentOS7') } } - stage('Linux aarch64') { + stage('CentOS7 aarch64') { agent { label "dockerBuild&&linux&&aarch64" } steps { - dockerBuild('arm64') + dockerBuild('arm64', 'centos7', 'Dockerfile.CentOS7') } } - stage('Linux ppc64le') { + stage('CentOS7 ppc64le') { agent { label "dockerBuild&&linux&&ppc64le" } steps { - dockerBuild('ppc64le') + dockerBuild('ppc64le', 'centos7', 'Dockerfile.CentOS7') + } + } + stage('Ubuntu16.04 armv7l') { + agent { + label "docker&&linux&&armv7l" + } + steps { + dockerBuild('armv7l', 'ubuntu1604', 'Dockerfile.Ubuntu1604') } } } @@ -43,12 +51,12 @@ pipeline { } } -def dockerBuild(architecture) { +def dockerBuild(architecture, distro, dockerfile) { git poll: false, url: 'https://github.com/adoptium/infrastructure.git' - sh label: '', script: "docker build -t adoptopenjdk/centos7_build_image:linux-$architecture -f ansible/Dockerfile.CentOS7 ." + sh label: '', script: "docker build -t adoptopenjdk/$distro_build_image:linux-$architecture -f ansible/docker/$dockerfile ." // dockerhub is the ID of the credentials stored in Jenkins docker.withRegistry('https://index.docker.io/v1/', 'dockerhub') { - sh label: '', script: "docker push adoptopenjdk/centos7_build_image:linux-$architecture" + sh label: '', script: "docker push adoptopenjdk/$distro_build_image:linux-$architecture" } } @@ -57,6 +65,7 @@ def dockerManifest() { docker.withRegistry('https://index.docker.io/v1/', 'dockerhub') { git poll: false, url: 'https://github.com/adoptium/infrastructure.git' sh ''' + # Centos7 export TARGET="adoptopenjdk/centos7_build_image" AMD64=$TARGET:linux-amd64 ARM64=$TARGET:linux-arm64 @@ -66,6 +75,12 @@ def dockerManifest() { docker manifest annotate $TARGET $ARM64 --arch arm64 --os linux docker manifest annotate $TARGET $PPC64LE --arch ppc64le --os linux docker manifest push $TARGET + # Ubuntu1604 + export TARGET="adoptopenjdk/ubuntu1604_build_image" + ARMV7L=$TARGET:linux-armv7l + docker manifest create $TARGET $ARMV7L + docker manifest annotate $TARGET $ARMV7L --arch armv7l --os linux + docker manifest push $TARGET ''' } -} +} \ No newline at end of file From 5ae5e22d6b565bb33084cf3eb7979d31081ec471 Mon Sep 17 00:00:00 2001 From: Stewart X Addison Date: Thu, 17 Jun 2021 19:57:48 +0100 Subject: [PATCH 5/5] SQASHME: Remove backup file Signed-off-by: Stewart X Addison --- .../roles/gcc_7/tasks/main.yml~ | 62 ------------------- 1 file changed, 62 deletions(-) delete mode 100644 ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/gcc_7/tasks/main.yml~ diff --git a/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/gcc_7/tasks/main.yml~ b/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/gcc_7/tasks/main.yml~ deleted file mode 100644 index 7428cd8392..0000000000 --- a/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/gcc_7/tasks/main.yml~ +++ /dev/null @@ -1,62 +0,0 @@ ---- -######### -# gcc_7 # -######### - -- name: Check if gcc 7.5 is installed on RHEL/CentOS - shell: /usr/local/gcc/bin/gcc-7.5 --version 2>&1 > /dev/null - ignore_errors: yes - register: gcc7_installed - when: ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "openSUSE" or (ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "16") or (ansible_distribution == "Debian" and ansible_architecture == "armv7l") - tags: gcc_7 - -# Unable to check the checksum of the binary as it'll be different for each architecture's tar.xz file -- name: Download AdoptOpenJDK gcc-7.5.0 binary - get_url: - url: https://ci.adoptopenjdk.net/userContent/gcc/gcc750+ccache.{{ ansible_architecture }}.tar.xz - dest: '/tmp/ansible-adoptopenjdk-gcc-7.tar.xz' - force: no - mode: 0644 - when: - - ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "openSUSE" or (ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "16") or (ansible_distribution == "Debian" and ansible_architecture == "armv7l") - - gcc7_installed.rc != 0 - tags: gcc_7 - -- name: Extract AdoptOpenJDK gcc-7 binary to /usr/local/gcc - unarchive: - src: /tmp/ansible-adoptopenjdk-gcc-7.tar.xz - dest: /usr/local/ - copy: False - when: - - ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "openSUSE" or (ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "16") or (ansible_distribution == "Debian" and ansible_architecture == "armv7l") - - gcc7_installed.rc != 0 - tags: gcc_7 - -- name: Remove downloaded gcc 7 binary tarball - file: - path: '/tmp/ansible-adoptopenjdk-gcc-7.tar.xz' - state: absent - when: - - ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "openSUSE" or (ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "16") or (ansible_distribution == "Debian" and ansible_architecture == "armv7l") - - gcc7_installed.rc != 0 - tags: gcc_7 - -# Stops buildng ccache from source when unnecessary -# See: https://github.com/AdoptOpenJDK/openjdk-infrastructure/issues/1472 -- name: Check if ccache is at /usr/local/bin/ccache - stat: - path: /usr/local/bin/ccache - register: ccache_symlink - when: - - ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "openSUSE" or (ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "16") or (ansible_distribution == "Debian" and ansible_architecture == "armv7l") - tags: gcc_7 - -- name: Create symlink for ccache - file: - src: /usr/local/gcc/bin/ccache - dest: /usr/local/bin/ccache - state: link - when: - - ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "openSUSE" or (ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "16") or (ansible_distribution == "Debian" and ansible_architecture == "armv7l") - - not ccache_symlink.stat.exists - tags: gcc_7