Skip to content

Commit 048ce6b

Browse files
authored
chore: add the testing suite for scala3-sbt-bridge and tasty-core (#23617)
Add and enable the tests for `scala3-sbt-bridge-nonbootstrapped` and `scala3-sbt-bridge-bootstrapped`. Add and enable the tests for `scala3-tasty-core-nonbootstrapped` and `scala3-tasty-core-bootstrapped`.
2 parents 74f78a1 + 287f746 commit 048ce6b

File tree

3 files changed

+127
-6
lines changed

3 files changed

+127
-6
lines changed

.github/workflows/stdlib.yaml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,3 +182,75 @@ jobs:
182182
- uses: sbt/setup-sbt@v1
183183
- name: Compile `scala3-sbt-bridge-bootstrapped`
184184
run: ./project/scripts/sbt scala3-sbt-bridge-bootstrapped/compile
185+
186+
#################################################################################################
187+
########################################### TEST JOBS ###########################################
188+
#################################################################################################
189+
190+
test-scala3-sbt-bridge-nonbootstrapped:
191+
runs-on: ubuntu-latest
192+
##needs: [scala3-sbt-bridge-nonbootstrapped] Add when we add support for caching here
193+
steps:
194+
- name: Git Checkout
195+
uses: actions/checkout@v4
196+
197+
- name: Set up JDK 17
198+
uses: actions/setup-java@v4
199+
with:
200+
distribution: 'temurin'
201+
java-version: 17
202+
cache: 'sbt'
203+
- uses: sbt/setup-sbt@v1
204+
- name: Test `scala3-sbt-bridge-nonbootstrapped`
205+
run: ./project/scripts/sbt scala3-sbt-bridge-nonbootstrapped/test
206+
207+
test-scala3-sbt-bridge-bootstrapped:
208+
runs-on: ubuntu-latest
209+
##needs: [scala3-sbt-bridge-bootstrapped] Add when we add support for caching here
210+
steps:
211+
- name: Git Checkout
212+
uses: actions/checkout@v4
213+
214+
- name: Set up JDK 17
215+
uses: actions/setup-java@v4
216+
with:
217+
distribution: 'temurin'
218+
java-version: 17
219+
cache: 'sbt'
220+
- uses: sbt/setup-sbt@v1
221+
- name: Test `scala3-sbt-bridge-bootstrapped`
222+
run: ./project/scripts/sbt scala3-sbt-bridge-bootstrapped/test
223+
224+
test-tasty-core-nonbootstrapped:
225+
runs-on: ubuntu-latest
226+
##needs: [tasty-core-nonbootstrapped] Add when we add support for caching here
227+
steps:
228+
- name: Git Checkout
229+
uses: actions/checkout@v4
230+
231+
- name: Set up JDK 17
232+
uses: actions/setup-java@v4
233+
with:
234+
distribution: 'temurin'
235+
java-version: 17
236+
cache: 'sbt'
237+
- uses: sbt/setup-sbt@v1
238+
- name: Test `tasty-core-nonbootstrapped`
239+
run: ./project/scripts/sbt tasty-core-nonbootstrapped/test
240+
241+
test-tasty-core-bootstrapped:
242+
runs-on: ubuntu-latest
243+
##needs: [tasty-core-bootstrapped] Add when we add support for caching here
244+
steps:
245+
- name: Git Checkout
246+
uses: actions/checkout@v4
247+
248+
- name: Set up JDK 17
249+
uses: actions/setup-java@v4
250+
with:
251+
distribution: 'temurin'
252+
java-version: 17
253+
cache: 'sbt'
254+
- uses: sbt/setup-sbt@v1
255+
- name: Test `tasty-core-bootstrapped`
256+
run: ./project/scripts/sbt tasty-core-bootstrapped-new/test

library/src/scala/collection/immutable/List.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,9 @@ final case class :: [+A](override val head: A, private[scala] var next: List[A @
658658
releaseFence()
659659
override def headOption: Some[A] = Some(head)
660660
override def tail: List[A] = next
661+
662+
def next$access$1 = next
663+
661664
}
662665

663666
case object Nil extends List[Nothing] {

project/Build.scala

Lines changed: 52 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1396,14 +1396,25 @@ object Build {
13961396
scalaVersion := referenceVersion, // nonbootstrapped artifacts are compiled with the reference compiler (already officially published)
13971397
crossPaths := false, // org.scala-lang:scala3-sbt-bridge doesn't have a crosspath
13981398
autoScalaLibrary := false, // do not add a dependency to stdlib, we depend transitively on the stdlib from `scala3-compiler-nonbootstrapped`
1399-
// Add the source directories for the stdlib (non-boostrapped)
1399+
// Add the source directories for the sbt-bridge (non-boostrapped)
14001400
Compile / unmanagedSourceDirectories := Seq(baseDirectory.value / "src"),
1401+
Test / unmanagedSourceDirectories := Seq(baseDirectory.value / "test"),
14011402
Compile / resourceDirectory := baseDirectory.value / "resources",
14021403
// NOTE: The only difference here is that we drop `-Werror` and semanticDB for now
14031404
Compile / scalacOptions := Seq("-deprecation", "-feature", "-unchecked", "-encoding", "UTF8", "-language:implicitConversions"),
14041405
// Make sure that the produced artifacts have the minimum JVM version in the bytecode
14051406
Compile / javacOptions ++= Seq("--target", Versions.minimumJVMVersion),
14061407
Compile / scalacOptions ++= Seq("--java-output-version", Versions.minimumJVMVersion),
1408+
// Add all the project's external dependencies
1409+
libraryDependencies ++= Seq(
1410+
("org.scala-sbt" %% "zinc-apiinfo" % "1.8.0" % Test).cross(CrossVersion.for3Use2_13),
1411+
"com.github.sbt" % "junit-interface" % "0.13.3" % Test,
1412+
),
1413+
// Exclude the transitive dependencies from `zinc-apiinfo` that causes issues at the moment
1414+
excludeDependencies ++= Seq(
1415+
"org.scala-lang" % "scala-reflect",
1416+
"org.scala-lang" % "scala-compiler",
1417+
),
14071418
// Packaging configuration of the stdlib
14081419
Compile / packageBin / publishArtifact := true,
14091420
Compile / packageDoc / publishArtifact := false,
@@ -1455,7 +1466,7 @@ object Build {
14551466

14561467
/* Configuration of the org.scala-lang:scala3-sbt-bridge:*.**.**-bootstrapped project */
14571468
lazy val `scala3-sbt-bridge-bootstrapped` = project.in(file("sbt-bridge"))
1458-
.dependsOn(`scala3-compiler-bootstrapped`) // TODO: Would this actually evict the reference compiler in scala-tool?
1469+
.dependsOn(`scala3-compiler-bootstrapped-new`) // TODO: Would this actually evict the reference compiler in scala-tool?
14591470
.settings(
14601471
name := "scala3-sbt-bridge-bootstrapped",
14611472
moduleName := "scala3-sbt-bridge",
@@ -1464,15 +1475,27 @@ object Build {
14641475
scalaVersion := referenceVersion, // nonbootstrapped artifacts are compiled with the reference compiler (already officially published)
14651476
crossPaths := false, // org.scala-lang:scala3-sbt-bridge doesn't have a crosspath
14661477
autoScalaLibrary := false, // do not add a dependency to stdlib, we depend transitively on the stdlib from `scala3-compiler-nonbootstrapped`
1467-
// Add the source directories for the stdlib (non-boostrapped)
1478+
// Add the source directories for the sbt-bridge (boostrapped)
14681479
Compile / unmanagedSourceDirectories := Seq(baseDirectory.value / "src"),
1480+
Test / unmanagedSourceDirectories := Seq(baseDirectory.value / "test"),
14691481
Compile / resourceDirectory := baseDirectory.value / "resources",
14701482
// NOTE: The only difference here is that we drop `-Werror` and semanticDB for now
14711483
Compile / scalacOptions := Seq("-deprecation", "-feature", "-unchecked", "-encoding", "UTF8", "-language:implicitConversions"),
14721484
// Make sure that the produced artifacts have the minimum JVM version in the bytecode
14731485
Compile / javacOptions ++= Seq("--target", Versions.minimumJVMVersion),
14741486
Compile / scalacOptions ++= Seq("--java-output-version", Versions.minimumJVMVersion),
1475-
// Packaging configuration of the stdlib
1487+
// Add all the project's external dependencies
1488+
libraryDependencies ++= Seq(
1489+
("org.scala-sbt" %% "zinc-apiinfo" % "1.8.0" % Test).cross(CrossVersion.for3Use2_13),
1490+
"com.github.sbt" % "junit-interface" % "0.13.3" % Test,
1491+
),
1492+
// Exclude the transitive dependencies from `zinc-apiinfo` that causes issues at the moment
1493+
excludeDependencies ++= Seq(
1494+
"org.scala-lang" % "scala-reflect",
1495+
"org.scala-lang" % "scala-compiler",
1496+
),
1497+
//
1498+
// Packaging configuration of `scala3-sbt-bridge`
14761499
Compile / packageBin / publishArtifact := true,
14771500
Compile / packageDoc / publishArtifact := false,
14781501
Compile / packageSrc / publishArtifact := true,
@@ -1714,10 +1737,17 @@ object Build {
17141737
autoScalaLibrary := false,
17151738
// Add the source directories for the stdlib (non-boostrapped)
17161739
Compile / unmanagedSourceDirectories := Seq(baseDirectory.value / "src"),
1740+
Test / unmanagedSourceDirectories := Seq(baseDirectory.value / "test"),
17171741
Compile / unmanagedSourceDirectories += baseDirectory.value / "src-non-bootstrapped",
1742+
// NOTE: The only difference here is that we drop `-Werror` and semanticDB for now
1743+
Compile / scalacOptions := Seq("-deprecation", "-feature", "-unchecked", "-encoding", "UTF8", "-language:implicitConversions"),
17181744
// Make sure that the produced artifacts have the minimum JVM version in the bytecode
17191745
Compile / javacOptions ++= Seq("--target", Versions.minimumJVMVersion),
17201746
Compile / scalacOptions ++= Seq("--java-output-version", Versions.minimumJVMVersion),
1747+
// Add all the project's external dependencies
1748+
libraryDependencies ++= Seq(
1749+
"com.github.sbt" % "junit-interface" % "0.13.3" % Test,
1750+
),
17211751
// Packaging configuration of the stdlib
17221752
Compile / packageBin / publishArtifact := true,
17231753
Compile / packageDoc / publishArtifact := false,
@@ -1745,11 +1775,16 @@ object Build {
17451775
state.value,
17461776
scalaInstanceTopLoader.value,
17471777
)},
1778+
// Add configuration of the test
1779+
Test / envVars ++= Map(
1780+
"EXPECTED_TASTY_VERSION" -> expectedTastyVersion,
1781+
),
1782+
17481783
)
17491784

17501785
/* Configuration of the org.scala-lang:tasty-core_3:*.**.**-bootstrapped project */
17511786
lazy val `tasty-core-bootstrapped-new` = project.in(file("tasty"))
1752-
.dependsOn(`scala3-library-bootstrapped`)
1787+
.dependsOn(`scala3-library-bootstrapped-new`)
17531788
.settings(
17541789
name := "tasty-core-bootstrapped",
17551790
moduleName := "tasty-core",
@@ -1761,10 +1796,17 @@ object Build {
17611796
autoScalaLibrary := false,
17621797
// Add the source directories for the stdlib (non-boostrapped)
17631798
Compile / unmanagedSourceDirectories := Seq(baseDirectory.value / "src"),
1799+
Test / unmanagedSourceDirectories := Seq(baseDirectory.value / "test"),
17641800
Compile / unmanagedSourceDirectories += baseDirectory.value / "src-bootstrapped",
1801+
// NOTE: The only difference here is that we drop `-Werror` and semanticDB for now
1802+
Compile / scalacOptions := Seq("-deprecation", "-feature", "-unchecked", "-encoding", "UTF8", "-language:implicitConversions"),
17651803
// Make sure that the produced artifacts have the minimum JVM version in the bytecode
17661804
Compile / javacOptions ++= Seq("--target", Versions.minimumJVMVersion),
17671805
Compile / scalacOptions ++= Seq("--java-output-version", Versions.minimumJVMVersion),
1806+
// Add all the project's external dependencies
1807+
libraryDependencies ++= Seq(
1808+
"com.github.sbt" % "junit-interface" % "0.13.3" % Test,
1809+
),
17681810
// Packaging configuration of the stdlib
17691811
Compile / packageBin / publishArtifact := true,
17701812
Compile / packageDoc / publishArtifact := false,
@@ -1801,6 +1843,10 @@ object Build {
18011843
scalaCompilerBridgeBinaryJar := {
18021844
Some((`scala3-sbt-bridge-nonbootstrapped` / Compile / packageBin).value)
18031845
},
1846+
// Add configuration of the test
1847+
Test / envVars ++= Map(
1848+
"EXPECTED_TASTY_VERSION" -> expectedTastyVersion,
1849+
),
18041850
)
18051851

18061852
// ==============================================================================================
@@ -1930,7 +1976,7 @@ object Build {
19301976

19311977
/* Configuration of the org.scala-lang:scala3-compiler_3:*.**.**-bootstrapped project */
19321978
lazy val `scala3-compiler-bootstrapped-new` = project.in(file("compiler"))
1933-
.dependsOn(`scala3-interfaces`, `tasty-core-bootstrapped`, `scala3-library-bootstrapped`)
1979+
.dependsOn(`scala3-interfaces`, `tasty-core-bootstrapped-new`, `scala3-library-bootstrapped-new`)
19341980
.settings(
19351981
name := "scala3-compiler-bootstrapped",
19361982
moduleName := "scala3-compiler",

0 commit comments

Comments
 (0)