Skip to content

Commit

Permalink
Merge branch 'main' into gatherer
Browse files Browse the repository at this point in the history
  • Loading branch information
wmdietl authored Dec 19, 2024
2 parents d4eb452 + 7cc2fbd commit f216731
Show file tree
Hide file tree
Showing 8,980 changed files with 401,664 additions and 278,747 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
68 changes: 68 additions & 0 deletions .github/actions/build-jtreg/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#
# Copyright (c) 2023, 2024, 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: 'Build JTReg'
description: 'Build JTReg'

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

- name: 'Check cache for already built JTReg'
id: get-cached
uses: actions/cache@v4
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.outputs.cache-hit != 'true')

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

- name: 'Upload JTReg artifact'
uses: actions/upload-artifact@v4
with:
name: bundles-jtreg-${{ steps.version.outputs.value }}
path: jtreg/installed
retention-days: 1
34 changes: 5 additions & 29 deletions .github/actions/get-jtreg/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#

name: 'Get JTReg'
description: 'Download JTReg from cache or source location'
description: 'Get JTReg'
outputs:
path:
description: 'Path to the installed JTReg'
Expand All @@ -39,36 +39,12 @@ runs:
with:
var: JTREG_VERSION

- name: 'Check cache for JTReg'
id: get-cached-jtreg
uses: actions/cache@v4
- name: 'Download JTReg artifact'
id: download-jtreg
uses: actions/download-artifact@v4
with:
name: bundles-jtreg-${{ steps.version.outputs.value }}
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: |
# If runner architecture is x64 set JAVA_HOME_17_X64 otherwise set to JAVA_HOME_17_arm64
if [[ '${{ runner.arch }}' == 'X64' ]]; then
JDK="$JAVA_HOME_17_X64"
else
JDK="$JAVA_HOME_17_arm64"
fi
# Build JTReg and move files to the proper locations
bash make/build.sh --jdk "$JDK"
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
Expand Down
21 changes: 21 additions & 0 deletions .github/scripts/gen-build-failure-report.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,19 @@
# questions.
#

# Import common utils
. .github/scripts/report-utils.sh

GITHUB_STEP_SUMMARY="$1"
BUILD_DIR="$(ls -d build/*)"

# Send signal to the do-build action that we failed
touch "$BUILD_DIR/build-failure"

# Collect hs_errs for build-time crashes, e.g. javac, jmod, jlink, CDS.
# These usually land in make/
hs_err_files=$(ls make/hs_err*.log 2> /dev/null || true)

(
echo '### :boom: Build failure summary'
echo ''
Expand All @@ -46,6 +53,20 @@ touch "$BUILD_DIR/build-failure"
echo '</details>'
echo ''

for hs_err in $hs_err_files; do
echo "<details><summary><b>View HotSpot error log: "$hs_err"</b></summary>"
echo ''
echo '```'
echo "$hs_err:"
echo ''
cat "$hs_err"
echo '```'
echo '</details>'
echo ''
done

echo ''
echo ':arrow_right: To see the entire test log, click the job in the list to the left. To download logs, see the `failure-logs` [artifact above](#artifacts).'
) >> $GITHUB_STEP_SUMMARY

truncate_summary
19 changes: 5 additions & 14 deletions .github/scripts/gen-test-results.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
# questions.
#

# Import common utils
. .github/scripts/report-utils.sh

GITHUB_STEP_SUMMARY="$1"

test_suite_name=$(cat build/run-test-prebuilt/test-support/test-last-ids.txt)
Expand Down Expand Up @@ -89,18 +92,6 @@ for test in $failures $errors; do
fi
done >> $GITHUB_STEP_SUMMARY

# With many failures, the summary can easily exceed 1024 kB, the limit set by Github
# Trim it down if so.
summary_size=$(wc -c < $GITHUB_STEP_SUMMARY)
if [[ $summary_size -gt 1000000 ]]; then
# Trim to below 1024 kB, and cut off after the last detail group
head -c 1000000 $GITHUB_STEP_SUMMARY | tac | sed -n -e '/<\/details>/,$ p' | tac > $GITHUB_STEP_SUMMARY.tmp
mv $GITHUB_STEP_SUMMARY.tmp $GITHUB_STEP_SUMMARY
(
echo ''
echo ':x: **WARNING: Summary is too large and has been truncated.**'
echo ''
) >> $GITHUB_STEP_SUMMARY
fi

echo ':arrow_right: To see the entire test log, click the job in the list to the left.' >> $GITHUB_STEP_SUMMARY

truncate_summary
41 changes: 41 additions & 0 deletions .github/scripts/report-utils.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash
#
# Copyright (c) 2024, 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.
#

function truncate_summary() {
# With large hs_errs, the summary can easily exceed 1024 kB, the limit set by Github
# Trim it down if so.
summary_size=$(wc -c < $GITHUB_STEP_SUMMARY)
if [[ $summary_size -gt 1000000 ]]; then
# Trim to below 1024 kB, and cut off after the last detail group
head -c 1000000 $GITHUB_STEP_SUMMARY | tac | sed -n -e '/<\/details>/,$ p' | tac > $GITHUB_STEP_SUMMARY.tmp
mv $GITHUB_STEP_SUMMARY.tmp $GITHUB_STEP_SUMMARY
(
echo ''
echo ':x: **WARNING: Summary is too large and has been truncated.**'
echo ''
) >> $GITHUB_STEP_SUMMARY
fi
}
6 changes: 5 additions & 1 deletion .github/workflows/build-cross-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:
- target-cpu: riscv64
gnu-arch: riscv64
debian-arch: riscv64
debian-repository: https://snapshot.debian.org/archive/debian/20240228T034848Z/
debian-repository: https://httpredir.debian.org/debian/
debian-version: sid
tolerate-sysroot-errors: true

Expand Down Expand Up @@ -131,6 +131,7 @@ jobs:
id: create-sysroot
run: >
sudo debootstrap
--no-merged-usr
--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,libfreetype-dev,libpng-dev
Expand All @@ -151,6 +152,9 @@ jobs:
rm -rf sysroot/usr/{sbin,bin,share}
rm -rf sysroot/usr/lib/{apt,gcc,udev,systemd}
rm -rf sysroot/usr/libexec/gcc
# /{bin,sbin,lib}/ are not symbolic links to /usr/{bin,sbin,lib}/ when debootstrap with --no-merged-usr
rm -rf sysroot/{sbin,bin}
rm -rf sysroot/lib/{udev,systemd}
if: steps.create-sysroot.outcome == 'success' && steps.get-cached-sysroot.outputs.cache-hit != 'true'

- name: 'Remove broken sysroot'
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/jspecify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: JSpecify JDK CI tests

on:
pull_request:
push:
branches: [ "main" ]

jobs:
build_jdk:
name: Build the JSpecify JDK
runs-on: ubuntu-latest
permissions:
contents: read
env:
JAVA_VERSION: 23
steps:
- uses: actions/checkout@v4
- name: Set up JDK 23
uses: actions/setup-java@v4
with:
java-version: 23
distribution: 'temurin'
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install --only-upgrade apt
sudo apt-get install gcc-10 g++-10 libxrandr-dev libxtst-dev libcups2-dev libasound2-dev
- name: Install jtreg
run: |
wget https://builds.shipilev.net/jtreg/jtreg-7.5%2B1.zip -O /tmp/jtreg.zip
unzip /tmp/jtreg.zip -d /tmp/
- name: Configure the JDK
run: bash ./configure --with-jtreg=/tmp/jtreg --disable-warnings-as-errors
- name: Build the JDK
run: make jdk

Loading

0 comments on commit f216731

Please sign in to comment.