From dae4288d849a4a48d56ee12b2e4c0d3ef71913e9 Mon Sep 17 00:00:00 2001 From: Samuel Chassot <14821693+samuelchassot@users.noreply.github.com> Date: Wed, 11 Dec 2024 17:11:40 +0100 Subject: [PATCH] Fix path issues in stainless-CI.yml and stainless-ci.sh (#1622) * try to add stainless to path * new way to add temp folder to options * opne line * line break * print in tests * change permission of temp folder * debug * debug * trying to reduce path * temporary fix , with one temp folder per CI, which is cleaned up anyway * better temp * add rm folder * remove print that was causing errors --- .github/workflows/stainless-CI.yml | 16 +++++++++++----- stainless-ci.sh | 1 + 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/stainless-CI.yml b/.github/workflows/stainless-CI.yml index 6ecf766bb..f7978549c 100644 --- a/.github/workflows/stainless-CI.yml +++ b/.github/workflows/stainless-CI.yml @@ -10,11 +10,10 @@ jobs: runs-on: labels: [self-hosted, linux] env: - JAVA_OPTS_TMP_DIR: ./tmp_java # define Java options for both official sbt and sbt-extras - JAVA_OPTS: -Dsbt.io.implicit.relative.glob.conversion=allow -Xss512M -Xms1024M -Xmx12G -XX:MaxMetaspaceSize=2G -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=768M -Djava.io.tmpdir=./tmp_java - JVM_OPTS: -Dsbt.io.implicit.relative.glob.conversion=allow -Xss512M -Xms1024M -Xmx12G -XX:MaxMetaspaceSize=2G -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=768M -Djava.io.tmpdir=./tmp_java - SBT_OPTS: -Djava.io.tmpdir=./temp_java --sbt-dir ./temp_java/.sbt + JAVA_OPTS: -Dsbt.io.implicit.relative.glob.conversion=allow -Xss512M -Xms1024M -Xmx12G -XX:MaxMetaspaceSize=2G -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=768M + JVM_OPTS: -Dsbt.io.implicit.relative.glob.conversion=allow -Xss512M -Xms1024M -Xmx12G -XX:MaxMetaspaceSize=2G -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=768M + JAVA_OPTS_TMP_DIR: /tmp/tmp_${{ github.run_id }}_${{ github.run_attempt }} steps: - name: Checkout uses: actions/checkout@v4 @@ -25,6 +24,13 @@ jobs: with: distribution: temurin java-version: 17 + - name: Setup java options + run: | + echo "JAVA_OPTS=$JAVA_OPTS -Djava.io.tmpdir=$JAVA_OPTS_TMP_DIR" >> "$GITHUB_ENV" && \ + echo "JVM_OPTS=$JVM_OPTS -Djava.io.tmpdir=$JAVA_OPTS_TMP_DIR" >> "$GITHUB_ENV" && \ + echo "SBT_OPTS=-Djava.io.tmpdir=$JAVA_OPTS_TMP_DIR --sbt-dir $JAVA_OPTS_TMP_DIR" >> "$GITHUB_ENV" + - name: Creating temp folder + run: rm -rf $JAVA_OPTS_TMP_DIR && mkdir -p $JAVA_OPTS_TMP_DIR && chmod 777 $JAVA_OPTS_TMP_DIR - name: Install and unpack sbt run: | wget https://github.com/sbt/sbt/releases/download/v1.10.1/sbt-1.10.1.tgz @@ -37,7 +43,7 @@ jobs: - name: Test solvers availability run: cvc5 --version && z3 --version && cvc4 --version - name: Build and Package - run: ./stainless-ci.sh --build-only + run: ./stainless-ci.sh --build-only && echo "PATH=./frontends/dotty/target/universal/stage/bin:$PATH" >> "$GITHUB_ENV" - name: Run Tests and Integration Tests run: ./stainless-ci.sh --skip-build --skip-bolts --skip-sbt-plugin - name: Sbt Plugin Tests diff --git a/stainless-ci.sh b/stainless-ci.sh index 1a74a70cb..b65566910 100755 --- a/stainless-ci.sh +++ b/stainless-ci.sh @@ -33,6 +33,7 @@ SBT_TEMP=$ROOT_DIR/sbt-temp # if TEMP_DIR is not set, set it to the default JAVA_OPTS_TMP_DIR=${JAVA_OPTS_TMP_DIR:-$ROOT_DIR/temporary} mkdir -p $JAVA_OPTS_TMP_DIR +chmod 777 $JAVA_OPTS_TMP_DIR SBT_DIR=$ROOT_DIR/temp # make better later SBT=${SBT_DIR}/sbt/bin/sbt