Skip to content

Commit

Permalink
Test stdlib-bootstrapped TASTy-MiMa in CI (#18158)
Browse files Browse the repository at this point in the history
This addition does have some fragility with the current TASTy numbering
scheme. The test script will change the TASTy version and recompile the
compiler and library with this version to allow TASTy MiMa to read those
files.

When we change to a new major version, there is the potential for this
TASTy to not be readable from the latest release of TASTy MiMa. In that
scenario, we would disable this test until a new version of TASTy MiMa
is published.
  • Loading branch information
sjrd authored Jul 31, 2023
2 parents a73316a + 776cee8 commit face377
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
22 changes: 22 additions & 0 deletions project/scripts/stdlib-bootstrapped-tasty-mima.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit face377

Please sign in to comment.