Skip to content

Commit

Permalink
Fix issue 3577 (adoptium#3732)
Browse files Browse the repository at this point in the history
* VPC: Add Ubuntu 24.04 Support

* VPC: Add Ubuntu 24 Support To Build Test

* Test using Devkit on noble

* VPC: Add Ubuntu 24 Support To Build Test

* VPC: Bump NASM to v2.16.03 and abstract

Linter Fix

Linter fix

VPC: Fix whitespace

VPC: Bump NASM to 2.16.03

This removes the need for a patch to support gcc > 7.5

Co-Authored-By: Martijn Verburg <[email protected]>
Co-Authored-By: Stewart X Addison <[email protected]>

---------

Co-authored-by: Martijn Verburg <[email protected]>
Co-authored-by: Stewart X Addison <[email protected]>
  • Loading branch information
3 people authored Sep 20, 2024
1 parent 617431d commit a39cca2
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 14 deletions.
13 changes: 8 additions & 5 deletions ansible/pbTestScripts/buildJDK.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,13 @@ processArgs() {

usage() {
echo "Usage: ./buildJDK.sh <options>
Options:
--version | -v Specify the JDK version to build
--fork | -f Specify the fork of openjdk-build to build from (Default: adoptopenjdk)
--branch | -b Specify the branch of the fork to build from (Default: master)
--hotspot | -hs Builds hotspot, default is openj9
--clean-workspace | -c Removes old openjdk-build folder before cloning
--help | -h Shows this message
If not specified, JDK8-J9 will be built with the standard openjdk-build repo"
echo
}
Expand Down Expand Up @@ -92,7 +90,7 @@ findJDK7() {
if [[ $jdkPath == "" ]]; then
jdkPath="/usr/lib/jvm/jdk8"
fi

export JDK7_BOOT_DIR=$jdkPath
}

Expand Down Expand Up @@ -165,14 +163,19 @@ if [[ "$(uname -m)" == "armv7l" && "$VARIANT" == "openj9" ]]; then
fi

if [[ "$JAVA_TO_BUILD" == "jdk8u" ]]; then
findJDK7
findJDK7
fi

# Don't build the debug-images as it takes too much space, and doesn't benefit VPC
# See: https://github.com/adoptium/infrastructure/issues/2033
export CONFIGURE_ARGS="--with-native-debug-symbols=none"
export BUILD_ARGS="--custom-cacerts false"

# For Ubuntu24.04 Support - Don't Use gcc-7
if grep 'noble' /etc/*-release >/dev/null 2>&1; then
export BUILD_ARGS="--custom-cacerts false --use-adoptium-devkit gcc-11.3.0-Centos7.9.2009-b03"
fi

echo "buildJDK.sh DEBUG:
TARGET_OS=${TARGET_OS:-}
ARCHITECTURE=${ARCHITECTURE:-}
Expand All @@ -185,7 +188,7 @@ echo "buildJDK.sh DEBUG:
BRANCH=$GIT_BRANCH:-}
FILENAME=${FILENAME:-}"

cloneRepo
cloneRepo

cd $WORKSPACE/openjdk-build
build-farm/make-adopt-build-farm.sh
3 changes: 3 additions & 0 deletions ansible/pbTestScripts/vmDestroy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ checkOS() {
osToDestroy="U21";;
"Ubuntu2204" | "U22" | "u22" )
osToDestroy="U22";;
"Ubuntu2404" | "U24" | "u24" )
osToDestroy="U24";;
"CentOS6" | "centos6" | "C6" | "c6" )
osToDestroy="C6" ;;
"CentOS7" | "centos7" | "C7" | "c7" )
Expand Down Expand Up @@ -83,6 +85,7 @@ listOS() {
- Ubuntu2004
- Ubuntu2104
- Ubuntu2204
- Ubuntu2404
- CentOS6
- CentOS7
- CentOS8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
# If so, nasm_installed.rc will equal 0, then check if its the version required
# If not, download, compile and install

- name: Set NASM version
set_fact:
nasm_version: "2.16.03"

# checking the common location for ubuntu package installs
- name: Checking for /usr/bin/gcc-7
stat: path=/usr/bin/gcc-7
Expand Down Expand Up @@ -71,43 +75,51 @@
tags: nasm

- name: Download nasm sources
shell: cd /tmp && wget https://www.nasm.us/pub/nasm/releasebuilds/2.13.03/nasm-2.13.03.tar.gz
shell: cd /tmp && wget https://www.nasm.us/pub/nasm/releasebuilds/{{ nasm_version }}/nasm-{{ nasm_version }}.tar.gz
when:
- (nasm_installed.rc is defined) and ((nasm_installed.rc != 0 ) or (nasm_installed.rc == 0 and nasm.stdout is version_compare('2.13.03', operator='ne')) )
- (nasm_installed.rc is defined) and ((nasm_installed.rc != 0 ) or (nasm_installed.rc == 0 and nasm.stdout is version_compare(nasm_version, operator='ne')) )
tags: nasm

- name: Extract nasm sources
unarchive:
src: /tmp/nasm-2.13.03.tar.gz
src: /tmp/nasm-{{ nasm_version }}.tar.gz
dest: /tmp/
copy: False
when:
- (nasm_installed.rc is defined) and ((nasm_installed.rc != 0 ) or (nasm_installed.rc == 0 and nasm.stdout is version_compare('2.13.03', operator='ne')) )
tags: nasm

- name: Running ./configure & make for nasm ( Not Ubuntu 22+ )
shell: cd /tmp/nasm-2.13.03 && CC={{ CC }} && ./configure -prefix=/usr/local && make install
shell: cd /tmp/nasm-{{ nasm_version }} && CC={{ CC }} && ./configure -prefix=/usr/local && make install
environment:
CC: "{{ CC }}"
when:
- (ansible_distribution != "Ubuntu" or ansible_distribution == "Ubuntu" and ansible_distribution_major_version < "22") and (nasm_installed.rc is defined) and ((nasm_installed.rc != 0 ) or (nasm_installed.rc == 0 and nasm.stdout is version_compare('2.13.03', operator='ne')) )
tags: nasm

- name: Running ./configure & make for nasm ( Ubuntu 22+ x64 )
shell: cd /tmp/nasm-2.13.03 && CC={{ CC }} && ./configure -prefix=/usr/local && make install
- name: Running ./configure & make for nasm ( Ubuntu 22 x64 )
shell: cd /tmp/nasm-{{ nasm_version }} && CC={{ CC }} && ./configure -prefix=/usr/local && make install
environment:
CC: "{{ CC }}"
LIBRARY_PATH: /usr/lib/x86_64-linux-gnu
when:
- (ansible_distribution == "Ubuntu" and ansible_distribution_major_version >= "22" and ansible_architecture == "x86_64") and (nasm_installed.rc is defined) and ((nasm_installed.rc != 0 ) or (nasm_installed.rc == 0 and nasm.stdout is version_compare('2.13.03', operator='ne')) )
- (ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "22" and ansible_architecture == "x86_64") and (nasm_installed.rc is defined) and ((nasm_installed.rc != 0 ) or (nasm_installed.rc == 0 and nasm.stdout is version_compare(nasm_version, operator='ne')) )
tags: nasm

- name: Running ./configure & make for nasm ( Ubuntu 24+ x64 )
shell: cd /tmp/nasm-{{ nasm_version }} && ./configure -prefix=/usr/local && make install
environment:
LIBRARY_PATH: /usr/lib/x86_64-linux-gnu
when:
- (ansible_distribution == "Ubuntu" and ansible_distribution_major_version >= "24" and ansible_architecture == "x86_64") and (nasm_installed.rc is defined) and ((nasm_installed.rc != 0 ) or (nasm_installed.rc == 0 and nasm.stdout is version_compare(nasm_version, operator='ne')) )
tags: nasm

- name: Remove downloaded packages for nasm
file:
path: "{{ item }}"
state: absent
with_items:
- /tmp/nasm-2.13.03
- /tmp/nasm-2.13.03.tar.gz
- /tmp/nasm-{{ nasm_version }}
- /tmp/nasm-{{ nasm_version }}.tar.gz
failed_when: false
tags: nasm
27 changes: 27 additions & 0 deletions ansible/vagrant/Vagrantfile.Ubuntu2404
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

$script = <<SCRIPT
# Put the host machine's IP into the authorised_keys file on the VM
if [ -r /vagrant/id_rsa.pub ]; then
mkdir -p $HOME/.ssh && cat /vagrant/id_rsa.pub >> $HOME/.ssh/authorized_keys
fi
SCRIPT

# 2 = version of configuration file for Vagrant 1.1+ leading up to 2.0.x
Vagrant.configure("2") do |config|

config.vm.define :adoptopenjdkU24 do |adoptopenjdkU24|
adoptopenjdkU24.vm.box = "bento/ubuntu-24.04"
adoptopenjdkU24.vm.synced_folder ".", "/vagrant"
adoptopenjdkU24.vm.hostname = "adoptopenjdkU24"
adoptopenjdkU24.vm.network :private_network, type: "dhcp"
adoptopenjdkU24.vm.provision "shell", inline: $script, privileged: false
end
config.vm.provider "virtualbox" do |v|
v.gui = false
v.memory = 4096
v.cpus = 2
v.customize ["modifyvm", :id, "--cpuexecutioncap", "50"]
end
end

0 comments on commit a39cca2

Please sign in to comment.