Skip to content

Commit

Permalink
Simplify the awfy repo, and remove unmaintained bits
Browse files Browse the repository at this point in the history
- move all build instructions to a build.sh in the language-specific folder
- update GitHub Actions to avoid deprecation warnings
- remove implementations folder
  - it contained various unmaintained and untested scripts
- simplify rebench.conf
  - it’s not tested, so, this is more of a template of how a setup may look like

Signed-off-by: Stefan Marr <[email protected]>
  • Loading branch information
smarr committed Feb 3, 2024
1 parent c3aecc5 commit cd02da5
Show file tree
Hide file tree
Showing 59 changed files with 238 additions and 872 deletions.
105 changes: 58 additions & 47 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,49 +9,38 @@ jobs:
fail-fast: false
matrix:
include:
- name: Java
id: java
- { name: Java, id: java, folder: Java }
- { name: SOM, id: som, folder: SOM }
- { name: Crystal, id: crystal, folder: Crystal }
- { name: JavaScript, id: js, folder: JavaScript }
- { name: SOMns, id: somns, folder: SOMns }

- name: SOM
id: som
#- { name: Pharo, id: pharo, folder: Smalltalk }

- name: Crystal
id: crystal

- name: JavaScript
id: js

- name: SOMns
id: somns

# - name: Pharo
# id: pharo

- name: Squeak 64-bit
id: squeak64

- name: Ruby
id: ruby

- name: Lua 5.2
id: lua52

- name: Python
id: python
- { name: Squeak, id: squeak, folder: Smalltalk }
- { name: Ruby, id: ruby, folder: Ruby }
- { name: Lua, id: lua, folder: Lua }
- { name: Python, id: python, folder: Python }

name: ${{ matrix.name }}
steps:
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: "3.11"

- name: Checkout AWFY Repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install ReBench
run: |
python -m pip install ReBench
- name: Install asdf and asdf-awfy
run: |
git clone --depth 1 https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.14.0
~/.asdf/bin/asdf plugin add awfy https://github.com/smarr/asdf-awfy.git
if: matrix.id == 'squeak'

- name: Install Crystal
if: matrix.id == 'crystal'
uses: oprypin/install-crystal@v1
Expand All @@ -67,17 +56,13 @@ jobs:
with:
smalltalk-image: Pharo64-stable

- name: Install Squeak64
if: matrix.id == 'squeak64'
uses: hpi-swa/setup-smalltalkCI@v1
with:
smalltalk-image: Squeak64-5.2

- name: Install Squeak32
if: matrix.id == 'squeak32'
uses: hpi-swa/setup-smalltalkCI@v1
with:
smalltalk-image: Squeak32-5.2
- name: Install Squeak
if: matrix.id == 'squeak'
run: |
~/.asdf/bin/asdf install awfy squeak-6.0-22148
cp ~/.asdf/installs/awfy/squeak-6.0-22148/shared/SqueakV60.sources benchmarks/Smalltalk/
cp ~/.asdf/installs/awfy/squeak-6.0-22148/shared/Squeak*.image benchmarks/Smalltalk/Squeak.image
cp ~/.asdf/installs/awfy/squeak-6.0-22148/shared/Squeak*.changes benchmarks/Smalltalk/Squeak.changes
- name: Install Ruby
if: matrix.id == 'ruby'
Expand All @@ -87,24 +72,50 @@ jobs:
- name: Install Lua
uses: leafo/gh-actions-lua@v10
with:
luaVersion: 5.2
if: matrix.id == 'lua52'
luaVersion: 5.2
if: matrix.id == 'lua'

- name: Install LuaRocks
uses: leafo/gh-actions-luarocks@v4
if: matrix.id == 'lua52'
if: matrix.id == 'lua'

- name: Install LuaCheck and lua5.2 symlink
run: |
luarocks install luacheck
(cd .lua/bin && ln -s lua lua5.2)
if: matrix.id == 'lua52'
if: matrix.id == 'lua'

- name: Install Python
run: |
python -m pip install pylint
if: matrix.id == 'python'

