Skip to content

Commit be01ed4

Browse files
committed
Remove some duplicated scripts.
1 parent 76d1ff7 commit be01ed4

File tree

12 files changed

+63
-73
lines changed

12 files changed

+63
-73
lines changed

.github/scripts/build-normal.sh

Lines changed: 0 additions & 20 deletions
This file was deleted.

.github/scripts/ci-build.sh

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,23 @@ set -xe
22

33
. $(dirname "$0")/common.sh
44

5-
unset JAVA_TOOL_OPTIONS
6-
unset MMTK_PLAN
5+
ensure_env OPENJDK_PATH
6+
ensure_env OPENJDK_BUILD_TARGET
77

8-
# To OpenJDK folder
9-
cd $OPENJDK_PATH
8+
# Use fastdebug if DEBUG_LEVEL is unset
9+
DEBUG_LEVEL=${DEBUG_LEVEL:="fastdebug"}
10+
11+
# Build target. Could be empty, or product-bundles.
12+
build_target=$1
1013

11-
# Build
14+
# Build product bundle
15+
cd $OPENJDK_PATH
1216
sh configure --disable-warnings-as-errors --with-debug-level=$DEBUG_LEVEL
13-
make CONF=linux-x86_64-normal-server-$DEBUG_LEVEL THIRD_PARTY_HEAP=$BINDING_PATH/openjdk
17+
make CONF=linux-x86_64-normal-server-$DEBUG_LEVEL THIRD_PARTY_HEAP=$BINDING_PATH/openjdk $OPENJDK_BUILD_TARGET
18+
19+
if [[ $DEBUG_LEVEL == "fastdebug" && $OPENJDK_BUILD_TARGET == "product-bundles" ]]; then
20+
pushd build/linux-x86_64-normal-server-fastdebug/bundles
21+
F=`ls *_bin-debug.tar.gz`
22+
mv $F ${F/_bin-debug/_bin}
23+
popd
24+
fi

.github/scripts/ci-setup.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ rustup component add clippy --toolchain $RUSTUP_TOOLCHAIN
99
rustup component add rustfmt --toolchain $RUSTUP_TOOLCHAIN
1010
rustup override set $RUSTUP_TOOLCHAIN
1111

12-
# Download dacapo
13-
mkdir -p $DACAPO_PATH
14-
wget https://downloads.sourceforge.net/project/dacapobench/archive/2006-10-MR2/dacapo-2006-10-MR2.jar -O $DACAPO_PATH/dacapo-2006-10-MR2.jar
12+
# Install running
13+
pip3 install running-ng
1514

1615
# Install dependencies
1716
sudo apt-get update -y
17+
sudo apt-get install dos2unix
1818
sudo apt-get install build-essential libx11-dev libxext-dev libxrender-dev libxtst-dev libxt-dev libcups2-dev libasound2-dev libxrandr-dev

.github/scripts/ci-test-assertions.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ unset JAVA_TOOL_OPTIONS
66

77
export MMTK_EXTREME_ASSERTIONS=1
88
. $(dirname "$0")/ci-build.sh
9-
export JAVA_BIN=$OPENJDK_PATH/build/linux-x86_64-normal-server-$DEBUG_LEVEL/jdk/bin/java
9+
export TEST_JAVA_BIN=$OPENJDK_PATH/build/linux-x86_64-normal-server-$DEBUG_LEVEL/jdk/bin/java
1010

1111
cd $OPENJDK_PATH
1212

