Skip to content

Commit 4f63373

Browse files
committed
chore: drop the old scala2-library-tasty projects
1 parent 712d5bc commit 4f63373

File tree

9 files changed

+23
-433
lines changed

9 files changed

+23
-433
lines changed

.github/workflows/ci.yaml

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -157,59 +157,6 @@ jobs:
157157
run: |
158158
./project/scripts/sbt ";sjsSandbox/run ;sjsSandbox/test ;sjsJUnitTests/test ;set sjsJUnitTests/scalaJSLinkerConfig ~= switchToESModules ;sjsJUnitTests/test ;sjsCompilerTests/test"
159159
160-
- name: Test with Scala 2 library TASTy (fast)
161-
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
162-
163-
- name: Test with Scala 2 library with CC TASTy (fast)
164-
run: ./project/scripts/sbt ";set ThisBuild/Build.scala2Library := Build.Scala2LibraryCCTasty; scala2-library-cc/compile; scala2-library-cc-tasty/compile; scala3-bootstrapped/testCompilation i3"
165-
166-
test_scala2_library_tasty:
167-
runs-on: [self-hosted, Linux]
168-
container:
169-
image: lampepfl/dotty:2024-10-18
170-
options: --cpu-shares 4096
171-
volumes:
172-
- ${{ github.workspace }}/../../cache/sbt:/root/.sbt
173-
- ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
174-
- ${{ github.workspace }}/../../cache/general:/root/.cache
175-
if: "github.event_name == 'schedule' && github.repository == 'scala/scala3'
176-
|| (
177-
github.event_name == 'pull_request'
178-
&& contains(github.event.pull_request.body, '[test_scala2_library_tasty]')
179-
)
180-
|| (
181-
github.event_name == 'workflow_dispatch'
182-
&& github.repository == 'scala/scala3'
183-
)"
184-
185-
steps:
186-
- name: Set JDK 17 as default
187-
run: echo "/usr/lib/jvm/java-17-openjdk-amd64/bin" >> $GITHUB_PATH
188-
189-
- name: Reset existing repo
190-
run: |
191-
git config --global --add safe.directory $GITHUB_WORKSPACE
192-
git -c "http.https://github.com/.extraheader=" fetch --recurse-submodules=no "https://github.com/scala/scala3" && git reset --hard FETCH_HEAD || true
193-
194-
- name: Checkout cleanup script
195-
uses: actions/checkout@v5
196-
197-
- name: Cleanup
198-
run: .github/workflows/cleanup.sh
199-
200-
- name: Git Checkout
201-
uses: actions/checkout@v5
202-
203-
- name: Add SBT proxy repositories
204-
run: cp -vf .github/workflows/repositories /root/.sbt/ ; true
205-
206-
- name: Test with Scala 2 library TASTy
207-
run: ./project/scripts/sbt ";set ThisBuild/Build.scala2Library := Build.Scala2LibraryTasty ;scala3-bootstrapped/test"
208-
209-
- name: Test with Scala 2 library with CC TASTy
210-
run: ./project/scripts/sbt ";set ThisBuild/Build.scala2Library := Build.Scala2LibraryCCTasty ;scala3-bootstrapped/test"
211-
212-
213160
test_windows_fast:
214161
runs-on: [self-hosted, Windows]
215162
if: "(

.github/workflows/test-cc.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

build.sbt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@ val `scala3-language-server` = Build.`scala3-language-server`
2828
val `scala3-bench` = Build.`scala3-bench`
2929
val `scala3-bench-bootstrapped` = Build.`scala3-bench-bootstrapped`
3030
val `scala3-bench-micro` = Build.`scala3-bench-micro`
31-
val `scala2-library-bootstrapped` = Build.`scala2-library-bootstrapped`
32-
val `scala2-library-tasty` = Build.`scala2-library-tasty`
33-
val `scala2-library-cc` = Build.`scala2-library-cc`
34-
val `scala2-library-cc-tasty` = Build.`scala2-library-cc-tasty`
3531
val `tasty-core` = Build.`tasty-core`
3632
val `tasty-core-nonbootstrapped` = Build.`tasty-core-nonbootstrapped`
3733
val `tasty-core-bootstrapped-new` = Build.`tasty-core-bootstrapped-new`