- name: Install SOM
run: |
source benchmarks/script.inc
load_git_repo https://github.com/SOM-st/som-java.git SOM
pushd SOM
git submodule update --recursive --init
ant
popd
load_git_repo https://github.com/SOM-st/TruffleSOM.git TruffleSOM
pushd TruffleSOM
git submodule update --recursive --init
./som --setup mx
./som --setup labsjdk
../mx/mx build
if: matrix.id == 'som'

- name: Install SOMns
run: |
source benchmarks/script.inc
load_git_repo https://github.com/smarr/SOMns.git SOMns
pushd SOMns
git submodule update --recursive --init
ant compile
if: matrix.id == 'somns'

- name: Python Black Style Check
uses: psf/black@stable
with:
Expand All @@ -114,12 +125,12 @@ jobs:

- name: Build
run: |
implementations/build-${{ matrix.id }}.sh
benchmarks/${{ matrix.folder }}/build.sh ${{ matrix.id }}
- name: ReBench Test Run
run: |
rebench test.conf test-${{ matrix.id }}
- name: Style Check
run: |
implementations/build-${{ matrix.id }}.sh style skip-black-for-python
benchmarks/${{ matrix.folder }}/build.sh style skip-black-for-python
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*.html
.Rhistory
.idea
.vscode
.eclipse-ws
benchmarks.jar
benchmark.data
Expand Down
12 changes: 10 additions & 2 deletions benchmarks/Crystal/build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
#!/bin/bash
set -e
SCRIPT_PATH=`dirname $0`
set -e # make script fail on first error
SCRIPT_PATH=$(dirname $0)
source $SCRIPT_PATH/../script.inc

if [[ "$1" = "style" ]]
then
exit 0
fi

INFO Build Crystal Benchmarks
pushd $SCRIPT_PATH
crystal build --release --no-debug harness.cr
13 changes: 13 additions & 0 deletions benchmarks/Java/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
set -e # make script fail on first error
SCRIPT_PATH=$(dirname $0)
source $SCRIPT_PATH/../script.inc
pushd $SCRIPT_PATH

if [[ "$1" = "style" ]]
then
ant checkstyle-jar && ant checkstyle
else
INFO Build Java Benchmarks
ant jar
fi
14 changes: 14 additions & 0 deletions benchmarks/JavaScript/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
set -e # make script fail on first error
SCRIPT_PATH=$(dirname $0)
source $SCRIPT_PATH/../script.inc

INFO Build Node.js Benchmarks
if [[ "$1" = "style" ]]
then
INFO Check style of JavaScript benchmarks
pushd $SCRIPT_PATH
npx eslint .
else
exit 0
fi
13 changes: 13 additions & 0 deletions benchmarks/Lua/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
set -e # make script fail on first error
SCRIPT_PATH=$(dirname $0)
source $SCRIPT_PATH/../script.inc

if [[ "$1" = "style" ]]
then
INFO Check style of Lua benchmarks
pushd $SCRIPT_PATH
luacheck *.lua
else
exit 0
fi
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/bash
set -e # make script fail on first error
SCRIPT_PATH=`dirname $0`
source $SCRIPT_PATH/script.inc
SCRIPT_PATH=$(dirname $0)
source $SCRIPT_PATH/../script.inc

if [ "$1" = "style" ]
if [[ "$1" = "style" ]]
then
INFO Check style of Python benchmarks
pushd $SCRIPT_PATH/../benchmarks/Python
pushd $SCRIPT_PATH
if [[ "$2" != "skip-black-for-python" ]]; then
python -m black --check --diff .
fi
Expand Down
8 changes: 4 additions & 4 deletions implementations/build-ruby.sh → benchmarks/Ruby/build.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/bash
set -e # make script fail on first error
SCRIPT_PATH=`dirname $0`
source $SCRIPT_PATH/script.inc
SCRIPT_PATH=$(dirname $0)
source $SCRIPT_PATH/../script.inc

if [ "$1" = "style" ]
if [[ "$1" = "style" ]]
then
INFO Check style of Ruby benchmarks
pushd $SCRIPT_PATH/../benchmarks/Ruby
pushd $SCRIPT_PATH
rubocop
else
exit 0
Expand Down
11 changes: 11 additions & 0 deletions benchmarks/SOM/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
set -e # make script fail on first error
SCRIPT_PATH=$(dirname $0)
source $SCRIPT_PATH/../script.inc