.github/scripts/ci-test-malloc-mark-sweep.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ run_test() {
2222
unset JAVA_TOOL_OPTIONS
2323
unset MMTK_PLAN
2424

25-
export JAVA_BIN=$OPENJDK_PATH/build/linux-x86_64-normal-server-$DEBUG_LEVEL/jdk/bin/java
25+
export TEST_JAVA_BIN=$OPENJDK_PATH/build/linux-x86_64-normal-server-$DEBUG_LEVEL/jdk/bin/java
2626

2727
# --- Normal test ---
2828
build

.github/scripts/ci-test-vo-bit.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export MMTK_EXTREME_ASSERTIONS=0
88
export VO_BIT=1
99
. $(dirname "$0")/ci-build.sh
1010

11-
export JAVA_BIN=$OPENJDK_PATH/build/linux-x86_64-normal-server-$DEBUG_LEVEL/jdk/bin/java
11+
export TEST_JAVA_BIN=$OPENJDK_PATH/build/linux-x86_64-normal-server-$DEBUG_LEVEL/jdk/bin/java
1212

1313
run_subset() {
1414
heap_multiplier=$1

.github/scripts/common.sh

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
BINDING_PATH=$(realpath $(dirname "$0"))/../..
2-
OPENJDK_PATH=$BINDING_PATH/repos/openjdk
3-
DACAPO_PATH=$OPENJDK_PATH/dacapo
4-
52
RUSTUP_TOOLCHAIN=`cat $BINDING_PATH/mmtk/rust-toolchain`
63

7-
DEBUG_LEVEL=fastdebug
8-
94
# dacapo2006 min heap for mark compact
105
MINHEAP_ANTLR=5
116
MINHEAP_FOP=13
@@ -16,6 +11,16 @@ MINHEAP_HSQLDB=117
1611
MINHEAP_ECLIPSE=23
1712
MINHEAP_XALAN=21
1813

14+
# ensure_env 'var_name'
15+
ensure_env() {
16+
env_var=$1
17+
18+
if ! [[ -v $env_var ]]; then
19+
echo "Environment Variable "$env_var" is required. "
20+
exit 1
21+
fi
22+
}
23+
1924
runbms_dacapo2006_with_heap_multiplier()
2025
{
2126
benchmark=$1
@@ -41,5 +46,8 @@ runbms_dacapo2006_with_heap_size()
4146

4247
shift 3
4348

44-
$JAVA_BIN -XX:+UseThirdPartyHeap -server -XX:MetaspaceSize=100M -Xms$min_heap_str -Xmx$max_heap_str $@ -jar $DACAPO_PATH/dacapo-2006-10-MR2.jar $benchmark
49+
ensure_env TEST_JAVA_BIN
50+
ensure_env DACAPO_PATH
51+
52+
$TEST_JAVA_BIN -XX:+UseThirdPartyHeap -server -XX:MetaspaceSize=100M -Xms$min_heap_str -Xmx$max_heap_str $@ -jar $DACAPO_PATH/dacapo-2006-10-MR2.jar $benchmark
4553
}

.github/scripts/new-common.sh

Lines changed: 0 additions & 4 deletions
This file was deleted.

.github/scripts/setup.sh

Lines changed: 0 additions & 20 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,11 @@ jobs:
2828
path: ./git/openjdk
2929
ref: ${{ steps.extract-openjdk-revision.outputs.openjdk-revision }}
3030
- name: Setup environment
31-
run: ./.github/scripts/setup.sh
32-
working-directory: ./git/mmtk-openjdk
33-
- name: Style checks
34-
run: ./.github/scripts/style-check.sh
31+
run: ./.github/scripts/ci-setup.sh
3532
working-directory: ./git/mmtk-openjdk
3633
- name: Build MMTk OpenJDK ${{ matrix.debug-level }}
37-
run: DEBUG_LEVEL=${{ matrix.debug-level }} ./.github/scripts/build-normal.sh
34+
run: |
35+
OPENJDK_PATH=$GITHUB_WORKSPACE/git/openjdk DEBUG_LEVEL=${{ matrix.debug-level }} OPENJDK_BUILD_TARGET=product-bundles ./.github/scripts/ci-build.sh
3836
working-directory: ./git/mmtk-openjdk
3937
- name: Upload bundles
4038
uses: actions/upload-artifact@v3

0 commit comments

Comments
 (0)