Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/standard' into dragonwell
Browse files Browse the repository at this point in the history
Summary: Merge upstream code

Testing: CICD

Reviewers: kuaiwei, yuleil

Issue: #225
  • Loading branch information
Accelerator1996 committed Jan 22, 2024
2 parents f6f0d6b + 6739881 commit c595052
Show file tree
Hide file tree
Showing 855 changed files with 17,174 additions and 23,102 deletions.
109 changes: 109 additions & 0 deletions .github/actions/get-bootjdk/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
#
# Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#

name: 'Get BootJDK'
description: 'Download the BootJDK from cache or source location'
inputs:
platform:
description: 'Platform'
required: true
outputs:
path:
description: 'Path to the installed BootJDK'
value: ${{ steps.path-name.outputs.path }}

runs:
using: composite
steps:
- name: 'Determine platform prefix'
id: platform-prefix
run: |
# Convert platform name to upper case
platform_prefix="$(echo ${{ inputs.platform }} | tr [a-z-] [A-Z_])"
echo "value=$platform_prefix" >> $GITHUB_OUTPUT
shell: bash

- name: 'Get URL configuration'
id: url
uses: ./.github/actions/config
with:
var: ${{ steps.platform-prefix.outputs.value}}_BOOT_JDK_URL

- name: 'Get SHA256 configuration'
id: sha256
uses: ./.github/actions/config
with:
var: ${{ steps.platform-prefix.outputs.value}}_BOOT_JDK_SHA256

- name: 'Get file extension configuration'
id: ext
uses: ./.github/actions/config
with:
var: ${{ steps.platform-prefix.outputs.value}}_BOOT_JDK_EXT

- name: 'Check cache for BootJDK'
id: get-cached-bootjdk
uses: actions/cache@v3
with:
path: bootjdk/jdk
key: boot-jdk-${{ inputs.platform }}-${{ steps.sha256.outputs.value }}

# macOS is missing sha256sum
- name: 'Install sha256sum'
run: |
# Run Homebrew installation
brew install coreutils
shell: bash
if: steps.get-cached-bootjdk.outputs.cache-hit != 'true' && runner.os == 'macOS'

- name: 'Download BootJDK'
run: |
# Download BootJDK and verify checksum
mkdir -p bootjdk/jdk
mkdir -p bootjdk/unpacked
wget --progress=dot:mega -O bootjdk/jdk.${{ steps.ext.outputs.value }} '${{ steps.url.outputs.value }}'
echo '${{ steps.sha256.outputs.value }} bootjdk/jdk.${{ steps.ext.outputs.value }}' | sha256sum -c >/dev/null -
shell: bash
if: steps.get-cached-bootjdk.outputs.cache-hit != 'true'

