Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 1 addition & 59 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -157,59 +157,6 @@ jobs:
run: |
./project/scripts/sbt ";sjsSandbox/run ;sjsSandbox/test ;sjsJUnitTests/test ;set sjsJUnitTests/scalaJSLinkerConfig ~= switchToESModules ;sjsJUnitTests/test ;sjsCompilerTests/test"

- name: Test with Scala 2 library TASTy (fast)
run: ./project/scripts/sbt ";set ThisBuild/Build.scala2Library := Build.Scala2LibraryTasty ;scala3-bootstrapped/testCompilation i5; scala3-bootstrapped/testCompilation tests/run/typelevel-peano.scala; scala3-bootstrapped/testOnly dotty.tools.backend.jvm.DottyBytecodeTests" # only test a subset of test to avoid doubling the CI execution time

- name: Test with Scala 2 library with CC TASTy (fast)
run: ./project/scripts/sbt ";set ThisBuild/Build.scala2Library := Build.Scala2LibraryCCTasty; scala2-library-cc/compile; scala2-library-cc-tasty/compile; scala3-bootstrapped/testCompilation i3"

test_scala2_library_tasty:
runs-on: [self-hosted, Linux]
container:
image: lampepfl/dotty:2024-10-18
options: --cpu-shares 4096
volumes:
- ${{ github.workspace }}/../../cache/sbt:/root/.sbt
- ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
- ${{ github.workspace }}/../../cache/general:/root/.cache
if: "github.event_name == 'schedule' && github.repository == 'scala/scala3'
|| (
github.event_name == 'pull_request'
&& contains(github.event.pull_request.body, '[test_scala2_library_tasty]')
)
|| (
github.event_name == 'workflow_dispatch'
&& github.repository == 'scala/scala3'
)"

steps:
- name: Set JDK 17 as default
run: echo "/usr/lib/jvm/java-17-openjdk-amd64/bin" >> $GITHUB_PATH

- name: Reset existing repo
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
git -c "http.https://github.com/.extraheader=" fetch --recurse-submodules=no "https://github.com/scala/scala3" && git reset --hard FETCH_HEAD || true

- name: Checkout cleanup script
uses: actions/checkout@v5

- name: Cleanup
run: .github/workflows/cleanup.sh

- name: Git Checkout
uses: actions/checkout@v5

- name: Add SBT proxy repositories
run: cp -vf .github/workflows/repositories /root/.sbt/ ; true

- name: Test with Scala 2 library TASTy
run: ./project/scripts/sbt ";set ThisBuild/Build.scala2Library := Build.Scala2LibraryTasty ;scala3-bootstrapped/test"

- name: Test with Scala 2 library with CC TASTy
run: ./project/scripts/sbt ";set ThisBuild/Build.scala2Library := Build.Scala2LibraryCCTasty ;scala3-bootstrapped/test"


test_windows_fast:
runs-on: [self-hosted, Windows]
if: "(
Expand Down Expand Up @@ -334,12 +281,7 @@ jobs:

- name: MiMa
run: |
./project/scripts/sbt ";scala3-interfaces/mimaReportBinaryIssues ;scala3-library-bootstrapped/mimaReportBinaryIssues ;scala3-library-bootstrappedJS/mimaReportBinaryIssues; tasty-core-bootstrapped/mimaReportBinaryIssues; scala2-library-bootstrapped/mimaReportBinaryIssues"

- name: TASTy MiMa
run: |
# This script cleans the compiler and recompiles it from scratch (keep as last run)
./project/scripts/scala2-library-tasty-mima.sh
./project/scripts/sbt ";scala3-interfaces/mimaReportBinaryIssues ;scala3-library-bootstrapped/mimaReportBinaryIssues ;scala3-library-bootstrappedJS/mimaReportBinaryIssues; tasty-core-bootstrapped/mimaReportBinaryIssues;"

community_build_a:
runs-on: [self-hosted, Linux]
Expand Down
31 changes: 0 additions & 31 deletions .github/workflows/test-cc.yml

This file was deleted.

