From 8d4435e8aad0ab67a17c5f8706f2efca1a44a291 Mon Sep 17 00:00:00 2001 From: Stewart X Addison <6487691+sxa@users.noreply.github.com> Date: Fri, 3 May 2024 13:29:17 +0100 Subject: [PATCH] unixPB: add openjdk devkit installs for Linux on x64, ppc64le, aarch64 (#3488) * unixPB: add adoptium openjdk devkit install Signed-off-by: Stewart X Addison * Remove trailing space Signed-off-by: Stewart X Addison * fixup Signed-off-by: Stewart X Addison * Adjust filenames/directory layout for new changes to devkit jobs Signed-off-by: Stewart X Addison * Add -gnu suffix to devkit filename * Revert "Adjust filenames/directory layout for new changes to devkit jobs" This reverts commit e6c4f45341749d3eaa1acf70e7a5414550a11e44. * Update devkit to b02 Signed-off-by: Stewart X Addison * Use different devkit for aarch64 Signed-off-by: Stewart X Addison * Add checksums for b02 devkits Signed-off-by: Stewart X Addison --------- Signed-off-by: Stewart X Addison --- .../AdoptOpenJDK_Unix_Playbook/main.yml | 12 +++++ .../roles/devkit/tasks/main.yml | 53 +++++++++++++++++++ .../roles/devkit/vars/main.yml | 4 ++ 3 files changed, 69 insertions(+) create mode 100644 ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/devkit/tasks/main.yml create mode 100644 ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/devkit/vars/main.yml diff --git a/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/main.yml b/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/main.yml index acbe6830fd..765c05c59f 100644 --- a/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/main.yml +++ b/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/main.yml @@ -72,6 +72,18 @@ tags: [build_tools] - role: gcc_11 # JDK19+ tags: [build_tools] + - role: devkit # JDK19+ + devkit_version: gcc-11.3.0-Centos7.9.2009-b02 + when: + - ansible_os_family == "RedHat" or ansible_os_family == "Debian" + - ansible_architecture == "x86_64" or ansible_architecture == "ppc64le" + tags: [devkit] + - role: devkit # JDK19+ + devkit_version: gcc-11.3.0-Centos7.6.1810-b02 + when: + - ansible_os_family == "RedHat" or ansible_os_family == "Debian" + - ansible_architecture == "aarch64" + tags: [devkit] - role: Xcode when: ansible_distribution == "MacOSX" - role: Xcode11 diff --git a/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/devkit/tasks/main.yml b/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/devkit/tasks/main.yml new file mode 100644 index 0000000000..6fc0d5d0ca --- /dev/null +++ b/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/devkit/tasks/main.yml @@ -0,0 +1,53 @@ +--- +################################ +# Adoptium devkit installation # +################################ + +- name: Check if devkit {{ devkit_version }} is installed + shell: /usr/local/devkit/{{ devkit_version }}/bin/gcc --version 2>&1 > /dev/null + failed_when: false + register: devkit_installed + changed_when: False + tags: devkit + +- name: Set filename of devkit tarball + set_fact: + devkit_filename: devkit-{{ devkit_version }}-{{ ansible_architecture }}-linux-gnu.tar.xz + when: + - devkit_installed.rc != 0 + tags: devkit + +- name: Download {{ devkit_filename }} + get_url: + url: https://github.com/adoptium/devkit-binaries/releases/download/{{ devkit_version }}/{{ devkit_filename }} + dest: /tmp/devkit.tar.xz + force: no + mode: 0644 + checksum: "sha256:{{ lookup('vars', 'csum_' + ansible_architecture) }}" + when: + - devkit_installed.rc != 0 + tags: devkit + +# Perhaps this should have the `b01` removed ... Or use a symlink? +- name: Create /usr/local/devkit/{{ devkit_version }} + file: + path: /usr/local/devkit/{{ devkit_version }} + state: directory + mode: '0755' + +- name: Extract {{ devkit_filename }} to /usr/local/devkit + unarchive: + src: /tmp/devkit.tar.xz + dest: /usr/local/devkit/{{ devkit_version }} + copy: False + when: + - devkit_installed.rc != 0 + tags: devkit + +- name: Remove tarball + file: + path: '/tmp/devkit.tar.xz' + state: absent + when: + - devkit_installed.rc != 0 + tags: devkit diff --git a/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/devkit/vars/main.yml b/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/devkit/vars/main.yml new file mode 100644 index 0000000000..0bf0e2832a --- /dev/null +++ b/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/devkit/vars/main.yml @@ -0,0 +1,4 @@ +--- +csum_x86_64: 8546406f0260ea6b2e136af13c3ea2d70d20f3d7c5935914f2f73b458141f231 +csum_aarch64: ac1bbbbbe28b753f865fa96dc48ac950f311c78304d03b05b234c8e16828c517 +csum_ppc64le: 5f4a9a3ea8c0c3d78800df805a64523ba3415fd68b6906c56ed9dacd1d0d5c1b