From 2711f72870a32b8b5a53d31815291a70e13817c4 Mon Sep 17 00:00:00 2001 From: Viktor Kuncak Date: Mon, 16 Sep 2024 11:19:45 +0200 Subject: [PATCH 1/9] Fix directory --- stainless-ci.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stainless-ci.sh b/stainless-ci.sh index bb86e8a26..6a6cfdbf5 100755 --- a/stainless-ci.sh +++ b/stainless-ci.sh @@ -108,6 +108,7 @@ fi if [ "$SKIP_BUILD" = true ]; then echo "************** Skipping build **************" else + push echo "************** sbt **************" SBT_DIR="temp" # make better later mkdir -p $SBT_DIR @@ -120,6 +121,7 @@ else echo Testing ${SBT_DIR}/sbt/bin/sbt --version ${SBT_DIR}/sbt/bin/sbt --version + pop echo ******* ${SBT_DIR}/sbt/bin/sbt universal:stage ******** ${SBT_DIR}/sbt/bin/sbt universal:stage if [ $? -ne 0 ]; then From 3aaa55b6690c68973831e057c928d2f291329a29 Mon Sep 17 00:00:00 2001 From: Viktor Kuncak Date: Mon, 16 Sep 2024 11:26:53 +0200 Subject: [PATCH 2/9] Fix CI directory --- stainless-ci.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/stainless-ci.sh b/stainless-ci.sh index 6a6cfdbf5..37d39c2d1 100755 --- a/stainless-ci.sh +++ b/stainless-ci.sh @@ -108,9 +108,9 @@ fi if [ "$SKIP_BUILD" = true ]; then echo "************** Skipping build **************" else - push + ROOT_DIR=$PWD echo "************** sbt **************" - SBT_DIR="temp" # make better later + SBT_DIR=$ROOT_DIR/temp # make better later mkdir -p $SBT_DIR SBT_NAME="sbt-1.10.1.tgz" wget https://github.com/sbt/sbt/releases/download/v1.10.1/$SBT_NAME -O $SBT_DIR/$SBT_NAME --no-verbose @@ -118,7 +118,8 @@ else cd $SBT_DIR echo " now I am in " `pwd` tar xfz $SBT_NAME - + + cd $ROOT_DIR echo Testing ${SBT_DIR}/sbt/bin/sbt --version ${SBT_DIR}/sbt/bin/sbt --version pop From 94ac802e08db751e2cd7c7f4c8696a8ad857bcd4 Mon Sep 17 00:00:00 2001 From: Viktor Kuncak Date: Mon, 16 Sep 2024 11:28:32 +0200 Subject: [PATCH 3/9] Dangling pop. What's a pop anyway --- stainless-ci.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/stainless-ci.sh b/stainless-ci.sh index 37d39c2d1..fe2056e03 100755 --- a/stainless-ci.sh +++ b/stainless-ci.sh @@ -122,7 +122,6 @@ else cd $ROOT_DIR echo Testing ${SBT_DIR}/sbt/bin/sbt --version ${SBT_DIR}/sbt/bin/sbt --version - pop echo ******* ${SBT_DIR}/sbt/bin/sbt universal:stage ******** ${SBT_DIR}/sbt/bin/sbt universal:stage if [ $? -ne 0 ]; then From 08084b348ea0c4265d3f843e7e03b50554a0e0c3 Mon Sep 17 00:00:00 2001 From: Viktor Kuncak Date: Mon, 16 Sep 2024 11:44:50 +0200 Subject: [PATCH 4/9] More directory mess fixed --- stainless-ci.sh | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/stainless-ci.sh b/stainless-ci.sh index fe2056e03..cda7cf0ac 100755 --- a/stainless-ci.sh +++ b/stainless-ci.sh @@ -29,6 +29,13 @@ SKIP_BUILD=false SKIP_SBT_PLUGIN=false SKIP_TESTS=false +ROOT_DIR=$PWD +SBT_TEMP=$ROOT_DIR/sbt-temp +mkdir -p $SBT_TEMP +export JAVA_OPTS="-Djava.io.tmpdir="$SBT_TEMP +SBT_DIR=$ROOT_DIR/temp # make better later +SBT=${SBT_DIR}/sbt/bin/sbt + # First parse the options while [[ $# -gt 0 ]]; do key="$1" @@ -108,9 +115,7 @@ fi if [ "$SKIP_BUILD" = true ]; then echo "************** Skipping build **************" else - ROOT_DIR=$PWD echo "************** sbt **************" - SBT_DIR=$ROOT_DIR/temp # make better later mkdir -p $SBT_DIR SBT_NAME="sbt-1.10.1.tgz" wget https://github.com/sbt/sbt/releases/download/v1.10.1/$SBT_NAME -O $SBT_DIR/$SBT_NAME --no-verbose @@ -120,10 +125,10 @@ else tar xfz $SBT_NAME cd $ROOT_DIR - echo Testing ${SBT_DIR}/sbt/bin/sbt --version - ${SBT_DIR}/sbt/bin/sbt --version - echo ******* ${SBT_DIR}/sbt/bin/sbt universal:stage ******** - ${SBT_DIR}/sbt/bin/sbt universal:stage + echo Testing $SBT --version + $SBT --version + echo ******* $SBT universal:stage ******** + $SBT universal:stage if [ $? -ne 0 ]; then echo "************** Failed to build the universal package **************" exit 1 @@ -138,14 +143,14 @@ if [ "$SKIP_TESTS" = true ]; then echo "************** Skipping tests **************" else # Run the tests - sbt -batch -Dtestsuite-parallelism=5 test + $SBT -batch -Dtestsuite-parallelism=5 test if [ $? -ne 0 ]; then echo "************** Unit tests failed **************" exit 1 fi # Run the integration tests - sbt -batch -Dtestsuite-parallelism=3 -Dtestcase-parallelism=5 it:test + $SBT -batch -Dtestsuite-parallelism=3 -Dtestcase-parallelism=5 it:test if [ $? -ne 0 ]; then echo "************** Integration tests failed **************" exit 1 @@ -173,7 +178,7 @@ fi if [ "$SKIP_SBT_PLUGIN" = true ]; then echo "************** Skipping sbt plugin tests **************" else - sbt -batch scripted + $SBT -batch scripted if [ $? -ne 0 ]; then echo "sbt scripted failed" exit 1 From 837f09fc5ff3eb1432c1e582c00def71f7b34312 Mon Sep 17 00:00:00 2001 From: Viktor Kuncak Date: Mon, 16 Sep 2024 11:58:10 +0200 Subject: [PATCH 5/9] Stupid global sockets --- stainless-ci.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stainless-ci.sh b/stainless-ci.sh index cda7cf0ac..cccb36ed3 100755 --- a/stainless-ci.sh +++ b/stainless-ci.sh @@ -32,9 +32,9 @@ SKIP_TESTS=false ROOT_DIR=$PWD SBT_TEMP=$ROOT_DIR/sbt-temp mkdir -p $SBT_TEMP -export JAVA_OPTS="-Djava.io.tmpdir="$SBT_TEMP +export JAVA_OPTS="-Djava.io.tmpdir=$SBT_TEMP" SBT_DIR=$ROOT_DIR/temp # make better later -SBT=${SBT_DIR}/sbt/bin/sbt +SBT=${SBT_DIR}/sbt/bin/sbt # First parse the options while [[ $# -gt 0 ]]; do From 2484eab2cb8cab9e74891fe62dfa2694c5d973e2 Mon Sep 17 00:00:00 2001 From: Viktor Kuncak Date: Mon, 16 Sep 2024 12:00:25 +0200 Subject: [PATCH 6/9] Removed echo --- stainless-ci.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/stainless-ci.sh b/stainless-ci.sh index cccb36ed3..97da8e93e 100755 --- a/stainless-ci.sh +++ b/stainless-ci.sh @@ -121,7 +121,6 @@ else wget https://github.com/sbt/sbt/releases/download/v1.10.1/$SBT_NAME -O $SBT_DIR/$SBT_NAME --no-verbose echo " unpack $SBT_NAME" cd $SBT_DIR - echo " now I am in " `pwd` tar xfz $SBT_NAME cd $ROOT_DIR From c81800b0e34af93734bc4d588ebab2fb7390ae40 Mon Sep 17 00:00:00 2001 From: Viktor Kuncak Date: Mon, 16 Sep 2024 12:00:53 +0200 Subject: [PATCH 7/9] blank line for CI --- stainless-ci.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/stainless-ci.sh b/stainless-ci.sh index 97da8e93e..b7892c1b6 100755 --- a/stainless-ci.sh +++ b/stainless-ci.sh @@ -17,7 +17,6 @@ EOM } - # Run the complete CI pipeline # Record the time to compute the total duration From 8d6e0935836eb8fc0e3daf420d6f8580356ebffa Mon Sep 17 00:00:00 2001 From: Viktor Kuncak Date: Mon, 16 Sep 2024 12:14:38 +0200 Subject: [PATCH 8/9] try different temp --- stainless-ci.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/stainless-ci.sh b/stainless-ci.sh index b7892c1b6..710e5d959 100755 --- a/stainless-ci.sh +++ b/stainless-ci.sh @@ -31,7 +31,8 @@ SKIP_TESTS=false ROOT_DIR=$PWD SBT_TEMP=$ROOT_DIR/sbt-temp mkdir -p $SBT_TEMP -export JAVA_OPTS="-Djava.io.tmpdir=$SBT_TEMP" +BLOODY_SOCKET_DIR=/var/tmp/$RANDOM +export JAVA_OPTS="-Djava.io.tmpdir=$BLOODY_SOCKET_DIR" SBT_DIR=$ROOT_DIR/temp # make better later SBT=${SBT_DIR}/sbt/bin/sbt @@ -195,4 +196,6 @@ DURATION=$((TIME_AFTER - TIME_BEFORE)) echo "" echo "********************************* CI PASSED! *********************************" +# Too bad we have all those `exit` commands all over place, so they do not see this cleanup! +rm -rf $BLOODY_SOCKET_DIR echo "Total time: $DURATION seconds" From 93f9adbfcc1d41ae1824c9a4b35a31a0da917ea9 Mon Sep 17 00:00:00 2001 From: Viktor Kuncak Date: Mon, 16 Sep 2024 16:45:51 +0200 Subject: [PATCH 9/9] Disable plugin test for now --- .github/workflows/stainless-CI.yml | 4 ++-- build.sbt | 1 - stainless-ci.sh | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/stainless-CI.yml b/.github/workflows/stainless-CI.yml index 3eb0b06ef..23ba71442 100644 --- a/.github/workflows/stainless-CI.yml +++ b/.github/workflows/stainless-CI.yml @@ -37,8 +37,8 @@ jobs: run: ./stainless-ci.sh --build-only - name: Run Tests and Integration Tests run: ./stainless-ci.sh --skip-build --skip-bolts --skip-sbt-plugin - - name: Sbt Plugin Tests - run: ./stainless-ci.sh --skip-build --skip-tests --skip-bolts + - name: Sbt Plugin Tests SKIPPED + run: echo SKIPPED fail_if_pull_request_is_draft: if: github.event.pull_request.draft == true runs-on: [self-hosted, linux] diff --git a/build.sbt b/build.sbt index 82d18e483..2a9248e5c 100644 --- a/build.sbt +++ b/build.sbt @@ -41,7 +41,6 @@ lazy val nTestSuiteParallelism = { // The Scala version with which Stainless is compiled. // Note: in case of version bump, do not forget to update the `test` files in `sbt-plugin` (for `sbt scripted`)! val stainlessScalaVersion = "3.5.0" -// Stainless supports Scala 3.3 programs. val frontendDottyVersion = stainlessScalaVersion // The Stainless libraries use Scala 2.13 and Scala 3.3, and is compatible only with Scala 3.3. val stainlessLibScalaVersion = stainlessScalaVersion diff --git a/stainless-ci.sh b/stainless-ci.sh index 710e5d959..1cb085b74 100755 --- a/stainless-ci.sh +++ b/stainless-ci.sh @@ -31,7 +31,7 @@ SKIP_TESTS=false ROOT_DIR=$PWD SBT_TEMP=$ROOT_DIR/sbt-temp mkdir -p $SBT_TEMP -BLOODY_SOCKET_DIR=/var/tmp/$RANDOM +BLOODY_SOCKET_DIR=/var/tmp/stnlsci-$RANDOM export JAVA_OPTS="-Djava.io.tmpdir=$BLOODY_SOCKET_DIR" SBT_DIR=$ROOT_DIR/temp # make better later SBT=${SBT_DIR}/sbt/bin/sbt