-
-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added builder scripts for more code-tools - jcstress, jtharness, sigtest and jcov #766
Changes from all commits
3bcd495
fb6e70e
dae215e
ab383e9
414d560
330b4c1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
#!/bin/bash | ||
|
||
################################################################### | ||
# Script to build jtharness reusable by jdk testing community # | ||
# currently builds tip and latest released version # | ||
################################################################### | ||
|
||
# shellcheck disable=SC2035,SC2155 | ||
set -euo pipefail | ||
WORKSPACE=$PWD | ||
|
||
function hashArtifacts() { | ||
echo "Creating checksums all jtharness*.jar" | ||
for file in `ls javatest*.jar` ; do | ||
sha256sum $file > $file.sha256sum.txt | ||
done | ||
} | ||
|
||
function detectJdks() { | ||
jvm_dir="/usr/lib/jvm/" | ||
find ${jvm_dir} -maxdepth 1 | sort | ||
echo "Available jdks 11 in ${jvm_dir}:" | ||
find ${jvm_dir} -maxdepth 1 | sort | grep -e java-11- -e jdk-11 | ||
jdk11=$(readlink -f $(find ${jvm_dir} -maxdepth 1 | sort | grep -e java-11- -e jdk-11 | head -n 1)) | ||
} | ||
|
||
REPO_DIR="jtharness" | ||
BUILD_PATH=JTHarness-build/binaries/lib | ||
main_file=javatest | ||
if [ ! -e $REPO_DIR ] ; then | ||
git clone https://github.com/openjdk/$REPO_DIR.git | ||
else | ||
rm -vf $REPO_DIR/$main_file*.jar | ||
fi | ||
detectJdks | ||
pushd $REPO_DIR | ||
git checkout master | ||
rm -rf ../$BUILD_PATH | ||
tip=`git log | head -n 1 | sed "s/.*\s\+//"` || true | ||
tip_shortened=`echo ${tip:0:10}` | ||
latestRelease=`git tag -l | sort -Vr | head -n 1` | ||
rc=$main_file-$latestRelease | ||
|
||
# latest released | ||
git checkout $latestRelease | ||
export JAVA_HOME=$jdk11 | ||
pushd build | ||
ant test | tee ../$rc.jar.txt || true | ||
ant build | ||
popd | ||
mv ../$BUILD_PATH/$main_file.jar $rc.jar | ||
echo "Manually renaming $rc.jar as $main_file.jar to provide latest-stable-recommended file" | ||
ln -sfv $rc.jar $main_file.jar | ||
pushd build | ||
ant clean | ||
popd | ||
rm -rf ../$BUILD_PATH | ||
|
||
# tip | ||
git checkout master | ||
export JAVA_HOME=$jdk11 | ||
pushd build | ||
ant test | tee ../$main_file-$tip_shortened.jar.txt || true | ||
ant build | ||
popd | ||
mv ../$BUILD_PATH/$main_file.jar $main_file-$tip_shortened.jar | ||
echo "Manually renaming $main_file-$tip_shortened.jar as $main_file-tip.jar to provide latest-unstable-recommended file" | ||
ln -sfv $main_file-$tip_shortened.jar $main_file-tip.jar | ||
pushd build | ||
ant clean | ||
popd | ||
rm -rf ../$BUILD_PATH | ||
|
||
echo "Resetting repo back to master" | ||
git checkout master | ||
hashArtifacts | ||
popd |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,161 @@ | ||
#!/bin/bash | ||
|
||
################################################################### | ||
# Script to build jcov reusable by jdk testing community # | ||
# It requires asm jars - downloaded during build # | ||
# It optionally requires javatest.jar - # | ||
# obtained from older release, buildable on demand or skipped # | ||
# currently builds tip and latest released version # | ||
################################################################### | ||
|
||
# shellcheck disable=SC2035,SC2155 | ||
set -euo pipefail | ||
WORKSPACE=$PWD | ||
|
||
function hashArtifacts() { | ||
echo "Creating checksums all jcov*.tar.gz" | ||
for file in `ls jcov*.tar.gz` ; do | ||
sha256sum $file > $file.sha256sum.txt | ||
done | ||
} | ||
|
||
function detectJdks() { | ||
jvm_dir="/usr/lib/jvm/" | ||
find ${jvm_dir} -maxdepth 1 | sort | ||
echo "Available jdks 17 in ${jvm_dir}:" | ||
find ${jvm_dir} -maxdepth 1 | sort | grep -e java-17- -e jdk-17 | ||
jdk17=$(readlink -f $(find ${jvm_dir} -maxdepth 1 | sort | grep -e java-17- -e jdk-17 | head -n 1)) | ||
} | ||
|
||
function resetRepo() { | ||
local branch=${1} | ||
rm -f .git/index.lock ; | ||
git reset --hard ; | ||
git checkout $branch | ||
} | ||
|
||
function cleanRepo() { | ||
pushd build | ||
ant clean | ||
popd | ||
rm -rf ../$BUILD_PATH | ||
} | ||
|
||
function getAsmDeps() { | ||
asm_version=$1 | ||
tools="asm asm-tree asm-util" | ||
main_url="https://repository.ow2.org/nexus/content/repositories/releases/org/ow2/asm" | ||
ASM_TITLE="Built against '$tools' tools in version '$asm_version'" | ||
ASM_URLS="" | ||
ASM_JARS="" | ||
ASM_PROPS="" | ||
for tool in $tools; do | ||
tool_prop="`echo $tool|sed "s/-/./g"`.jar" | ||
tool_versioned="$tool-$asm_version.jar" | ||
tool_url="$main_url/$tool/$asm_version/$tool_versioned" | ||
if [ ! -e $tool_versioned ] ; then | ||
wget $tool_url | ||
fi | ||
ASM_URLS="$ASM_URLS$tool_url | ||
" #ne per line | ||
ASM_PROPS="$ASM_PROPS -D$tool_prop=`pwd`/$tool_versioned" | ||
ASM_JARS="$ASM_JARS$tool_versioned:" | ||
done | ||
} | ||
|
||
function getReadme() { | ||
echo $ASM_TITLE | ||
echo "" | ||
echo "Get:" | ||
echo "$ASM_URLS" | ||
echo "" | ||
echo "Use on CP:" | ||
echo $ASM_JARS="" | ||
echo "" | ||
echo "In addition jtobserver.jar requires javatest.sh" | ||
echo "You can get one at adoptium: https://ci.adoptium.net/view/Dependencies/job/dependency_pipeline/" #TODO add better link? | ||
echo "Or build one from: https://github.com/openjdk/jtharness/" | ||
} | ||
|
||
function getJavatest() { | ||
local javatest=javatest.jar | ||
pushd build | ||
if [ ! -e $javatest ] ; then | ||
# For local usage you can build local javatest.jar by running javatest.sh | ||
# Then also the jtobserver.jar will be built | ||
# FIXME replace by wget of latest javatest.jar downloaded from published javatest.sh artifacts | ||
if [ -e ../../jtharness/$javatest ] ; then | ||
cp ../../jtharness/$javatest . | ||
else | ||
# unsetting the javatestjar will exclude build of | ||
sed "s/javatestjar.*/javatestjar=/g" -i build.properties | ||
fi | ||
fi | ||
if [ ! -e testng.jar ] ; then | ||
local testngv=6.9.10 | ||
wget https://repo1.maven.org/maven2/org/testng/testng/$testngv/testng-$testngv.jar | ||
mv testng-$testngv.jar testng.jar | ||
fi | ||
if [ ! -e jcommander.jar ] ; then | ||
jcommanderv=1.81 | ||
wget https://repo1.maven.org/maven2/com/beust/jcommander/$jcommanderv/jcommander-$jcommanderv.jar | ||
mv jcommander-$jcommanderv.jar jcommander.jar | ||
fi | ||
popd | ||
} | ||
|
||
REPO_DIR="jcov" | ||
BUILD_PATH=JCOV_BUILD/ | ||
main_file=jcov | ||
if [ ! -e $REPO_DIR ] ; then | ||
git clone https://github.com/openjdk/$REPO_DIR.git | ||
else | ||
rm -vf $REPO_DIR/$main_file*.tar.gz | ||
fi | ||
|
||
detectJdks | ||
|
||
pushd $REPO_DIR | ||
|
||
resetRepo master | ||
rm -rf ../$BUILD_PATH | ||
tip=`git log | head -n 1 | sed "s/.*\s\+//"` || true | ||
tip_shortened=`echo ${tip:0:10}` | ||
latestRelease=`git tag -l | sed "s/rc/b000/g" | sort -Vr | sed "s/b000/rc/" | head -n 1` | ||
rc=$main_file-$latestRelease | ||
|
||
# latest released | ||
resetRepo "$latestRelease" | ||
getAsmDeps "8.0.1" | ||
getJavatest | ||
pushd build | ||
ant $ASM_PROPS build | ||
popd | ||
pushd $BUILD_PATH/jcov*/ | ||
getReadme > readme.txt | ||
tar -czf ../../$rc.tar.gz *.jar readme.txt | ||
popd | ||
echo "Manually renaming $rc.tar.gz as $main_file.tar.gz to provide latest-stable-recommended file" | ||
ln -sfv $rc.tar.gz $main_file.tar.gz | ||
cleanRepo | ||
|
||
# tip | ||
resetRepo master | ||
getAsmDeps "9.0" | ||
getJavatest | ||
pushd build | ||
ant $ASM_PROPS test | tee ../$main_file-$tip_shortened.tar.gz.txt || true | ||
ant $ASM_PROPS build | ||
popd | ||
pushd $BUILD_PATH/jcov*/ | ||
getReadme > readme.txt | ||
tar -czf ../../$main_file-$tip_shortened.tar.gz *.jar readme.txt | ||
popd | ||
echo "Manually renaming $main_file-$tip_shortened.tar.gz as $main_file-tip..tar.gz to provide latest-unstable-recommended file" | ||
ln -sfv $main_file-$tip_shortened.tar.gz $main_file-tip.tar.gz | ||
cleanRepo | ||
|
||
echo "Resetting repo back to master" | ||
resetRepo master | ||
hashArtifacts | ||
popd |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
#!/bin/bash | ||
|
||
################################################################### | ||
# Script to build jcstress to be reused by jdk testing community # | ||
# currently builds tip and latest released version # | ||
################################################################### | ||
|
||
# shellcheck disable=SC2035,SC2155 | ||
set -euo pipefail | ||
karianna marked this conversation as resolved.
Show resolved
Hide resolved
|
||
WORKSPACE=$PWD | ||
|
||
function hashArtifacts() { | ||
echo "Creating checksums all jcstress*.jar" | ||
for file in `ls jcstress*.jar` ; do | ||
sha256sum $file > $file.sha256sum.txt | ||
done | ||
} | ||
|
||
function detectJdks() { | ||
jvm_dir="/usr/lib/jvm/" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This only builds on Linux, I wonder if there's a more O/S independent way to pass the java in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For our CI farm we can of course pin to a Linux node if need be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like below that Java 11 is required? |
||
find ${jvm_dir} -maxdepth 1 | sort | ||
echo "Available jdks 11 in ${jvm_dir}:" | ||
find ${jvm_dir} -maxdepth 1 | sort | grep -e java-11- -e jdk-11 | ||
jdk11=$(readlink -f $(find ${jvm_dir} -maxdepth 1 | sort | grep -e java-11- -e jdk-11 | head -n 1)) | ||
} | ||
|
||
REPO_DIR="jcstress" | ||
main_name=$REPO_DIR | ||
main_file=$main_name.jar | ||
if [ ! -e $REPO_DIR ] ; then | ||
git clone https://github.com/openjdk/$REPO_DIR.git | ||
else | ||
rm -vf $REPO_DIR/$main_name*.jar $REPO_DIR/$main_name*.sha256sum.txt | ||
fi | ||
detectJdks | ||
pushd $REPO_DIR | ||
git checkout master | ||
tip=`git log | head -n 1 | sed "s/.*\s\+//"` || true | ||
tip_shortened=`echo ${tip:0:10}` | ||
latestRelease=`git tag -l | sort -Vr | head -n 1` | ||
rc=$main_name-$latestRelease.jar | ||
|
||
# latest released | ||
git checkout $latestRelease | ||
export JAVA_HOME=$jdk11 | ||
mvn clean install | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. assumes mvn is installed on build host |
||
mv tests-all/target/$main_name.jar $rc | ||
echo "Manually renaming $rc as $main_file to provide latest-stable-recommended file" | ||
ln -sfv $rc $main_file | ||
mvn clean | ||
|
||
# tip | ||
git checkout master | ||
export JAVA_HOME=$jdk11 | ||
mvn clean install | ||
mv tests-all/target/$main_file $main_name-$tip_shortened.jar | ||
echo "Manually renaming $main_name-$tip_shortened.jar as $main_name-tip.jar to provide latest-unstable-recommended file" | ||
ln -sfv $main_name-$tip_shortened.jar $main_name-tip.jar | ||
mvn clean | ||
|
||
echo "Resetting repo back to master" | ||
git checkout master | ||
hashArtifacts | ||
popd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.