From 776cee8705c620adadd7225e0ee0df92139a4e2f Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Thu, 6 Jul 2023 17:10:17 +0200 Subject: [PATCH] Test stdlib-bootstrapped TASTy-MiMa in CI --- .github/workflows/ci.yaml | 5 +++++ .../scripts/stdlib-bootstrapped-tasty-mima.sh | 22 +++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100755 project/scripts/stdlib-bootstrapped-tasty-mima.sh diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 727e62f62afa..3c154b68491d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -255,6 +255,11 @@ jobs: run: | ./project/scripts/sbt ";scala3-interfaces/mimaReportBinaryIssues ;scala3-library-bootstrapped/mimaReportBinaryIssues ;scala3-library-bootstrappedJS/mimaReportBinaryIssues; tasty-core-bootstrapped/mimaReportBinaryIssues; stdlib-bootstrapped/mimaReportBinaryIssues" + - name: TASTy MiMa + run: | + # This script cleans the compiler and recompiles it from scratch (keep as last run) + ./project/scripts/stdlib-bootstrapped-tasty-mima.sh + community_build_a: runs-on: [self-hosted, Linux] container: diff --git a/project/scripts/stdlib-bootstrapped-tasty-mima.sh b/project/scripts/stdlib-bootstrapped-tasty-mima.sh new file mode 100755 index 000000000000..8fcd4723a125 --- /dev/null +++ b/project/scripts/stdlib-bootstrapped-tasty-mima.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +set -eux + +source $(dirname $0)/cmdTestsCommon.inc.sh + +TASTY_FROMAT_FILE="tasty/src/dotty/tools/tasty/TastyFormat.scala" +MINOR_TASTY_VERSION_SUPPORTED_BY_TASTY_MIMA=3 +MINOR_TASTY_VERSION=$(grep -oE 'val MinorVersion: Int = ([0-9]+)' $TASTY_FROMAT_FILE | grep -oE '[0-9]+') +EXPERIMENTAL_TASTY_VERSION=$(grep -oE 'val ExperimentalVersion: Int = ([0-9]+)' $TASTY_FROMAT_FILE | grep -oE '[0-9]+') + +setTastyVersion() { + sed -i -E -e "s/val MinorVersion: Int = [0-9]+/val MinorVersion: Int = $1/" -e "s/val ExperimentalVersion: Int = [0-9]+/val ExperimentalVersion: Int = $2/" $TASTY_FROMAT_FILE +} + +setTastyVersion $MINOR_TASTY_VERSION_SUPPORTED_BY_TASTY_MIMA 0 + +# Run stdlib-bootstrapped/tastyMiMaReportIssues using a custom TASTy version. +# We clean before to make sure all sources are recompiled using the new TASTY version. +# We clean after to make sure no other test will use the TASTy generated with this version. +"$SBT" "clean; stdlib-bootstrapped/clean; reload; stdlib-bootstrapped/tastyMiMaReportIssues; clean; stdlib-bootstrapped/clean" + +setTastyVersion $MINOR_TASTY_VERSION $EXPERIMENTAL_TASTY_VERSION