compiler/test/dotty/Properties.scala

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,8 @@ object Properties {
8181
/** scala-library jar */
8282
def scalaLibrary: String = sys.props("dotty.tests.classes.scalaLibrary")
8383

84-
/** scala-library TASTy jar */
85-
def scalaLibraryTasty: Option[String] = sys.props.get("dotty.tests.tasties.scalaLibrary")
86-
87-
/** If we are using the scala-library TASTy jar */
88-
def usingScalaLibraryTasty: Boolean = scalaLibraryTasty.isDefined
89-
/** If we are using the scala-library TASTy jar */
90-
91-
def usingScalaLibraryCCTasty: Boolean = scalaLibraryTasty.exists(_.contains("scala2-library-cc-tasty"))
84+
/** If we are using the scala-library TASTy jar */ // TODO: Remove this
85+
def usingScalaLibraryTasty: Boolean = true
9286

9387
/** scala-asm jar */
9488
def scalaAsm: String = sys.props("dotty.tests.classes.scalaAsm")

compiler/test/dotty/tools/dotc/CompilationTests.scala

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,7 @@ class CompilationTests {
4444
// Run tests for legacy lazy vals
4545
compileFilesInDir("tests/pos", defaultOptions.and("-Wsafe-init", "-Ylegacy-lazy-vals", "-Ycheck-constraint-deps"), FileFilter.include(TestSources.posLazyValsAllowlist)),
4646
compileDir("tests/pos-special/java-param-names", defaultOptions.withJavacOnlyOptions("-parameters")),
47-
) ::: (
48-
// TODO create a folder for capture checking tests with the stdlib, or use tests/pos-custom-args/captures under this mode?
49-
if Properties.usingScalaLibraryCCTasty then List(compileDir("tests/pos-special/stdlib", allowDeepSubtypes))
50-
else Nil
47+
compileDir("tests/pos-special/stdlib", allowDeepSubtypes),
5148
)
5249

5350
if scala.util.Properties.isJavaAtLeast("16") then
@@ -248,9 +245,8 @@ class CompilationTests {
248245
implicit val testGroup: TestGroup = TestGroup("checkInitGlobal")
249246
compileFilesInDir("tests/init-global/warn", defaultOptions.and("-Ysafe-init-global"), FileFilter.exclude(TestSources.negInitGlobalScala2LibraryTastyExcludelisted)).checkWarnings()
250247
compileFilesInDir("tests/init-global/pos", defaultOptions.and("-Ysafe-init-global", "-Xfatal-warnings"), FileFilter.exclude(TestSources.posInitGlobalScala2LibraryTastyExcludelisted)).checkCompile()
251-
if Properties.usingScalaLibraryTasty && !Properties.usingScalaLibraryCCTasty then
252-
compileFilesInDir("tests/init-global/warn-tasty", defaultOptions.and("-Ysafe-init-global"), FileFilter.exclude(TestSources.negInitGlobalScala2LibraryTastyExcludelisted)).checkWarnings()
253-
compileFilesInDir("tests/init-global/pos-tasty", defaultOptions.and("-Ysafe-init-global", "-Xfatal-warnings"), FileFilter.exclude(TestSources.posInitGlobalScala2LibraryTastyExcludelisted)).checkCompile()
248+
compileFilesInDir("tests/init-global/warn-tasty", defaultOptions.and("-Ysafe-init-global"), FileFilter.exclude(TestSources.negInitGlobalScala2LibraryTastyExcludelisted)).checkWarnings()
249+
compileFilesInDir("tests/init-global/pos-tasty", defaultOptions.and("-Ysafe-init-global", "-Xfatal-warnings"), FileFilter.exclude(TestSources.posInitGlobalScala2LibraryTastyExcludelisted)).checkCompile()
254250
end if
255251
}
256252

compiler/test/dotty/tools/vulpix/TestConfiguration.scala

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,12 @@ object TestConfiguration {
2525
"-Xverify-signatures"
2626
)
2727

28-
val basicClasspath = mkClasspath(
29-
Properties.scalaLibraryTasty.toList ::: List(
28+
val basicClasspath = mkClasspath(List(
3029
Properties.scalaLibrary,
3130
Properties.dottyLibrary
3231
))
3332

34-
val withCompilerClasspath = mkClasspath(
35-
Properties.scalaLibraryTasty.toList ::: List(
33+
val withCompilerClasspath = mkClasspath(List(
3634
Properties.scalaLibrary,
3735
Properties.scalaAsm,
3836
Properties.jlineTerminal,

docs/_docs/contributing/testing.md

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -162,41 +162,6 @@ To run `testCompilation` on a bootstrapped Dotty compiler, use
162162
Some tests can only be run in bootstrapped compilers; that includes all tests
163163
with `with-compiler` in their name.
164164

165-
### Scala 2 library TASTy tests
166-
167-
Usually we use the Scala 2 library JAR (with classfiles) generated by Scala 2. We can
168-
also use a special version of the library that we generate with only TASTy files. This
169-
JAR is added to the classpath before the Scala 2 library JAR. This allows the compiler
170-
to load the TASTy and the runtime to load the original classfiles.
171-
172-
The library is compiled in `scala2-library-bootstrapped` with TASTy and classfiles.
173-
These classfiles should not be used. The `scala2-library-tasty` project repackages the
174-
JAR `scala2-library-bootstrapped` to only keep TASTy files.
175-
176-
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`).
177-
178-
```
179-
$ sbt
180-
> set ThisBuild/Build.scala2Library := Build.Scala2LibraryTasty
181-
> scala3-compiler-bootstrapped/scalac MyFile.scala
182-
> scala3-compiler-bootstrapped/test
183-
> scala3-compiler-bootstrapped/testCompilation
184-
```
185-
186-
By default `scala2Library` is set to `Scala2LibraryJar`. This setting can be set to stop using the Scala 2 library TASTy.
187-
```
188-
> set ThisBuild/Build.scala2Library := Build.Scala2LibraryJar
189-
```
190-
191-
#### Scala 2 library with CC TASTy tests
192-
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`).
193-
194-
We can also enable this library in the build using the SBT setting `useScala2LibraryTasty`.
195-
```
196-
> set ThisBuild/Build.scala2Library := Build.Scala2LibraryCCTasty
197-
```
198-
199-
200165
### From TASTy tests
201166

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

0 commit comments

Comments
 (0)