if [[ "$1" = "style" ]]
then
exit 0
else
exit 0
fi
11 changes: 11 additions & 0 deletions benchmarks/SOMns/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
set -e # make script fail on first error
SCRIPT_PATH=$(dirname $0)
source $SCRIPT_PATH/../script.inc

if [[ "$1" = "style" ]]
then
exit 0
else
exit 0
fi
2 changes: 1 addition & 1 deletion benchmarks/Smalltalk/build-image-squeak.st
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ FileStream stdout nextPutAll: '== Save and Exit'; cr.
PreferenceWizardMorph allInstances do: #delete.
SystemWindow allSubInstances do: #delete.

Smalltalk saveAs: 'AWFY'] on: Error do: [:e |
Smalltalk saveAs: 'AWFY_Squeak'] on: Error do: [:e |
FileStream stdout nextPutAll: e printString.
].

Expand Down
31 changes: 31 additions & 0 deletions benchmarks/Smalltalk/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash
set -e # make script fail on first error
SCRIPT_PATH="$(dirname $0)"
source "$SCRIPT_PATH/../script.inc"

if [[ "$1" = "style" ]]
then
exit 0
elif [[ "$1" == "squeak" ]]
then
pushd "$SCRIPT_PATH"
if [[ ! -f "Squeak.image" ]]
then
ERR "Squeak.image is needed but not found."
ERR "Please copy a Squeak.image, Squeak.changes and the corresponding *.sources file to this directory."
exit 1
fi
~/.asdf/installs/awfy/squeak-6.0-22148/bin/squeak -headless Squeak.image build-image-squeak.st
elif [[ "$1" == "pharo" ]]
then
pushd "$SCRIPT_PATH"
if [[ ! -f "Pharo.image" ]]
then
ERR "Pharo.image is needed but not found."
ERR "Please copy a Pharo.image, Pharo.changes and the corresponding *.sources file to this directory."
exit 1
fi
~/.asdf/installs/awfy/pharo-120/bin/pharo Pharo.image build-image.st
else
exit 0
fi
25 changes: 4 additions & 21 deletions implementations/script.inc → benchmarks/script.inc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# make SCRIPT_PATH absolute
pushd `dirname $0` > /dev/null
pushd $(dirname $0) > /dev/null
SCRIPT_PATH=`pwd`
popd > /dev/null

Expand Down Expand Up @@ -55,7 +55,7 @@ function check_for_tools() {
function get_pypy() {
if [ \! -d pypy ]; then
get_web_getter

INFO Get PyPy Source
PYPY_VERSION="5.8.0"
PYPY_DIR="pypy2-v${PYPY_VERSION}-src"
Expand All @@ -73,7 +73,7 @@ function get_jdk9ea() {
JDK_ARCHIVE=jdk-9-ea+96_linux-x64_bin.tar.gz
JDK_URL=http://www.java.net/download/jdk9/archive/96/binaries/$JDK_ARCHIVE
JDK_DIR=jdk-9

INFO Get JDK9 Early Access from $JDK_URL
if [ \! -d "$JDK_DIR" ]; then
$GET $JDK_URL || $GET $JDK_URL
Expand All @@ -86,7 +86,7 @@ function get_jdk9ea() {

function load_git_repo() {
INFO Cloning "$1" into "$2"
if [ -z "$3" ]
if [[ -z "$3" ]]
then
git clone --depth=1 "$1" "$2"
else
Expand All @@ -109,20 +109,3 @@ function check_for() {
fi
fi
}

function check_for_crystal() {
check_for "crystal" "Please see http://crystal-lang.org/docs/installation/index.html" "$1"
}

function check_for_node() {
check_for "node" "Please see https://nodejs.org/en/download/" "$1"
}

function check_for_graalvm() {
if [ ! -x "$SCRIPT_PATH/graalvm/jre/bin/javao" ]
then
ERR "GraalVM not found."
ERR "To run benchmarks on the GraalVM, please see 'implementations/graalvm/README.md'"
fi
}

6 changes: 0 additions & 6 deletions implementations/SOMns-e.sh

This file was deleted.

Loading

0 comments on commit cd02da5

Please sign in to comment.