Skip to content

Commit

Permalink
CI: add workaround for Java 16
Browse files Browse the repository at this point in the history
  • Loading branch information
vhotspur committed Jul 22, 2021
1 parent 3caac4a commit 65329f0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tools/ci/bench-base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ java -jar "$RENAISSANCE_JAR" --raw-list > list.txt

for BENCH in $(cat list.txt); do
echo "====> $BENCH"
java -Xms2500M -Xmx2500M -jar "$RENAISSANCE_JAR" -c test -r 1 --csv output.csv --json output.json "$BENCH" || exit 1
java -Xms2500M -Xmx2500M $( get_jvm_workaround_args ) -jar "$RENAISSANCE_JAR" -c test -r 1 --csv output.csv --json output.json "$BENCH" || exit 1
done
1 change: 1 addition & 0 deletions tools/ci/bench-jmh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ source "$(dirname "$0")/common.sh"

java -jar "$RENAISSANCE_JMH_JAR" \
-jvmArgs -Xms2500M -jvmArgs -Xmx2500m \
$( for arg in $( get_jvm_workaround_args ); do echo "-jvmArgs" "$arg"; done ) \
-jvmArgs -Dorg.renaissance.jmh.configuration=test \
-jvmArgs -Dorg.renaissance.jmh.fakeIncompatible=true \
-wi 0 -i 1 -f 1 -foe true
15 changes: 15 additions & 0 deletions tools/ci/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ RENAISSANCE_GIT_VERSION=$(git describe --tags --always --dirty=-SNAPSHOT || echo
# Strip leading 'v' from the git-produced version
RENAISSANCE_VERSION=${RENAISSANCE_GIT_VERSION#v}

# Try to guess JVM version
RENAISSANCE_JVM_MAJOR_VERSION="$( java -XshowSettings:properties -version 2>&1 \
| sed -n -e 's#^[ \t]*java.version[ ]*=[ ]\(.*\)#\1#p' \
| sed -e 's#1\.8#8#' -e 's#\([^.]*\).*#\1#' \
|| echo 8 )"

# The base bundle
RENAISSANCE_DIR="target"
RENAISSANCE_JAR_NAME="renaissance-gpl-${RENAISSANCE_VERSION}.jar"
Expand All @@ -43,6 +49,15 @@ cp_reflink() {
cp $REFLINK "$@"
}

get_jvm_workaround_args() {
if [ "$RENAISSANCE_JVM_MAJOR_VERSION" = "16" ]; then
echo "--add-opens=java.base/java.lang.invoke=ALL-UNNAMED"
echo "--add-opens=java.base/java.util=ALL-UNNAME"
echo "--add-opens=java.base/java.nio=ALL-UNNAMED"
echo "--add-opens=java.base/sun.nio.ch=ALL-UNNAMED"
fi
}


# Make sure we are in the top-level directory so that we can use
# relative paths when referring to files within the project.
Expand Down

0 comments on commit 65329f0

Please sign in to comment.