Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/rivos/main' into rivos/merge-jdk…
Browse files Browse the repository at this point in the history
…-24+18
  • Loading branch information
luhenry committed Oct 3, 2024
2 parents 19642bd + 1b547b1 commit 5b3046c
Show file tree
Hide file tree
Showing 20 changed files with 1,008 additions and 9 deletions.
4 changes: 4 additions & 0 deletions .gdbinit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
set sysroot /sysroot/focal-riscv64

handle SIGILL nostop noprint
handle SIGSEGV nostop noprint
104 changes: 104 additions & 0 deletions .github/workflows/downstream.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
#
# Copyright (c) 2022, Rivos Inc. 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: 'OpenJDK Downstreaming'

on:
schedule:
# Trigger on Sunday to Friday at 21:00 UTC (23:00 CET, 14:00 PT)
# It triggers at least 9 hours before start of the working day in CET
# since that's when I would want to review it. And given GHA takes a long
# time to run, we want to start doing it as early as possible
- cron: '0 21 * * 0-4'
workflow_dispatch:
inputs: {}

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
pull-requests: write

jobs:
fetch-push-pr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.WORKFLOW_TOKEN }}
ref: 'rivos/main'
fetch-depth: 0

- name: "Fetch"
id: fetch
run: |
git remote add upstream https://github.com/openjdk/jdk.git
git fetch --tags upstream master
- name: "Configure"
id: configure
run: |
TAG=$(git tag | grep --extended-regexp '^jdk\-.*' | sort --version-sort | tail --lines 1 | tr --delete '\n')
test -n "$TAG"
echo "tag=$TAG" >> $GITHUB_OUTPUT
echo "diff=$(test -n "$(git diff rivos/main...$TAG)" && echo "true" || echo "false")" >> $GITHUB_OUTPUT
- name: "Push"
run: |
git push origin ${{ steps.configure.outputs.tag }}
if [ "${{ steps.configure.outputs.diff }}" = "true" ]; then
git branch -f rivos/merge-${{ steps.configure.outputs.tag }} ${{ steps.configure.outputs.tag }}
git checkout rivos/merge-${{ steps.configure.outputs.tag }}
# Setup user for merge commit
git config user.name "Ludovic Henry"
git config user.email "ludovic@rivosinc.com"
if ! git merge --no-ff --no-edit origin/rivos/main; then
# Print the conflicts
git diff
# Abort the merge and let assignee manually resolve them
git merge --abort
fi
git push origin rivos/merge-${{ steps.configure.outputs.tag }}
fi
- name: "Create PR"
run: |
if [ "${{ steps.configure.outputs.diff }}" = "true" ]; then
gh pr create \
--repo rivosinc/jdk \
--base rivos/main \
--head rivos/merge-${{ steps.configure.outputs.tag }} \
--title "Merge ${{ steps.configure.outputs.tag }} into rivos/main" \
--body "" \
--assignee "luhenry" || true
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11 changes: 6 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@
name: 'OpenJDK GHA Sanity Checks'

on:
pull_request:
branches:
- rivos/main
push:
branches-ignore:
- master
- pr/*
- jdk*
branches:
- rivos/main
workflow_dispatch:
inputs:
platforms:
Expand Down Expand Up @@ -89,7 +90,7 @@ jobs:
function check_platform() {
if [[ $GITHUB_EVENT_NAME == workflow_dispatch ]]; then
input='${{ github.event.inputs.platforms }}'
elif [[ $GITHUB_EVENT_NAME == push ]]; then
elif [[ $GITHUB_EVENT_NAME == push || $GITHUB_EVENT_NAME == pull_request ]]; then
if [[ '${{ !secrets.JDK_SUBMIT_FILTER || startsWith(github.ref, 'refs/heads/submit/') }}' == 'false' ]]; then
# If JDK_SUBMIT_FILTER is set, and this is not a "submit/" branch, don't run anything
>&2 echo 'JDK_SUBMIT_FILTER is set and not a "submit/" branch'
Expand Down
2 changes: 2 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Default owners to managed runtimes team
* @rivosinc/managed-runtimes
5 changes: 5 additions & 0 deletions make.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

DIST=${DIST:-focal}

/sysroot/run-in.sh /sysroot/$DIST-amd64 make $*
16 changes: 16 additions & 0 deletions rivos/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Setup

## QEMU

You most likely want to setup QEMU user-space emulation at the OS level to transparently execute RISC-V binaries on an x86-64 host.

To do so, first install `rivos-sdk-qemu`:
```
sudo apt-get update
sudo apt-get install -y rivos-sdk-qemu
```

Then, setup binfmt_mist with:
```
docker run --privileged --rm -v /rivos:/rivos -e QEMU_BINARY_PATH=/rivos/qemu/bin tonistiigi/binfmt --install riscv64
```
14 changes: 14 additions & 0 deletions rivos/configure-amd64.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

DIST=${DIST:-focal}

ARGS=(
--with-boot-jdk=/rivos/jdk
--with-zlib=system
--with-sysroot=/sysroot/$DIST-amd64
--with-jmh=/workspace/jmh/build/images/jmh
--with-jtreg=/workspace/jtreg/build/images/jtreg
--with-hsdis=binutils --with-binutils-src=/workspace/binutils --enable-hsdis-bundling
)

bash configure ${ARGS[@]} $*
15 changes: 15 additions & 0 deletions rivos/configure-riscv64.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

ARGS=(
--openjdk-target=riscv64-linux-gnu
--with-boot-jdk=/rivos/jdk
--with-build-jdk=/rivos/jdk
# --with-debug-level=slowdebug
--with-zlib=system
--with-sysroot=/rivos/sysroot/riscv
--with-jmh=/workspace/jmh/build/images/jmh
--with-jtreg=/workspace/jtreg/build/images/jtreg
--with-hsdis=binutils --with-binutils-src=/workspace/binutils --enable-hsdis-bundling
)

bash configure ${ARGS[@]} $*
Loading

0 comments on commit 5b3046c

Please sign in to comment.