- name: 'Unpack BootJDK'
run: |
# Unpack the BootJDK and move files to a common location
if [[ '${{ steps.ext.outputs.value }}' == 'tar.gz' ]]; then
tar -xf bootjdk/jdk.${{ steps.ext.outputs.value }} -C bootjdk/unpacked
else
unzip -q bootjdk/jdk.${{ steps.ext.outputs.value }} -d bootjdk/unpacked
fi
jdk_root="$(dirname $(find bootjdk/unpacked -name bin -type d))"
mv "$jdk_root"/* bootjdk/jdk/
shell: bash
if: steps.get-cached-bootjdk.outputs.cache-hit != 'true'

- name: 'Export path to where BootJDK is installed'
id: path-name
run: |
# Export the absolute path
echo "path=`pwd`/bootjdk/jdk" >> $GITHUB_OUTPUT
shell: bash
72 changes: 72 additions & 0 deletions .github/actions/get-jtreg/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#
# Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#

name: 'Get JTReg'
description: 'Download JTReg from cache or source location'
outputs:
path:
description: 'Path to the installed JTReg'
value: ${{ steps.path-name.outputs.path }}

runs:
using: composite
steps:
- name: 'Get JTReg version configuration'
id: version
uses: ./.github/actions/config
with:
var: JTREG_VERSION

- name: 'Check cache for JTReg'
id: get-cached-jtreg
uses: actions/cache@v3
with:
path: jtreg/installed
key: jtreg-${{ steps.version.outputs.value }}

- name: 'Checkout the JTReg source'
uses: actions/checkout@v4
with:
repository: openjdk/jtreg
ref: jtreg-${{ steps.version.outputs.value }}
path: jtreg/src
if: steps.get-cached-jtreg.outputs.cache-hit != 'true'

- name: 'Build JTReg'
run: |
# Build JTReg and move files to the proper locations
bash make/build.sh --jdk "$JAVA_HOME_11_X64"
mkdir ../installed
mv build/images/jtreg/* ../installed
working-directory: jtreg/src
shell: bash
if: steps.get-cached-jtreg.outputs.cache-hit != 'true'

- name: 'Export path to where JTReg is installed'
id: path-name
run: |
# Export the path
echo 'path=jtreg/installed' >> $GITHUB_OUTPUT
shell: bash
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#
# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
Expand All @@ -21,4 +23,22 @@
# questions.
#

exclusiveAccess.dirs=.
name: 'Get MSYS2'
description: 'Download MSYS2 and prepare a Windows host'

runs:
using: composite
steps:
- name: 'Install MSYS2'
uses: msys2/setup-msys2@v2
with:
install: 'autoconf tar unzip zip make'
path-type: minimal
location: ${{ runner.tool_cache }}/msys2

# We can't run bash until this is completed, so stick with pwsh
- name: 'Set MSYS2 path'
run: |
# Prepend msys2/msys64/usr/bin to the PATH
echo "$env:RUNNER_TOOL_CACHE/msys2/msys64/usr/bin" >> $env:GITHUB_PATH
shell: pwsh
54 changes: 39 additions & 15 deletions .github/workflows/build-cross-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,22 @@ on:
workflow_call:
inputs:
gcc-major-version:
required: true
type: string
extra-conf-options:
required: false
type: string
configure-arguments:
required: false
type: string
make-arguments:
required: false
type: string
default: '10'

jobs:
build-cross-compile:
name: build
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

strategy:
fail-fast: false
Expand All @@ -48,22 +56,30 @@ jobs:
- ppc64le
include:
- target-cpu: aarch64
debian-arch: arm64
gnu-arch: aarch64
debian-arch: arm64
debian-repository: https://httpredir.debian.org/debian/
debian-version: bullseye
- target-cpu: arm
debian-arch: armhf
gnu-arch: arm
debian-arch: armhf
debian-repository: https://httpredir.debian.org/debian/
debian-version: bullseye
gnu-abi: eabihf
- target-cpu: s390x
debian-arch: s390x
gnu-arch: s390x
debian-arch: s390x
debian-repository: https://httpredir.debian.org/debian/
debian-version: bullseye
- target-cpu: ppc64le
debian-arch: ppc64el
gnu-arch: powerpc64le
debian-arch: ppc64el
debian-repository: https://httpredir.debian.org/debian/
debian-version: bullseye

steps:
- name: 'Checkout the JDK source'
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: 'Get the BootJDK'
id: bootjdk
Expand Down Expand Up @@ -105,22 +121,26 @@ jobs:

- name: 'Create sysroot'
run: >
sudo qemu-debootstrap
sudo debootstrap
--arch=${{ matrix.debian-arch }}
--verbose
--include=fakeroot,symlinks,build-essential,libx11-dev,libxext-dev,libxrender-dev,libxrandr-dev,libxtst-dev,libxt-dev,libcups2-dev,libfontconfig1-dev,libasound2-dev,libfreetype6-dev,libpng-dev
--include=fakeroot,symlinks,build-essential,libx11-dev,libxext-dev,libxrender-dev,libxrandr-dev,libxtst-dev,libxt-dev,libcups2-dev,libfontconfig1-dev,libasound2-dev,libfreetype-dev,libpng-dev
--resolve-deps
buster
--variant=minbase
${{ matrix.debian-version }}
sysroot
https://httpredir.debian.org/debian/
${{ matrix.debian-repository }}
if: steps.get-cached-sysroot.outputs.cache-hit != 'true'

- name: 'Prepare sysroot'
run: |
# Prepare sysroot and remove unused files to minimize cache
sudo chroot sysroot symlinks -cr .
sudo chown ${USER} -R sysroot
rm -rf sysroot/{dev,proc,run,sys}
rm -rf sysroot/{dev,proc,run,sys,var}
rm -rf sysroot/usr/{sbin,bin,share}
rm -rf sysroot/usr/lib/{apt,gcc,udev,systemd}
rm -rf sysroot/usr/libexec/gcc
if: steps.get-cached-sysroot.outputs.cache-hit != 'true'

- name: 'Configure'
Expand All @@ -135,12 +155,16 @@ jobs:
--openjdk-target=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}
--with-sysroot=sysroot
--with-build-jdk=${{ steps.buildjdk.outputs.jdk-path }}
CC=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}-gcc-10
CXX=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}-g++-10
CC=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}-gcc-${{ inputs.gcc-major-version }}
CXX=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}-g++-${{ inputs.gcc-major-version }}
${{ inputs.extra-conf-options }} ${{ inputs.configure-arguments }} || (
echo "Dumping config.log:" &&
cat config.log &&
exit 1)
- name: 'Build'
id: build
uses: ./.github/actions/do-build
with:
make-target: 'hotspot'
make-target: 'hotspot ${{ inputs.make-arguments }}'
platform: linux-${{ matrix.target-cpu }}
Loading

0 comments on commit c595052

Please sign in to comment.