Skip to content

Commit face377

Browse files
authored
Test stdlib-bootstrapped TASTy-MiMa in CI (#18158)
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.
2 parents a73316a + 776cee8 commit face377

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

Diff for: .github/workflows/ci.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,11 @@ jobs:
255255
run: |
256256
./project/scripts/sbt ";scala3-interfaces/mimaReportBinaryIssues ;scala3-library-bootstrapped/mimaReportBinaryIssues ;scala3-library-bootstrappedJS/mimaReportBinaryIssues; tasty-core-bootstrapped/mimaReportBinaryIssues; stdlib-bootstrapped/mimaReportBinaryIssues"
257257
258+
- name: TASTy MiMa
259+
run: |
260+
# This script cleans the compiler and recompiles it from scratch (keep as last run)
261+
./project/scripts/stdlib-bootstrapped-tasty-mima.sh
262+
258263
community_build_a:
259264
runs-on: [self-hosted, Linux]
260265
container:

Diff for: project/scripts/stdlib-bootstrapped-tasty-mima.sh

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env bash
2+
set -eux
3+
4+
source $(dirname $0)/cmdTestsCommon.inc.sh
5+
6+
TASTY_FROMAT_FILE="tasty/src/dotty/tools/tasty/TastyFormat.scala"
7+
MINOR_TASTY_VERSION_SUPPORTED_BY_TASTY_MIMA=3
8+
MINOR_TASTY_VERSION=$(grep -oE 'val MinorVersion: Int = ([0-9]+)' $TASTY_FROMAT_FILE | grep -oE '[0-9]+')
9+
EXPERIMENTAL_TASTY_VERSION=$(grep -oE 'val ExperimentalVersion: Int = ([0-9]+)' $TASTY_FROMAT_FILE | grep -oE '[0-9]+')
10+
11+
setTastyVersion() {
12+
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
13+
}
14+
15+
setTastyVersion $MINOR_TASTY_VERSION_SUPPORTED_BY_TASTY_MIMA 0
16+
17+
# Run stdlib-bootstrapped/tastyMiMaReportIssues using a custom TASTy version.
18+
# We clean before to make sure all sources are recompiled using the new TASTY version.
19+
# We clean after to make sure no other test will use the TASTy generated with this version.
20+
"$SBT" "clean; stdlib-bootstrapped/clean; reload; stdlib-bootstrapped/tastyMiMaReportIssues; clean; stdlib-bootstrapped/clean"
21+
22+
setTastyVersion $MINOR_TASTY_VERSION $EXPERIMENTAL_TASTY_VERSION

0 commit comments

Comments
 (0)