4 changes: 0 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ val `scala3-language-server` = Build.`scala3-language-server`
val `scala3-bench` = Build.`scala3-bench`
val `scala3-bench-bootstrapped` = Build.`scala3-bench-bootstrapped`
val `scala3-bench-micro` = Build.`scala3-bench-micro`
val `scala2-library-bootstrapped` = Build.`scala2-library-bootstrapped`
val `scala2-library-tasty` = Build.`scala2-library-tasty`
val `scala2-library-cc` = Build.`scala2-library-cc`
val `scala2-library-cc-tasty` = Build.`scala2-library-cc-tasty`
val `tasty-core` = Build.`tasty-core`
val `tasty-core-nonbootstrapped` = Build.`tasty-core-nonbootstrapped`
val `tasty-core-bootstrapped-new` = Build.`tasty-core-bootstrapped-new`
Expand Down
11 changes: 4 additions & 7 deletions compiler/test/dotty/Properties.scala
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,11 @@ object Properties {
/** scala-library jar */
def scalaLibrary: String = sys.props("dotty.tests.classes.scalaLibrary")

/** scala-library TASTy jar */
def scalaLibraryTasty: Option[String] = sys.props.get("dotty.tests.tasties.scalaLibrary")
// TODO: Remove this once we migrate the test suite
def usingScalaLibraryCCTasty: Boolean = false

/** If we are using the scala-library TASTy jar */
def usingScalaLibraryTasty: Boolean = scalaLibraryTasty.isDefined
/** If we are using the scala-library TASTy jar */

def usingScalaLibraryCCTasty: Boolean = scalaLibraryTasty.exists(_.contains("scala2-library-cc-tasty"))
// TODO: Remove this once we migrate the test suite
def usingScalaLibraryTasty: Boolean = false

/** scala-asm jar */
def scalaAsm: String = sys.props("dotty.tests.classes.scalaAsm")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import scala.language.unsafeNulls
import org.junit.{ Test, BeforeClass, AfterClass }
import org.junit.Assert._
import org.junit.Assume._
import org.junit.Ignore
import org.junit.experimental.categories.Category

import scala.concurrent.duration._
Expand Down Expand Up @@ -131,7 +132,7 @@ class BootstrappedOnlyCompilationTests {
aggregateTests(tests*).checkRuns()
}

@Test def runScala2LibraryFromTasty: Unit = {
@Ignore @Test def runScala2LibraryFromTasty: Unit = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When will we re-enable this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the next PR, when I switch the testing suite to use the new artifacts.

implicit val testGroup: TestGroup = TestGroup("runScala2LibraryFromTasty")
// These tests recompile the entire scala2-library from TASTy,
// they are resource intensive and should not run alongside other tests to avoid timeouts
Expand Down
6 changes: 2 additions & 4 deletions compiler/test/dotty/tools/vulpix/TestConfiguration.scala
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,12 @@ object TestConfiguration {
"-Xverify-signatures"
)

val basicClasspath = mkClasspath(
Properties.scalaLibraryTasty.toList ::: List(
val basicClasspath = mkClasspath(List(
Properties.scalaLibrary,
Properties.dottyLibrary
))

val withCompilerClasspath = mkClasspath(
Properties.scalaLibraryTasty.toList ::: List(
val withCompilerClasspath = mkClasspath(List(
Properties.scalaLibrary,
Properties.scalaAsm,
Properties.jlineTerminal,
Expand Down
35 changes: 0 additions & 35 deletions docs/_docs/contributing/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,41 +162,6 @@ To run `testCompilation` on a bootstrapped Dotty compiler, use
Some tests can only be run in bootstrapped compilers; that includes all tests
with `with-compiler` in their name.

### Scala 2 library TASTy tests

Usually we use the Scala 2 library JAR (with classfiles) generated by Scala 2. We can
also use a special version of the library that we generate with only TASTy files. This
JAR is added to the classpath before the Scala 2 library JAR. This allows the compiler
to load the TASTy and the runtime to load the original classfiles.

The library is compiled in `scala2-library-bootstrapped` with TASTy and classfiles.
These classfiles should not be used. The `scala2-library-tasty` project repackages the
JAR `scala2-library-bootstrapped` to only keep TASTy files.

We can enable this library in the build using the SBT setting `useScala2LibraryTasty`. This setting can only be used by bootstrapped compiler tests and is currently only supported for `test` (or `testCompilation`) and `scalac` (or `run`).

```
$ sbt
> set ThisBuild/Build.scala2Library := Build.Scala2LibraryTasty
> scala3-compiler-bootstrapped/scalac MyFile.scala
> scala3-compiler-bootstrapped/test
> scala3-compiler-bootstrapped/testCompilation
```

By default `scala2Library` is set to `Scala2LibraryJar`. This setting can be set to stop using the Scala 2 library TASTy.
```
> set ThisBuild/Build.scala2Library := Build.Scala2LibraryJar
```

#### Scala 2 library with CC TASTy tests
These follow the same structure as the _Scala 2 library TASTy tests_ but add captured checked signatures to the library. The library is compiled in `scala2-library-cc` (instead of `scala2-library-bootstrapped`) and `scala2-library-cc-tasty` (instead of `scala2-library-cc-tasty`).

We can also enable this library in the build using the SBT setting `useScala2LibraryTasty`.
```
> set ThisBuild/Build.scala2Library := Build.Scala2LibraryCCTasty
```


### From TASTy tests

`testCompilation` has an additional mode to run tests that compile code from a `.tasty` file.
Expand Down
Loading
Loading